query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
prepare collection for block to display
protected function _prepareCollection() { $collection = Mage::getModel('solutionpartner/partner')->getCollection(); $collection->getSelect()->joinLeft( array('order' => $collection->getTable('sales/order')), 'main_table.email = order.customer_email AND order.status = "complete"', array( 'order_id' => 'entity_id', 'order_status' => 'order.status', 'number_qtys' => 'count(order.entity_id)' )) ->group('main_table.solutionpartner_id'); $this->setCollection($collection); return parent::_prepareCollection(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareCollection() {\n /**\n * \n * @var unknown\n */\n /**\n * Calling the parent Construct Method.\n * \n * Getting collection for bank details\n */\n $managebankdetailsCollection = Mage::getModel ( 'airhotels/managebankdetails' )->getCollection ();\n $this->setCollection ( $managebankdetailsCollection ); \n return parent::_prepareCollection ();\n /**\n * return _prepareCollection\n */\n }", "protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t$this->setCollection($collection);\n\t\t \n\t\treturn parent::_prepareCollection();\n\t}", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $collection->setOrder('ID','DESC');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $currentCampaign = Mage::getSingleton('adminhtml/session')->getCurrentCampaign();\n $collection = Mage::getModel('campaign/bannerslider')->getCollection();\n $collection->getSelect()\n ->joinLeft(array('campaign'=>$collection->getTable('campaign/campaign')),\n 'main_table.campaign_id = campaign.campaign_id', '')\n ->columns(array('campaign_name'=>'IF(main_table.campaign_id = \"'.$currentCampaign->getId().'\", \"Current\", campaign.name)'))\n ->group('main_table.bannerslider_id');\n $filter = Mage::registry('banner_reloaded_ids');\n if(!isset($filter)){//if reset no filter\n $selected_id = $this->_selectedId();\n if(!empty($selected_id)){\n $collection->addFieldToFilter('bannerslider_id', array('in'=>$selected_id));\n }\n }\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('lavi_news/news')->getResourceCollection();\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = $this->collectionFactory->create();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection() {\n /**\n * Get the Collection of Manage Subscription\n */\n $manageSubscription = Mage::getModel ( 'airhotels/managesubscriptions' )->getCollection ();\n \n /**\n * Get the Table Prefix Value\n */\n $tablePrefix = Mage::getConfig ()->getTablePrefix ();\n $manageSubscription->getSelect ()->group ( 'main_table.product_id' )->joinLeft ( $tablePrefix . 'apptha_productsubscriptions', 'main_table.product_id =' . $tablePrefix . 'apptha_productsubscriptions.product_id AND ' . $tablePrefix . 'apptha_productsubscriptions.is_delete = 0', array (\n 'main_table.id as id',\n 'main_table.product_name as product_name',\n $tablePrefix . 'apptha_productsubscriptions.subscription_type as subscription_type' \n ) )->where ( 'main_table.is_subscription_only = ?', 1 );\n \n $collection = $manageSubscription;\n $this->setCollection ( $collection );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareCollection ();\n }", "protected function _prepareCollection()\n {\n $userId = Mage::getSingleton('admin/session')->getUser()->getId();\n\n /* var $collection Gri_Cms_Model_Mysql4_Version_Collection */\n $collection = Mage::getModel('gri_cms/page_version')->getCollection()\n ->addPageFilter($this->getPage())\n ->addVisibilityFilter($userId,\n Mage::getSingleton('gri_cms/config')->getAllowedAccessLevel())\n ->addUserColumn()\n ->addUserNameColumn();\n\n if (!$this->getParam($this->getVarNameSort())) {\n $collection->addNumberSort();\n }\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection () {\n $collection\n = Mage::getResourceModel('mventory/carrier_volumerate_collection')\n ->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n $shippingTypes\n = Mage::getModel('mventory/system_config_source_allowedshippingtypes')\n ->toArray();\n\n foreach ($collection as $rate) {\n $name = $rate->getConditionName();\n\n if ($name == 'weight')\n $rate->setWeight($rate->getConditionValue());\n else if ($name == 'volume')\n $rate->setVolume($rate->getConditionValue());\n\n $shippingType = $rate->getShippingType();\n\n $shippingType = isset($shippingTypes[$shippingType])\n ? $shippingTypes[$shippingType]\n : '';\n\n $rate->setShippingType($shippingType);\n }\n\n return parent::_prepareCollection();\n }", "protected function collectChildren(): void\n {\n $this->collection = new Collection();\n foreach ($this->rawResults as $blockChildContent) {\n $this->collection->add(Block::fromResponse($blockChildContent));\n }\n }", "protected function _prepareCollection()\n {\n /* @var $collection Scandi_MenuManager_Model_Resource_Item_Collection */\n $collection = Mage::getModel('scandi_menumanager/item')->getResourceCollection()\n ->addMenuFilter(Mage::registry('menumanager_menu'));\n if (!$this->getRequest()->getParam('sort')) { $collection->setPositionOrder(); }\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\t\t \n\t\t\n $collection = Mage::getModel('catalog/product')\n \t->getCollection()\n \t->addAttributeToSelect('name')\n \t->addAttributeToSelect('price')\n \t->addAttributeToSelect('special_price')\n \t->addAttributeToSelect('name')\n \t->addAttributeToSelect('manufacturer')\n \t->addFieldToFilter('type_id', array('in' => array(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL)))\n ->joinField('qty',\n 'cataloginventory/stock_item',\n 'qty',\n 'product_id=entity_id',\n '{{table}}.stock_id=1',\n 'left');\n \t;\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = $this->_createCollection()->addCustomerIdFilter($this->_getCustomer()->getId())\n ->resetSortOrder()\n ->addDaysInWishlist()\n ->addStoreData();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n\n\t\t\n\t\t$collection = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('sku')\n ->addAttributeToSelect('name');\n\t\t\t\n\t\t$collection->addAttributeToSelect('thumbnail');\n\t\t\n\t\t$collection->addAttributeToFilter('image', array('eq' => 'no_selection'));\n \n\t\t//$collection->joinAttribute('image', 'catalog_product/image', 'entity_id', null, 'left');\n\n\t\t$this->setCollection($collection);\n\t\treturn parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n /** @var $collection ChazkiExpressCollection */\n $collection = $this->_collectionFactory->create();\n $collection->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('name')\n ->addAttributeToSelect('type')\n ->addAttributeToSelect('status')\n ->addAttributeToSelect('visibility')\n ->addAttributeToSelect('sku');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t//$collection->getSelect()->joinLeft(array('st' => 'core_store'),'main_table.SiteID = st.store_id',array('storename' => 'st.name'));\n $this->setCollection($collection);\n \n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('sales/order_shipment')->getCollection();\n $tableName = Mage::getSingleton('core/resource')->getTableName('sales_flat_order');\n\n $collection->getSelect()->joinLeft(array('o'=>$tableName), 'main_table.order_id=o.entity_id', array(\n 'order_increment_id'=>'o.increment_id',\n 'order_created_date'=>'o.created_at',\n 'o.shipping_description'));\n\n $collection->addFieldToFilter('o.shipping_description', array('like'=>'%canpar%'));\n $tableName = Mage::getSingleton('core/resource')->getTableName('ch_canpar_shipment');\n\n $collection->getSelect()->joinLeft(array('ch_shipment'=>$tableName), 'main_table.entity_id=ch_shipment.magento_shipment_id',array(\n 'canpar_shipment_id'=>'shipment_id',\n 'manifest_id'=>'manifest_id'));\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('oggetto_oneclick/order')->getResourceCollection();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "function prepare_items() {\n\t\t\n\t\t// Get how many records per page to show\n\t\t$per_page\t= $this->per_page;\n\t\t\n\t\t// Get All, Hidden, Sortable columns\n\t\t$columns\t= $this->get_columns();\n\t\t$hidden \t= array();\n\t\t$sortable \t= $this->get_sortable_columns();\n\t\t\n\t\t// Get final column header\n\t\t$this->_column_headers = array($columns, $hidden, $sortable);\n\t\t\n\t\t// Get Data of particular page\n\t\t$data_res \t= $this->bdpp_display_styles_list();\n\t\t$data \t\t= $data_res['data'];\n\t\t\n\t\t// Get current page number\n\t\t$current_page = $this->get_pagenum();\n\t\t\n\t\t// Get total count\n\t\t$total_items = $data_res['total'];\n\t\t\n\t\t// Get page items\n\t\t$this->items = $data;\n\t\t\n\t\t// Register pagination options and calculations.\n\t\t$this->set_pagination_args( array(\n\t\t\t\t\t\t\t\t\t\t\t'total_items' => $total_items, // Calculate the total number of items\n\t\t\t\t\t\t\t\t\t\t\t'per_page' => $per_page, // Determine how many items to show on a page\n\t\t\t\t\t\t\t\t\t\t\t'total_pages' => ceil($total_items / $per_page)\t// Calculate the total number of pages\n\t\t\t\t\t\t\t\t\t\t));\n\t}", "protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getResourceModel($this->_getCollectionClass());\n $collection->getSelect()->joinLeft(\n array('sfo' => 'sales_flat_order'),\n 'main_table.order_id = sfo.entity_id',\n array('increment_id')\n );\n\t\t$this->setCollection($collection);\n\n\t\treturn parent::_prepareCollection();\n\t}", "function prepare_items() {\n\t\t$columns = $this->get_columns();\n\t\t$hidden = array();\n\t\t$sortable = $this->get_sortable_columns();\n\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\n\t\t$ubc_di_sites = $this->ubc_di_get_assessment_results();\n\n\t\tusort( $ubc_di_sites, array( &$this, 'usort_reorder' ) );\n\n\t\t$per_page = 50;\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = count( $ubc_di_sites );\n\t\t// only ncessary because we have sample data\n\t\t$ubc_di_sites_subset = array_slice( $ubc_di_sites, ( ( $current_page - 1 ) * $per_page ), $per_page );\n\t\t$this->set_pagination_args( array(\n\t\t\t'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t\t'per_page' => $per_page, //WE have to determine how many items to show on a page\n\t\t) );\n\t\t$this->items = $ubc_di_sites_subset;\n\t}", "public function prepare_items()\r\n\t{\r\n\t\t$columns = $this->get_columns();\r\n\t\t$hidden = $this->get_hidden_columns();\r\n\t\t$sortable = $this->get_sortable_columns();\r\n\r\n\t\t$currentPage = $this->get_pagenum();\r\n\r\n\t\t$this->total = Lead::count();\r\n\t\t$data = Lead::take( $this->per_page )->skip( ( $currentPage - 1 ) * $this->per_page )\r\n\t\t ->get()->toArray();\r\n\r\n\t\t$this->set_pagination_args( [\r\n\t\t\t'total_items' => $this->total,\r\n\t\t\t'per_page' => $this->per_page\r\n\t\t] );\r\n\r\n\t\t$this->_column_headers = [ $columns, $hidden, $sortable ];\r\n\r\n\t\t$this->items = $data;\r\n\t}", "protected function _prepareLayout()\n {\n $collection = $this->getTicketFactory()->getCollection();\n parent::_prepareLayout();\n\n if ($collection) \n {\n // create pager block for collection\n $pager = $this->getLayout()->createBlock('Magento\\Theme\\Block\\Html\\Pager', 'my.custom.pager');\n\n // // assign collection to pager\n $pager->setLimit(10)->setCollection($collection);\n $pager->setAvailableLimit([10 => 10, 20 => 20, 50 => 50, 100 => 100]);\n $this->setChild('pager', $pager); // set pager block in layout\n }\n return $this;\n }", "public function getBlocks(): Collection;", "protected function _prepareCollection()\r\n {\r\n\t\tif($this->getRequest()->getParam('store')){\r\n\t\t\t$store_id = $this->getRequest()->getParam('store');\r\n\t\t} else {\r\n\t\t\t$store_id = Mage::helper('items')-> getMlDefaultStoreId();\r\n\t\t}\r\n\t\t$attribute_id = '';\r\n\t\tif($this->getRequest()->getParam('attribute_id')!=''){\r\n\t\t\t$attribute_id = $this->getRequest()->getParam('attribute_id');\r\n\t\t} \r\n\t\t\r\n\t\t$category_id = 0;\r\n\t\tif($this->getRequest()->getParam('category_id')){\r\n\t\t\t$category_id = $this->getRequest()->getParam('category_id');\r\n\t\t}\r\n\t\t\r\n\t\t$collection = Mage::getModel('eav/entity_attribute_option')\r\n\t\t\t\t\t-> getCollection()\r\n\t\t\t\t\t-> setStoreFilter($store_id)\r\n\t\t\t\t\t-> join('attribute','attribute.attribute_id=main_table.attribute_id', 'attribute_code')\r\n\t\t\t\t\t-> addFieldToFilter('attribute.attribute_id',$attribute_id)\r\n\t\t\t\t\t-> addFieldToFilter('tsv.value', array('neq' => 'NULL' ));\t\t\t\r\n\t\t\t\t\t\r\n $collection -> getSelect()\r\n\t\t\t\t -> joinleft(array('mavm'=>'mercadolibre_attribute_value_mapping'), \" main_table.option_id = mavm.mage_attribute_option_id AND mavm.sort_order = '0' AND mavm.category_id = '\".$category_id.\"' AND mavm.store_id = '\".$store_id.\"'\",array('mavm.*'));\r\n\t\t \r\n\t\t\t\t \r\n\t\t\t\t \t\t\t\t\t\t\t\t\r\n\t $this->setCollection($collection);\r\n return parent::_prepareCollection();\r\n }", "protected function _prepareCollection()\r\n {\r\n $this->setCollection(Mage::getModel('dynamic_brand/brand')->getCollection());\r\n return parent::_prepareCollection();\r\n }", "public function prepare_response_for_collection($response)\n {\n }", "public function prepare_items()\n\t\t {\n\t\t // How many records are to be shown on page\n\t\t\t\t$per_page = 20;\n\n\t\t\t\t// Columns array to be displayed\n\t\t $columns = $this->get_columns();\n\n\t\t // Columns array to be hidden\n\t\t $hidden = array();\n\n\t\t // List of sortable columns\n\t\t $sortable = $this->get_sortable_columns();\n\t\t \n\t\t // Create the array that is used by the class\n\t\t $this->_column_headers = array($columns, $hidden, $sortable);\n\t\t \n\t\t // Process bulk actions\n\t\t $this->process_bulk_action();\n\n\t\t \t// Current page\n\t\t $current_page = $this->get_pagenum();\n\n\t\t // Get contests\n\t\t $data = $this->getContests();\n\t\t \n\t\t // Total number of items\n\t\t $total_items = count($data);\n\t\t \n\t\t // Slice data for pagination\n\t\t $data = array_slice($data, (($current_page-1)*$per_page), $per_page);\n\t\t \n\t\t // Send processed data to the items property to be used\n\t\t $this->items = $data;\n\t\t \n\t\t // Register pagination options & calculations\n\t\t $this->set_pagination_args(array(\n\t\t 'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t 'per_page' => $per_page, //WE have to determine how many items to show on a page\n\t\t 'total_pages' => ceil($total_items/$per_page) //WE have to calculate the total number of pages\n\t\t ));\n\t\t }", "protected function initialize()\n {\n $this->viewData['list_sb'] = $this->list_sb = SkeletalBone::orderBy('name', 'asc')->pluck('name', 'id');\n $this->viewData['list_side'] = $this->list_side = SkeletalElement::$side;\n $this->viewData['list_completeness'] = $this->list_completeness = SkeletalElement::$completeness;\n $this->viewData['list_lab'] = $this->list_lab = Lab::where('type', 'Isotope')->get()->pluck('full_name', 'id');\n $this->viewData['list_status'] = $this->list_status = IsotopeBatch::$status;\n $this->viewData['batchStatus'] = $this->batchStatus = 'Open';\n $this->viewData['initialshow'] = $this->initialshow = false;\n }", "function prepare_items() {\n\t\t$per_page\t= $this->per_page;\n\n\t\t// Get All, Hidden, Sortable columns\n\t\t$columns = $this->get_columns();\n\t\t$hidden = array();\n\t\t$sortable = $this->get_sortable_columns();\n\n\t\t// Get final column header\n\t\t$this->_column_headers\t= array( $columns, $hidden, $sortable );\n\n\t\t// Get Data of particular page\n\t\t$data_res \t= $this->display_used_vouchers();\n\t\t$data \t\t= $data_res['data'];\n\n\t\t// Get current page number\n\t\t$current_page = $this->get_pagenum();\n\n\t\t// Get total count\n\t\t$total_items = $data_res['total'];\n\n\t\t// Get page items\n\t\t$this->items = $data;\n\n\t\t// We also have to register our pagination options & calculations.\n\t\t$this->set_pagination_args( array(\n\t\t\t\t\t\t\t\t\t\t\t'total_items' => $total_items,\n\t\t\t\t\t\t\t\t\t\t\t'per_page' => $per_page,\n\t\t\t\t\t\t\t\t\t\t\t'total_pages' => ceil( $total_items/$per_page )\n\t\t\t\t\t\t\t\t\t\t) );\n }", "public function prepare_items() {\n\n\t\t// Roll out each part.\n\t\t$columns = $this->get_columns();\n\t\t$hidden = $this->get_hidden_columns();\n\t\t$sortable = $this->get_sortable_columns();\n\t\t$dataset = $this->table_data();\n\n\t\t// Check for the action key value to filter.\n\t\tif ( ! empty( $_REQUEST['wbr-review-filter'] ) ) { // WPCS: CSRF ok.\n\t\t\t$dataset = $this->maybe_filter_dataset( $dataset );\n\t\t}\n\n\t\t// Handle our sorting.\n\t\tusort( $dataset, array( $this, 'sort_data' ) );\n\n\t\t// Load up the pagination settings.\n\t\t$paginate = 20;\n\t\t$item_count = count( $dataset );\n\t\t$current = $this->get_pagenum();\n\n\t\t// Set my pagination args.\n\t\t$this->set_pagination_args( array(\n\t\t\t'total_items' => $item_count,\n\t\t\t'per_page' => $paginate,\n\t\t\t'total_pages' => ceil( $item_count / $paginate ),\n\t\t));\n\n\t\t// Slice up our dataset.\n\t\t$dataset = array_slice( $dataset, ( ( $current - 1 ) * $paginate ), $paginate );\n\n\t\t// Do the column headers.\n\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\n\t\t// Make sure we have the single action running.\n\t\t$this->process_single_action();\n\n\t\t// Make sure we have the bulk action running.\n\t\t$this->process_bulk_action();\n\n\t\t// Make sure we have the status change.\n\t\t$this->process_status_change();\n\n\t\t// And the result.\n\t\t$this->items = $dataset;\n\t}", "protected function _prepareCollection() {\n $collection = Mage::getModel('vidtest/video')\n ->getCollection()\n ->addProductFilter($this->getProduct()->getId())\n ;\n\n if ($storeId = $this->getProduct()->getStoreId()) {\n $collection->addStoreFilter($storeId);\n }\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('iparcel/log')->getCollection();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel('bs_docwise/docwisement_collection');\n\n if ($this->getExam()->getId()) {\n $constraint = 'related.exam_id='.$this->getExam()->getId();\n } else {\n $constraint = 'related.exam_id=0';\n }\n $collection->getSelect()->joinLeft(\n array('related' => $collection->getTable('bs_docwise/exam_docwisement')),\n 'related.docwisement_id = main_table.entity_id AND '.$constraint,\n array('position')\n );\n\n\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "private function createCollection()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "protected function _prepareCollection() {\n $website_id = Mage::app()->getWebsite()->getId();\n $collection = Mage::getModel('inchoo_supportticket/ticket')\n ->getCollection();\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "protected function _prepareCollection()\n {\n /* @var $collection Belvg_Storelocator_Model_Resource_Location_Collection */\n $collection = Mage::getModel('storelocator/location')->getResourceCollection();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function prepare_items() {\n\n\t\t$columns = $this->get_columns();\n\t\t$hidden = get_hidden_columns( $this->screen );\n \t\t$sortable = $this->get_sortable_columns();\n \t\t$this->_column_headers = array($columns, $hidden, $sortable);\n \t\t//$this->_column_headers = $this->get_column_info();\n\t\t/** Process bulk action */\n\t\t$this->process_bulk_action();\n\n\t\t$per_page = $this->get_items_per_page( 'transactions_per_page', 10 );\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = self::record_count();\n\n\t\t$this->set_pagination_args( array(\n\t\t\t'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t\t'per_page' => $per_page //WE have to determine how many items to show on a page\n\t\t));\n\n\t\t$this->items = self::get_customers( $per_page, $current_page );\n\t}", "public function prepareCollection()\n {\n $this->_reset();\n\n $this->addAttributeToSelect('*');\n\n // Select cart items\n $this->joinTable(\n array('qi' => 'sales/quote_item'),\n 'product_id = entity_id',\n array(\n 'product_name' => 'name',\n 'counts' => 'COUNT(1)',\n 'sum_qty' => \"SUM(CASE WHEN qip.product_type IN ('configurable', 'bundle') THEN qip.qty * qi.qty ELSE qi.qty END)\",\n 'total' => \"SUM(CASE WHEN qip.product_type='configurable' THEN qip.base_row_total ELSE qi.base_row_total END)\",\n 'product_type',\n 'quote_id' => 'quote_id',\n 'parent_item_id' => 'parent_item_id',\n 'item_created_at' => 'created_at'\n )\n );\n $this->addFilterToMap('parent_item_id', 'qi.parent_item_id');\n $this->addFilterToMap('product_type', 'qi.product_type');\n $this->addFilterToMap('item_created_at', 'item_created_at');\n\n // Retrieve base currency code from parent quote\n $this->joinTable(\n array('q' => 'sales/quote'),\n 'entity_id = quote_id',\n array('currency_code' => 'base_currency_code', 'store_id' => 'store_id')\n );\n\n // Select only cart items attached to a subscription\n $this->joinTable(\n array('s' => 'sheep_subscription/subscription'),\n 'quote_id = quote_id',\n array('subscription_created_at' => 'created_at',)\n );\n\n // re-join sales_flat_quote_item to retrieve parent info (if available)\n $this->joinTable(\n array('qip' => 'sales/quote_item'),\n 'item_id = parent_item_id',\n array('parent_product_type' => 'product_type', 'parent_qty' => 'qty'),\n null,\n 'left'\n );\n $this->addFilterToMap('parent_product_type', 'qip.product_type');\n $this->addFilterToMap('parent_qty', 'qip.qty');\n\n // Filter only cart items created during specified period\n $this->addFieldToFilter('item_created_at', array(\n 'from' => $this->_from,\n 'to' => $this->_to,\n 'datetime' => true\n ));\n\n $this->getSelect()->where(\n \"(qi.parent_item_id is null and qi.product_type NOT IN ('bundle', 'configurable')) OR\" .\n \"(qi.parent_item_id is not null and qip.product_type IN ('bundle', 'configurable'))\"\n );\n\n $this->getSelect()\n ->group('e.entity_id')\n ->order('counts ' . self::SORT_ORDER_DESC)\n ->having('COUNT(qi.product_id) > ?', 0);\n\n\n // Filter only quotes that were created in specified stores\n if ($this->_storeIds) {\n $this->addFieldToFilter('store_id', array('in' => $this->_storeIds));\n }\n }", "private function buildCollection(): void\n {\n //todo 這邊可以在sql裡面處理,但因為時程的關係,先用這種方法處理\n $userId = auth()->user()->id;\n $this->collection->map(function ($item) use ($userId) {\n $item->isAuthor = ($item->user_id == $userId);\n $item->user_id = null;\n });\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel('bs_worksheet/worksheet_collection');\n if ($this->getCurriculum()->getId()) {\n $constraint = 'related.curriculum_id='.$this->getCurriculum()->getId();\n } else {\n $constraint = 'related.curriculum_id=0';\n }\n $collection->getSelect()->joinLeft(\n array('related' => $collection->getTable('bs_worksheet/worksheet_curriculum')),\n 'related.worksheet_id=main_table.entity_id AND '.$constraint,\n array('position')\n );\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "protected function prepareForPresentation()\n {\n if ($this->prepared) {\n return;\n }\n\n $this->permissionGroups = new Collection;\n $this->ungroupedPermissions = [];\n $this->groupedPermissionIndex = [];\n\n $this->loadPermissionsFromModules()\n ->loadCustomPermissions()\n ->loadCustomPermissionGroups()\n ->addUngroupedPermissionGroup()\n ->filterEmptyGroups();\n }", "protected function _prepareCollection()\n {\n $collection = $this->_collectionFactory->create()->addVisibleFilter();\n $vendor_attrs = [];\n $vendor_id = $this->customerSession->getVendorId();\n if ($vendor_id) {\n $attr_model = $this->attribute->getProductAttributes($vendor_id)->getData();\n foreach ($attr_model as $key => $attr_id) {\n $vendor_attrs[] = $attr_id['attribute_id'];\n }\n $collection->addFieldToFilter('main_table.attribute_id', ['in' => $vendor_attrs]);\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }\n return $this;\n }", "public function prepare_items() {\n\t\t$per_page = $this->get_items_per_page( 'cert_dashboards_per_page', 1 );\n\t\t$this->items = self::get_cert_dashboards( $per_page );\n\t}", "public function prepare_items()\r\n {\r\n $columns = $this->get_columns();\r\n $hidden = $this->get_hidden_columns();\r\n $sortable = $this->get_sortable_columns();\r\n\r\n /** Process bulk action */\r\n $this->process_bulk_action();\r\n\r\n $data = $this->table_data();\r\n usort($data, array(&$this, 'sort_data'));\r\n $perPage = 30;\r\n $currentPage = $this->get_pagenum();\r\n $totalItems = count($data);\r\n $this->set_pagination_args(array(\r\n 'total_items' => $totalItems,\r\n 'per_page' => $perPage\r\n ));\r\n $data = array_slice($data, (($currentPage - 1) * $perPage), $perPage);\r\n // var_dump($data);\r\n // die();\r\n $this->_column_headers = array($columns, $hidden, $sortable);\r\n $this->items = $data;\r\n }", "protected function _prepareCollection()\r\n {\r\n $collection = Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->getCollection();\r\n $giftCartAccount_data = array();\r\n foreach($collection as $key=>$item){\r\n $giftCartAccount_data[$item->getData('giftcardaccount_id')][0] = $item->getData();\r\n $collection->removeItemByKey($key);\r\n }\r\n\r\n $creat_collection = Mage::getModel('enterprise_giftcardaccount/history')->getCollection();\r\n $creat_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('giftcardaccount_id','generated_order_number' => 'additional_info', 'original_amount' => 'balance_delta'));\r\n $creat_collection->addFieldToFilter('action', 0);\r\n $creat_collection->setOrder('giftcardaccount_id', 'asc');\r\n $creat_collection->setOrder('updated_at', 'asc');\r\n $id = '';\r\n $i = 0;\r\n foreach($creat_collection as $item){\r\n $giftcardaccount_id = $item->getData('giftcardaccount_id');\r\n if($giftcardaccount_id == $id){\r\n $i++;\r\n }else{\r\n $id = $giftcardaccount_id;\r\n $i = 0;\r\n }\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['generated_order_number'] = $item->getData('generated_order_number');\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['original_amount'] = $item->getData('original_amount');\r\n }\r\n\r\n $use_collection = Mage::getModel('enterprise_giftcardaccount/history')->getCollection();\r\n $use_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('giftcardaccount_id','used_date' => 'updated_at', 'used_order_number' => 'additional_info', 'used_amount' => 'ABS(main_table.balance_delta)'));\r\n $use_collection->addFieldToFilter('action', 1);\r\n $use_collection->setOrder('giftcardaccount_id', 'asc');\r\n $use_collection->setOrder('updated_at', 'asc');\r\n $id = '';\r\n $i = 0;\r\n foreach($use_collection as $item){\r\n $giftcardaccount_id = $item->getData('giftcardaccount_id');\r\n if($giftcardaccount_id == $id){\r\n $i++;\r\n }else{\r\n $id = $giftcardaccount_id;\r\n $i = 0;\r\n }\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['used_date'] = $item->getData('used_date');\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['used_order_number'] = $item->getData('used_order_number');\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['used_amount'] = $item->getData('used_amount');\r\n }\r\n\r\n $send_collection = Mage::getModel('enterprise_giftcardaccount/history')->getCollection();\r\n $send_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('giftcardaccount_id','additional_info'));\r\n $send_collection->addFieldToFilter('action', 2);\r\n $send_collection->setOrder('giftcardaccount_id', 'asc');\r\n $send_collection->setOrder('updated_at', 'asc');\r\n $id = '';\r\n $i = 0;\r\n foreach($send_collection as $item){\r\n $giftcardaccount_id = $item->getData('giftcardaccount_id');\r\n if($giftcardaccount_id == $id){\r\n $i++;\r\n }else{\r\n $id = $giftcardaccount_id;\r\n $i = 0;\r\n }\r\n $additional_info = $item->getData('additional_info');\r\n preg_match ('/^Recipient: (.*?) <(.*?)>.(.*)$/', $additional_info, $param);\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['receptor_name'] = $param[1];\r\n $giftCartAccount_data[$giftcardaccount_id][$i]['receptor_email']= $param[2];\r\n }\r\n\r\n $total_collection = Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->getCollection();\r\n $total_collection->getSelect()\r\n ->reset(Zend_Db_Select::COLUMNS)\r\n ->columns(array('main_table.giftcardaccount_id'))\r\n ->joinLeft(\r\n array('history' => $collection->getTable('enterprise_giftcardaccount/history')),\r\n 'history.giftcardaccount_id = main_table.giftcardaccount_id and history.action = 1',\r\n array('total'=>'ABS(SUM(history.balance_delta))')\r\n )\r\n ->group('main_table.giftcardaccount_id');\r\n foreach($total_collection->getData() as $val){\r\n $giftCartAccount_data[$val['giftcardaccount_id']][0]['total_used_amount'] = $val['total']?$val['total']:'';\r\n }\r\n\r\n foreach($giftCartAccount_data as $value){\r\n foreach($value as $val){\r\n $item = $collection->getNewEmptyItem();\r\n $item->setData($val);\r\n $collection->addItem($item);\r\n }\r\n }\r\n $this->setCollection($collection);\r\n\r\n parent::_prepareCollection();\r\n return $this;\r\n }", "public function prepare_items()\n {\n $per_page = 100;\n\n // define column headers\n $columns = $this->get_columns();\n $hidden = [];\n $sortable = $this->get_sortable_columns();\n $this->_column_headers = [$columns, $hidden, $sortable];\n\n // retrieve data\n $data = \\Podlove\\Model\\EpisodeAsset::all('ORDER BY position ASC');\n\n // get current page\n $current_page = $this->get_pagenum();\n // get total items\n $total_items = count($data);\n // extrage page for current page only\n $data = array_slice($data, ($current_page - 1) * $per_page, $per_page);\n // add items to table\n $this->items = $data;\n\n // register pagination options & calculations\n $this->set_pagination_args([\n 'total_items' => $total_items,\n 'per_page' => $per_page,\n 'total_pages' => ceil($total_items / $per_page),\n ]);\n }", "protected function prepareGalleryData() {}", "public function __construct()\n {\n $this->setRefreshAt();\n $this->setOptions();\n $this->blocks = new ArrayCollection();\n }", "public function populateCollection() {\n\t\tif(empty($this->rawData)) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach($this->rawData as $item) {\n\t\t\t$feedItem = new TwitterItemAdapter($item);\n\t\t\t$this->feed->addItem($feedItem);\n\t\t}\n\t}", "public function prepare_items() {\n\t\t/** Process bulk action */\n\t\t$this->process_bulk_action();\n\n\t\t$columns = $this->get_columns();\n $hidden = $this->get_hidden_columns();\n $sortable = $this->get_sortable_columns();\n $this->_column_headers = array($columns, $hidden, $sortable);\n\n\t\t$per_page = $this->get_items_per_page( 'posts_per_page', 20 );\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = self::record_count();\n\n\t\t$this->set_pagination_args( [\n\t\t\t'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t\t'per_page' => $per_page //WE have to determine how many items to show on a page\n\t\t] );\n\n\t\t$this->items = self::get_posts( $per_page, $current_page );\n\t}", "public function prepare_items() {\n\t\t$column = $this->get_columns();\n\t\t$hidden = array();\n\t\t$sortable = $this->get_sortable_columns();\n\n\t\t$this->_column_headers = array( $column, $hidden, $sortable );\n\n\t\t$per_page = 20;\n\t\t$current_page = $this->get_pagenum();\n\t\t$offset = ( $current_page - 1 ) * $per_page;\n\n\t\t$args = array(\n\t\t\t'number' => $per_page,\n\t\t\t'offset' => $offset,\n\t\t);\n\n\t\tif ( isset( $_REQUEST['orderby'] ) && isset( $_REQUEST['order'] ) ) {\n\t\t\t$args['orderby'] = $_REQUEST['orderby'];\n\t\t\t$args['order'] = $_REQUEST['order'];\n\t\t}\n\n\t\t$this->items = Persistence::get( $args );\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => Persistence::count(),\n\t\t\t\t'per_page' => $per_page,\n\t\t\t)\n\t\t);\n\t}", "public function prepareShow()\n {\n $this->location();\n $this->type;\n $this->amenityIds();\n $this->utilityIds();\n $this->reviewCount();\n $this->user->location();\n $this->user->profilePicture();\n $this->user->reviewCount();\n $this->reviews = $this->reviews()->select('reviews.*')->withReviewer()->get();\n $this->coordinates;\n $this->imageRoutes();\n $this->image_ids = $this->images->pluck('id');\n }", "protected function _prepareCollection() {\r\n $collection = Mage::getResourceModel('zozoconcepts_brands/brand_collection');\r\n if ($this->getProduct()->getId()){\r\n $constraint = 'related.product_id='.$this->getProduct()->getId();\r\n }\r\n else{\r\n $constraint = 'related.product_id=0';\r\n }\r\n $collection->getSelect()->joinLeft(\r\n array('related'=>$collection->getTable('zozoconcepts_brands/brand_product')),\r\n 'related.brand_id=main_table.entity_id AND '.$constraint,\r\n array('position')\r\n );\r\n $this->setCollection($collection);\r\n parent::_prepareCollection();\r\n return $this;\r\n }", "public function prepare_items() {\n\n\t\t\t$columns = $this->get_columns();\n\n\t\t\t$hidden = array(); // No hidden columns\n\n\t\t\t$sortable = $this->get_sortable_columns();\n\n\t\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\n\n\n\t\t\t// Process bulk action\n\n\t\t\t$this->process_bulk_action();\n\n\n\n\t\t\t$current_page = $this->get_pagenum();\n\n\t\t\t$total_items = self::record_count();\n\n\n\n\t\t\t$this->items = self::get_topics( 20, $current_page );\n\n\n\n\t\t\t$this->set_pagination_args( [\n\n\t\t\t\t'total_items' => $total_items,\n\n\t\t\t\t'per_page' => 20\n\n\t\t\t] );\n\n\t\t}", "public function prepare_items()\n {\n $columns = $this->get_columns();\n $hidden = $this->get_hidden_columns();\n $sortable = $this->get_sortable_columns();\n $data = $this->table_data();\n usort( $data, array( &$this, 'sort_data' ) );\n $perPage = 10;\n $currentPage = $this->get_pagenum();\n $totalItems = count($data);\n $this->set_pagination_args( array(\n 'total_items' => $totalItems,\n 'per_page' => $perPage\n ) );\n $data = array_slice($data,(($currentPage-1)*$perPage),$perPage);\n $this->_column_headers = array($columns, $hidden, $sortable);\n $this->process_bulk_action();\n $this->items = $data;\n }", "protected function _collectBlocks()\n {\n if ($blocks = $this->_layoutHandleUpdatesXml->xpath('//block/label/..')) {\n /* @var $block Mage_Core_Model_Layout_Element */\n foreach ($blocks as $block) {\n if ((string)$block->getAttribute('name') && $this->_filterBlock($block)) {\n $helper = Mage::helper(Mage_Core_Model_Layout::findTranslationModuleName($block));\n $this->_blocks[(string)$block->getAttribute('name')] = $helper->__((string)$block->label);\n }\n }\n }\n asort($this->_blocks, SORT_STRING);\n }", "protected function _prepareCollection() {\n $collection = Config::get()->collectionTransaction();\n $asTrnx = 'main_table';\n $collection->addFieldToSelect(Transaction::ATTR_ID, self::AS_TRAN_ID);\n $collection->addFieldToSelect(Transaction::ATTR_DATE_APPLIED, self::AS_DATE_APPLIED);\n $collection->addFieldToSelect(Transaction::ATTR_VALUE, self::AS_VALUE);\n /* LEFT JOIN prxgt_bonus_operation oper ON trnx.operation_id = oper.id */\n $asOper = 'oper';\n $tbl = array( $asOper => Config::ENTITY_OPERATION );\n $cond = $asTrnx . '.' . Transaction::ATTR_OPERATION_ID . '=' . $asOper . '.' . Operation::ATTR_ID;\n $cols = array(\n self::AS_OPER_ID => Operation::ATTR_ID,\n self::AS_DATE_PERFORMED => Operation::ATTR_DATE_PERFORMED\n );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_account credit ON trnx.credit_acc_id = credit.id */\n $asCredit = 'credit';\n $tbl = array( $asCredit => Config::ENTITY_ACCOUNT );\n $cond = $asTrnx . '.' . Transaction::ATTR_CREDIT_ACC_ID . '=' . $asCredit . '.' . Account::ATTR_ID;\n $cols = array();\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_account debit ON trnx.debit_acc_id = debit.id */\n $asDebit = 'debit';\n $tbl = array( $asDebit => Config::ENTITY_ACCOUNT );\n $cond = $asTrnx . '.' . Transaction::ATTR_DEBIT_ACC_ID . '=' . $asDebit . '.' . Account::ATTR_ID;\n $cols = array();\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN customer_entity custCred ON credit.customer_id = custCred.entity_id */\n $asCreditCust = 'creditCust';\n $tbl = array( $asCreditCust => 'customer/entity' );\n $cond = $asCredit . '.' . Account::ATTR_CUSTOMER_ID . '=' . $asCreditCust . '.' . Eav::DEFAULT_ENTITY_ID_FIELD;\n $cols = array( self::AS_CREDIT_CUST => ConfigCore::ATTR_CUST_MLM_ID );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN customer_entity custDeb ON debit.customer_id = custDeb.entity_id */\n $asDebitCust = 'debitCust';\n $tbl = array( $asDebitCust => 'customer/entity' );\n $cond = $asDebit . '.' . Account::ATTR_CUSTOMER_ID . '=' . $asDebitCust . '.' . Eav::DEFAULT_ENTITY_ID_FIELD;\n $cols = array( self::AS_DEBIT_CUST => ConfigCore::ATTR_CUST_MLM_ID );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_type_asset asset ON credit.asset_id = asset.id */\n $asAsset = 'asset';\n $tbl = array( $asAsset => Config::ENTITY_TYPE_ASSET );\n $cond = $asCredit . '.' . Account::ATTR_ASSET_ID . '=' . $asAsset . '.' . TypeAsset::ATTR_ID;\n $cols = array( self::AS_ASSET_CODE => TypeAsset::ATTR_CODE );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_type_oper operType ON oper.type_id = operType.id */\n $asOperType = 'operType';\n $tbl = array( $asOperType => Config::ENTITY_TYPE_OPER );\n $cond = $asOper . '.' . Operation::ATTR_TYPE_ID . '=' . $asOperType . '.' . TypeOper::ATTR_ID;\n $cols = array( self::AS_OPER_CODE => TypeOper::ATTR_CODE );\n $collection->join($tbl, $cond, $cols);\n /* prepare collection */\n $sql = $collection->getSelectSql(true);\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "public function asCollection(): Collection\n {\n $collection = parent::asCollection();\n if ($this->showUnsupported) {\n return $collection;\n } else {\n return $collection->filter(function ($block) {\n return $block->getType() !== 'unsupported';\n });\n }\n }", "protected function fetchBlocks()\n {\n if (null === $this->blocks)\n {\n $this->blocks = array();\n\n $allBlocks = ContentBlockQuery::create()\n ->find()\n ;\n\n foreach ($allBlocks as $block)\n {\n /* @var $block ContentBlock */\n $this->blocks[$block->getName()][$block->getLocale()] = $block;\n }\n }\n }", "public function prepare_items() {\r\n\t\t$this->_column_headers = $this->get_column_info();\r\n\r\n\t\t/** Process bulk action */\r\n\t\t$this->process_bulk_action();\r\n\r\n\t\t$per_page = $this->get_items_per_page( 'customers_per_page', 5 );\r\n\t\t$current_page = $this->get_pagenum();\r\n\t\t$total_items = self::record_count();\r\n\r\n\t\t$this->set_pagination_args( [\r\n\t\t\t'total_items' => $total_items,\r\n\t\t\t'per_page' => $per_page\r\n\t\t] );\r\n\r\n\t\t$this->items = self::get_customers( $per_page, $current_page );\r\n\t}", "public function prepare_items()\r\r\n {\r\r\n\r\r\n $this->_column_headers = $this->get_column_info();\r\r\n\r\r\n /** Process bulk action */\r\r\n //\t$this->process_bulk_action();\r\r\n $per_page = $this->get_items_per_page('data_logs_per_page', 5);\r\r\n $current_page = $this->get_pagenum();\r\r\n $total_items = self::record_count();\r\r\n $this->set_pagination_args(array(\r\r\n 'total_items' => $total_items,\r\r\n 'per_page' => $per_page,\r\r\n ));\r\r\n\r\r\n $this->items = self::get_Data($per_page, $current_page);\r\r\n }", "private function loadBlockSettings() {\n\t\t$this->block['limited_categories'] = get_sub_field($this->current . '_category_filter');\n\n\t\t$this->block['limited_categories_term_string'] = [];\n\t\t$category_filters = get_sub_field($this->current . '_category_filter');\n\t\tif(!empty($category_filters)):\n\t\t\tforeach($category_filters as $filter_cat):\n\t\t\t\t$this->block['limited_categories_term_string'][] = $filter_cat->slug;\n\t\t\tendforeach;\n\t\tendif;\n\n\t\t$this->block['block_title'] = get_sub_field($this->current . '_title_title');\n\n\t\tif($this->layout == 'key_areas')\n\t\t\t$this->block['sections'] = get_sub_field($this->current . '_keyarea');\n\n\t\tif($this->layout == 'jobs_aside')\n\t\t\t$this->block['sections'] = get_sub_field($this->current . '_sections');\n\n\t}", "protected function _createCollection()\n {\n return Mage::getModel('wishlist/item')->getCollection()\n ->setWebsiteId($this->_getCustomer()->getWebsiteId())\n ->setCustomerGroupId($this->_getCustomer()->getGroupId());\n }", "public function __construct()\n {\n $this->items = new Collection;\n }", "public function __construct()\n {\n $this->items = new Collection;\n }", "protected function _prepareCollection() {\n $collection = Mage::helper('ProductReturn/SupplierReturn')->getProductsPending();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function run()\n {\n $this->disableForeignKeys();\n $this->truncate('blocks');\n\n /*\n * ABOUT US PAGE BLOCKS\n */\n $blocks = [\n [\n 'page_id' => 1,\n 'title' => 'History',\n 'title_ru' => 'История',\n 'title_it' => 'Mostra di più',\n 'body' => 'The collection is inspired by the Renaissance town of Verona, symbol of the classic and highly appreciated Italian style, romantic and elegant at a time. Special care is devoted to details, the selection of tissues, and the coordination of color nuances.\n ',\n 'body_ru' => 'Коллекция вдохновлена эпохой Возрождения Вероны, символом классического и высоко оцененного итальянского стиля, романтического и элегантного за один раз. Особое внимание уделяется деталям, выбору тканей и координации цветовых нюансов.',\n 'body_it' => 'La collezione è ispirata alla città rinascimentale di Verona, simbolo del classico stile italiano molto apprezzato, romantico ed elegante alla volta. La cura particolare è dedicata ai dettagli, alla selezione dei tessuti e al coordinamento delle sfumature di colore.\n ',\n 'image' => null,\n 'title_limit' => 15,\n 'body_limit' => 300,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Expression of style',\n 'title_ru' => 'Выражение стиля',\n 'title_it' => 'Espressione dello stile',\n 'body_it' => 'Anche nell\\'area dell\\'ufficio un nuovo concetto di spazio, adattato alle vostre esigenze, riesce a ripristinare un design elegante e raffinato che si esprime in una cura amorosa per i dettagli, in una lavorazione a mano che esalta le texture, dando complementi di mobili con un unico e Fascino senza tempo.',\n 'body_ru' => 'Кроме того, в офисной зоне новая концепция пространства, адаптированная к вашим потребностям, оживляет элегантный и изысканный дизайн, который выражается в любящей заботе о деталях, в ручном производстве, которое превозносит текстуры, придавая вам мебельные дополнения с уникальным и Вневременное очарование',\n 'body' => 'Also in the office area a new concept of space, tailored to your needs, to revive an elegant and refined design that expresses itself in a loving care for details, in a hand manufacturing that exalt the textures, giving you furniture complements with a unique and timeless charm',\n 'image' => 'under-history-right.jpg',\n 'title_limit' => 25,\n 'body_limit' => 330,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => 'The lifelong experience is being reflected in almost every project. At Cavio-Casa, we are welcoming challenges to foster our creativity. People inspire us and we want to inspire them too.<br><br>Everything we do at Cavio-Casa is guided by our vision to ensure that we all go the extra mile to help our customers reach their audiences. So far, we have achieved to play a dynamic role in shaping the jewelry industry.\n ',\n 'body_ru' => 'Жизненный опыт отражается почти во всех проектах. В Cavio-Casa мы приветствуем проблемы, способствующие нашему творчеству. Люди вдохновляют нас, и мы хотим их вдохновить. <br><br> Все, что мы делаем в Cavio-Casa, руководствуется нашим видением, чтобы все мы прошли лишнюю милю, чтобы помочь нашим клиентам достичь своей аудитории. До сих пор мы достигли динамичной роли в формировании ювелирной промышленности.',\n 'body_it' => 'L\\'esperienza permanente si riflette in quasi tutti i progetti. A Cavio-Casa, stiamo accogliendo sfide per promuovere la nostra creatività. La gente ci ispira e vogliamo ispirare anche loro<br><br> Tutto quello che facciamo a Cavio-Casa è guidato dalla nostra visione per assicurarci che tutti noi passiamo il miglio supplementare per aiutare i nostri clienti a raggiungere il loro pubblico. Finora abbiamo raggiunto un ruolo dinamico nella progettazione dell\\'industria dei gioielli.',\n 'image' => 'under-history-left.jpg',\n 'title_limit' => null,\n 'body_limit' => 500,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Philosofhy',\n 'title_ru' => 'Философия',\n 'title_it' => 'Filosofia',\n 'body' => 'The collection is inspired by the Renaissance town of Verona, symbol of the classic and highly appreciated Italian style, romantic and elegant at a time. Special care is devoted to details, the selection of tissues, and the coordination of color nuances.',\n 'body_ru' => 'Коллекция вдохновлена эпохой Возрождения Вероны, символом классического и высоко оцененного итальянского стиля, романтического и элегантного за один раз. Особое внимание уделяется деталям, выбору тканей и координации цветовых нюансов.',\n 'body_it' => 'La collezione è ispirata alla città rinascimentale di Verona, simbolo del classico stile italiano molto apprezzato, romantico ed elegante alla volta. La cura particolare è dedicata ai dettagli, alla selezione dei tessuti e al coordinamento delle sfumature di colore.',\n 'image' => null,\n 'title_limit' => 15,\n 'body_limit' => 300,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body_it' => 'Tutto quello che facciamo a Cavio-Casa è guidato dalla nostra visione per assicurare che tutti noi andiamo il miglio supplementare per aiutare i nostri clienti a raggiungere il loro pubblico. Finora abbiamo raggiunto un ruolo dinamico nella progettazione dell\\'industria dei gioielli<br><br> L\\'esperienza permanente si riflette in quasi tutti i progetti. A Cavio-Casa, stiamo accogliendo sfide per promuovere la nostra creatività. Le persone ci ispirano e vogliamo ispirare anche loro.',\n 'body_ru' => 'Все, что мы делаем в Cavio-Casa, руководствуется нашим видением, чтобы все мы прошли лишнюю милю, чтобы помочь нашим клиентам достичь своей аудитории. До сих пор мы достигли динамичной роли в формировании ювелирной промышленности.<br>Жизненный опыт отражается почти во всех проектах. В Cavio-Casa мы приветствуем проблемы, способствующие нашему творчеству. Люди вдохновляют нас, и мы хотим вдохновить их тоже.',\n 'body' => 'Everything we do at Cavio-Casa is guided by our vision to ensure that we all go the extra mile to help our customers reach their audiences. So far, we have achieved to play a dynamic role in shaping the jewelry industry.<br>The lifelong experience is being reflected in almost every project. At Cavio-Casa, we are welcoming challenges to foster our creativity. People inspire us and we want to inspire them too.',\n 'image' => null,\n 'title_limit' => null,\n 'body_limit' => 500,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => 'We have been renowned for the high quality of our hand-made products, the innovative ideas, the effective co-operation with clients around the world and the ability to tailor our services to each customer’s needs surpassing their expectations.<br><br>We are always next to you, full of new ideas, determination and love because we believe in what we do.',\n 'image' => null,\n 'body_ru' => 'Мы были известны высоким качеством наших изделий ручной работы, инновационными идеями, эффективным сотрудничеством с клиентами по всему миру и возможностью адаптировать наши услуги к потребностям каждого клиента, превосходящим их ожидания. <br><br> Мы всегда рядом с вами, полны новых идей, решительности и любви, потому что мы верим в то, что делаем.',\n 'body_it' => 'Siamo stati rinomati per l\\'alta qualità dei nostri prodotti fatti a mano, le idee innovative, l\\'efficace collaborazione con i clienti in tutto il mondo e la capacità di adattare i nostri servizi alle esigenze di ogni cliente che supera le loro aspettative.<br><br> Siamo sempre accanto a voi, pieno di nuove idee, determinazione e amore perché crediamo in ciò che facciamo.',\n 'title_limit' => null,\n 'body_limit' => 500,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body_ru' => '<span class=colored>Свобода</span>для сопоставления<br>разных материалов и отделок<br>и <span class=colored>ошеломляющий</span>визуал.',\n 'image' => null,\n 'body' => 'The <span class=colored>freedom</span>to to juxtapose<br>different materials, finishes<br>and <span class=colored>stunning</span>visual.',\n 'body_it' => 'La <span class=colored>libertà</span>Per giungere a destra<br>Materiali diversi, finiture<br>e <span class=colored>stunning</span>visivo.',\n 'title_limit' => null,\n 'body_limit' => 150,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Mood',\n 'title_ru' => 'Настроение',\n 'title_it' => 'Umore',\n 'body' => 'Special care is devoted to details, the selection of tissues, and the coordination of color nuances. The collection is inspired by the Renaissance town of Verona, symbol of the classic and highly appreciated Italian style, romantic and elegant at a time.',\n 'body_ru' => 'Особое внимание уделяется деталям, выбору тканей и координации цветовых нюансов. Коллекция вдохновлена эпохой Возрождения Вероны, символом классического и высоко оцененного итальянского стиля, романтического и элегантного за один раз.',\n 'body_it' => 'La cura particolare è dedicata ai dettagli, alla selezione dei tessuti e al coordinamento delle sfumature di colore. La collezione è ispirata alla città rinascimentale di Verona, simbolo del classico stile italiano molto apprezzato, romantico ed elegante alla volta.',\n 'image' => null,\n 'title_limit' => 15,\n 'body_limit' => 300,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Expression',\n 'title_ru' => 'Выражение',\n 'title_it' => 'Espressione',\n 'body' => 'Also in the office area a new concept of space, tailored to your needs, to revive an elegant and refined design that expresses itself in a loving care for details.',\n 'body_ru' => 'Кроме того, в офисе новая концепция пространства, адаптированная к вашим потребностям, оживляет элегантный и изысканный дизайн, который выражает себя в любящей заботе о деталях.',\n 'body_it' => 'Anche nell\\'area dell\\'ufficio un nuovo concetto di spazio, adattato alle vostre esigenze, riesumina un design elegante e raffinato che si esprime in una cura amorosa per i dettagli.',\n 'image' => null,\n 'title_limit' => 12,\n 'body_limit' => 190,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Style',\n 'title_ru' => 'Стиль',\n 'title_it' => 'Stile',\n 'body' => 'In a hand manufacturing that exalt the textures, giving you furniture complements with a unique and timeless charm.\n ',\n 'body_ru' => 'В ручном производстве, которые превозносят текстуры, дают вам комплименты мебели с уникальным и неподвластным времени очарованием.',\n 'body_it' => 'In una produzione a mano che esalta le texture, dandovi complimenti per mobili con un fascino unico e senza tempo.',\n 'image' => null,\n 'title_limit' => 12,\n 'body_limit' => 190,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Quality',\n 'title_ru' => 'Качество',\n 'title_it' => 'Qualità',\n 'body' => 'Also in the office area a new concept of space, tailored to your needs, to revive an elegant and refined design that expresses itself in a loving care for details.\n ',\n 'body_ru' => 'Кроме того, в офисе новая концепция пространства, адаптированная к вашим потребностям, оживляет элегантный и изысканный дизайн, который выражает себя в любящей заботе о деталях.',\n 'body_it' => 'Anche nell\\'area dell\\'ufficio un nuovo concetto di spazio, adattato alle vostre esigenze, riesumina un design elegante e raffinato che si esprime in una cura amorosa per i dettagli.',\n 'image' => null,\n 'title_limit' => 12,\n 'body_limit' => 190,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n /*\n * Contacts PAGE BLOCKS\n */\n [\n 'page_id' => 2,\n 'title' => 'CAVIO Factory & Showroom',\n 'title_ru' => 'CAVIO Фабрики & Посредники',\n 'title_it' => 'CAVIO Factory & Showroom',\n 'body' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR)\n Italia<br><br>Telefone: <a href=\"tel:+39 045 71 44 503\" class=tel>+39 045 71 44 503</a><br>Fax:\n <a href=\"tel:+39 045 71 44 277\" class=tel>+39 045 71 44 277</a><br><br><a\n href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'body_ru' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR)\n Italia<br><br>Telefone: <a href=\"tel:+39 045 71 44 503\" class=tel>+39 045 71 44 503</a><br>Fax:\n <a href=\"tel:+39 045 71 44 277\" class=tel>+39 045 71 44 277</a><br><br><a\n href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'body_it' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR)\n Italia<br><br>Telefone: <a href=\"tel:+39 045 71 44 503\" class=tel>+39 045 71 44 503</a><br>Fax:\n <a href=\"tel:+39 045 71 44 277\" class=tel>+39 045 71 44 277</a><br><br><a\n href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'image' => 'cont-r.jpg',\n 'title_limit' => 26,\n 'body_limit' => 400,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 2,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'image' => 'cont-map.jpg',\n 'title_limit' => null,\n 'body_limit' => null,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 2,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'image' => 'cont-bottom.jpg',\n 'title_limit' => null,\n 'body_limit' => null,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 8,\n 'title' => 'Our philosofy',\n 'title_ru' => 'Наша философия',\n 'title_it' => 'La filosofia',\n 'body' => '<div class=wrap-phil-p><p>Italian furniture showroom CAVIO found its adherents in 38 countries, including Switzerland, France, Sweden, Netherlands, Germany, Australia and the United States.</div><div class=wrap-phil-p><p>In Kiev, the Italian furniture CAVIO presented in several showrooms, conveniently located on the left and right banks.</div><div class=wrap-phil-p><p>Here, professional consultants will help you to implement a holistic complete interior - from the kitchen, bedroom, living room and study to the children\\'s room <a href=# class=link-arrow>→</a></div>',\n 'body_ru' => '<div class=wrap-phil-p><p>Italian furniture showroom CAVIO found its adherents in 38 countries, including Switzerland, France, Sweden, Netherlands, Germany, Australia and the United States.</div><div class=wrap-phil-p><p>In Kiev, the Italian furniture CAVIO presented in several showrooms, conveniently located on the left and right banks.</div><div class=wrap-phil-p><p>Here, professional consultants will help you to implement a holistic complete interior - from the kitchen, bedroom, living room and study to the children\\'s room <a href=# class=link-arrow>→</a></div>',\n 'body_it' => '<div class=wrap-phil-p><p>Italian furniture showroom CAVIO found its adherents in 38 countries, including Switzerland, France, Sweden, Netherlands, Germany, Australia and the United States.</div><div class=wrap-phil-p><p>In Kiev, the Italian furniture CAVIO presented in several showrooms, conveniently located on the left and right banks.</div><div class=wrap-phil-p><p>Here, professional consultants will help you to implement a holistic complete interior - from the kitchen, bedroom, living room and study to the children\\'s room <a href=# class=link-arrow>→</a></div>',\n 'image' => 'phil-image.jpg',\n 'title_limit' => 15,\n 'body_limit' => 810,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 9,\n 'title' => 'Privacy Policy',\n 'title_ru' => 'Политика приватности',\n 'title_it' => 'Politica sulla riservatezza',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'image' => null,\n 'title_limit' => 30,\n 'body_limit' => null,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n\n /*\n * Showroom page\n */\n\n [\n 'page_id' => 5,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'title_limit' => null,\n 'body_limit' => null,\n 'image' => 'show_r-slide-2.jpg',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 5,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'title_limit' => null,\n 'body_limit' => null,\n 'image' => 'show_r-slide-3.jpg',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 5,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'title_limit' => null,\n 'body_limit' => null,\n 'image' => 'show_r-slide-1.jpg',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 5,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => 'Don’t found showroom<br>near you? <span class=colored>Contact main</span><br>',\n 'body_ru' => 'Не нашли салон рядом<br>с вами? <span class=colored>Обратитесь в главный</span><br>',\n 'body_it' => 'Non ho trovato lo showroom<br>vicino a te? <span class=colored>Contatto principale</span><br>',\n 'image' => null,\n 'title_limit' => null,\n 'body_limit' => 100,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 5,\n 'title' => 'Main Showroom',\n 'title_ru' => 'Главный магазин',\n 'title_it' => 'Showroom principale',\n 'body' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR) Italia<br><br>Telefone: <a href=tel:+390457144503 class=tel>+39 045 71 44 503</a><br>Fax: <a href=tel:+390457144277 class=tel>+39 045 71 44 277</a><br><br><a href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'body_ru' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR) Italia<br><br>Telefone: <a href=tel:+390457144503 class=tel>+39 045 71 44 503</a><br>Fax: <a href=tel:+390457144277 class=tel>+39 045 71 44 277</a><br><br><a href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'body_it' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR) Italia<br><br>Telefone: <a href=tel:+390457144503 class=tel>+39 045 71 44 503</a><br>Fax: <a href=tel:+390457144277 class=tel>+39 045 71 44 277</a><br><br><a href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'image' => 'main-showroom.jpg',\n 'title_limit' => null,\n 'body_limit' => 320,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n\n\n ];\n\n DB::table('blocks')->insert($blocks);\n\n\n $this->enableForeignKeys();\n }", "public function prepare_items()\n {\n /* 20 seems like a good number to show */\n $per_page = 10;\n $columns = $this->get_columns();\n $hidden = array();\n $sortable = $this->get_sortable_columns();\n\n $this->_column_headers = array($columns, $hidden, $sortable);\n\n /* Parameters that are used to order the results table */\n $orderby = !empty($_GET[\"orderby\"]) ? mysql_real_escape_string($_GET[\"orderby\"]) : 'id';\n $order = !empty($_GET[\"order\"]) ? mysql_real_escape_string($_GET[\"order\"]) : 'ASC';\n\n $current_page = $this->get_pagenum();\n $total_items = count($this->items);\n if ($total_items > 0) {\n\n $this->items = array_slice($this->items,(($current_page-1)*$per_page),$per_page);\n\n $this->set_pagination_args( array(\n 'total_items' => $total_items, //WE have to calculate the total number of items\n 'per_page' => $per_page, //WE have to determine how many items to show on a page\n 'total_pages' => ceil($total_items/$per_page) //WE have to calculate the total number of pages\n ) );\n }\n }", "public function collect() {\n foreach ($this->_items as $item) {\n $item->collect();\n }\n }", "public function getCollection() ;", "public function prepare_items() {\n \n /**\n * Set how many records per page to show\n */\n $_iItemsPerPage = 20;\n \n /**\n * Define our column headers. \n */\n $this->_column_headers = array( \n $this->get_columns(), // $aColumns\n array(), // $aHidden\n $this->get_sortable_columns() // $aSortable\n );\n \n \n /**\n * Process bulk actions.\n */\n // $this->process_bulk_action(); // in our case, it is dealt before the header is sent. ( with the Admin page class )\n \n /**\n * Variables\n */\n $_aData = $this->aData;\n \n \n /**\n * Sort the array.\n */\n usort( $_aData, array( $this, 'usort_reorder' ) );\n \n \n /**\n * For pagination.\n */\n $_iCurrentPageNumber = $this->get_pagenum();\n $_iTotalItems = count( $_aData );\n $this->set_pagination_args( \n array(\n 'total_items' => $_iTotalItems, // calculate the total number of items\n 'per_page' => $_iItemsPerPage, // determine how many items to show on a page\n 'total_pages' => ceil( $_iTotalItems / $_iItemsPerPage ) // calculate the total number of pages\n )\n );\n $_aData = array_slice( \n $_aData, \n ( ( $_iCurrentPageNumber -1 ) * $_iItemsPerPage ), \n $_iItemsPerPage \n );\n \n /*\n * Set data\n * */\n $this->items = $_aData;\n \n }", "protected function _prepareCollection() {\n $session = Mage::getModel('core/session');\n $filterConditions = $session->getData('rp_conditions');\n if (!$filterConditions)\n $filterConditions = $this->_filterConditions;\n $posorderCollection = Mage::getModel('webpos/posorder')->getCollection();\n /* Jack - create an empty collection */\n $collection = $posorderCollection;\n foreach ($collection->getItems() as $key => $item) {\n $collection->removeItemByKey($key);\n }\n /**/\n\n /* Define variables and set default data */\n $totalsSalesByUser = array();\n $totalSales = 0;\n $incTimeStrings = array('1' => ' +1 week', '2' => ' +1 day', '3' => ' +1 month', '4' => ' +1 day', '5' => ' +1 day', '6' => ' +1 week', '7' => ' +1 week');\n $descTimeStrings = array('4' => ' -1 week', '5' => ' -1 week', '6' => ' -1 month', '7' => ' -1 month');\n $periodFormat = ($filterConditions['period'] == 3 || $filterConditions['period'] == 6 || $filterConditions['period'] == 7 ) ? \"Y-m-d\" : \"Y-m-d\";\n $specialPeriod = array('1', '2', '3', '4');\n $stringTimeFrom = array('1' => 'monday this week', '2' => 'monday last week', '3' => 'first day of this month', '4' => 'first day of previous month');\n $stringTimeTo = array('1' => 'sunday this week', '2' => 'sunday last week', '3' => 'last day of this month', '4' => 'last day of previous month');\n $thisFriday = date($periodFormat, strtotime('friday this week'));\n $today = date($periodFormat);\n $userIds = $this->userIds;\n if (($filterConditions['from'] == '' || $filterConditions['to'] == '' ) && in_array($filterConditions['period'], $specialPeriod) == false) {\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }\n\n $startTime = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeFrom[$filterConditions['range']]))) : date($periodFormat, strtotime($filterConditions['from']));\n $timeFrom = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeFrom[$filterConditions['range']]))) : date($periodFormat, strtotime($filterConditions['from']));\n $timeTo = (in_array($filterConditions['range'], $specialPeriod)) ? (date($periodFormat, strtotime($stringTimeTo[$filterConditions['range']]))) : date(\"Y-m-d\", strtotime($filterConditions['to']));\n if ($timeFrom && $timeTo) {\n while ($timeFrom <= $timeTo) {\n $i = 0;\n foreach ($this->userIds as $userId => $displayName) {\n $isSave = true;\n $totalSalesOfPeriod = 0;\n $isEmpty = true;\n if ($filterConditions['period'] == 1) {\n $endTime = $this->lastDayOf('year', new DateTime($timeFrom))->format('Y-m-d');\n } else if ($filterConditions['period'] == 3) {\n $endTime = $this->lastDayOf('month', new DateTime($timeFrom))->format('Y-m-d');\n } else\n $endTime = date('Y-m-d', strtotime($timeFrom . $incTimeStrings[$filterConditions['period']]));\n $endTime = (strtotime($endTime) < strtotime($timeTo)) ? $endTime : $timeTo;\n $itemDataObject = new Varien_Object();\n if ($i == 0) {\n if ($filterConditions['period'] == 1) {\n $exTimeFrom = explode('-', $timeFrom);\n $itemDataObject->setData('period', $exTimeFrom[0]);\n } else if ($filterConditions['period'] == 3) {\n $exTimeFrom = explode('-', $timeFrom);\n $itemDataObject->setData('period', $exTimeFrom[0] . '-' . $exTimeFrom[1]);\n } else\n $itemDataObject->setData('period', $timeFrom);\n } else\n $itemDataObject->setData('period', '');\n if ($itemDataObject->getData('period'))\n $itemDataObject->setData('period', date('F j, Y', strtotime($itemDataObject->getData('period'))));\n $webposOrderCollection = $this->getSalesCollection($timeFrom, $endTime, array('user_id' => $userId));\n $totalU = 0;\n if (count($webposOrderCollection) > 0) {\n foreach ($webposOrderCollection as $order) {\n $totalU += $order->getTotals();\n }\n }\n if (!$totalU && $filterConditions['rp_settings']['show_empty_result'] == 'false')\n $isSave = false;\n\n if ($isSave) {\n $itemDataObject->setData('user', $displayName);\n\n $itemDataObject->setData('totals_sales', ($totalU > 0) ? $totalU : '0.00');\n $collection->addItem($itemDataObject);\n }\n $i++;\n }\n if ($filterConditions['period'] == 1)\n $timeFrom = date('Y-m-d', strtotime($endTime));\n else\n $timeFrom = date($periodFormat, strtotime($timeFrom . $incTimeStrings[$filterConditions['period']]));\n }\n /* get last item data \n $i = 0;\n foreach($this->userIds as $userId => $displayName){\n $isSave = true;\n $beforeLastItem = new Varien_Object();\n if($i == 0){\n if($filterConditions['period'] == 1){\n $exTimeFrom = explode('-',$timeTo);\n $beforeLastItem->setData('period',$exTimeFrom[0]);\n }\n else if($filterConditions['period'] == 3){\n $exTimeFrom = explode('-',$timeTo);\n $beforeLastItem->setData('period',$exTimeFrom[0].'-'.$exTimeFrom[1]);\n }\n else\n $beforeLastItem->setData('period',$timeTo);\n }\n else\n $beforeLastItem->setData('period','');\n if($beforeLastItem->getData('period'))\n $beforeLastItem->setData('period',date('F j, Y', strtotime($beforeLastItem->getData('period'))));\n $webposOrderCollection = $this->getSalesCollection($timeTo,$timeTo,array('user_id' => $userId))->getFirstItem();\n if( !$webposOrderCollection->getTotals() && $filterConditions['rp_settings']['show_empty_result'] == 'false')\n $isSave = false;\n if($isSave){\n $beforeLastItem->setData('user',$displayName);\n $beforeLastItem->setData('totals_sales',$webposOrderCollection->getTotals()?$webposOrderCollection->getTotals():'0.00');\n $collection->addItem($beforeLastItem);\n }\n $i++;\n }\n end last item */\n }\n /* set data for totals row */\n $lastItemDataObject = new Varien_Object();\n $lastItemDataObject->setData('period', 'Totals:');\n $orders = $this->getSalesTotal($startTime, $endTime);\n\n $totalU = 0;\n if (count($orders) > 0) {\n foreach ($orders as $order) {\n $totalU += $order->getTotals();\n }\n }\n $lastItemDataObject->setData('totals_sales', $totalU);\n $collection->addItem($lastItemDataObject);\n $this->setCollection($collection);\n /* set session for chart */\n $sessionObject = new Varien_Object();\n foreach ($this->userIds as $userId => $username) {\n $orders = $this->getSalesTotal($startTime, $endTime, array('user_id' => $userId));\n\n\n $totalU = 0;\n if (count($orders) > 0) {\n foreach ($orders as $order) {\n $totalU += $order->getTotals();\n }\n }\n $sessionObject->setData($username, $totalU);\n }\n Mage::getSingleton('core/session')->setData('total_sales_by_user', $sessionObject->toArray());\n Mage::getSingleton('core/session')->setType('user');\n $this->setTotalRowByUser($sessionObject->toArray());\n return parent::_prepareCollection();\n }", "public function __construct()\n {\n $this->commentaires = new ArrayCollection();\n $this->photos = new ArrayCollection();\n }", "private function prepareItems()\n {\n $attribute = $this->attribute;\n $items = $this->model->$attribute;\n if (!is_array($items)) {\n $items = [];\n }\n\n $this->_items = $items;\n }", "protected function _prepareCollection() {\r\n $store = $this->_getStore();\r\n $collection = Mage::getModel('catalog/product')->getCollection()\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('attribute_set_id')\r\n ->addAttributeToSelect('type_id');\r\n\r\n if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) {\r\n $collection->joinField('qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id', '{{table}}.stock_id=1', 'left');\r\n }\r\n if ($store->getId()) {\r\n $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;\r\n $collection->addStoreFilter($store);\r\n $collection->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner', $adminStore);\r\n $collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId());\r\n $collection->joinAttribute('reqcoupon_status', 'catalog_product/reqcoupon_status', 'entity_id', null, 'left');\r\n } else {\r\n $collection->addAttributeToSelect('price');\r\n $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');\r\n $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');\r\n $collection->joinAttribute('reqcoupon_status', 'catalog_product/reqcoupon_status', 'entity_id', null, 'left');\r\n }\r\n\r\n $this->setCollection($collection);\r\n\r\n parent::_prepareCollection();\r\n $this->getCollection()->addWebsiteNamesToResult();\r\n return $this;\r\n }", "protected function prepareBeforeLoop() {\n\n parent::buildElement();\n\n $this\n ->addContext('objects.columns', new VTCore_Bootstrap_Grid_Column($this->getContext('grids')))\n ->addData('arrival', $this->getContext('id'));\n\n return $this;\n }", "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 loadCollections(Block $block): array;", "protected function _setCollection(){\n $storeId = Mage::app()->getStore()->getId();\n $products = Mage::getResourceModel('reports/product_collection')\n ->addOrderedQty()\n ->addAttributeToSelect(array('name', 'price', 'small_image', 'short_description', 'description'))\n ->setStoreId($storeId)\n ->addStoreFilter($storeId)\n ->setPageSize($this->getProductsCount())\n ->setOrder('ordered_qty', 'desc');\n\n Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);\n Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);\n\n $this->_topsellerCollection = $products;\n }", "public function prepare_items()\r\n {\r\n if( !count( $this->columns ) )\r\n $this->set_columns();\r\n\r\n $per_page = 20;\r\n\r\n $columns = $this->get_columns();\r\n $hidden = array();\r\n $sortable = $this->get_sortable_columns();\r\n\r\n $this->_column_headers = array( $columns, $hidden, $sortable );\r\n\r\n $this->process_bulk_action();\r\n\r\n $data = $this->values;\r\n\r\n usort( $data, array( $this, 'usort_reorder' ) );\r\n\r\n $current_page = $this->get_pagenum();\r\n\r\n $total_items = count( $data );\r\n\r\n $data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );\r\n\r\n $this->items = $data;\r\n\r\n if( $total_items > $per_page ) {\r\n $this->set_pagination_args( array(\r\n 'total_items' => $total_items,\r\n 'per_page' => $per_page,\r\n 'total_pages' => ceil( $total_items / $per_page ),\r\n ) );\r\n }\r\n }", "abstract protected function collectionLoader();", "public function prepare_items() {\n\n\t\t// Retrieve count.\n\t\t$this->get_counts();\n\n\t\t/**\n\t\t * TODO: implement.\n\t\t */\n\t\t$this->process_bulk_action();\n\n\t\t/*\n\t\t * Prepare all the params to pass to our Collection.\n\t\t * All sanitization is done in that class.\n\t\t */\n\t\t$params = $this->get_filters_query_params();\n\n\t\t// Total amount for pagination with WHERE clause - super quick count DB request.\n\t\t$total_items = ( new EmailsCollection( $params ) )->get_count();\n\n\t\tif ( ! empty( $_REQUEST['orderby'] ) && in_array( $_REQUEST['orderby'], [ 'subject', 'date_sent' ], true ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t\t$params['orderby'] = sanitize_key( $_REQUEST['orderby'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t}\n\n\t\tif ( ! empty( $_REQUEST['order'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t\t$params['order'] = sanitize_key( $_REQUEST['order'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t}\n\n\t\t$params['offset'] = ( $this->get_pagenum() - 1 ) * EmailsCollection::$per_page;\n\n\t\t// Get the data from the DB using parameters defined above.\n\t\t$collection = new EmailsCollection( $params );\n\t\t$this->items = $collection->get();\n\n\t\t/*\n\t\t * Register our pagination options & calculations.\n\t\t */\n\t\t$this->set_pagination_args(\n\t\t\t[\n\t\t\t\t'total_items' => $total_items,\n\t\t\t\t'per_page' => EmailsCollection::$per_page,\n\t\t\t]\n\t\t);\n\t}", "protected function _prepareFromResourceData()\n {\n if (count($this->_items) == 0) {\n $i = 0;\n $charities = array();\n \n foreach ($this->_resourceCollection as $item) {\n $item->setData('from',$this->_from);\n $item->setData('to',$this->_to);\n $charities[$item->getData('charity_id')][] = $item;\n }\n foreach($charities as $id => $charity)\n {\n $item = $this->getItemModel()->fromCharityData($charity);\n foreach($item->getData() as $idx => $value)\n {\n $this->getTotals()->setData($idx,$this->getTotals()->getData($idx) + $value);\n }\n $this->_items[] = $item;\n }\n }\n \n return $this;\n }", "public function init()\n {\n $this->_items = $this->getTable('Item');\n $this->_exhibits = $this->getTable('NeatlineExhibit');\n $this->_editions = $this->getTable('NeatlineEdition');\n\n // Get exhibit and document markup.\n $item = $this->_items->find($this->_request->id);\n $edition = $this->_editions->findByItem($item);\n $exhibit = $edition->getExhibit();\n $document = $edition->getDocumentMarkup();\n\n // Push records.\n $this->view->exhibit = $exhibit;\n $this->view->edition = $edition;\n $this->view->document = $document;\n }", "function prepare_items() {\n\t\tglobal $avail_post_stati, $wp_query, $per_page, $mode, $post;\n\n\t\t$columns = $this->get_columns();\n\t\t$hidden = array();\n\t\t$sortable = $this->get_sortable_columns();\n\t\t\n\t\t\n\t\t/**\n\t\t * REQUIRED. Finally, we build an array to be used by the class for column \n\t\t * headers. The $this->_column_headers property takes an array which contains\n\t\t * 3 other arrays. One for all columns, one for hidden columns, and one\n\t\t * for sortable columns.\n\t\t */\n\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\n\t\t$post_type = 'dwqa-answer';\n\t\t$per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );\n\n\t\t/** This filter is documented in wp-admin/includes/post.php */\n \t\t$per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );\n\n\t\t$question_id = $post->ID;\n\t\t$args = array(\n\t\t\t'post_type' => 'dwqa-answer',\n\t\t\t'posts_per_page' => $per_page,\n\t\t\t'order' => 'ASC',\n\t\t\t'meta_query' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key' => '_question',\n\t\t\t\t\t'value' => array( $question_id ),\n\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t),\n\t\t ),\n\t\t 'post_status' => 'publish',\n\t\t );\n\t\t$data = get_posts( $args );\n\t\t$this->items = $data;\n\t}", "function carrinho(){\n\t\t\t$this->items = array();\n\t\t}", "public function __construct()\n {\n //$this->bannerPageId = new ArrayCollection();\n }", "abstract protected function _generateDataCollection();", "public function getBlocks(): Collection\n {\n return $this->blocks;\n }", "protected function _prepareCollection($collection)\n {\n return $this;\n }", "public function prepare_items() {\n\t\tglobal $per_page;\n\n\t\t$per_page = $this->get_items_per_page( 'rank_math_404_monitor_per_page', 100 );\n\t\t$search = $this->get_search();\n\n\t\t$data = DB::get_logs(\n\t\t\t[\n\t\t\t\t'limit' => $per_page,\n\t\t\t\t'order' => $this->get_order(),\n\t\t\t\t'orderby' => $this->get_orderby( 'accessed' ),\n\t\t\t\t'paged' => $this->get_pagenum(),\n\t\t\t\t'search' => $search ? $search : '',\n\t\t\t]\n\t\t);\n\n\t\t$this->items = $data['logs'];\n\n\t\tforeach ( $this->items as $i => $item ) {\n\t\t\t$this->items[ $i ]['uri_decoded'] = urldecode( $item['uri'] );\n\t\t}\n\n\t\t$this->set_pagination_args(\n\t\t\t[\n\t\t\t\t'total_items' => $data['count'],\n\t\t\t\t'per_page' => $per_page,\n\t\t\t]\n\t\t);\n\t}", "protected function _prepareCollection()\n {\n /** @var \\Mage_Catalog_Model_Resource_Product_Attribute_Collection $collection */\n $collection = Mage::getResourceModel('catalog/product_attribute_collection')\n ->addVisibleFilter();\n\n $store = $this->_getStore();\n// $prefix = Mage::getConfig()->getTablePrefix()->__toString();\n// $jobAttributeQuery = 'select a.`version`, a.`attribute_id` from `'.$prefix.'straker_job_attribute` as a\n// left join `'.$prefix.'straker_job` as b on a.`job_id`=b.`id`\n// where b.`store_id` ='.$store->getId().' and a.`version` =1\n// GROUP BY a.`attribute_id`';\n//\n// //join straker job product table to get version for each product\n// $collection->getSelect()->joinLeft(\n//\n// new Zend_Db_Expr('('.$jobAttributeQuery.')'),\n// 'main_table.attribute_id = t.attribute_id',\n// array('version')\n//\n// );\n /** @var StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Attribute_Collection $strakerJobProductCollection */\n $strakerJobAttributeCollection = Mage::getModel('strakertranslations_easytranslationplatform/job_attribute')->getCollection();\n $strakerJobAttributeCollection->getSelect()\n ->reset(Zend_Db_Select::COLUMNS)\n ->joinLeft(\n ['b' => $strakerJobAttributeCollection->getTable('strakertranslations_easytranslationplatform/job')],\n '`main_table`.`job_id` = `b`.`id`',\n []\n )->where(\n '`b`.`store_id` = ?', $store->getId()\n )->where(\n '`main_table`.`version` = ?', 1\n )->group(\n 'main_table.attribute_id'\n )->columns(\n ['version' => 'version', 'attribute_id' => 'attribute_id']\n );\n\n $jobAttributeQuery = $strakerJobAttributeCollection->getSelect();\n\n $collection->getSelect()->joinLeft(\n $jobAttributeQuery,\n 'main_table.attribute_id = t.attribute_id',\n array('version')\n );\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }" ]
[ "0.7329801", "0.6989855", "0.6978141", "0.6924719", "0.6898002", "0.6804254", "0.67915636", "0.67820585", "0.6733773", "0.6731595", "0.6717381", "0.67111105", "0.66257966", "0.65898454", "0.6557178", "0.6545744", "0.6513495", "0.65055937", "0.647104", "0.6455959", "0.64556706", "0.64556706", "0.64556706", "0.6454952", "0.64549166", "0.6431165", "0.6407876", "0.64015", "0.6393671", "0.6380841", "0.6353787", "0.6348053", "0.6338546", "0.63357717", "0.6328766", "0.63187206", "0.62919736", "0.62863773", "0.6282101", "0.6276198", "0.6263101", "0.6244974", "0.6233473", "0.62065005", "0.61869854", "0.6162009", "0.61573195", "0.6132105", "0.6099989", "0.6076825", "0.60520685", "0.6047844", "0.60373557", "0.60336006", "0.6027602", "0.6025557", "0.6016964", "0.6001055", "0.59953976", "0.5957683", "0.5928413", "0.5904802", "0.58831656", "0.58444095", "0.583676", "0.5835718", "0.5832521", "0.58244956", "0.5821828", "0.5816897", "0.57886696", "0.57853895", "0.57853895", "0.5780702", "0.57681227", "0.57598776", "0.5750501", "0.5735657", "0.5727944", "0.5726326", "0.5724159", "0.5719035", "0.57170266", "0.57126755", "0.57057995", "0.5704499", "0.5696583", "0.56929326", "0.56754494", "0.5670558", "0.56673825", "0.56672204", "0.5653457", "0.56515956", "0.5650673", "0.5649046", "0.5642533", "0.5628505", "0.5626614", "0.56035715" ]
0.6039622
52
prepare columns for this grid
protected function _prepareColumns() { $this->addColumn('solutionpartner_id', array( 'header' => Mage::helper('solutionpartner')->__('ID'), 'align' =>'right', 'width' => '50px', 'index' => 'solutionpartner_id', )); $this->addColumn('name', array( 'header' => Mage::helper('solutionpartner')->__('Name'), 'align' =>'left', 'index' => 'name', )); $this->addColumn('email', array( 'header' => Mage::helper('solutionpartner')->__('Email'), 'align' =>'left', 'index' => 'email', 'renderer' => 'solutionpartner/adminhtml_solutionpartner_renderer_customer', )); $this->addColumn('website', array( 'header' => Mage::helper('solutionpartner')->__('Website'), 'align' => 'left', 'index' => 'website', 'renderer' => 'solutionpartner/adminhtml_solutionpartner_renderer_website', )); $this->addColumn('country', array( 'header' => Mage::helper('solutionpartner')->__('Country'), 'align' => 'left', 'index' => 'country', 'type' => 'options', 'options' => Mage::helper('solutionpartner')->getCountryList(), )); $this->addColumn('number_qtys', array( 'header' => Mage::helper('solutionpartner')->__('Order Qty'), 'align' => 'center', 'index' => 'number_qtys', 'filter_index' => 'count(order.entity_id)', 'type' => 'number', 'filter_condition_callback' => array($this, '_filterTotalProductsCallback'), // 'renderer' => 'partner/adminhtml_partner_renderer_orderquantity', )); // $this->addColumn('cumulative_amount', array( // 'header' => Mage::helper('solutionpartner')->__('Accumulated Revenue'), // 'type' => 'price', // 'index' => 'cumulative_amount', // 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(), // )); // // $this->addColumn('cumulative_amount_history', array( // 'header' => Mage::helper('solutionpartner')->__('Revenue History'), // 'type' => 'price', // 'index' => 'cumulative_amount_history', // 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(), // )); $this->addColumn('registered_date', array( 'header' => Mage::helper('solutionpartner')->__('Registered Date'), 'align' => 'left', 'index' => 'registered_date', 'type' => 'datetime' )); $this->addColumn('status', array( 'header' => Mage::helper('solutionpartner')->__('Status'), 'align' => 'left', 'width' => '80px', 'index' => 'status', 'type' => 'options', 'options' => array( 1 => 'Enabled', 2 => 'Disabled', ), )); $this->addColumn('action', array( 'header' => Mage::helper('solutionpartner')->__('Action'), 'width' => '100', 'type' => 'action', 'getter' => 'getId', 'actions' => array( array( 'caption' => Mage::helper('solutionpartner')->__('Edit'), 'url' => array('base'=> '*/*/edit'), 'field' => 'id' )), 'filter' => false, 'sortable' => false, 'index' => 'stores', 'is_system' => true, )); $this->addExportType('*/*/exportCsv', Mage::helper('solutionpartner')->__('CSV')); $this->addExportType('*/*/exportXml', Mage::helper('solutionpartner')->__('XML')); return parent::_prepareColumns(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareColumns()\n\t{\n\t\t$this->addColumn('id',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('ID'),\n\t\t\t\t\t\t'align' =>'right',\n\t\t\t\t\t\t'width' => '50px',\n\t\t\t\t\t\t'index' => 'id'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\t$this->addColumn('name',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Name'),\n\t\t\t\t\t\t'index' => 'name'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('description',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Description'),\n\t\t\t\t\t\t'index' => 'description'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('percentage',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Percentage'),\n\t\t\t\t\t\t'index' => 'percentage'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\treturn parent::_prepareColumns();\n\t}", "protected function _prepareColumns()\n {\n $this->addColumn($this->_productIdField, array(\n 'header' => $this->_getHelper()->__('ID'),\n 'sortable' => true,\n 'index' => $this->_productIdField,\n 'width' => 60,\n ));\n\n $this->addColumn('title', array(\n 'header' => $this->_getHelper()->__('Title'),\n 'index' => 'title'\n ));\n\n $this->addColumn('set_title', array(\n 'header' => $this->_getHelper()->__('Attachments Set'),\n 'index' => 'set_title',\n 'width' => 150,\n 'frame_callback' => array($this, 'prepareSetUrl')\n ));\n\n $this->addColumn('file_url', array(\n 'header' => $this->_getHelper()->__('Download'),\n 'index' => 'download',\n 'sortable' => false,\n 'filter' => false,\n 'width' => 150,\n 'frame_callback' => array($this, 'prepareFileUrl')\n ));\n\n $this->addColumn('type', array(\n 'header' => $this->_getHelper()->__('Type'),\n 'index' => 'type',\n 'filter' => false,\n 'width' => 50,\n 'frame_callback' => array($this, 'prepareType')\n ));\n\n $this->addColumn('updated_at', array(\n 'header' => $this->_getHelper()->__('Updated'),\n 'type' => 'date',\n 'index' => 'updated_at',\n 'width' => 150,\n ));\n\n return Mage_Adminhtml_Block_Widget_Grid::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('hourbelt_id', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('ID'),\n 'width' => '50px',\n 'index' => 'hourbelt_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Nombre Franja'),\n 'index' => 'name',\n ));\n\n $this->addColumn('start', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Hora Inicio'),\n 'index' => 'start',\n ));\n\n $this->addColumn('finish', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Hora Fin'),\n 'index' => 'finish',\n ));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('ID',\n array(\n 'header'=> $this->__('ID'),\n 'width' => '50px',\n 'index' => 'ID'\n )\n );\n\n\n $this->addColumn('browser',\n array(\n 'header'=> $this->__('Browser Data'),\n 'width' => '50px',\n 'index' => 'browser',\n 'renderer' => 'Mage_Osc_Block_Renderers_Browser'\n )\n );\n\n\n $this->addColumn('quote_id',\n array(\n 'header'=> $this->__('ID do Carrinho'),\n 'width' => '50px',\n 'index' => 'quote_id'\n )\n );\n\n\n $this->addColumn('order_id',\n array(\n 'header'=> $this->__('ID do Pedido'),\n 'width' => '50px',\n 'index' => 'order_id',\n 'renderer' => 'Mage_Osc_Block_Renderers_Order'\n )\n );\n\n\n $this->addColumn('customer_id',\n array(\n 'header'=> $this->__('Cliente'),\n 'width' => '50px',\n 'index' => 'customer_id',\n 'renderer' => 'Mage_Osc_Block_Renderers_Customer'\n )\n );\n\n\n $this->addColumn('clickedfo',\n array(\n 'header'=> $this->__('Quantidade de Cliques'),\n 'width' => '50px',\n 'index' => 'clickedfo'\n )\n );\n\n\n $this->addColumn('payment_method',\n array(\n 'header'=> $this->__('Método de Pagamento'),\n 'width' => '50px',\n 'index' => 'payment_method'\n )\n );\n\n\n return parent::_prepareColumns();\n }", "private function _setColumns()\n {\n $this->columns = new Pike_Grid_DataSource_Columns();\n\n foreach ($this->_query->getFields() as $field) {\n $this->columns->add($field, null, $field);\n }\n }", "protected function _prepareColumns()\n\t{\n\t\tparent::_prepareColumns();\n\t\t\n\t\t// remove old columns\n\t\t$this->removeColumn('gender'); // futureproof\n $this->removeColumn('lastname');\n $this->removeColumn('firstname');\n\t\t\n\t\t// add new columns\n\t\t$this->addColumnAfter('gender', array(\n\t\t\t'header' => Mage::helper('newsletter')->__('Gender'),\n 'index' => 'customer_gender',\n 'type' => 'options',\n 'options' => array(\n 1 => Mage::helper('newsletter')->__('Mr'),\n 2 => Mage::helper('newsletter')->__('Ms/Mrs')\n ),\n\t\t\t'renderer'\t=> 'Mediarocks_NewsletterExtended_Adminhtml_Block_Newsletter_Subscriber_Grid_Renderer_Gender'\n\t\t), 'type');\n\t\t\n\t\t$this->addColumnAfter('firstname', array(\n\t\t\t'header' => Mage::helper('newsletter')->__('Firstname'),\n 'index' => 'customer_firstname',\n\t\t\t'renderer'\t=> 'Mediarocks_NewsletterExtended_Adminhtml_Block_Newsletter_Subscriber_Grid_Renderer_Firstname'\n\t\t), 'gender');\n\t\t\n\t\t$this->addColumnAfter('lastname', array(\n\t\t\t'header' => Mage::helper('newsletter')->__('Lastname'),\n 'index' => 'customer_lastname',\n\t\t\t'renderer'\t=> 'Mediarocks_NewsletterExtended_Adminhtml_Block_Newsletter_Subscriber_Grid_Renderer_Lastname'\n\t\t), 'firstname');\n\n\t\t// manually sort again, that our custom order works\n\t\t$this->sortColumnsByOrder();\n\t\t\n return $this;\n }", "protected function _prepareColumns()\n {\n $this->addColumn('ticket_id', array(\n 'header' => Mage::helper('inchoo_supportticket')->__('ID'),\n 'width' => '80px',\n 'index' => 'ticket_id'\n ));\n $this->addColumn('subject', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Subject'),\n 'type'=> 'text',\n 'width' => '300px',\n 'index' => 'subject',\n 'escape' => true\n ));\n $this->addColumn('content', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Content'),\n 'type' => 'text',\n 'index' => 'content',\n 'escape' => true\n ));\n $this->addColumn('status', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Status'),\n 'type'=> 'text',\n 'width' => '200px',\n 'index' => 'status',\n 'escape' => true\n ));\n $this->addColumn('created_at', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Created at'),\n 'type' => 'text',\n 'width' => '170px',\n 'index' => 'created_at',\n ));\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n parent::_prepareColumns();\n\n $this->addColumn('attribute_code', array(\n 'header' => Mage::helper('eav')->__('Attribute Code'),\n 'sortable' => true,\n 'index' => 'attribute_code'\n ));\n\n $this->addColumn('frontend_label', array(\n 'header' => Mage::helper('eav')->__('Attribute Label'),\n 'sortable' => true,\n 'index' => 'frontend_label'\n ));\n }", "protected function _prepareColumns()\n {\n if (Mage::helper('route')->canChangeOrderGrid()) {\n\n $this->addColumnAfter('route_is_insured', array(\n 'header'=> Mage::helper('sales')->__('Route Insurance'),\n 'width' => '80px',\n 'index' => 'route_is_insured',\n 'type' => 'options',\n 'renderer' => 'route/adminhtml_widget_grid_column_renderer_insured',\n 'options' => array(\n 1 => 'Yes',\n 0 => 'No',\n ),\n ),'status');\n\n $this->addColumnAfter('fee_amount', array(\n 'header'=> Mage::helper('sales')->__('Route Charge'),\n 'width' => '80px',\n 'filter' => false,\n 'sortable' => false,\n 'type' => 'currency',\n 'index' => 'fee_amount',\n 'currency' => 'order_currency_code',\n ),'route_is_insured');\n }\n parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n if (!$this->getCategory()->getProductsReadonly()) {\n $this->addColumn('in_category', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_category',\n 'values' => $this->_getSelectedProducts(),\n 'align' => 'center',\n 'index' => 'entity_id',\n 'is_system' => true,\n ));\n }\n $this->addColumn('entity_id', array(\n 'header' => Mage::helper('catalog')->__('ID'),\n 'sortable' => true,\n 'width' => '60',\n 'index' => 'entity_id'\n ));\n $this->addColumn('name', array(\n 'header' => Mage::helper('catalog')->__('Name'),\n 'index' => 'name'\n ));\n $this->addColumn('sku', array(\n 'header' => Mage::helper('catalog')->__('SKU'),\n 'width' => '80',\n 'index' => 'sku'\n ));\n $this->addColumn('price', array(\n 'header' => Mage::helper('catalog')->__('Price'),\n 'type' => 'currency',\n 'width' => '1',\n 'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),\n 'index' => 'price'\n ));\n $this->addColumn('position', array(\n 'header' => Mage::helper('catalog')->__('Position'),\n 'width' => '1',\n 'type' => 'number',\n 'index' => 'position',\n 'editable' => !$this->getCategory()->getProductsReadonly(),\n //'renderer' => 'adminhtml/widget_grid_column_renderer_input'\n ));\n\n //Add export type for CSV\n $this->addExportType('*/*/exportCsv', Mage::helper('adminhtml')->__('CSV'));\n }", "private function prepareColumns()\n {\n $readOnlyAttribute = $this->readOnlyAttribute;\n\n $columns = [];\n if ($this->canMove) {\n $columns[] = [\n 'class' => MovingColumn::className(),\n 'movingDisabledAttribute' => $readOnlyAttribute,\n ];\n }\n foreach ($this->columns as $column) {\n if (is_string($column)) {\n $column = ['attribute' => $column];\n }\n\n if (empty($column['class'])) {\n $column['class'] = isset($column['items']) ? DropdownInputColumn::className() : TextInputColumn::className();\n }\n\n if ($this->itemClass === null && empty($column['label'])) {\n $column['label'] = Inflector::camel2words($column['attribute'], true);\n }\n\n $column = array_merge([\n 'readOnlyAttribute' => $readOnlyAttribute,\n ], $column);\n\n $columns[] = $column;\n }\n\n if ($this->canRemove) {\n $columns[] = [\n 'class' => 'smart\\grid\\ActionColumn',\n 'options' => ['style' => 'width: 25px;'],\n 'template' => '{remove}',\n 'buttons' => [\n 'remove' => function ($url, $model, $key) use ($readOnlyAttribute) {\n $readOnly = false;\n if ($readOnlyAttribute !== null) {\n $readOnly = ArrayHelper::getValue($model, $readOnlyAttribute);\n }\n\n if ($readOnly) {\n return '';\n }\n\n return Html::a('<span class=\"fas fa-remove\"></span>', '#', [\n 'class' => 'item-remove',\n 'title' => $this->removeLabel,\n ]);\n },\n ],\n ];\n }\n\n $this->_columns = $columns;\n }", "protected function _prepareColumns()\n {\n \tparent::_prepareColumns();\n \tunset($this->_columns['actionColumn']);\n }", "protected function _prepareColumns()\n {\n $this->addColumn('recipetype_id', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('ID'),\n 'width' => '50px',\n 'index' => 'recipetype_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Nombre Clasificación'),\n 'index' => 'name',\n ));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns() {\n $this->addColumn('period', array(\n 'header' => Mage::helper('webpos')->__('Period'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'index' => 'period',\n 'width' => '100px',\n ));\n $this->addColumn('user', array(\n 'header' => Mage::helper('webpos')->__('User'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'index' => 'user',\n 'width' => '200px',\n ));\n $this->addColumn('totals_sales', array(\n 'header' => Mage::helper('webpos')->__('Sales Total'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'width' => '100px',\n 'index' => 'totals_sales',\n 'type' => 'price',\n 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n ));\n $this->addExportType('*/*/exportCsv', Mage::helper('webpos')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('webpos')->__('XML'));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('increment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'increment_id',\n 'filter_index' => 'main_table.increment_id',\n 'type' => 'text',\n ));\n $this->addColumn('shipment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'entity_id',\n 'filter_index' => 'main_table.entity_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('canpar_shipment_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Shipment #'),\n 'index' => 'canpar_shipment_id',\n 'filter_index' => 'ch_shipment.shipment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('manifest_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Manifest #'),\n 'index' => 'manifest_id',\n 'renderer' => 'canparmodule/adminhtml_canparshipment_renderer_manifestId',\n 'filter_index' => 'ch_shipment.manifest_id',\n ));\n\n $this->addColumn('created_at', array(\n 'header' => Mage::helper('sales')->__('Date Shipped'),\n 'index' => 'created_at',\n 'filter_index' =>'main_table.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('order_increment_id', array(\n 'header' => Mage::helper('sales')->__('Order #'),\n 'index' => 'order_increment_id',\n 'filter_index'=> 'o.increment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('order_created_date', array(\n 'header' => Mage::helper('sales')->__('Order Date'),\n 'index' => 'order_created_date',\n 'filter_index' =>'o.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('total_qty', array(\n 'header' => Mage::helper('sales')->__('Total Qty'),\n 'index' => 'total_qty',\n 'type' => 'number',\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('sales')->__('Action'),\n 'width' => '50px',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('sales')->__('View'),\n 'url' => array('base'=>'*/sales_shipment/view'),\n 'field' => 'shipment_id'\n )\n ),\n 'filter' => false,\n 'sortable' => false,\n 'is_system' => true\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));\n $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n \t// Checkbox\n \t$checkboxColumnBody = new Lumia_DataGrid_Body_Checkbox('student_id[]');\n \t$checkboxColumnHeader = new Lumia_DataGrid_Header_Checkbox();\n $this->addColumn(new Lumia_DataGrid_Column($checkboxColumnBody, $checkboxColumnHeader));\n \n // Name\n $nameColumnBody = new Lumia_DataGrid_Body_Text('student_name');\n $nameColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Name');\n $this->addColumn(new Lumia_DataGrid_Column($nameColumnBody, $nameColumnHeader));\n \n // Code\n $codeColumnBody = new Lumia_DataGrid_Body_Text('student_code');\n $codeColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Code');\n $this->addColumn(new Lumia_DataGrid_Column($codeColumnBody, $codeColumnHeader));\n \n // Date of birth\n $dateColumnBody = new Lumia_DataGrid_Body_Date('student_birth');\n $dateColumnBody->setOptions(array('dateFormat' => 'dd/MM/yyyy'));\n $dateColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Date of birth');\n $this->addColumn(new Lumia_DataGrid_Column($dateColumnBody, $dateColumnHeader));\n \n // Gender\n $genderColumnBody = new Admin_DataGrid_Student_Body_Gender('student_gender');\n $genderColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Gender');\n $this->addColumn(new Lumia_DataGrid_Column($genderColumnBody, $genderColumnHeader));\n \n // Class\n $classColumnBody = new Lumia_DataGrid_Body_Text('class_department');\n $classColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Class/Department');\n $this->addColumn(new Lumia_DataGrid_Column($classColumnBody, $classColumnHeader));\n \n // Status\n $statusColumnBody = new Admin_DataGrid_Student_Body_Status('user_status');\n $statusColumnHeader = new Lumia_DataGrid_Header_Text('StudentListView:@Status');\n $this->addColumn(new Lumia_DataGrid_Column($statusColumnBody, $statusColumnHeader));\n \n // Action\n $actionColumnBody = new Admin_DataGrid_Student_Body_Action('actionColumn');\n $actionColumnHeader = new Lumia_DataGrid_Header_Text();\n $this->addColumn(new Lumia_DataGrid_Column($actionColumnBody, $actionColumnHeader));\n }", "protected function _prepareColumns()\n {\n $this->addColumn(\n 'in_worksheets',\n array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_worksheets',\n 'values'=> $this->_getSelectedWorksheets(),\n 'align' => 'center',\n 'index' => 'entity_id'\n )\n );\n $this->addColumn(\n 'ws_name',\n array(\n 'header' => Mage::helper('bs_worksheet')->__('Worksheet Name'),\n 'align' => 'left',\n 'index' => 'ws_name',\n 'renderer' => 'bs_worksheet/adminhtml_helper_column_renderer_relation',\n 'params' => array(\n 'id' => 'getId'\n ),\n 'base_link' => 'adminhtml/worksheet_worksheet/edit',\n )\n );\n $this->addColumn(\n 'ws_code',\n array(\n 'header' => Mage::helper('bs_worksheet')->__('Worksheet Code'),\n 'align' => 'left',\n 'index' => 'ws_code',\n )\n );\n $this->addColumn(\n 'position',\n array(\n 'header' => Mage::helper('bs_worksheet')->__('Position'),\n 'name' => 'position',\n 'width' => 60,\n 'type' => 'number',\n 'validate_class' => 'validate-number',\n 'index' => 'position',\n 'editable' => true,\n )\n );\n return parent::_prepareColumns();\n }", "protected function _configureColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n $this->_sourceColumns = $this->columns;;\n\n $columnsByKey = [];\n foreach ($this->columns as $column) {\n $columnKey = $this->_getColumnKey($column);\n for ($j = 0; true; $j++) {\n $suffix = ($j) ? '_' . $j : '';\n $columnKey .= $suffix;\n if (!array_key_exists($columnKey, $columnsByKey)) {\n break;\n }\n }\n $columnsByKey[$columnKey] = $column;\n }\n\n $this->columns = $columnsByKey;\n }", "protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n $this->allColumns[$i] = $column;\n continue;\n }\n $this->columns[$i] = $column;\n $this->allColumns[$i] = $column;\n }\n }", "protected function initColumns()\n\t{\n\t\tif($this->columns===array())\n\t\t{\n\t\t\tif($this->dataProvider instanceof NActiveDataProvider)\n\t\t\t\t$this->columns=$this->dataProvider->model->attributeNames();\n\t\t\telse if($this->dataProvider instanceof IDataProvider)\n\t\t\t{\n\t\t\t\t// use the keys of the first row of data as the default columns\n\t\t\t\t$data=$this->dataProvider->getData();\n\t\t\t\tif(isset($data[0]) && is_array($data[0]))\n\t\t\t\t\t$this->columns=array_keys($data[0]);\n\t\t\t}\n\t\t}\n\t\t$id=$this->getId();\n\t\tforeach($this->columns as $i=>$column)\n\t\t{\n\t\t\tif ($column['name'] && (!isset($column['export']) || @$column['export']!=false)) {\n\t\t\t\tif(is_string($column))\n\t\t\t\t\t$column=$this->createDataColumn($column);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!isset($column['class']))\n\t\t\t\t\t\t$column['class']='NDataColumn';\n\t\t\t\t\t$column=Yii::createComponent($column, $this);\n\t\t\t\t}\n\t\t\t\tif(!$column->visible)\n\t\t\t\t{\n\t\t\t\t\tunset($this->columns[$i]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif($column->id===null)\n\t\t\t\t\t$column->id=$id.'_c'.$i;\n\t\t\t\t$this->columns[$i]=$column;\n\t\t\t} else {\n\t\t\t\tunset($this->columns[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tforeach($this->columns as $column)\n\t\t\t\t$column->init();\n\t}", "protected function _prepareColumns()\n\t{\n\t\t$this->addColumn('id',\n\t\t\tarray(\n\t\t\t\t'header'=> $this->__('ID'),\n\t\t\t\t'align' =>'right',\n\t\t\t\t'width' => '50px',\n\t\t\t\t'index' => 'id'\n\t\t\t)\n\t\t);\n\n\t\t$this->addColumn('product_id',\n\t\t\tarray(\n\t\t\t\t'header'=> $this->__('Product ID'),\n\t\t\t\t'index' => 'product_id'\n\t\t\t)\n\t\t);\n\n\t\t$this->addColumn('increment_id',\n\t\t\tarray(\n\t\t\t\t'header'=> $this->__('Order ID'),\n\t\t\t\t'index' => 'increment_id'\n\t\t\t)\n\t\t);\n\n $this->addColumn('sfo.order_id',\n array(\n 'header' => Mage::helper('core')->__('View Order'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getOrderId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('core')->__('View'),\n 'url' => array('base'=> 'adminhtml/sales_order/view'),\n 'field' => 'order_id',\n 'target' => '_blank'\n )\n ),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true\n )\n );\n\n $this->addColumn('email',\n array(\n 'header'=> $this->__('Customer Email'),\n 'index' => 'email'\n )\n );\n\n $statusOptions = array(\n '0' => 'Working',\n '1' => 'Requested',\n '2' => 'Collected'\n );\n $this->addColumn('status',\n array(\n 'header'=> $this->__('Status (WORKING=0,REQUESTED=1,COLLECTED=2)'),\n 'index' => 'status',\n 'filter_index' => '`main_table`.`status`',\n 'type' => 'options',\n 'options' => $statusOptions,\n )\n );\n\n $this->addColumn('collect_date',\n array(\n 'header'=> $this->__('Collect Date'),\n 'index' => 'collect_date'\n )\n );\n\n\t\treturn parent::_prepareColumns();\n\t}", "protected function _prepareColumns()\n {\n \t\n \t/*$this->addColumn('module',\n array(\n 'header' => 'SugarCRM Module Name',\n 'align' =>'left',\n 'index' => 'module',\n \t ));*/\n\t\t\n\t\t$this->addColumn('fields', array(\n 'header' => 'SugarCRM Field Name',\n 'align' =>'left',\n 'index' => 'wp_meta_label',\n \t \t ));\n\t\t\n\t\t/*$this->addColumn('fieldtype', array(\n 'header' => 'Field Type',\n 'align' =>'left',\n 'index' => 'field_type',\n \t\t ));*/\n\t\t\t\t \n\t\t$this->addColumn(\"magfield\", array(\n\t\t\t\t\t\"header\" \t=> Mage::helper(\"contact\")->__(\"Magento Field Names\"),\n\t\t\t\t\t'filter' => false,\n\t\t\t\t\t'sortable' => false,\n\t\t\t\t\t'align' =>'left',\n\t\t\t\t\t'width'\t\t=> '45%',\n\t\t\t\t\t'renderer' \t=> 'Offshoreevolution_Contact_Block_Adminhtml_Synctable_Grid_Renderer_Filter'\n\t\t\t\t )); \n\t\t\n\t\t$this->addColumn(\"actionButton\", array(\n\t\t\t\t\t\"header\" \t=> Mage::helper(\"contact\")->__(\"Action\"),\n\t\t\t\t\t'filter' => false,\n\t\t\t\t\t'sortable' => false,\n\t\t\t\t\t'align' =>'center',\n\t\t\t\t\t'width'\t\t=> '80',\n\t\t\t\t\t'renderer' \t=> 'Offshoreevolution_Contact_Block_Adminhtml_Synctable_Grid_Renderer_Button'\n\t\t\t\t )); \n\t\t//$this->addColumn('action',\n//\t\t\t\t\tarray(\n//\t\t\t\t\t'header' => Mage::helper('sugarcrm')->__('Action'),\n//\t\t\t\t\t'width' => '100',\n//\t\t\t\t\t'type' => 'action',\n//\t\t\t\t\t'getter' => 'getId',\n//\t\t\t\t\t'index' => 'pid',\n//\t\t\t\t\t'actions' => array(\n//\t\t\t\t\t\t\tarray(\n//\t\t\t\t\t\t\t\t\t'caption' => Mage::helper('sugarcrm')->__('Sync'),\n//\t\t\t\t\t\t\t\t\t'class'\t\t=> 'syncAction',\n//\t\t\t\t\t\t\t\t\t//'url' => array('base'=> '*/*/edit'),\n//\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\t\t\t'field' => 'id'\n//\t\t\t\t\t\t\t)\n//\t\t\t\t\t),\n//\t\t\t\t\t'filter' => false,\n//\t\t\t\t\t'sortable' => false,\n//\t\t\t\t\t'index' => 'stores',\n//\t\t\t\t\t'is_system' => true,\n//\t\t));\n//\t\t$this->addColumn('id',\n// array(\n// 'header' => 'ID',\n// 'align' =>'right',\n// 'width' => '50px',\n// 'index' => 'pid',\n//\t\t\t\t\t'column_css_class'=>'no-display',\n// \t\t\t\t\t'header_css_class'=>'no-display'\n// \t ));\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n\n $this->addColumn(\n 'entity_id',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Id'),\n 'index' => 'entity_id',\n 'type' => 'number'\n )\n );\n\n $this->addColumn(\n 'in_docwisements',\n array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_docwisements',\n 'values'=> $this->_getSelectedDocwisements(),\n 'align' => 'center',\n 'index' => 'entity_id'\n )\n );\n\n $this->addColumn(\n 'doc_name',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Document Name'),\n 'align' => 'left',\n 'index' => 'doc_name',\n )\n );\n\n\n $this->addColumn(\n 'doc_type',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Document Type'),\n 'index' => 'doc_type',\n 'type' => 'options',\n 'options' => Mage::helper('bs_docwise')->convertOptions(\n Mage::getModel('bs_docwise/docwisement_attribute_source_doctype')->getAllOptions(false)\n )\n\n )\n );\n $this->addColumn(\n 'doc_date',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Date'),\n 'index' => 'doc_date',\n 'type'=> 'date',\n\n )\n );\n\n $this->addColumn(\n 'download',\n array(\n 'header' => Mage::helper('bs_docwise')->__('View/Download'),\n 'type' =>'text',\n 'renderer' => 'bs_docwise/adminhtml_helper_column_renderer_download',\n\n 'filter' => false,\n 'sortable' => false,\n )\n );\n\n $this->addColumn(\n 'position',\n array(\n 'header' => Mage::helper('catalog')->__('Position'),\n 'name' => 'position',\n 'width' => 60,\n 'type' => 'number',\n 'validate_class' => 'validate-number',\n 'index' => 'position',\n 'editable' => true,\n )\n );\n $this->addColumn(\n 'action',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('bs_docwise')->__('Edit'),\n 'url' => array('base'=> '*/docwise_docwisement/edit'),\n 'field' => 'id'\n )\n ),\n 'filter' => false,\n 'is_system' => true,\n 'sortable' => false,\n )\n );\n }", "protected function _prepareColumns() {\n /**\n * Add columa 'id','name'.\n */\n $this->addCustomColumn ( 'id' );\n $this->addCustomColumn ( 'name' );\n /**\n * Get the Collection of subscriptiontype\n */\n $subscriptionTitle = Mage::getModel ( 'airhotels/subscriptiontype' )->getCollection ();\n $data = $subscriptionTitle->getData ();\n $substitle = null;\n foreach ( $data as $value ) {\n $i = $value ['id'];\n $substitle [$i] = $value ['title'];\n }\n /**\n * When building a module always utilise the installation and\n * upgrade scripts so that any database additions or changes are automatically modified\n * on module installation.\n * There are a number of built in functions to these modules allowing you to add attributes,\n * create new tables etc.\n *\n * Add Column for subscription_type\n */\n $this->addColumn ( 'subscription_type', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Subscription Type' ),\n 'align' => 'left',\n 'width' => '80px',\n 'index' => 'subscription_type',\n 'type' => 'options',\n 'options' => $substitle,\n 'renderer' => 'Apptha_Airhotels_Block_Adminhtml_Managesubscriptions_Grid_Renderer_Type' \n ) );\n /**\n * When building a module always utilise the installation and\n * upgrade scripts so that any database additions or changes are automatically modified\n * on module installation.\n * There are a number of built in functions to these modules allowing you to add attributes,\n * create new tables etc.\n *\n * Add Column for action\n */\n $this->addColumn ( 'action', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Action' ),\n 'filter' => false,\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId', \n 'index' => 'stores',\n 'actions' => array (\n array (\n 'caption' => Mage::helper ( 'airhotels' )->__ ( 'Edit' ),\n 'url' => array (\n 'base' => '*/*/edit'\n ),\n 'field' => 'id'\n )\n ),\n 'sortable' => false,\n 'is_system' => true \n ) );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareColumns ();\n }", "protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n continue;\n }\n $this->columns[$i] = $column;\n }\n }", "protected function _prepareColumns()\n {\n $this->addColumn('grid_checkbox', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'index' => 'bannerslider_id',\n //'name' => 'grid_checkbox',\n 'align' => 'center',\n 'width' => '50px',\n 'values' => $this->_selectedId(),\n ));\n\n /*$this->addColumn('widget_banner_id', array(\n 'header' => Mage::helper('campaign')->__('ID'),\n 'align' =>'right',\n 'width' => '50px',\n 'index' => 'widget_banner_id',\n ));*/\n\n $this->addColumn('title', array(\n 'header' => Mage::helper('campaign')->__('Banner title'),\n 'align' => 'left',\n 'width' => '220px',\n 'index' => 'title',\n //'renderer' => 'Magestore_Campaign_Block_Adminhtml_Banner_Grid_Renderer_BannerType',\n //'filter' => false,\n ));\n\n /*$this->addColumn('in_widgets', array(\n 'header' => Mage::helper('campaign')->__('In Widgets'),\n 'index' => 'widget_selected_ids',\n //'width' => '220px',\n 'renderer' => 'Magestore_Campaign_Block_Adminhtml_Banner_Grid_Renderer_InWidgets',\n 'filter_condition_callback' => array($this, '_filterInWidgets'),\n ));*/\n\n $this->addColumn('in_campaign', array(\n 'header' => Mage::helper('campaign')->__('Added to Campaign'),\n 'index' => 'campaign_name',\n 'width' => '220px',\n 'filter_condition_callback' => array($this, '_filterInCampaign'),\n ));\n\n $this->addColumn('status', array(\n 'header' => Mage::helper('campaign')->__('Status'),\n 'align' => 'left',\n 'width' => '80px',\n 'index' => 'status',\n 'filter_index'=>'main_table.status',\n 'type' => 'options',\n 'options' => Magestore_Campaign_Model_Sliderstatus::getOptionArray(),\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('campaign')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('campaign')->__('Edit'),\n 'url' => array('base'=> '*/adminhtml_bannerslider/edit'),\n //'onclick' => 'return saveAndContinueEdit();',\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addColumn('action_delete',\n array(\n 'header' => Mage::helper('campaign')->__('Disable Banner'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('campaign')->__('Disable'),\n 'url' => array('base'=> '*/adminhtml_bannerslider/disableSlider'),\n //'onclick' => 'return saveAndContinueEdit();',\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('campaign')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('campaign')->__('XML'));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n/*\n $this->addColumn('version_number', array(\n 'header' => Mage::helper('gri_cms')->__('Version #'),\n 'width' => 100,\n 'index' => 'version_number',\n 'type' => 'options',\n 'options' => Mage::helper('gri_cms')->getVersionsArray($this->getPage())\n ));\n*/\n $this->addColumn('label', array(\n 'header' => Mage::helper('gri_cms')->__('Version Label'),\n 'index' => 'label',\n 'type' => 'options',\n 'options' => $this->getCollection()\n ->getAsArray('label', 'label')\n ));\n\n $this->addColumn('owner', array(\n 'header' => Mage::helper('gri_cms')->__('Owner'),\n 'index' => 'username',\n 'type' => 'options',\n 'options' => $this->getCollection()->getUsersArray(false),\n 'width' => 250\n ));\n\n $this->addColumn('access_level', array(\n 'header' => Mage::helper('gri_cms')->__('Access Level'),\n 'index' => 'access_level',\n 'type' => 'options',\n 'width' => 100,\n 'options' => Mage::helper('gri_cms')->getVersionAccessLevels()\n ));\n\n $this->addColumn('revisions', array(\n 'header' => Mage::helper('gri_cms')->__('Revisions Qty'),\n 'index' => 'revisions_count',\n 'type' => 'number'\n ));\n\n $this->addColumn('created_at', array(\n 'width' => 150,\n 'header' => Mage::helper('gri_cms')->__('Created At'),\n 'index' => 'created_at',\n 'type' => 'datetime',\n ));\n\n return parent::_prepareColumns();\n }", "private function prepareColumns()\n {\n // start with the tableName and the primary key e.g. 'fos_user' and 'id'\n $this->addSelectColumn($this->metadata, $this->rootEntityIdentifier);\n\n foreach ($this->datatable->getColumns() as $column) {\n // association delimiter found (e.g. 'posts.comments.title')?\n if (strstr($column->getProperty(), '.') !== false) {\n $array = explode('.', $column->getProperty());\n $this->setAssociations($array, $this->metadata);\n } else {\n // no association found\n if ($column !== $this->rootEntityIdentifier) {\n $this->addSelectColumn($this->metadata, $column->getProperty());\n }\n\n $this->allColumns[] = $this->metadata->getTableName().'.'.$column->getProperty();\n }\n }\n\n return $this;\n }", "protected function _prepareColumns(){\r\n $this->addColumn('in_brands', array(\r\n 'header_css_class' => 'a-center',\r\n 'type' => 'checkbox',\r\n 'name' => 'in_brands',\r\n 'values'=> $this->_getSelectedBrands(),\r\n 'align' => 'center',\r\n 'index' => 'entity_id'\r\n ));\r\n $this->addColumn('title', array(\r\n 'header'=> Mage::helper('zozoconcepts_brands')->__('Title'),\r\n 'align' => 'left',\r\n 'index' => 'title',\r\n ));\r\n $this->addColumn('position', array(\r\n 'header' => Mage::helper('zozoconcepts_brands')->__('Position'),\r\n 'name' => 'position',\r\n 'width' => 60,\r\n 'type' => 'number',\r\n 'validate_class'=> 'validate-number',\r\n 'index' => 'position',\r\n 'editable' => true,\r\n ));\r\n return parent::_prepareColumns();\r\n }", "protected function _prepareColumns()\n {\n parent::_prepareColumns();\n\n $this->addColumnAfter(\n 'is_visible',\n [\n 'header' => __('Visible'),\n 'sortable' => true,\n 'index' => 'is_visible_on_front',\n 'type' => 'options',\n 'options' => ['1' => __('Yes'), '0' => __('No')],\n 'align' => 'center'\n ],\n 'frontend_label'\n );\n\n $this->addColumnAfter(\n 'is_global',\n [\n 'header' => __('Scope'),\n 'sortable' => true,\n 'index' => 'is_global',\n 'type' => 'options',\n 'options' => [\n \\Magento\\Eav\\Model\\Entity\\Attribute\\ScopedAttributeInterface::SCOPE_STORE => __('Store View'),\n \\Magento\\Eav\\Model\\Entity\\Attribute\\ScopedAttributeInterface::SCOPE_WEBSITE => __('Web Site'),\n \\Magento\\Eav\\Model\\Entity\\Attribute\\ScopedAttributeInterface::SCOPE_GLOBAL => __('Global'),\n ],\n 'align' => 'center'\n ],\n 'is_visible'\n );\n\n $this->addColumn(\n 'is_searchable',\n [\n 'header' => __('Searchable'),\n 'sortable' => true,\n 'index' => 'is_searchable',\n 'type' => 'options',\n 'options' => ['1' => __('Yes'), '0' => __('No')],\n 'align' => 'center'\n ]\n\n );\n\n $this->_eventManager->dispatch('product_attribute_grid_build', ['grid' => $this]);\n\n $this->addColumnAfter(\n 'is_comparable',\n [\n 'header' => __('Comparable'),\n 'sortable' => true,\n 'index' => 'is_comparable',\n 'type' => 'options',\n 'options' => ['1' => __('Yes'), '0' => __('No')],\n 'align' => 'center'\n ],\n 'is_filterable'\n );\n\n return $this;\n }", "protected function _prepareColumns()\r\n {\r\n $this->addColumn('itemid', array(\r\n 'header' => Mage::helper('items')->__('Item ID'),\r\n 'align' =>'left',\r\n 'index' => 'itemid',\r\n ));\r\n $this->addColumn('question_id', array(\r\n 'header' => Mage::helper('items')->__('Question ID'),\r\n 'align' =>'left',\r\n 'index' => 'question_id',\r\n ));\r\n $this->addColumn('question', array(\r\n 'header' => Mage::helper('items')->__('Question'),\r\n 'align' =>'left',\r\n 'index' => 'question',\r\n ));\t\r\n $this->addColumn('question_date', array(\r\n 'header' => Mage::helper('items')->__('Question Date'),\r\n 'align' =>'left',\r\n\t\t 'width' => '20px',\r\n 'index' => 'question_date',\r\n ));\r\n /*$this->addColumn('buyer', array(\r\n 'header' => Mage::helper('items')->__('Buyer'),\r\n 'align' =>'left',\r\n 'index' => 'buyer',\r\n ));*/\r\n \r\n $this->addColumn('answer', array(\r\n 'header' => Mage::helper('items')->__('Answer'),\r\n 'align' =>'left',\r\n 'index' => 'answer',\r\n ));\r\n /*$this->addColumn('created_at', array(\r\n 'header' => Mage::helper('items')->__('Created at'),\r\n 'align' =>'left',\r\n 'index' => 'created_at',\r\n )); */\r\n\r\n $this->addColumn('status', array(\r\n 'header' => Mage::helper('items')->__('Status'),\r\n 'align' => 'left',\r\n 'width' => '80px',\r\n 'index' => 'status',\r\n 'type' => 'options',\r\n 'options' => array(\r\n 'ANSWERED' => 'ANSWERED',\r\n 'UNANSWERED' => 'UNANSWERED',\r\n ),\r\n ));\r\n\t \r\n\t $this->setFilterVisibility(false);\r\n $this->setPagerVisibility(false); \r\n\treturn parent::_prepareColumns();\r\n }", "protected function _prepareColumns()\n {\n parent::_prepareColumns();\n\n\n $this->addColumn('attribute_code', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Code'),\n 'sortable'=>true,\n 'index'=>'attribute_code',\n 'width' => '22%'\n ));\n\n $this->addColumn('frontend_label', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Label'),\n 'sortable'=>true,\n 'index'=>'frontend_label',\n 'width' => '22%'\n ));\n\n $this->addColumn('translate_options', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Translate Attribute Options'),\n 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_TranslateOptions',\n 'align' => 'center',\n 'index' => 'frontend_input',\n 'sortable'=> false,\n 'type' => 'options',\n 'options' => [\n 'no' => Mage::helper('catalog')->__('No Options'),\n 'select' => Mage::helper('catalog')->__('Has Options')\n ],\n 'filter_condition_callback' => array($this, '_optionsFilter'),\n 'width' => '22%'\n ));\n\n $this->addColumn('is_visible', array(\n 'header'=>Mage::helper('catalog')->__('Visible'),\n 'sortable'=>true,\n 'index'=>'is_visible_on_front',\n 'type' => 'options',\n 'options' => array(\n '1' => Mage::helper('catalog')->__('Yes'),\n '0' => Mage::helper('catalog')->__('No'),\n ),\n 'align' => 'center',\n 'width' => '22%'\n ));\n\n $this->addColumn('version',\n array(\n 'header'=> Mage::helper('catalog')->__('Translated'),\n 'width' => '70px',\n 'index' => 'version',\n 'type' => 'options',\n 'options' => array(\n 'Translated' => Mage::helper('catalog')->__('Translated'),\n 'Not Translated' => Mage::helper('catalog')->__('Not Translated')\n ),\n 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Translated',\n 'filter_condition_callback' => array($this, '_versionFilter'),\n ));\n\n return $this;\n }", "private function initColumns(){\n //Initialize our custom post type column management\n $this->cptWPDSCols = new Columns($this->wpdsPostType);\n \n //Remove our title\n $this->cptWPDSCols->removeColumn('title');\n \n //Add our content column\n $this->cptWPDSCols->addColumn('content', 'Content', 2);\n \n //Add our content column content\n $this->cptWPDSCols->addColumnPostContent('content');\n \n //Add our content column content\n $this->cptWPDSCols->addColumnOptionData('content', 'site_url');\n \n //Reposition column\n $this->cptWPDSCols->reorderColumn('content', 1);\n }", "abstract protected function columns();", "protected function _prepareColumns() {\r\n $this->addColumn('entity_id', array(\r\n 'header' => Mage::helper('catalog')->__('ID'),\r\n 'width' => '50px',\r\n 'index' => 'entity_id',\r\n )); //Product Id\r\n $this->addColumn('name', array(\r\n 'header' => Mage::helper('catalog')->__('Name'),\r\n 'index' => 'name',\r\n )); //Product name\r\n\r\n $store = $this->_getStore();\r\n if ($store->getId()) {\r\n $this->addColumn('custom_name', array(\r\n 'header' => Mage::helper('catalog')->__('Name in %s', $store->getName()),\r\n 'index' => 'custom_name',\r\n ));\r\n }//Store Information \r\n\r\n $this->addColumn('type', array(\r\n 'header' => Mage::helper('catalog')->__('Type'),\r\n 'width' => '60px',\r\n 'index' => 'type_id',\r\n 'type' => 'options',\r\n 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),\r\n )); //Product Type\r\n\r\n $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')\r\n ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())\r\n ->load()\r\n ->toOptionHash();\r\n\r\n $this->addColumn('sku', array(\r\n 'header' => Mage::helper('catalog')->__('SKU'),\r\n 'width' => '80px',\r\n 'index' => 'sku',\r\n )); //Product unique id SKU\r\n\r\n $store = $this->_getStore();\r\n $this->addColumn('price', array(\r\n 'header' => Mage::helper('catalog')->__('Price'),\r\n 'type' => 'price',\r\n 'currency_code' => $store->getBaseCurrency()->getCode(),\r\n 'index' => 'price',\r\n )); //Product Price\r\n\r\n\r\n\r\n $this->addColumn('reqcoupon_status', array(\r\n 'header' => Mage::helper('catalog')->__('Request Coupon Status'),\r\n 'width' => '70px',\r\n 'index' => 'reqcoupon_status',\r\n 'type' => 'options',\r\n 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),\r\n )); //Status of the Product \r\n\r\n /**\r\n * To export the Grid date in XML / CSV file\r\n */\r\n $this->addExportType('*/*/exportCsv', Mage::helper('reqforcoupon')->__('CSV'));\r\n $this->addExportType('*/*/exportXml', Mage::helper('reqforcoupon')->__('XML'));\r\n\r\n return parent::_prepareColumns();\r\n }", "protected function _prepareColumns() {\n $video = Mage::getModel('vidtest/video');\n\n $this->addColumn('video_id', array(\n 'header' => $this->__('Id'),\n 'align' => 'left',\n 'index' => 'video_id',\n 'width' => 50,\n 'type' => 'number'\n ));\n\n if (!Mage::app()->isSingleStoreMode() && !$this->getProduct()->getStoreId()) {\n $this->addColumn('stores', array(\n 'header' => $this->__('Store View'),\n 'index' => 'stores',\n 'type' => 'store',\n 'store_all' => true,\n 'store_view' => true,\n 'sortable' => false,\n 'filter_condition_callback' => array($this, '_filterStoreCondition'),\n ));\n }\n\n $this->addColumn('title', array(\n 'header' => $this->__('Title'),\n 'index' => 'title',\n 'type' => 'text',\n ));\n\n $this->addColumn('author_name', array(\n 'header' => $this->__('Author Name'),\n 'index' => 'author_name',\n 'type' => 'text',\n ));\n\n $this->addColumn('author_email', array(\n 'header' => $this->__('Author Email'),\n 'index' => 'author_email',\n 'type' => 'text',\n ));\n\n $this->addColumn('rate', array(\n 'header' => $this->__('Rate'),\n 'index' => 'rate',\n 'type' => 'number',\n ));\n\n $this->addColumn('created_at', array(\n 'header' => Mage::helper('sales')->__('Date'),\n 'index' => 'created_at',\n 'type' => 'datetime',\n 'width' => '100px',\n ));\n\n $this->addColumn('status', array(\n 'header' => $this->__('Status'),\n 'align' => 'left',\n 'width' => '160px',\n 'index' => 'status',\n 'type' => 'options',\n 'options' => $video->getStatusesArray(),\n ));\n\n\n $this->addColumn('action', array(\n 'header' => $this->__('Action'),\n 'width' => '80',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => $this->__('Edit'),\n 'url' => array('base' => 'vidtest_admin/admin_video/edit'),\n 'field' => 'id',\n ),\n array(\n 'caption' => $this->__('Enable'),\n 'url' => array('base' => 'vidtest_admin/admin_video/enable'),\n 'field' => 'id',\n ),\n array(\n 'caption' => $this->__('Disable'),\n 'url' => array('base' => 'vidtest_admin/admin_video/disable'),\n 'field' => 'id',\n ),\n array(\n 'caption' => $this->__('Delete testimonial'),\n 'url' => array('base' => 'vidtest_admin/admin_video/delete'),\n 'field' => 'id',\n 'confirm' => $this->__('Are you sure you want to delete testimonial?'),\n ),\n array(\n 'caption' => $this->__('Delete testimonial and video source'),\n 'url' => array('base' => 'vidtest_admin/admin_video/fulldelete'),\n 'field' => 'id',\n 'confirm' => $this->__('Are you sure you want to delete testimonial and video source?'),\n ),\n ),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n $result = parent::_prepareColumns();\n $column = $this->getColumn('action');\n if (!$column) {\n return $result;\n }\n $data = $column->getData();\n $data['actions'][0]['url'] = array('base' => 'adminhtml/sales_order/view');\n $column->setData($data);\n return $result;\n }", "protected function afterConstruct() {\n\t\tif(count($this->defaultColumns) == 0) {\n\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t'header' => 'No',\n\t\t\t\t'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'\n\t\t\t);\n\t\t\t$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'complete_name';\n\t\t\t$this->defaultColumns[] = 'address';\n\t\t\t$this->defaultColumns[] = 'city_id';\n\t\t\t$this->defaultColumns[] = 'province_id';\n\t\t\t$this->defaultColumns[] = 'post_code';\n\t\t\t$this->defaultColumns[] = 'house_phone';\n\t\t\t$this->defaultColumns[] = 'mobile_phone';\n\t\t\t$this->defaultColumns[] = 'mobile_phone2';\n\t\t\t$this->defaultColumns[] = 'birth_place';\n\t\t\t$this->defaultColumns[] = 'birth_date';\n\t\t\t$this->defaultColumns[] = 'sex';\n\t\t\t$this->defaultColumns[] = 'religion';\n\t\t\t$this->defaultColumns[] = 'homepage';\n\t\t\t$this->defaultColumns[] = 'origin_status';\n\t\t\t$this->defaultColumns[] = 'origin_address';\n\t\t\t$this->defaultColumns[] = 'origin_city_id';\n\t\t\t$this->defaultColumns[] = 'origin_province_id';\n\t\t\t$this->defaultColumns[] = 'hobby';\n\t\t\t$this->defaultColumns[] = 'photo';\n\t\t\t$this->defaultColumns[] = 'status';\n\t\t\t$this->defaultColumns[] = 'child';\n\t\t\t$this->defaultColumns[] = 'is_data_changed';\n\t\t\t$this->defaultColumns[] = 'swt_users_id';\n\t\t}\n\t\tparent::afterConstruct();\n\t}", "public function prepare_items()\r\n {\r\n $columns = $this->get_columns();\r\n $hidden = $this->get_hidden_columns();\r\n $sortable = $this->get_sortable_columns();\r\n\r\n /** Process bulk action */\r\n $this->process_bulk_action();\r\n\r\n $data = $this->table_data();\r\n usort($data, array(&$this, 'sort_data'));\r\n $perPage = 30;\r\n $currentPage = $this->get_pagenum();\r\n $totalItems = count($data);\r\n $this->set_pagination_args(array(\r\n 'total_items' => $totalItems,\r\n 'per_page' => $perPage\r\n ));\r\n $data = array_slice($data, (($currentPage - 1) * $perPage), $perPage);\r\n // var_dump($data);\r\n // die();\r\n $this->_column_headers = array($columns, $hidden, $sortable);\r\n $this->items = $data;\r\n }", "protected function _prepareColumns(): Product\r\n {\r\n parent::_prepareColumns();\r\n $this->addColumnAfter(\r\n 'image',\r\n [\r\n 'header' => __('Thumbnail'),\r\n 'index' => 'image',\r\n 'renderer' => Image::class,\r\n 'filter' => false,\r\n 'sortable' => false,\r\n 'column_css_class' => 'data-grid-thumbnail-cell'\r\n ],\r\n 'entity_id'\r\n );\r\n $this->addColumnAfter(\r\n 'url_key',\r\n [\r\n 'header' => __('Product Url'),\r\n 'index' => 'url_key' \r\n ],\r\n 'entity_id'\r\n );\r\n $this->addColumnAfter(\r\n 'meta_title',\r\n [\r\n 'header' => __('Meta Title'),\r\n 'index' => 'meta_title' \r\n ],\r\n 'entity_id'\r\n );\r\n $this->sortColumnsByOrder();\r\n \r\n return $this;\r\n }", "protected function loadColumns(){\n\t\t\t$this->columns = array_diff(\n\t\t\t\tarray_keys(get_class_vars($this->class)),\n\t\t\t\t$this->getIgnoreAttributes()\n\t\t\t);\n\t\t}", "protected function _prepareColumns()\n {\n $this->addColumn('in_products', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'field_name' => 'in_products',\n 'values' => $this->_getSelectedProducts(),\n 'align' => 'center',\n 'index' => 'entity_id'\n ));\n\n /*$this->addColumn('entity_id',\n array(\n 'header'=> Mage::helper('catalog')->__('ID'),\n 'width' => 50,\n 'sortable' => true,\n 'type' => 'number',\n 'index' => 'entity_id',\n ));*/\n $this->addColumn('product_name',\n array(\n 'header'=> Mage::helper('catalog')->__('Name'),\n 'index' => 'name',\n ));\n\n $this->addColumn('type',\n array(\n 'header' => Mage::helper('catalog')->__('Type'),\n 'width' => 100,\n 'index' => 'type_id',\n 'type' => 'options',\n 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),\n ));\n\n $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')\n ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())\n ->load()\n ->toOptionHash();\n\n $this->addColumn('set_name',\n array(\n 'header' => Mage::helper('catalog')->__('Attrib. Set Name'),\n 'width' => 100,\n 'index' => 'attribute_set_id',\n 'type' => 'options',\n 'options' => $sets,\n ));\n\n $this->addColumn('sku',\n array(\n 'header'=> Mage::helper('catalog')->__('SKU'),\n 'width' => 80,\n 'index' => 'sku',\n ));\n\n $this->addColumn('price',\n array(\n 'header' => Mage::helper('catalog')->__('Price'),\n 'type' => 'price',\n 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n 'index' => 'price',\n ));\n\n $this->addColumn('visibility',\n array(\n 'header' => Mage::helper('catalog')->__('Visibility'),\n 'width' => 100,\n 'index' => 'visibility',\n 'type' => 'options',\n 'options' => Mage::getModel('catalog/product_visibility')->getOptionArray(),\n ));\n\n $this->addColumn('status',\n array(\n 'header' => Mage::helper('catalog')->__('Status'),\n 'width' => 70,\n 'index' => 'status',\n 'type' => 'options',\n 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),\n ));\n\n $this->addColumn('source_store',\n array(\n 'header'=> Mage::helper('catalog')->__('Source Store'),\n 'width' => '100px',\n 'sortable' => false,\n 'index' => 'source_store_view',\n 'type' => 'options',\n 'options' => Mage::getModel('unl_core/store_source_filter')->toOptionArray(),\n ));\n\n return parent::_prepareColumns();\n }", "protected function generateColumns()\n\t{\n\t\tforeach ($this->dataSource->getColumns() as $name) {\n\t\t\t$this->addColumn($name);\n\t\t}\n\t}", "function ReInitTableColumns()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ReInitTableColumns();\" . \"<HR>\";\n foreach ($this->form_fields as $prefix => $form) {\n foreach ($form as $i => $field) {\n foreach ($field as $param => $value) {\n //if found database parameters\n if (strpos($param, \"dbfield_\") !== false) {\n $columnparam = substr($param, strlen(\"dbfield_\"), strlen($param));\n $this->Storage->setColumnParameter($field[\"field_name\"], trim($columnparam), $value);\n }\n }\n }\n }\n }", "function prepareTemplateVars() {\n\t\tif (empty($this->matrixId)) {\n\t\t\t$this->matrixId = KRequest::getInt('id',0);\n\t\t}\n\n\t\t// Load the matrix values\n\t\t$db = KenedoPlatform::getDb();\n\t\t$query = \"SELECT * FROM `#__configbox_calculation_matrices_data` WHERE `id` = \".intval($this->matrixId).\" ORDER BY `ordering`, `y`, `x`\";\n\t\t$db->setQuery($query);\n\t\t$values = $db->loadAssocList();\n\n\t\t// Group them\n\t\t$this->matrixValues = array();\n\t\tforeach ($values as $value ) {\n\t\t\t$this->matrixValues[$value['y']][$value['x']] = $value['value'];\n\t\t}\n\n\t\t// Set init values for matrix values (So that a table with a few empty rows and columns appear\n\t\t// Makes it easier to understand the table for a first-time user\n\t\tif (count($this->matrixValues) == 0) {\n\t\t\t$this->matrixValues[0] = array('','','','');\n\t\t\t$this->matrixValues[1] = array('','','','');\n\t\t\t$this->matrixValues[2] = array('','','','');\n\t\t}\n\n\t\t// Prepare the record data\n\t\t$model = $this->getDefaultModel();\n\t\t$this->record = $model->getRecord($this->matrixId);\n\t\tif (!$this->record) {\n\t\t\t$this->record = $model->initData();\n\t\t\t$this->isNew = true;\n\t\t}\n\t\telse {\n\t\t\t$this->isNew = false;\n\t\t}\n\n\t\t$this->columnType = $this->record->column_type;\n\t\t// It should init to 'none', but just in case\n\t\tif ($this->columnType == '') {\n\t\t\t$this->columnType = 'none';\n\t\t}\n\t\t$this->columnQuestionId = $this->record->column_element_id;\n\t\t$this->columnCalculationId = $this->record->column_calc_id;\n\n\t\tif ($this->columnQuestionId) {\n\t\t\t$this->columnAnswers = $model->getAnswerDropdownData($this->columnQuestionId);\n\t\t}\n\t\telse {\n\t\t\t$this->columnAnswers = array();\n\t\t}\n\n\t\t$this->rowType = $this->record->row_type;\n\t\t// It should init to 'none', but just in case\n\t\tif ($this->rowType == '') {\n\t\t\t$this->rowType = 'none';\n\t\t}\n\t\t$this->rowQuestionId = $this->record->row_element_id;\n\t\t$this->rowCalculationId = $this->record->row_calc_id;\n\n\t\tif ($this->rowQuestionId) {\n\t\t\t$this->rowAnswers = $model->getAnswerDropdownData($this->rowQuestionId);\n\t\t}\n\t\telse {\n\t\t\t$this->rowAnswers = array();\n\t\t}\n\n\t\t$this->columnUsesAnswers = ($this->columnType == 'question' && count($this->columnAnswers) > 1);\n\t\t$this->rowUsesAnswers = ($this->rowType == 'question' && count($this->rowAnswers) > 1);\n\n\t\t$this->properties = $model->getProperties();\n\n\t\t// Get the calculations for the calculation axis picker\n\t\t$calcModel = KenedoModel::getModel('ConfigboxModelAdmincalculations');\n\t\t$calculations = $calcModel->getRecords(array('admincalculations.product_id'=>$this->productId));\n\n\t\t// Prepare the calculations for the axis picker\n\t\t$this->calculations = array(KText::_('Select a calculation'));\n\t\tforeach ($calculations as $calculation) {\n\n\t\t\t// Skip the calculation that is the one we load right now\n\t\t\tif ($calculation->id == $this->matrixId) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->calculations[$calculation->id] = $calculation->name;\n\n\t\t}\n\n\t\t// Prepare the questions for the axis picker\n\t\t$questionModel = KenedoModel::getModel('ConfigboxModelAdminelements');\n\t\t$questions = $questionModel->getRecords(array('adminpages.product_id'=>$this->productId));\n\n\t\t$this->questionTitles = array(KText::_('Select a question'));\n\t\tforeach ($questions as $id => $question) {\n\t\t\tif (CbSettings::getInstance()->get('use_internal_question_names')) {\n\t\t\t\t$title = (!empty($question->internal_name)) ? $question->internal_name : $question->title;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$title = $question->title;\n\t\t\t}\n\n\t\t\t$this->questionTitles[$question->id] = $title;\n\t\t}\n\t\tunset($question);\n\t\tunset($questions);\n\n\t\t// Add view CSS classes\n\t\t$this->addViewCssClasses();\n\n\t}", "protected function afterConstruct() {\n\t\tif(count($this->defaultColumns) == 0) {\n\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t'header' => 'No',\n\t\t\t\t'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'\n\t\t\t);\n\t\t\t//$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'subject';\n\t\t\t$this->defaultColumns[] = 'messege';\n\t\t\t//$this->defaultColumns[] = 'from_user_id';\n\t\t\t$this->defaultColumns[] = 'from_user_name';\n\t\t\t//$this->defaultColumns[] = 'to_user_id';\n\t\t\t$this->defaultColumns[] = 'to_user_name';\n\t\t\t//$this->defaultColumns[] = 'is_read';\n\t\t\t$this->defaultColumns[] = 'sent_time';\n\t\t\t//$this->defaultColumns[] = 'is_deleted_by_sender';\n\t\t\t//$this->defaultColumns[] = 'is_deleted_by_receiver';\n\t\t\t/* $this->defaultColumns[] = array(\n\t\t\t\t'name' => 'publish',\n\t\t\t\t'value' => 'Utility::getPublish(Yii::app()->controller->createUrl(\"publish\",array(\"id\"=>$data->id)), $data->publish, 1)',\n\t\t\t\t'htmlOptions' => array(\n\t\t\t\t\t'class' => 'center',\n\t\t\t\t),\n\t\t\t\t'type' => 'raw',\n\t\t\t); */\n\n\t\t}\n\t\tparent::afterConstruct();\n\t}", "protected function afterConstruct() {\n\t\tif(count($this->defaultColumns) == 0) {\n\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t'header' => 'No',\n\t\t\t\t'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'\n\t\t\t);\n\t\t\t//$this->defaultColumns[] = 'id';\n\t\t\t//$this->defaultColumns[] = 'bank_id';\n $this->defaultColumns[] = array(\n 'name' => 'bankName',\n 'value' => '$data->bank->bank_name',\n );\n\t\t\t$this->defaultColumns[] = 'account_number';\n\t\t\t$this->defaultColumns[] = 'owner_name_alias';\n\t\t\t/* $this->defaultColumns[] = array(\n\t\t\t\t'name' => 'publish',\n\t\t\t\t'value' => 'Utility::getPublish(Yii::app()->controller->createUrl(\"publish\",array(\"id\"=>$data->id)), $data->publish, 1)',\n\t\t\t\t'htmlOptions' => array(\n\t\t\t\t\t'class' => 'center',\n\t\t\t\t),\n\t\t\t\t'type' => 'raw',\n\t\t\t); */\n\n\t\t}\n\t\tparent::afterConstruct();\n\t}", "public function prepare_items()\n {\n $columns = $this->get_columns();\n $hidden = $this->get_hidden_columns();\n $sortable = $this->get_sortable_columns();\n $data = $this->table_data();\n usort( $data, array( &$this, 'sort_data' ) );\n $perPage = 10;\n $currentPage = $this->get_pagenum();\n $totalItems = count($data);\n $this->set_pagination_args( array(\n 'total_items' => $totalItems,\n 'per_page' => $perPage\n ) );\n $data = array_slice($data,(($currentPage-1)*$perPage),$perPage);\n $this->_column_headers = array($columns, $hidden, $sortable);\n $this->process_bulk_action();\n $this->items = $data;\n }", "protected function _prepareToRender()\n {\n $this->addColumn('gender', [\n 'label' => __('Gender/Age Group'),\n 'renderer' => $this->getGendersRenderer(),\n ]);\n $this->addColumn('categories', [\n 'label' => __('Categories'),\n 'renderer' => $this->getCategoriesRenderer(),\n 'extra_params' => 'multiple=\"multiple\"'\n ]);\n $this->_addAfter = false;\n $this->_addButtonLabel = __('Add');\n }", "abstract protected function doCols();", "public function prepare_items() {\n\t\t$column = $this->get_columns();\n\t\t$hidden = array();\n\t\t$sortable = $this->get_sortable_columns();\n\n\t\t$this->_column_headers = array( $column, $hidden, $sortable );\n\n\t\t$per_page = 20;\n\t\t$current_page = $this->get_pagenum();\n\t\t$offset = ( $current_page - 1 ) * $per_page;\n\n\t\t$args = array(\n\t\t\t'number' => $per_page,\n\t\t\t'offset' => $offset,\n\t\t);\n\n\t\tif ( isset( $_REQUEST['orderby'] ) && isset( $_REQUEST['order'] ) ) {\n\t\t\t$args['orderby'] = $_REQUEST['orderby'];\n\t\t\t$args['order'] = $_REQUEST['order'];\n\t\t}\n\n\t\t$this->items = Persistence::get( $args );\n\n\t\t$this->set_pagination_args(\n\t\t\tarray(\n\t\t\t\t'total_items' => Persistence::count(),\n\t\t\t\t'per_page' => $per_page,\n\t\t\t)\n\t\t);\n\t}", "protected function _prepareColumns() {\n /**\n * Add columns\n * \n * @column id\n * @column country_code\n * @column currency_code\n * @column editaction\n * @column deleteaction\n */\n $this->addColumn ( 'id', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Id' ),'align' => 'left','index' => 'id' \n ) );\n /**\n * Add new column for country code\n */\n $this->addColumn ( 'country_code', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Country' ), 'align' => 'left',\n 'index' => 'country_code', 'renderer' => 'Apptha_Airhotels_Block_Adminhtml_Renderer_Countrylist') );\n /**\n * Add new column for currency_code\n */\n $this->addColumn ( 'currency_code', array ( 'header' => Mage::helper ( 'airhotels' )->__ ( 'Currency' ), 'align' => 'left', 'index' => 'country_code','renderer' => 'Apptha_Airhotels_Block_Adminhtml_Renderer_Currencylist') );\n /**\n * Add new column for created_at\n */\n $this->addColumn ( 'created_at', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Created' ),\n 'align' => 'left','index' => 'created_at', 'type' => 'datetime' ) );\n /**\n * Add new column for field_name\n */\n $this->addColumn ( 'field_name', array ( 'header' => Mage::helper ( 'airhotels' )->__ ( 'Field Name' ), 'align' => 'left', 'index' => 'field_name' ) );\n /**\n * Add new column for field_title\n */\n $this->addColumn ( 'field_title', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Field Title' ),\n 'align' => 'left','index' => 'field_title' \n ) );\n /**\n * Add new column for editaction\n */\n $this->addColumn ( 'editaction', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Edit Action' ), 'width' => '50px','type' => 'action', 'getter' => 'getId', 'actions' => array (\n array (\n 'caption' => Mage::helper ( 'airhotels' )->__ ( 'Edit' ), 'url' => array ( 'base' => 'airhotels/adminhtml_managebankdetails/edit/', 'params' => array (\n 'store' => $this->getRequest ()->getParam ( 'store' ) \n ) \n ),\n 'field' => 'id' \n ) \n ),\n 'filter' => false, 'sortable' => false,'index' => 'stores' \n ) );\n /**\n * Add new column form delete action\n */\n $this->addColumn ( 'deleteaction', array ( 'header' => Mage::helper ( 'airhotels' )->__ ( 'Delete Action' ), 'width' => '50px',\n 'type' => 'action','getter' => 'getId', 'actions' => array ( array ( 'caption' => Mage::helper ( 'airhotels' )->__ ( 'Delete' ), 'url' => array ( 'base' => 'airhotels/adminhtml_managebankdetails/delete/', 'params' => array ('store' => $this->getRequest ()->getParam ( 'store' ) ) ),'field' => 'id','confirm' => Mage::helper ( 'airhotels' )->__ ( 'Are you sure?' ) ) ), 'filter' => false, 'sortable' => false, 'index' => 'stores' ) );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareColumns ();\n }", "public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_LASTNAME));\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_FIRSTNAME));\n\n $showEmail = Configuration::getInstance()->get_setting(array('Chamilo\\Core\\User', 'show_email_addresses'));\n\n if($showEmail)\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_EMAIL));\n }\n\n $this->add_column(new SortableStaticTableColumn('progress'));\n $this->add_column(new SortableStaticTableColumn('completed'));\n $this->add_column(new SortableStaticTableColumn('started'));\n\n if($this->getCurrentTreeNode()->supportsScore())\n {\n $this->add_column(new StaticTableColumn(self::COLUMN_LAST_SCORE));\n }\n }", "protected function afterConstruct() {\r\n\t\tif(count($this->templateColumns) == 0) {\r\n\t\t\t$this->templateColumns['_option'] = array(\r\n\t\t\t\t'class' => 'CCheckBoxColumn',\r\n\t\t\t\t'name' => 'id',\r\n\t\t\t\t'selectableRows' => 2,\r\n\t\t\t\t'checkBoxHtmlOptions' => array('name' => 'trash_id[]')\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['_no'] = array(\r\n\t\t\t\t'header' => Yii::t('app', 'No'),\r\n\t\t\t\t'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['name'] = array(\r\n\t\t\t\t'name' => 'name',\r\n\t\t\t\t'value' => '$data->name ? $data->name : \\'-\\'',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['desc'] = array(\r\n\t\t\t\t'name' => 'desc',\r\n\t\t\t\t'value' => '$data->desc ? $data->desc : \\'-\\'',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['folder'] = array(\r\n\t\t\t\t'name' => 'folder',\r\n\t\t\t\t'value' => '$data->folder',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['parent_id'] = array(\r\n\t\t\t\t'name' => 'parent_id',\r\n\t\t\t\t'value' => '$data->parent_id ? $data->parent->folder : \\'-\\'',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['orders'] = array(\r\n\t\t\t\t'name' => 'orders',\r\n\t\t\t\t'value' => '$data->orders',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['model'] = array(\r\n\t\t\t\t'name' => 'model',\r\n\t\t\t\t'value' => '$data->model',\r\n\t\t\t);\r\n\t\t\tif(!Yii::app()->getRequest()->getParam('creation')) {\r\n\t\t\t\t$this->templateColumns['creation_search'] = array(\r\n\t\t\t\t\t'name' => 'creation_search',\r\n\t\t\t\t\t'value' => '$data->creation->displayname ? $data->creation->displayname : \\'-\\'',\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t$this->templateColumns['creation_date'] = array(\r\n\t\t\t\t'name' => 'creation_date',\r\n\t\t\t\t'value' => '!in_array($data->creation_date, array(\\'0000-00-00 00:00:00\\', \\'1970-01-01 00:00:00\\')) ? Utility::dateFormat($data->creation_date) : \\'-\\'',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter' => Yii::app()->controller->widget('application.libraries.core.components.system.CJuiDatePicker', array(\r\n\t\t\t\t\t'model'=>$this,\r\n\t\t\t\t\t'attribute'=>'creation_date',\r\n\t\t\t\t\t'language' => 'en',\r\n\t\t\t\t\t'i18nScriptFile' => 'jquery-ui-i18n.min.js',\r\n\t\t\t\t\t//'mode'=>'datetime',\r\n\t\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t\t'id' => 'creation_date_filter',\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'options'=>array(\r\n\t\t\t\t\t\t'showOn' => 'focus',\r\n\t\t\t\t\t\t'dateFormat' => 'dd-mm-yy',\r\n\t\t\t\t\t\t'showOtherMonths' => true,\r\n\t\t\t\t\t\t'selectOtherMonths' => true,\r\n\t\t\t\t\t\t'changeMonth' => true,\r\n\t\t\t\t\t\t'changeYear' => true,\r\n\t\t\t\t\t\t'showButtonPanel' => true,\r\n\t\t\t\t\t),\r\n\t\t\t\t), true),\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['modified_date'] = array(\r\n\t\t\t\t'name' => 'modified_date',\r\n\t\t\t\t'value' => '!in_array($data->modified_date, array(\\'0000-00-00 00:00:00\\', \\'1970-01-01 00:00:00\\')) ? Utility::dateFormat($data->modified_date) : \\'-\\'',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter' => Yii::app()->controller->widget('application.libraries.core.components.system.CJuiDatePicker', array(\r\n\t\t\t\t\t'model'=>$this,\r\n\t\t\t\t\t'attribute'=>'modified_date',\r\n\t\t\t\t\t'language' => 'en',\r\n\t\t\t\t\t'i18nScriptFile' => 'jquery-ui-i18n.min.js',\r\n\t\t\t\t\t//'mode'=>'datetime',\r\n\t\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t\t'id' => 'modified_date_filter',\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'options'=>array(\r\n\t\t\t\t\t\t'showOn' => 'focus',\r\n\t\t\t\t\t\t'dateFormat' => 'dd-mm-yy',\r\n\t\t\t\t\t\t'showOtherMonths' => true,\r\n\t\t\t\t\t\t'selectOtherMonths' => true,\r\n\t\t\t\t\t\t'changeMonth' => true,\r\n\t\t\t\t\t\t'changeYear' => true,\r\n\t\t\t\t\t\t'showButtonPanel' => true,\r\n\t\t\t\t\t),\r\n\t\t\t\t), true),\r\n\t\t\t);\r\n\t\t\tif(!Yii::app()->getRequest()->getParam('modified')) {\r\n\t\t\t\t$this->templateColumns['modified_search'] = array(\r\n\t\t\t\t\t'name' => 'modified_search',\r\n\t\t\t\t\t'value' => '$data->modified->displayname ? $data->modified->displayname : \\'-\\'',\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t$this->templateColumns['install'] = array(\r\n\t\t\t\t'name' => 'install',\r\n\t\t\t\t'value' => 'Utility::getPublish(Yii::app()->controller->createUrl(\\'install\\',array(\\'id\\'=>$data->plugin_id)), $data->install, \\'Install,Uninstall\\')',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter'=>array(\r\n\t\t\t\t\t1=>Yii::t('phrase', 'Yes'),\r\n\t\t\t\t\t0=>Yii::t('phrase', 'No'),\r\n\t\t\t\t),\r\n\t\t\t\t'type' => 'raw',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['actived'] = array(\r\n\t\t\t\t'name' => 'actived',\r\n\t\t\t\t'value' => '$data->install == 1 ? ($data->actived == 2 ? CHtml::image(Yii::app()->theme->baseUrl.\\'/images/icons/publish.png\\') : Utility::getPublish(Yii::app()->controller->createUrl(\\'active\\',array(\"id\"=>$data->plugin_id)), $data->actived, \\'Actived,Deactived\\')) : \"-\"',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter'=>array(\r\n\t\t\t\t\t1=>Yii::t('phrase', 'Yes'),\r\n\t\t\t\t\t0=>Yii::t('phrase', 'No'),\r\n\t\t\t\t),\r\n\t\t\t\t'type' => 'raw',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['search'] = array(\r\n\t\t\t\t'name' => 'search',\r\n\t\t\t\t'value' => '$data->search == 1 ? CHtml::image(Yii::app()->theme->baseUrl.\\'/images/icons/publish.png\\') : CHtml::image(Yii::app()->theme->baseUrl.\\'/images/icons/unpublish.png\\')',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter'=>array(\r\n\t\t\t\t\t1=>Yii::t('phrase', 'Yes'),\r\n\t\t\t\t\t0=>Yii::t('phrase', 'No'),\r\n\t\t\t\t),\r\n\t\t\t\t'type' => 'raw',\r\n\t\t\t);\r\n\t\t\t$this->templateColumns['default'] = array(\r\n\t\t\t\t'name' => 'default',\r\n\t\t\t\t'value' => '$data->install == 1 ? ($data->default == 1 ? CHtml::image(Yii::app()->theme->baseUrl.\\'/images/icons/publish.png\\') : Utility::getPublish(Yii::app()->controller->createUrl(\\'default\\',array(\"id\"=>$data->plugin_id)), $data->default)) : \"-\"',\r\n\t\t\t\t'htmlOptions' => array(\r\n\t\t\t\t\t'class' => 'center',\r\n\t\t\t\t),\r\n\t\t\t\t'filter'=>array(\r\n\t\t\t\t\t1=>Yii::t('phrase', 'Yes'),\r\n\t\t\t\t\t0=>Yii::t('phrase', 'No'),\r\n\t\t\t\t),\r\n\t\t\t\t'type' => 'raw',\r\n\t\t\t);\r\n\t\t}\r\n\t\tparent::afterConstruct();\r\n\t}", "public function prepare_items()\r\n {\r\n if( !count( $this->columns ) )\r\n $this->set_columns();\r\n\r\n $per_page = 20;\r\n\r\n $columns = $this->get_columns();\r\n $hidden = array();\r\n $sortable = $this->get_sortable_columns();\r\n\r\n $this->_column_headers = array( $columns, $hidden, $sortable );\r\n\r\n $this->process_bulk_action();\r\n\r\n $data = $this->values;\r\n\r\n usort( $data, array( $this, 'usort_reorder' ) );\r\n\r\n $current_page = $this->get_pagenum();\r\n\r\n $total_items = count( $data );\r\n\r\n $data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );\r\n\r\n $this->items = $data;\r\n\r\n if( $total_items > $per_page ) {\r\n $this->set_pagination_args( array(\r\n 'total_items' => $total_items,\r\n 'per_page' => $per_page,\r\n 'total_pages' => ceil( $total_items / $per_page ),\r\n ) );\r\n }\r\n }", "protected function afterConstruct() {\n\t\t$current = strtolower(Yii::app()->controller->id.'/'.Yii::app()->controller->action->id);\n\t\tif(count($this->defaultColumns) == 0) {\n\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t'header' => 'No',\n\t\t\t\t'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'\n\t\t\t);\n\t\t\t$this->defaultColumns[] = 'title';\n\t\t\t//$this->defaultColumns[] = 'alias_url';\n\t\t\t$this->defaultColumns[] = 'description';\n\t\t\t$this->defaultColumns[] = 'image';\n\t\t\t//$this->defaultColumns[] = 'image_position';\n\t\t\t$this->defaultColumns[] = 'published';\n\t\t\t$this->defaultColumns[] = 'ordering';\n\t\t\t//$this->defaultColumns[] = 'access';\n\t\t\t//$this->defaultColumns[] = 'params';\n\t\t}\n\t\tparent::afterConstruct();\n\t}", "public function prepare_items() {\n\t\tif( !empty($_GET['orderby']) ){\n\t\t\tusort($this->items, [$this, 'reorder_products']);\n\t\t}\n\n\t\t$columns = $this->get_columns();\n\t\t$hidden = array();\n\t\t$sortable = $this->get_sortable_columns();\n\t\t$this->_column_headers = array($columns, $hidden, $sortable);\n\t}", "private function prepare_data(){\r\n\t\t\t$this->data_table['cols'] = array();\r\n\t\t\t\r\n\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\tswitch($column_info['type']){\r\n\t\t\t\t\tcase 'number':\r\n\t\t\t\t\tcase 'float':\r\n\t\t\t\t\tcase 'currency':\r\n\t\t\t\t\t\t$column_info['type'] = 'number';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$column_info['type'] = 'string';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['cols'][] = array_merge(array('id' => $column_id), $column_info);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$rows_count = sizeof(reset($this->data));\r\n\t\t\t\r\n\t\t\tfor($i = 0; $i < $rows_count; $i++){\r\n\t\t\t\t$c = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\t\t$value = $this->data[$column_id][$i];\r\n\t\t\t\t\t$c[] = array('v' => $value);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['rows'][] = array('c' => $c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->data_table = json_encode($this->data_table);\r\n\t\t}", "private function getGridColumns()\n\t{\n\t\treturn array(\n\t\t\t'submission_id' => array('field' => 'submission_id', 'sortable' => true, 'hidden' => true),\n\t\t\t'title' => array('field' => 'title', 'label' => 'Title', 'sortable' => true),\n\t\t\t'date' => array('field' => 'date', 'label' => 'Received', 'sortable' => true, 'modifier' => 'formatDate'),\n\t\t\t'organisation' => array('field' => 'organisation', 'label' => 'Organisation', 'sortable' => true),\n\t\t\t'fname' => array('field' => 'fname', 'label' => 'Fname', 'sortable' => true),\n\t\t\t'lname' => array('field' => 'lname', 'label' => 'Lname', 'sortable' => true),\n\t\t\t'email' => array('field' => 'email', 'label' => 'Email', 'sortable' => true),\n\t\t\t'file_id' => array('field' => 'file_id', 'label' => 'File', 'sortable' => true),\n\t\t\t'status' => array('field' => 'status', 'label' => 'Status', 'sortable' => true),\n\t\t\t'session_title' => array('field' => 'session_title', 'label' => 'Session', 'sortable' => true),\n\t\t\t'review_first' => array('field' => 'review_first', 'label' => 'Review first', 'sortable' => true),\n\t\t\t'review_last' => array('field' => 'review_last', 'label' => 'Review last', 'sortable' => true),\n\t\t\t'conference_id' => array('field' => 'conference_id', 'label' => 'Conference id', 'sortable' => true),\n\t\t\t'review_count' => array('field' => 'review_count', 'label' => 'Reviews', 'sortable' => true)\n\t\t);\n\n\t}", "function custom_edit_coupon_columns($columns) {\r\n\r\n $columns['coupon_type'] = esc_html__( 'Coupon', 'wp-coupon' );\r\n $columns['expires'] = esc_html__( 'Expires', 'wp-coupon' );\r\n $columns['stats'] = esc_html__( 'Votes / Clicks', 'wp-coupon' );\r\n\r\n\r\n //unset( $columns['author'] );\r\n // Move default columns to right\r\n if ( isset( $columns['comments'] ) ) {\r\n $title = $columns['comments'];\r\n unset( $columns['comments'] );\r\n $columns['comments'] = $title;\r\n }\r\n\r\n if ( isset( $columns['author'] ) ) {\r\n $title = $columns['author'];\r\n unset( $columns['author'] );\r\n $columns['author'] = $title;\r\n }\r\n\r\n if ( isset( $columns['date'] ) ) {\r\n $title = $columns['date'];\r\n unset( $columns['date'] );\r\n $columns['date'] = $title;\r\n }\r\n\r\n return $columns;\r\n }", "function hub_columns( $columns ) {\r\n $columns['hub_title'] = 'HUB Title';\r\n $columns['client'] = 'Client';\r\n\r\n unset( $columns['title'] );\r\n unset( $columns['date'] );\r\n\r\n $columns['date'] = 'Date';\r\n\r\n return $columns;\r\n }", "public function prepare_items()\n {\n $per_page = 100;\n\n // define column headers\n $columns = $this->get_columns();\n $hidden = [];\n $sortable = $this->get_sortable_columns();\n $this->_column_headers = [$columns, $hidden, $sortable];\n\n // retrieve data\n $data = \\Podlove\\Model\\EpisodeAsset::all('ORDER BY position ASC');\n\n // get current page\n $current_page = $this->get_pagenum();\n // get total items\n $total_items = count($data);\n // extrage page for current page only\n $data = array_slice($data, ($current_page - 1) * $per_page, $per_page);\n // add items to table\n $this->items = $data;\n\n // register pagination options & calculations\n $this->set_pagination_args([\n 'total_items' => $total_items,\n 'per_page' => $per_page,\n 'total_pages' => ceil($total_items / $per_page),\n ]);\n }", "protected function _prepareColumns()\r\n {\r\n\t\t$this->addColumn('brand_id', array(\r\n\t\t\t'header' => Mage::helper('dynamic_brand')->__('ID'),\r\n\t\t\t'index' => 'brand_id',\r\n\t\t));\r\n\t //echo \"<pre>\";print_r($this->getOptionArray());die;\r\n /*$this->addColumn('brand_position', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Position'),\r\n 'align' => 'right',\r\n 'width' => '50px',\r\n 'index' => 'brand_position',\r\n 'type' => 'number',\r\n ));*/\r\n\r\n $this->addColumn('brand_name', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Brand Name'),\r\n 'index' => 'brand_name',\r\n ));\r\n $this->addColumn('sort_order', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Sort Order'),\r\n 'align' => 'left',\r\n 'index' => 'sort_order',\r\n ));\r\n $this->addColumn('url', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('URL'),\r\n 'index' => 'url',\r\n ));\r\n $this->addColumn(\"image\", array(\r\n \"header\" => Mage::helper(\"dynamic_brand\")->__(\"Image\"),\r\n \"index\" => \"image\",\r\n \"renderer\" =>\"Dynamic_Brand_Block_Adminhtml_Renderer_Image\",\r\n ));\r\n\r\n \r\n /*$this->addColumn('brand_title', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Title'),\r\n 'align' => 'left',\r\n 'index' => 'brand_title',\r\n ));\r\n\t\t\r\n \r\n\r\n $this->addColumn('brand_text', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Text'),\r\n 'align' => 'left',\r\n 'index' => 'brand_text',\r\n ));\r\n $this->addColumn('store_id', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Store View'),\r\n 'index' => 'store_id',\r\n 'type' => 'store',\r\n 'store_all' => true,\r\n 'store_view' => true,\r\n 'sortable' => true,\r\n //'filter_condition_callback' => array($this, '_filterStoreCondition'),\r\n\r\n ));*/\r\n \r\n\t\t/*\r\n $this->addColumn('brand_status', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Status'),\r\n 'align' => 'center',\r\n\t\t\t'type' \t\t=> 'options',\r\n 'index' => 'brand_status',\r\n\t\t\t'options' => array(\r\n\t\t\t\t1 => 'Enabled',\r\n\t\t\t\t2 => 'Disabled',\r\n\t\t\t),\r\n ));*/\r\n\r\n /* $fieldset->addField('category', 'multiselect',\r\n array(\r\n 'label' => Mage::helper('dynamic_brand')->__('Category'),\r\n 'class' => 'required-entry',\r\n 'required' => true,\r\n 'values' => $this->getOptionArray(),\r\n 'name' => 'category',\r\n\r\n ));*/\r\n $this->addColumn('category', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Category'),\r\n 'width' => '180px',\r\n 'index' => 'category',\r\n \"renderer\" =>\"Dynamic_Brand_Block_Adminhtml_Renderer_Category\",\r\n\r\n ));\r\n\t\t$this->addColumn('action',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'header' => Mage::helper('dynamic_brand')->__('Action'),\r\n\t\t\t\t\t'width' => '80',\r\n\t\t\t\t\t'type' => 'action',\r\n\t\t\t\t\t'getter' => 'getId',\r\n\t\t\t\t\t'actions' => array(\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t'caption' => Mage::helper('dynamic_brand')->__('Edit'),\r\n\t\t\t\t\t\t\t'url' => array('base' => '*/*/edit'),\r\n\t\t\t\t\t\t\t'field' => 'id'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'filter' => false,\r\n\t\t\t\t\t'sortable' => false,\r\n\t\t\t\t\t'index' => 'stores',\r\n\t\t\t\t\t'is_system' => true,\r\n\t\t));\r\n\t\t$this->addExportType('*/*/exportCsv', Mage::helper('dynamic_brand')->__('CSV'));\r\n\t\t$this->addExportType('*/*/exportXml', Mage::helper('dynamic_brand')->__('XML'));\r\n\t\t\r\n return parent::_prepareColumns();\r\n }", "private function initColumnArrays()\n {\n foreach ($this->columns as $key => $column) {\n $dql = $this->accessor->getValue($column, 'dql');\n $data = $this->accessor->getValue($column, 'data');\n\n $currentPart = $this->entityShortName;\n $currentAlias = $currentPart;\n $metadata = $this->metadata;\n\n if (true === $this->accessor->getValue($column, 'customDql')) {\n $columnAlias = str_replace('.', '_', $data);\n\n // Select\n $selectDql = preg_replace('/\\{([\\w]+)\\}/', '$1', $dql);\n $this->addSelectColumn(null, $selectDql.' '.$columnAlias);\n // Order on alias column name\n $this->addOrderColumn($column, null, $columnAlias);\n // Fix subqueries alias duplication\n $searchDql = preg_replace('/\\{([\\w]+)\\}/', '$1_search', $dql);\n $this->addSearchColumn($column, null, $searchDql);\n } elseif (true === $this->accessor->getValue($column, 'selectColumn')) {\n $parts = explode('.', $dql);\n\n while (count($parts) > 1) {\n $previousPart = $currentPart;\n $previousAlias = $currentAlias;\n\n $currentPart = array_shift($parts);\n $currentAlias = ($previousPart === $this->entityShortName ? '' : $previousPart.'_').$currentPart;\n\n if (!array_key_exists($previousAlias.'.'.$currentPart, $this->joins)) {\n $this->addJoin($previousAlias.'.'.$currentPart, $currentAlias, $this->accessor->getValue($column, 'joinType'));\n }\n\n $metadata = $this->setIdentifierFromAssociation($currentAlias, $currentPart, $metadata);\n }\n\n $this->addSelectColumn($currentAlias, $this->getIdentifier($metadata));\n $this->addSelectColumn($currentAlias, $parts[0]);\n $this->addSearchOrderColumn($column, $currentAlias, $parts[0]);\n } else {\n // Add Order-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'orderColumn') && true === $this->accessor->getValue($column, 'orderable')) {\n $orderColumn = $this->accessor->getValue($column, 'orderColumn');\n $orderParts = explode('.', $orderColumn);\n if (count($orderParts) < 2) {\n $orderColumn = $this->entityShortName.'.'.$orderColumn;\n }\n $this->orderColumns[] = $orderColumn;\n } else {\n $this->orderColumns[] = null;\n }\n\n // Add Search-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'searchColumn') && true === $this->accessor->getValue($column, 'searchable')) {\n $searchColumn = $this->accessor->getValue($column, 'searchColumn');\n $searchParts = explode('.', $searchColumn);\n if (count($searchParts) < 2) {\n $searchColumn = $this->entityShortName.'.'.$searchColumn;\n }\n $this->searchColumns[] = $searchColumn;\n } else {\n $this->searchColumns[] = null;\n }\n }\n }\n\n return $this;\n }", "private function getGridColumns()\n\t{\n\t\treturn array(\n\t\t\t// presentation_id is hidden so I don't have to provide a label\n\t\t\t'presentation_id' => array('field' => 'presentation_id', 'sortable' => true, 'hidden' => true),\n\t\t\t'session_id' => array('field' => 'session_id', 'sortable' => false, 'hidden' => true),\n\t\t\t'presentation_title' => array('field' => 'presentation_title', 'label' => 'Title', 'sortable' => true),\n\t\t\t'email' => array('field' => 'email', 'label' => 'User', 'sortable' => true, 'resource' => 'session', 'privilege' => 'save'),\n\t\t\t'session_title' => array('field' => 'session_title', 'label' => 'Session', 'sortable' => true)\n\t\t);\n\n\t}", "protected function initializeColumnMapping() {\n\t\t// add always available cols for filemetadata\n\t\tforeach ($this->metaColMapping as $damColName => $metaColName) {\n\t\t\t$this->columnMapping[$damColName] = $metaColName;\n\t\t}\n\n\t\t// add additional cols if ext:for filemetadata is installed\n\t\tif (ExtensionManagementUtility::isLoaded('filemetadata')) {\n\t\t\tforeach ($this->additionalMetaColMapping as $damColName => $metaColName) {\n\t\t\t\t$this->columnMapping[$damColName] = $metaColName;\n\t\t\t}\n\t\t}\n\t}", "public function setColumns()\r\n\t{\r\n\t\t$columns = array_filter($this->getRules(), function($rule) {\r\n\t\t\tif($rule instanceof ColumnInterface) {\r\n\t\t\t\treturn $rule;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$columns = array_map(function(ColumnInterface $rule) {\r\n\t\t\treturn $rule->getTitle();\r\n\t\t}, $columns);\r\n\r\n\t\t$this->columns = $columns;\r\n\t}", "public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(Right::class_name(), Right::PROPERTY_NAME));\n $this->add_column(new DataClassPropertyTableColumn(Right::class_name(), Right::PROPERTY_DESCRIPTION));\n }", "protected function get_sortable_columns()\n {\n }", "protected function get_sortable_columns()\n {\n }", "protected function get_sortable_columns()\n {\n }", "protected function addColumns()\n {\n parent::addColumns();\n\n foreach ($this->config['fields'] as $key => $values) {\n\n switch ($values['type']) {\n case 'text':\n $this->table->addColumn($key, 'string', array('length' => 256, 'default' => ''));\n break;\n case 'textarea':\n case 'select':\n $this->table->addColumn($key, 'text', array('default' => ''));\n break;\n case 'checkbox':\n $this->table->addColumn($key, 'boolean', array('default' => 0));\n break;\n default:\n $this->table->addColumn($key, 'text', array('default' => ''));\n }\n\n }\n }", "public function makeColumns(){\n $hijosDetalle=$this->\n getReportedetalle()->\n where(['and', \"esdetalle='1'\", \"visiblecampo='1'\"])->\n orderBy('orden')->all();\n //echo count( $hijosDetalle);die();\n $columns=[];\n foreach($hijosDetalle as $fila){\n $columns[]=[\n 'attribute'=>$fila->nombre_campo,\n 'label'=>$fila->aliascampo,\n 'format'=>'raw',\n 'options'=>['width'=>\n $this->sizePercentCampo($fila->nombre_campo).'%'],\n ];\n \n \n }\n return $columns;\n \n }", "protected function guessColumns()\n {\n $models = $this->dataProvider->getModels();\n $model = reset($models);\n if (is_array($model) || is_object($model)) {\n foreach ($model as $name => $value) {\n if ($value === null || is_scalar($value) || is_callable([$value, '__toString'])) {\n $this->columns[] = (string) $name;\n }\n }\n }\n }", "protected function prepare_fields()\n {\n }", "public function getGridColumns()\n {\n return [\n 'id' => [\n 'attribute' => 'id',\n ],\n 'name' => [\n 'attribute' => 'name',\n ],\n 'surname' => [\n 'attribute' => 'surname',\n ],\n [\n 'attribute' => 'image_name',\n ],\n [\n 'attribute' => 'image_md5',\n ],\n [\n 'attribute' => 'image_extension',\n ],\n [\n 'filter' => false,\n 'format' => 'raw',\n 'header' => \\yii::t('execut/books', 'Preview'),\n 'value' => $this->getValueCallback(),\n ],\n [\n 'attribute' => 'image_mime_type',\n ],\n [\n 'attribute' => 'main_book_id',\n 'value' => 'mainBook.name',\n 'filter' => Select2::widget([\n 'model' => $this,\n 'attribute' => 'main_book_id',\n 'bsVersion' => 3,\n 'theme' => 'bootstrap',\n 'language' => 'ru',\n 'initValueText' => $this->mainBook ? $this->mainBook->name : null,\n 'pluginOptions' => [\n 'allowClear' => true,\n 'ajax' => [\n 'dataType' => 'json',\n 'url' => Url::to(['/booksNative/books']),\n 'data' =>\n new \\yii\\web\\JsExpression('function(params) {\n return {\n \"Book[name]\": params.term,\n page: params.page\n };\n }'),\n ],\n ],\n 'options' => [\n 'placeholder' => \\yii::t('execut/books', 'Main Book'),\n ],\n 'showToggleAll' => false,\n ]),\n ],\n 'actions' => [\n 'class' => ActionColumn::class,\n 'buttons' => [\n 'view' => function () {\n return false;\n },\n ],\n ]\n ];\n }", "public function prepare_items() {\n\t\t/** Process bulk action */\n\t\t$this->process_bulk_action();\n\n\t\t$columns = $this->get_columns();\n $hidden = $this->get_hidden_columns();\n $sortable = $this->get_sortable_columns();\n $this->_column_headers = array($columns, $hidden, $sortable);\n\n\t\t$per_page = $this->get_items_per_page( 'posts_per_page', 20 );\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = self::record_count();\n\n\t\t$this->set_pagination_args( [\n\t\t\t'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t\t'per_page' => $per_page //WE have to determine how many items to show on a page\n\t\t] );\n\n\t\t$this->items = self::get_posts( $per_page, $current_page );\n\t}", "function sb_slideshow_columns( $columns ) {\n\tunset( $columns['date'] ); // remove date column\n\t$columns['id'] = 'ID';\n\t$columns['shortcode'] = 'Shortcode';\n\t$columns['date'] = 'Date'; // add date column back, at the end\n\n\treturn $columns;\n}", "public function prepare_items()\n {\n /* 20 seems like a good number to show */\n $per_page = 10;\n $columns = $this->get_columns();\n $hidden = array();\n $sortable = $this->get_sortable_columns();\n\n $this->_column_headers = array($columns, $hidden, $sortable);\n\n /* Parameters that are used to order the results table */\n $orderby = !empty($_GET[\"orderby\"]) ? mysql_real_escape_string($_GET[\"orderby\"]) : 'id';\n $order = !empty($_GET[\"order\"]) ? mysql_real_escape_string($_GET[\"order\"]) : 'ASC';\n\n $current_page = $this->get_pagenum();\n $total_items = count($this->items);\n if ($total_items > 0) {\n\n $this->items = array_slice($this->items,(($current_page-1)*$per_page),$per_page);\n\n $this->set_pagination_args( array(\n 'total_items' => $total_items, //WE have to calculate the total number of items\n 'per_page' => $per_page, //WE have to determine how many items to show on a page\n 'total_pages' => ceil($total_items/$per_page) //WE have to calculate the total number of pages\n ) );\n }\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 }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function prepare_items() {\n \n /**\n * Set how many records per page to show\n */\n $_iItemsPerPage = 20;\n \n /**\n * Define our column headers. \n */\n $this->_column_headers = array( \n $this->get_columns(), // $aColumns\n array(), // $aHidden\n $this->get_sortable_columns() // $aSortable\n );\n \n \n /**\n * Process bulk actions.\n */\n // $this->process_bulk_action(); // in our case, it is dealt before the header is sent. ( with the Admin page class )\n \n /**\n * Variables\n */\n $_aData = $this->aData;\n \n \n /**\n * Sort the array.\n */\n usort( $_aData, array( $this, 'usort_reorder' ) );\n \n \n /**\n * For pagination.\n */\n $_iCurrentPageNumber = $this->get_pagenum();\n $_iTotalItems = count( $_aData );\n $this->set_pagination_args( \n array(\n 'total_items' => $_iTotalItems, // calculate the total number of items\n 'per_page' => $_iItemsPerPage, // determine how many items to show on a page\n 'total_pages' => ceil( $_iTotalItems / $_iItemsPerPage ) // calculate the total number of pages\n )\n );\n $_aData = array_slice( \n $_aData, \n ( ( $_iCurrentPageNumber -1 ) * $_iItemsPerPage ), \n $_iItemsPerPage \n );\n \n /*\n * Set data\n * */\n $this->items = $_aData;\n \n }", "public function prepare_items() {\n\n\t\t// Roll out each part.\n\t\t$columns = $this->get_columns();\n\t\t$hidden = $this->get_hidden_columns();\n\t\t$sortable = $this->get_sortable_columns();\n\t\t$dataset = $this->table_data();\n\n\t\t// Check for the action key value to filter.\n\t\tif ( ! empty( $_REQUEST['wbr-review-filter'] ) ) { // WPCS: CSRF ok.\n\t\t\t$dataset = $this->maybe_filter_dataset( $dataset );\n\t\t}\n\n\t\t// Handle our sorting.\n\t\tusort( $dataset, array( $this, 'sort_data' ) );\n\n\t\t// Load up the pagination settings.\n\t\t$paginate = 20;\n\t\t$item_count = count( $dataset );\n\t\t$current = $this->get_pagenum();\n\n\t\t// Set my pagination args.\n\t\t$this->set_pagination_args( array(\n\t\t\t'total_items' => $item_count,\n\t\t\t'per_page' => $paginate,\n\t\t\t'total_pages' => ceil( $item_count / $paginate ),\n\t\t));\n\n\t\t// Slice up our dataset.\n\t\t$dataset = array_slice( $dataset, ( ( $current - 1 ) * $paginate ), $paginate );\n\n\t\t// Do the column headers.\n\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\n\t\t// Make sure we have the single action running.\n\t\t$this->process_single_action();\n\n\t\t// Make sure we have the bulk action running.\n\t\t$this->process_bulk_action();\n\n\t\t// Make sure we have the status change.\n\t\t$this->process_status_change();\n\n\t\t// And the result.\n\t\t$this->items = $dataset;\n\t}", "private function load_columns_information() {\n $query = \"SELECT ordinal_position,\n column_name,\n data_type,\n is_nullable::boolean::integer\n FROM information_schema.columns\n WHERE table_schema = 'public'\n AND table_name = '{$this->get_table_name()}';\";\n $this->columns_information = DB::fetch_all($query);\n\n // Cria os campos da tabela no objeto corrente\n foreach($this->columns_information as $column) {\n $this->$column['column_name'] = null;\n $this->{'_' . $column['column_name']} = null;\n }\n }", "function prepare_items() {\n\t\t$per_page\t= $this->per_page;\n\n\t\t// Get All, Hidden, Sortable columns\n\t\t$columns = $this->get_columns();\n\t\t$hidden = array();\n\t\t$sortable = $this->get_sortable_columns();\n\n\t\t// Get final column header\n\t\t$this->_column_headers\t= array( $columns, $hidden, $sortable );\n\n\t\t// Get Data of particular page\n\t\t$data_res \t= $this->display_used_vouchers();\n\t\t$data \t\t= $data_res['data'];\n\n\t\t// Get current page number\n\t\t$current_page = $this->get_pagenum();\n\n\t\t// Get total count\n\t\t$total_items = $data_res['total'];\n\n\t\t// Get page items\n\t\t$this->items = $data;\n\n\t\t// We also have to register our pagination options & calculations.\n\t\t$this->set_pagination_args( array(\n\t\t\t\t\t\t\t\t\t\t\t'total_items' => $total_items,\n\t\t\t\t\t\t\t\t\t\t\t'per_page' => $per_page,\n\t\t\t\t\t\t\t\t\t\t\t'total_pages' => ceil( $total_items/$per_page )\n\t\t\t\t\t\t\t\t\t\t) );\n }", "function get_columns() {\n\n\t\treturn $columns = array(\n\t\t\t'cb'\t\t=> '<input type=\"checkbox\" />', //Render a checkbox instead of text\n\t\t\t'title'\t\t=> 'Title',\n\t\t\t'rating'\t=> 'Rating',\n\t\t\t'director'\t=> 'Director'\n\t\t);\n\t}", "protected function _prepareRowsAction() {\n \n }", "public function prepare_items() {\n\n\t\t$columns = $this->get_columns();\n\t\t$hidden = get_hidden_columns( $this->screen );\n \t\t$sortable = $this->get_sortable_columns();\n \t\t$this->_column_headers = array($columns, $hidden, $sortable);\n \t\t//$this->_column_headers = $this->get_column_info();\n\t\t/** Process bulk action */\n\t\t$this->process_bulk_action();\n\n\t\t$per_page = $this->get_items_per_page( 'transactions_per_page', 10 );\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = self::record_count();\n\n\t\t$this->set_pagination_args( array(\n\t\t\t'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t\t'per_page' => $per_page //WE have to determine how many items to show on a page\n\t\t));\n\n\t\t$this->items = self::get_customers( $per_page, $current_page );\n\t}", "public static function columns()\n {\n return filterColumnByRole([\n 'plot_ref' => trans('system.code'),\n 'plot_name' => trans_title('plots'),\n 'user.name' => trans_title('users'),\n 'city.city_name' => trans_title('cities'),\n 'plot_percent_cultivated_land' => sections('plots.cultivated_land'),\n 'plot_real_area' => sections('plots.real_area'),\n 'plot_start_date' => sections('plots.start_date'),\n 'plot_active' => trans('persona.contact.active'),\n 'plot_green_cover' => sections('plots.green_cover'),\n 'plot_pond' => sections('plots.pond'),\n 'plot_road' => sections('plots.road'),\n ],\n $roleFilter = Credentials::isAdmin(),\n $newColumns = ['client.client_name' => trans_title('clients')],//Admits multiple arrays\n $addInPosition = 3\n );\n }", "public function prepare_items()\r\n\t{\r\n\t\t$columns = $this->get_columns();\r\n\t\t$hidden = $this->get_hidden_columns();\r\n\t\t$sortable = $this->get_sortable_columns();\r\n\r\n\t\t$currentPage = $this->get_pagenum();\r\n\r\n\t\t$this->total = Lead::count();\r\n\t\t$data = Lead::take( $this->per_page )->skip( ( $currentPage - 1 ) * $this->per_page )\r\n\t\t ->get()->toArray();\r\n\r\n\t\t$this->set_pagination_args( [\r\n\t\t\t'total_items' => $this->total,\r\n\t\t\t'per_page' => $this->per_page\r\n\t\t] );\r\n\r\n\t\t$this->_column_headers = [ $columns, $hidden, $sortable ];\r\n\r\n\t\t$this->items = $data;\r\n\t}", "function get_columns(){\n $columns = array(\n 'cb' \t\t=> '<input type=\"checkbox\" />', //Render a checkbox instead of text\n 'img' => __( 'Image', 'wp-lister-for-amazon' ),\n 'sku' => __( 'SKU', 'wp-lister-for-amazon' ),\n 'listing_title' \t=> __( 'Title', 'wp-lister-for-amazon' ),\n 'quantity'\t\t\t=> __( 'Stock', 'wp-lister-for-amazon' ),\n // 'quantity_sold'\t\t=> __( 'Sold', 'wp-lister-for-amazon' ),\n 'price' => __( 'Price', 'wp-lister-for-amazon' ),\n 'lowest_price' => str_replace(' ', '&nbsp;', __( 'Buy Box', 'wp-lister-for-amazon' ) ),\n 'loffer_price'\t\t=> __( 'Lowest Offer', 'wp-lister-for-amazon' ),\n // 'fees'\t\t\t\t=> __( 'Fees', 'wp-lister-for-amazon' ),\n 'date_published' => str_replace(' ', '&nbsp;', __( 'Created at', 'wp-lister-for-amazon' ) ),\n 'profile' => __( 'Profile', 'wp-lister-for-amazon' ),\n 'account' => __( 'Account', 'wp-lister-for-amazon' ),\n 'status'\t\t \t=> __( 'Status', 'wp-lister-for-amazon' )\n );\n\n // if ( ! get_option( 'wpla_enable_thumbs_column' ) )\n // unset( $columns['img'] );\n\n return $columns;\n }", "function ganesh_set_ganesh_contact_columns($columns){\r\n\t$newColumns = array();\r\n\t$newColumns['title'] = 'Full Name';\r\n\t$newColumns['message'] = 'Message';\r\n\t$newColumns['email'] = 'Email';\r\n\t$newColumns['date'] = 'Date';\r\n\treturn $newColumns;\r\n}", "protected function get_column_info()\n {\n }", "protected function get_column_info()\n {\n }", "protected function assign_report_columns() {\n\t\t$table_name = self::get_db_table_name();\n\t\t// Avoid ambigious columns in SQL query.\n\t\t$this->report_columns = array(\n\t\t\t'order_id' => \"{$table_name}.order_id\",\n\t\t\t'parent_id' => \"{$table_name}.parent_id\",\n\t\t\t'date_created' => \"{$table_name}.date_created\",\n\t\t\t'date_created_gmt' => \"{$table_name}.date_created_gmt\",\n\t\t\t'status' => \"REPLACE({$table_name}.status, 'wc-', '') as status\",\n\t\t\t'customer_id' => \"{$table_name}.customer_id\",\n\t\t\t'net_total' => \"{$table_name}.net_total\",\n\t\t\t'total_sales' => \"{$table_name}.total_sales\",\n\t\t\t'num_items_sold' => \"{$table_name}.num_items_sold\",\n\t\t\t'customer_type' => \"(CASE WHEN {$table_name}.returning_customer = 1 THEN 'returning' WHEN {$table_name}.returning_customer = 0 THEN 'new' ELSE '' END) as customer_type\",\n\t\t);\n\t}" ]
[ "0.8032783", "0.7970797", "0.7810431", "0.77156216", "0.759689", "0.75775754", "0.75636953", "0.7553819", "0.75534993", "0.75257516", "0.7525625", "0.7402476", "0.7365304", "0.7329322", "0.7305655", "0.7302874", "0.7265779", "0.7246611", "0.7231808", "0.7189809", "0.7185018", "0.71762055", "0.7173562", "0.7161073", "0.71564853", "0.7142298", "0.71407723", "0.7114547", "0.71062994", "0.7029196", "0.70179975", "0.69946986", "0.6940452", "0.68615574", "0.680506", "0.67130476", "0.6699648", "0.66843194", "0.66548985", "0.6640231", "0.663665", "0.66285855", "0.6581849", "0.6469583", "0.6466983", "0.6465242", "0.639352", "0.63889134", "0.63804394", "0.6371296", "0.6350425", "0.6337233", "0.63366455", "0.632479", "0.6318064", "0.6291681", "0.6286608", "0.6281226", "0.6272507", "0.6262032", "0.6255031", "0.62428546", "0.623867", "0.62321436", "0.62311804", "0.6230602", "0.6221777", "0.621588", "0.6206491", "0.62058544", "0.62058544", "0.6171943", "0.6161853", "0.61491764", "0.61465794", "0.6143199", "0.6118218", "0.6111325", "0.6088887", "0.6077526", "0.6075408", "0.6075408", "0.6075408", "0.6075408", "0.60745215", "0.60745215", "0.6072022", "0.60507584", "0.6036404", "0.60344994", "0.60282147", "0.602312", "0.6017374", "0.6011605", "0.60113925", "0.6008997", "0.60069174", "0.5997935", "0.59977716", "0.59944874" ]
0.7148879
25
prepare mass action for this grid
protected function _prepareMassaction() { $this->setMassactionIdField('solutionpartner_id'); $this->getMassactionBlock()->setFormFieldName('solutionpartner'); $this->getMassactionBlock()->addItem('delete', array( 'label' => Mage::helper('solutionpartner')->__('Delete'), 'url' => $this->getUrl('*/*/massDelete'), 'confirm' => Mage::helper('solutionpartner')->__('Are you sure?') )); $statuses = Mage::getSingleton('solutionpartner/status')->getOptionArray(); array_unshift($statuses, array('label'=>'', 'value'=>'')); $this->getMassactionBlock()->addItem('status', array( 'label'=> Mage::helper('solutionpartner')->__('Change status'), 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)), 'additional' => array( 'visibility' => array( 'name' => 'status', 'type' => 'select', 'class' => 'required-entry', 'label' => Mage::helper('solutionpartner')->__('Status'), 'values'=> $statuses )) )); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareMassAction()\n {\n parent::_prepareMassaction();\n $this->setMassactionIdField('customer_name');\n $this->getMassactionBlock()->setFormFieldName('order');\n $this->getMassactionBlock()->addItem('oggetto_oneclick', array(\n 'label' => Mage::helper('oggetto_oneclick')->__('Delete'),\n 'url' => $this->getUrl('*/*/massDelete'),\n 'confirm' => Mage::helper('oggetto_oneclick')->__('Are you sure?')\n )\n );\n }", "protected function _prepareMassaction(){\r\n return $this;\r\n }", "protected function _prepareMassaction() {\n /**\n * Set massaction id\n * Set massaction name\n */\n $this->setMassactionIdField ( 'id' );\n $this->getMassactionBlock ()->setFormFieldName ( 'country_code' );\n /**\n * Add delete mass action \n */ \n $this->getMassactionBlock ()->addItem ( 'delete', array (\n 'label' => Mage::helper ( 'airhotels' )->__ ( 'Delete' ),\n 'url' => $this->getUrl ( '*/*/massDelete' ),\n 'confirm' => Mage::helper ( 'airhotels' )->__ ( 'Are you sure?' ) \n ) );\n return $this;\n }", "public function bulkAction() {\n\t\t$this->_helper->ajaxgrid->massActions ();\n\t}", "public function bulkAction() {\n\t\t$this->_helper->ajaxgrid->massActions ();\n\t}", "protected function _prepareMassaction()\n {\n $this->setMassactionIdField('entity_id');\n $this->getMassactionBlock()->setFormFieldName('shipment_ids');\n $this->getMassactionBlock()->setUseSelectAll(false);\n\n $this->getMassactionBlock()->addItem('create_shipment', array(\n 'label'=> Mage::helper('sales')->__('Create Canpar Shipments'),\n 'url' => $this->getUrl('*/canparshipment/massCreate'),\n ));\n\n $this->getMassactionBlock()->addItem('void_shipment', array(\n 'label'=> Mage::helper('sales')->__('Void Canpar Shipments'),\n 'url' => $this->getUrl('*/canparshipment/massVoid'),\n ));\n\n $this->getMassactionBlock()->addItem('get_label', array(\n 'label'=> Mage::helper('sales')->__('Print Labels'),\n 'url' => $this->getUrl('*/canparshipment/massLabels'),\n ));\n\n $this->getMassactionBlock()->addItem('get_tlabel', array(\n 'label'=> Mage::helper('sales')->__('Print Thermal Labels'),\n 'url' => $this->getUrl('*/canparshipment/massLabels', array('_thermal' => true)),\n ));\n\n return $this;\n }", "protected function _prepareMassaction() {\r\n //entity_id is unique identifier \r\n $this->setMassactionIdField('entity_id');\r\n //Form field name\r\n $this->getMassactionBlock()->setFormFieldName('product');\r\n //status enable/disable\r\n $this->getMassactionBlock()->addItem('status', array(\r\n 'label' => Mage::helper('catalog')->__('Enable Coupon Request '),\r\n 'url' => $this->getUrl('*/*/massEnable', array('_current' => true)),\r\n ))\r\n ->addItem('status1', array(\r\n 'label' => Mage::helper('catalog')->__('Disable Coupon Request'),\r\n 'url' => $this->getUrl('*/*/massDisable', array('_current' => true)),\r\n ));\r\n\r\n\r\n return $this;\r\n }", "protected function _prepareMassAction()\n {\n\tparent::_prepareMassAction();\n\t$this->getMassActionBlock()->setUseSelectAll(true);\n\treturn $this;\n }", "protected function _prepareMassaction()\n {\n return $this;\n }", "protected function _prepareMassaction()\n {\n return $this;\n }", "protected function _prepareMassaction() {\r\n\r\n $this->setMassactionIdField('entity_id');\r\n $this->getMassactionBlock()->setFormFieldName('TicketsList');\r\n\r\n $helper = Mage::helper('CrmTicket');\r\n\r\n $this->getMassactionBlock()->addItem('category', array(\r\n 'label' => $helper->__('Assign to a category'),\r\n 'url' => $this->getUrl('*/*/MassTickets/category/', array('_current' => true)),\r\n 'additional' => array(\r\n 'visibility' => array(\r\n 'name' => 'categories',\r\n 'type' => 'select',\r\n 'class' => 'required-entry',\r\n 'label' => $helper->__('Category'),\r\n 'values' => $this->getCategoryMenuForMassAction()\r\n )\r\n )\r\n ));\r\n\r\n $this->getMassactionBlock()->addItem('status', array(\r\n 'label' => $helper->__('Change status'),\r\n 'url' => $this->getUrl('*/*/MassTickets/status/', array('_current' => true)),\r\n 'additional' => array(\r\n 'visibility' => array(\r\n 'name' => 'statuses',\r\n 'type' => 'select',\r\n 'class' => 'required-entry',\r\n 'label' => $helper->__('Status'),\r\n 'values' => mage::getModel('CrmTicket/Ticket')->getStatuses()\r\n )\r\n )\r\n ));\r\n\r\n $this->getMassactionBlock()->addItem('user', array(\r\n 'label' => $helper->__('Change user'),\r\n 'url' => $this->getUrl('*/*/MassTickets/user/', array('_current' => true)),\r\n 'additional' => array(\r\n 'visibility' => array(\r\n 'name' => 'users',\r\n 'type' => 'select',\r\n 'class' => 'required-entry',\r\n 'label' => $helper->__('User'),\r\n 'values' => $this->getUsersMenuForMassAction()\r\n )\r\n )\r\n ));\r\n\r\n $this->getMassactionBlock()->addItem('tag', array(\r\n 'label' => $helper->__('Add tag'),\r\n 'url' => $this->getUrl('*/*/MassTickets/tag/', array('_current' => true)),\r\n 'additional' => array(\r\n 'visibility' => array(\r\n 'name' => 'tags',\r\n 'type' => 'select',\r\n 'class' => 'required-entry',\r\n 'label' => $helper->__('Tags'),\r\n 'values' => mage::helper('CrmTicket/Tag')->getAllTags()\r\n )\r\n )\r\n ));\r\n\r\n $this->getMassactionBlock()->addItem('spam', array(\r\n 'label' => $helper->__('Mark as spam '),\r\n 'url' => $this->getUrl('*/*/MassTickets/spam/', array('_current' => true)),\r\n 'additional' => array(\r\n 'visibility' => array(\r\n 'name' => 'spam',\r\n 'type' => 'select',\r\n 'class' => 'required-entry',\r\n 'label' => $helper->__('Spam'),\r\n 'values' => mage::getModel('CrmTicket/EmailSpam')->getSpamActions()\r\n )\r\n )\r\n ));\r\n\r\n if (Mage::getStoreConfig('crmticket/ticket_grid/mass_delete_ticket')) {\r\n $this->getMassactionBlock()->addItem('delete', array(\r\n 'label' => $helper->__('Delete ticket'),\r\n 'url' => $this->getUrl('*/*/MassDeleteTickets/', array('_current' => true))\r\n ));\r\n }\r\n\r\n return $this;\r\n }", "protected function _prepareColumns()\n {\n $result = parent::_prepareColumns();\n $column = $this->getColumn('action');\n if (!$column) {\n return $result;\n }\n $data = $column->getData();\n $data['actions'][0]['url'] = array('base' => 'adminhtml/sales_order/view');\n $column->setData($data);\n return $result;\n }", "function admin_bulk_action(){\n\t\t\n\t\t$this->layout = \"\";\n\t\t$this->autoRender = false;\n\t\tif(isset($this->data['Model']['id']) && count($this->data['Model']['id'])>0 && isset($this->data['Model']['action'])){\n\t\t\t\n\t\t\t$infected_records = array();\n\t\t\tforeach($this->data['Model']['id'] as $ids){\n\t\t\t\t$infected_records[] = DECRYPT_DATA($ids);\n\t\t\t}\n\t\t\t$model_name = $this->data['Model']['model_name'];\n\t\t\t$action = $this->data['Model']['action'];\n\t\t\tApp::import(\"Model\",$model_name);\n\t\t\t$this->$model_name = new $model_name();\n\t\t\tif($action == 0){//Activate Status\n\t\t\t $this->$model_name->updateAll(array(\"$model_name.is_active\"=>\"'1'\"),array(\"$model_name.id\"=>$infected_records));\n\t\t\t $this->Session->setFlash(RECORD_ACTIVATED, 'message/green');\n\t\t\t}\n\t\t\telse if($action == 1){//Inactivate Status\n\t\t\t $this->$model_name->updateAll(array(\"$model_name.is_active\"=>\"'0'\"),array(\"$model_name.id\"=>$infected_records));\n\t\t\t $this->Session->setFlash(RECORD_DEACTIVATED, 'message/green');\n\t\t\t}else if($action == 2){//Delete selected records\n\t\t\t\t\n\t\t\t $this->$model_name->updateAll(array(\"$model_name.is_deleted\"=>\"'1'\"),array(\"$model_name.id\"=>$infected_records));\n\t\t\t if($model_name == \"Vendor\"){\n\t\t\t\tApp::import(\"Model\",\"Product\");\n\t\t\t\t$this->Product = new Product();\n\t\t\t\t$this->Product->updateAll(array(\"Product.is_deleted\"=>\"'1'\"),array(\"Product.vendor_id\"=>$infected_records));\n\t\t\t\tApp::import(\"Model\",\"Coupon\");\n\t\t\t\t$this->Coupon = new Coupon();\n\t\t\t\t$this->Coupon->updateAll(array(\"Coupon.is_deleted\"=>\"'1'\"),array(\"Coupon.vendor_id\"=>$infected_records));\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t $this->Session->setFlash(RECORD_DELETED, 'message/green');\n\t\t\t}\n\t\t\t$this->redirect($this->referer());exit();\t\n\t\t}\n\t}", "public function prepare()\n {\n parent::prepare();\n\n $this->_data['config']['actions'] = [\n [\n 'actionName' => 'reset',\n 'targetName' => '${ $.name }',\n 'params' => [\n json_encode($this->getRobotsDefaultCustomInstructions())\n ]\n ]\n ];\n }", "protected function _prepareRowsAction() {\n \n }", "public function bulk_actions(){\n\t\t$this->autoRender = false;\n\t\t$this->layout = false;\n\t\t\n\t\tif(!$this->_checkSession()){\n\t\t\t$this->Session->setFlash(__(\"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">Acess Denied!</div>\"), 'flash_custom');\n\t\t\t$this->redirect(array('action'=>'login'));\n\t\t}\n\t\t\n\t\tif(!$this->request->is('post')){\n\t\t\tdie(\"Access denied!\");\n\t\t}\n\t\t$process_action = $this->request->data['process_action'];\n\t\t$process_model = $this->request->data['process_model'];\n\t\t\n\t\tswitch($process_action){\n\t\t\tcase 'delete':\n\t\t\t\t\t\tif(isset($this->request->data['item_id']) && !empty($this->request->data['item_id'])){\n\t\t\t\t\t\t\tforeach($this->request->data['item_id'] as $item_id){\n\t\t\t\t\t\t\t\t$this->$process_model->id = $item_id;\n\t\t\t\t\t\t\t\t$this->$process_model->delete();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->Session->setFlash(__('<div class=\"alert alert-success\" role=\"alert\">Records deleted successfully!</div>'), 'flash_custom');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t\t\n\t\t}\n\t\t\t\n\t\t$this->redirect($this->referer());\n\t}", "function process_bulk_action() {\n\t\t\n\t\t//Detect when a bulk action is being triggered...\n\t\tif( 'delete'=== $this->current_action() ) {\n\t\t\twp_die( 'Items deleted (or they would be if we had items to delete)!' );\n\t\t}\n\t\t\n\t}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function _prepareColumns()\n {\n \tparent::_prepareColumns();\n \tunset($this->_columns['actionColumn']);\n }", "function process_bulk_action() {\n \n //Detect when a bulk action is being triggered...\n if( 'delete'===$this->current_action() ) {\n wp_die('Items deleted (or they would be if we had items to delete)!');\n }\n \n }", "protected function _changeActions(Mage_Index_Block_Adminhtml_Process_Grid $grid)\n {\n $grid->getColumn('action')->setActions(array(\n array(\n 'caption' => Mage::helper('index')->__('Reindex Data'),\n 'url' => array('base' => '*/*/reindexProcess'),\n 'field' => 'process'\n ),\n array(\n 'caption' => Mage::helper('index')->__('Schedule Reindex'),\n 'url' => array('base' => 'adminhtml/asyncindex/index'),\n 'params' => array('_current' => true, '_secure' => false),\n 'field' => 'process'\n ),\n array(\n 'caption' => Mage::helper('index')->__('Schedule partial index'),\n 'url' => array('base' => 'adminhtml/asyncindex/schedulePartial'),\n 'params' => array('_current' => true, '_secure' => false),\n 'field' => 'process'\n ),\n ));\n return $this;\n }", "protected function executeAction() {\n \n }", "function process_bulk_action() {\n global $wbdb;\n \n //Detect when a bulk action is being triggered...\n if( 'delete'===$this->current_action() ) {\n #wp_die('Items deleted (or they would be if we had items to delete)!');\n #$wpdb->query(\"DELETE FROM {$wpdb->prefix}amazon_listings WHERE id = ''\",)\n }\n\n if( 'verify'===$this->current_action() ) {\n\t\t\t#echo \"<br>verify handler<br>\";\t\t\t\n }\n \n }", "protected function get_bulk_actions()\n {\n }", "protected function get_bulk_actions()\n {\n }", "protected function initializeProcessAction() {}", "function process_bulk_action()\n {\n //Detect when a bulk action is being triggered...\n if ('delete_selected' === $this->current_action() && $_GET['shortcode']) {\n foreach ($_GET['shortcode'] as $id) {\n $this->delete_shortcode($id);\n }\n }\n }", "private function actions()\n {\n }", "public function process_bulk_action() {\n\n if ( ! isset( $_REQUEST[ 'template' ] ) ) {\n return;\n }\n \n switch( strtolower( $this->current_action() ) ){\n case 'activate':\n do_action( 'aal_action_activate_templates', ( array ) $_REQUEST[ 'template' ], true );\n break;\n case 'deactivate':\n do_action( 'aal_action_deactivate_templates', ( array ) $_REQUEST[ 'template' ], true );\n break; \n default:\n return; // do nothing.\n }\n\n // Reload the page.\n exit( \n wp_safe_redirect( \n add_query_arg( \n array(\n 'post_type' => AmazonAutoLinks_Registry::$aPostTypes[ 'unit' ],\n 'page' => AmazonAutoLinks_Registry::$aAdminPages[ 'template' ],\n 'tab' => 'table',\n ), \n admin_url( $GLOBALS[ 'pagenow' ] ) \n )\n )\n );\n \n }", "public function process_bulk_action() {\n\n\t\tswitch ( $this->current_action() ) {\n\t\t\tcase 'delete':\n\t\t\t\t// This case is handled in \\WPMailSMTP\\Pro\\Emails\\Logs\\Logs::process_email_delete().\n\t\t\t\tbreak;\n\t\t}\n\t}", "protected function prepareItemActions()\n {\n if (!empty($this->_actions)) {\n return;\n }\n \n $currentType = FormUtil::getPassedValue('type', 'user', 'GETPOST', FILTER_SANITIZE_STRING);\n $currentFunc = FormUtil::getPassedValue('func', 'main', 'GETPOST', FILTER_SANITIZE_STRING);\n $dom = ZLanguage::getModuleDomain('MUTicket');\n if ($currentType == 'admin') {\n if (in_array($currentFunc, array('main', 'view'))) {\n /* $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'preview',\n 'linkTitle' => __('Open preview page', $dom),\n 'linkText' => __('Preview', $dom)\n );*/\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'display',\n 'linkTitle' => str_replace('\"', '', $this['title']),\n 'linkText' => __('Details', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n $component = 'MUTicket:CurrentState:';\n $instance = $this->id . '::';\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'edit',\n 'linkTitle' => __('Edit', $dom),\n 'linkText' => __('Edit', $dom)\n );\n /* $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'astemplate' => $this['id'])),\n 'icon' => 'saveas',\n 'linkTitle' => __('Reuse for new item', $dom),\n 'linkText' => __('Reuse', $dom)\n );*/\n }\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_DELETE)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'delete', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'delete',\n 'linkTitle' => __('Delete', $dom),\n 'linkText' => __('Delete', $dom)\n );\n }\n }\n if ($currentFunc == 'display') {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'view', 'arguments' => array('ot' => 'currentState')),\n 'icon' => 'back',\n 'linkTitle' => __('Back to overview', $dom),\n 'linkText' => __('Back to overview', $dom)\n );\n }\n }\n if ($currentType == 'user') {\n if (in_array($currentFunc, array('main', 'view'))) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'display',\n 'linkTitle' => str_replace('\"', '', $this['title']),\n 'linkText' => __('Details', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n $component = 'MUTicket:CurrentState:';\n $instance = $this->id . '::';\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'edit',\n 'linkTitle' => __('Edit', $dom),\n 'linkText' => __('Edit', $dom)\n );\n /* $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'edit', 'arguments' => array('ot' => 'currentState', 'astemplate' => $this['id'])),\n 'icon' => 'saveas',\n 'linkTitle' => __('Reuse for new item', $dom),\n 'linkText' => __('Reuse', $dom)\n );*/\n }\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_DELETE)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'delete', 'arguments' => array('ot' => 'currentState', 'id' => $this['id'])),\n 'icon' => 'delete',\n 'linkTitle' => __('Delete', $dom),\n 'linkText' => __('Delete', $dom)\n );\n }\n }\n if ($currentFunc == 'display') {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'view', 'arguments' => array('ot' => 'currentState')),\n 'icon' => 'back',\n 'linkTitle' => __('Back to overview', $dom),\n 'linkText' => __('Back to overview', $dom)\n );\n }\n }\n }", "public function process_bulk_action() \n\t{\n\t\t$action = $this->current_action();\n\t\t\n\t\tif ( $action and array_key_exists( $action, $this->bulkActions ) )\n\t\t{\n\t\t\t$class = $this->activeRecordClass;\n\t\t\tforeach( $_POST[ 'item' ] as $item_id )\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$item = $class::load( $item_id );\n\t\t\t\t\tif ( is_callable( array( $item, $action ) ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tcall_user_func( array( $item, $action ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch( \\Exception $e ) { }\n\t\t\t}\n\t\t}\n\t}", "public function massaction($observer)\n {\n if (!Mage::helper('simple_relevance')->enabled()) {\n return $this;\n }\n\n $block = $observer->getEvent()->getBlock();\n $action = $block->getRequest()->getControllerName();\n\n if (get_class($block) == 'Mage_Adminhtml_Block_Widget_Grid_Massaction') {\n $this->_block = $block;\n\n switch ($action) {\n case 'customer':\n $this->_addMassItem('massCustomer');\n break;\n case 'catalog_product':\n $this->_addMassItem('massInventory');\n break;\n case 'sales_order':\n $this->_addMassItem('massOrder');\n break;\n }\n }\n\n return $observer;\n }", "public function executeAction() {\r\n\t\t\r\n\t}", "function process_bulk_action() {\r\n if( 'apporve'===$this->current_action() ) {\r\n wp_die('Items deleted (or they would be if we had items to delete)!');\r\n }\r\n elseif( 'reject'===$this->current_action() ) {\r\n wp_die('Items deleted (or they would be if we had items to delete)!');\r\n }\r\n \r\n }", "public function process_bulk_action()\n {\n if ('update' === $this->current_action()) {\n wp_die('Items deleted (or they would be if we had items to delete)!');\n }\n }", "public function setup_actions() {}", "public function paroleAction() {\n\t\t \t\t\t\t\n\t\t\n\t}", "protected function bulk_actions($which = '')\n {\n }", "protected function _addMassactions()\r\n {\r\n// $this\r\n// ->_addMassaction('delete', [\r\n// 'label' => Lang::get('general.delete'),\r\n// 'url' => URL::route('users.mass-delete'),\r\n// 'confirm' => Lang::get('general.are_you_sure'),\r\n// ]);\r\n }", "function mass_actions () {\n\t\t$OBJECT_NAME\t= \"help\";\n\n\t\tif (isset($_POST[\"delete\"])) {\n\t\t\t$CURRENT_OPERATION = \"delete\";\n\t\t} elseif (isset($_POST[\"close\"])) {\n\t\t\t$CURRENT_OPERATION = \"close\";\n\t\t} elseif (isset($_POST[\"activate\"])) {\n\t\t\t$CURRENT_OPERATION = \"activate\";\n\t\t} elseif (isset($_POST[\"mass_reply\"])) {\n\t\t\t$CURRENT_OPERATION = \"mass_reply\";\n\t\t}\n\t\t// Check if we determine current operation\n\t\tif (empty($CURRENT_OPERATION)) {\n\t\t\treturn _e(\"Please select operation\");\n\t\t}\n\t\t// Prepare ads ids\n\t\tforeach ((array)$_POST[\"items\"] as $cur_id) {\n\t\t\t$cur_id = intval($cur_id);\n\t\t\tif (empty($cur_id)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$items_ids[$cur_id] = $cur_id;\n\t\t}\n\t\t// Get tickets\n\t\tif (!empty($items_ids)) {\n\t\t\t$Q = db()->query(\"SELECT * FROM \".db('help_tickets').\" WHERE id IN(\".implode(\",\", $items_ids).\")\");\n\t\t\twhile ($A = db()->fetch_assoc($Q)) {\n\t\t\t\t$tickets_infos[$A[\"id\"]]\t= $A;\n\t\t\t\t$emails[$A[\"email\"]]\t\t= _es($A[\"email\"]);\n\t\t\t}\n\t\t}\n\t\t// Get users details\n\t\tif (!empty($emails)) {\n\t\t\t$Q = db()->query(\"SELECT * FROM \".db('user').\" WHERE email IN('\".implode(\"','\", $emails).\"')\");\n\t\t\twhile ($A = db()->fetch_assoc($Q)) {\n\t\t\t\t$users_infos[$A[\"email\"]] = $A;\n\t\t\t}\n\t\t}\n\t\t// Do get current admin info\n\t\t$admin_info = db()->query_fetch(\"SELECT * FROM \".db('admin').\" WHERE id=\".intval($_SESSION[\"admin_id\"]));\n\t\t$admin_name = $admin_info[\"first_name\"].\" \".$admin_info[\"last_name\"];\n\t\t// Switch between operation\n\t\t// ###########################################\n\t\tif ($CURRENT_OPERATION == \"delete\") {\n\n\t\t\tif (!empty($items_ids)) {\n\t\t\t\tdb()->query(\"DELETE FROM \".db('help_tickets').\" WHERE id IN(\".implode(\",\",$items_ids).\")\");\n\t\t\t}\n\n\t\t// ###########################################\n\t\t} elseif ($CURRENT_OPERATION == \"close\") {\n\n\t\t\tif (!empty($items_ids)) {\n\t\t\t\tdb()->query(\"UPDATE \".db('help_tickets').\" SET status='closed' WHERE id IN(\".implode(\",\",$items_ids).\")\");\n\t\t\t}\n\n\t\t// ###########################################\n\t\t} elseif ($CURRENT_OPERATION == \"activate\") {\n\n\t\t\tforeach ((array)$tickets_infos as $_id => $_ticket_info) {\n\t\t\t\t$user_info = $users_infos[$_ticket_info[\"email\"]];\n\t\t\t\tif (empty($user_info) \n\t\t\t\t\t|| $user_info[\"is_deleted\"] == 1\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Do activate user's account\n\t\t\t\tdb()->query(\"UPDATE \".db('user').\" SET active='1' WHERE id=\".intval($user_info[\"id\"]));\n\t\t\t\t// Prepare email\n\t\t\t\t$replace = array(\n\t\t\t\t\t\"user_name\"\t\t=> _prepare_html(_display_name($user_info)),\n\t\t\t\t\t\"user_login\"\t=> _prepare_html($user_info[\"login\"]),\n\t\t\t\t\t\"user_password\"\t=> _prepare_html($user_info[\"password\"]),\n\t\t\t\t);\n\t\t\t\t$message = tpl()->parse($_GET[\"object\"].\"/email_on_auto_activate\", $replace);\n\t\t\t\t// Do send mail\n\t\t\t\t$from_name = $this->ADD_ADMIN_NAME ? \"Admin \".SITE_ADVERT_NAME : SITE_ADMIN_NAME;\n\t\t\t\t$send_result = common()->send_mail(SITE_ADMIN_EMAIL_ADV, $from_name, $_ticket_info[\"email\"], $_ticket_info[\"email\"], \"Help ticket answer\", $message, nl2br($message));\n\t\t\t\t// Close ticket\n\t\t\t\tdb()->query(\"UPDATE \".db('help_tickets').\" SET status='closed' WHERE id=\".intval($_ticket_info[\"id\"]));\n\t\t\t\t// Do not close ticket if we have troubles with sending email\n\t\t\t\tif ($send_result) {\n\t\t\t\t} else {\n\t\t\t\t\t// comment that we have trouble with sending email\n\t\t\t\t\t$messqge = \"Error with sending confirmation email to user\";\n\t\t\t\t}\n\t\t\t\t// Add comment\n\t\t\t\tdb()->INSERT(\"comments\", array(\n\t\t\t\t\t\"object_name\"\t\t=> _es(\"help\"),\n\t\t\t\t\t\"object_id\"\t\t\t=> intval($_ticket_info[\"id\"]),\n\t\t\t\t\t\"user_id\"\t\t\t=> 0,\n\t\t\t\t\t\"user_name\"\t\t\t=> _es(\"Admin: \".$admin_name),\n\t\t\t\t\t\"text\" \t\t\t\t=> _es($message),\n\t\t\t\t\t\"add_date\"\t\t\t=> time(),\n\t\t\t\t\t\"active\"\t\t\t=> 1,\n\t\t\t\t));\n\t\t\t}\n\n\t\t// ###########################################\n\t\t} elseif ($CURRENT_OPERATION == \"mass_reply\") {\n\n\t\t\t// Get first site info\n\t\t\tif (is_array(_class('sites_info')->info))\t{\n\t\t\t\t$FIRST_SITE_INFO = array_shift(_class('sites_info')->info);\n\t\t\t}\n\t\t\t$processed_tickets_ids = array();\n\t\t\t// Process selected tickets\n\t\t\tforeach ((array)$tickets_infos as $_id => $_ticket_info) {\n\t\t\t\t// Prepare ticket id\n\t\t\t\t$TICKET_ID = $_ticket_info[\"ticket_key\"];\n// TODO: need to do something when text is empty\n\t\t\t\t// Prepare text to replay\n\t\t\t\t$replace_pairs = array(\n\t\t\t\t\t'%%user_name%%'\t\t=> !empty($user_info) ? _display_name($user_info) : $_ticket_info[\"name\"],\n\t\t\t\t\t'%%account_type%%'\t=> !empty($user_info) ? $this->_account_types[$user_info[\"group\"]] : \"\",\n\t\t\t\t);\n\t\t\t\t$PREPARED_TEXT = str_replace(\n\t\t\t\t\tarray_keys($replace_pairs), \n\t\t\t\t\tarray_values($replace_pairs), \n\t\t\t\t\t$_POST[\"reply_text\"]\n\t\t\t\t);\n\t\t\t\t// Do insert record\n\t\t\t\tdb()->INSERT(\"comments\", array(\n\t\t\t\t\t\"object_name\"\t\t=> _es($OBJECT_NAME),\n\t\t\t\t\t\"object_id\"\t\t\t=> intval($_ticket_info[\"id\"]),\n\t\t\t\t\t\"user_id\"\t\t\t=> 0,\n\t\t\t\t\t\"user_name\"\t\t\t=> _es(\"Admin: \".$admin_name),\n\t\t\t\t\t\"text\" \t\t\t\t=> _es($PREPARED_TEXT),\n\t\t\t\t\t\"add_date\"\t\t\t=> time(),\n\t\t\t\t\t\"active\"\t\t\t=> 1,\n\t\t\t\t));\n\t\t\t\t$RECORD_ID = db()->INSERT_ID();\n\t\t\t\t// Add activity points for registered user if needed\n\t\t\t\tif (!empty($_ticket_info[\"user_id\"])) {\n\t\t\t\t\tcommon()->_add_activity_points($_ticket_info[\"user_id\"], \"bug_report\", 1000, $RECORD_ID);\n\t\t\t\t}\n\t\t\t\t$replace = array(\n\t\t\t\t\t\"name\"\t\t\t\t=> _prepare_html($_ticket_info[\"name\"]),\n\t\t\t\t\t\"site_name\"\t\t\t=> _prepare_html($FIRST_SITE_INFO[\"name\"]),\n\t\t\t\t\t\"author_name\"\t\t=> _prepare_html($this->ADD_ADMIN_NAME ? SITE_ADVERT_NAME.\" Admin \".$admin_name : SITE_ADMIN_NAME),\n\t\t\t\t\t\"text\"\t\t\t\t=> _prepare_html($PREPARED_TEXT),\n\t\t\t\t\t\"ticket_id\"\t\t\t=> _prepare_html($TICKET_ID),\n\t\t\t\t\t\"ticket_url\"\t\t=> process_url(\"./?object=help&action=view_answers&id=\".$TICKET_ID, 1, $_ticket_info[\"site_id\"]),\n\t\t\t\t\t\"request_subject\"\t=> _prepare_html($_ticket_info[\"subject\"]),\n\t\t\t\t\t\"request_message\"\t=> _prepare_html($_ticket_info[\"message\"]),\n\t\t\t\t);\n\t\t\t\t$text\t\t= tpl()->parse($_GET[\"object\"].\"/email_to_user\", $replace);\n\t\t\t\t$email_from\t= SITE_ADMIN_EMAIL;\n\t\t\t\t$name_from\t= $this->ADD_ADMIN_NAME ? SITE_ADVERT_NAME.\" Admin \".$admin_name : SITE_ADMIN_NAME;\n\t\t\t\t$email_to\t= $_ticket_info[\"email\"];\n\t\t\t\t$name_to\t= _prepare_html($_ticket_info[\"name\"]);\n\t\t\t\t$subject\t= \"Response to support ticket #\".$TICKET_ID;\n\t\t\t\t$send_result= common()->send_mail($email_from, $name_from, $email_to, $name_to, $subject, $text, nl2br($text));\n\t\t\t\t// Store processed tickets ids\n\t\t\t\t$processed_tickets_ids[$_ticket_info[\"id\"]] = $_ticket_info[\"id\"];\n\t\t\t}\n\t\t\t// Mass change status on reply\n\t\t\tif (!empty($processed_tickets_ids)) {\n\t\t\t\tdb()->query(\n\t\t\t\t\t\"UPDATE \".db('help_tickets').\" \n\t\t\t\t\tSET status = '\".(!empty($_POST[\"reply_close\"]) ? \"closed\" : \"read\").\"' \n\t\t\t\t\tWHERE id IN(\".implode(\",\", $processed_tickets_ids).\")\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t// ###########################################\n\t\t}\n\t\treturn js_redirect($_SERVER[\"HTTP_REFERER\"], 0);\n\t}", "public function bulkAction()\r\n {\r\n $this->checkIfDemo();\r\n $this->AdminJobModel->bulkAction();\r\n }", "private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}", "public function prepare_items() {\n\t\t/** Process bulk action */\n\t\t$this->process_bulk_action();\n\n\t\t$columns = $this->get_columns();\n $hidden = $this->get_hidden_columns();\n $sortable = $this->get_sortable_columns();\n $this->_column_headers = array($columns, $hidden, $sortable);\n\n\t\t$per_page = $this->get_items_per_page( 'posts_per_page', 20 );\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = self::record_count();\n\n\t\t$this->set_pagination_args( [\n\t\t\t'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t\t'per_page' => $per_page //WE have to determine how many items to show on a page\n\t\t] );\n\n\t\t$this->items = self::get_posts( $per_page, $current_page );\n\t}", "public function executeActions(){\n\t\tif(!isset($this->request['do'])) return;\n\t\t\n\t\tif(!is_array($this->request['do'])){\n\t\t\t$this->request['do'] = array($this->request['do']);\n\t\t}\n\t\t\n\t\tforeach($this->request['do'] as $action){\n\t\t\t$this->action_response = array();\n\t\t\t$method = \"action_\" . $action;\n\t\t\tif(method_exists($this, $method)){\n\t\t\t\t$player_id = null;\n\t\t\t\t$game_id = null;\n\t\t\t\tif(is_object($this->session->me)) $player_id = $this->session->me->getID();\n\t\t\t\tif(is_object($this->game)) $game_id = $this->game->getID();\n\t\t\t\t$sql = new SqlManager();\n\t\t\t\t$new = array( \"action_date\" => date(\"Y-m-d H:i:s\", time()), \"action_name\" => $action, \"action_game\" => $game_id, \"action_player\" => $player_id );\n\t\t\t\t$sql->insert(\"action\", $new);\n\t\t\t\t$this->action_response[$action] = $this->$method($sql->getLastInsertID());\n\t\t\t}\n\t\t}\n\t}", "public function gridAction() {\n $this->loadLayout(false)\n ->renderLayout();\n }", "public function process() {\r\n if(!in_array($this->getRouter()->getAction(), $this->getAllowActions()) || $this->getRouter()->getAction() == null) {\r\n $this->defaultAction();\r\n } else {\r\n $customAction = $this->getRouter()->getAction().Globals::getConfig()->action->suffix;\r\n $this->$customAction();\r\n }\r\n }", "function Prepare()\r\n\t{\r\n\t\tif (!$this->Active) return;\r\n\r\n\t\t$act = Server::GetState($this->Name.'_action');\r\n\r\n\t\tif ($this->sorting == ED_SORT_TABLE)\r\n\t\t\t$this->sort = array(Server::GetVar('sort', $this->ds->id) =>\r\n\t\t\t\tServer::GetVar('order', 'ASC'));\r\n\r\n\t\t$this->state = $act == 'edit' ? STATE_EDIT : STATE_CREATE;\r\n\r\n\t\tif ($act == 'Cancel') $this->Reset();\r\n\r\n\t\tif ($act == 'Create')\r\n\t\t{\r\n\t\t\t$insert = array();\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = isset($child_id) ? $this->ds->children[$child_id] : $this;\r\n\r\n\t\t\t$fields = $context->ds->FieldInputs;\r\n\t\t\tforeach ($fields as $col => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in))\r\n\t\t\t\t{\r\n\t\t\t\t\t$value = Server::GetVar($this->Name.'_'.$col);\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'date')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$insert[$col] = date('Y-m-d', strtotime($value));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if($in->attr('TYPE') == 'datetime')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($value[5][0] == 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//time is in PM\r\n\t\t\t\t\t\t\tif($value[3][0] != 12) $value[3][0] += 12;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$time_portion = \" {$value[3][0]}:{$value[4][0]}:00\";\r\n\t\t\t\t\t\t$insert[$col] = $value[2].'-'.$value[0].'-'.$value[1].$time_portion;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'password' && strlen($value) > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$insert[$col] = md5($value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (empty($value['tmp_name'])) continue;\r\n\t\t\t\t\t\t$ext = strrchr($value['name'], '.');\r\n\r\n\t\t\t\t\t\t# We move files later because we do not have enough\r\n\t\t\t\t\t\t# data to decide where to put them or what to name them.\r\n\r\n\t\t\t\t\t\t$files[] = array(\r\n\t\t\t\t\t\t\t'src' => $value['tmp_name'],\r\n\t\t\t\t\t\t\t'dst' => $in->attr('VALUE')\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t//$insert[$col] = $ext;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'selects') $insert[$col] = $value;\r\n\t\t\t\t\telse $insert[$col] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telse if (is_numeric($col)) continue;\r\n\t\t\t\telse $insert[$col] = Database::SqlUnquote($in);\r\n\t\t\t\t//I just changed this to 'else' (check the history), because a\r\n\t\t\t\t//numeric value with a string column would not go in eg. 5\r\n\t\t\t\t//instead of '5', if this ends up conflicting, we'll need to\r\n\t\t\t\t//come up with a different solution.\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t{\r\n\t\t\t\tif (!$handler->Create($this, $insert)) { $this->Reset(); return; }\r\n\t\t\t}\r\n\r\n\t\t\t$parent = Server::GetVar('parent');\r\n\r\n\t\t\tif (isset($parent))\r\n\t\t\t{\r\n\t\t\t\t$child = $this->ds->children[Server::GetVar('child')];\r\n\t\t\t\t$insert[$child->child_key] = $parent;\r\n\t\t\t}\r\n\r\n\t\t\t$id = $context->ds->Add($insert);\r\n\t\t\t$insert[$context->ds->id] = $id;\r\n\r\n\t\t\t# Handle all uploads\r\n\r\n\t\t\tif (!empty($files))\r\n\t\t\t{\r\n\t\t\t\t$vp = new VarParser();\r\n\t\t\t\tforeach ($files as $file)\r\n\t\t\t\t{\r\n\t\t\t\t\t# Handler associated\r\n\t\t\t\t\tif (is_object($file['dst']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$file['dst']->Create($file['src'], $insert);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse # Move uploaded file\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$dst = $vp->ParseVars($file['dst'], $insert);\r\n\t\t\t\t\t\tmove_uploaded_file($file['src'], $dst);\r\n\t\t\t\t\t\tchmod($dst, 0777);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t$handler->Created($this, $id, $insert);\r\n\r\n\t\t\t$this->Reset();\r\n\t\t}\r\n\r\n\t\telse if ($act == 'Update')\r\n\t\t{\r\n\t\t\t$ci = Server::GetVar('ci');\r\n\r\n\t\t\tif ($this->type == CONTROL_SIMPLE)\r\n\t\t\t{\r\n\t\t\t\tforeach (array_keys($this->ds->FieldInputs) as $name)\r\n\t\t\t\t{\r\n\t\t\t\t\t$vals[$name] = Server::GetVar($name);\r\n\t\t\t\t}\r\n\t\t\t\t$fp = fopen($ci, 'w+');\r\n\t\t\t\tfwrite($fp, serialize($vals));\r\n\t\t\t\tfclose($fp);\r\n\t\t\t}\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = $child_id != null ? $this->ds->children[$child_id] : $this;\r\n\t\t\t$update = array();\r\n\t\t\tforeach ($context->ds->FieldInputs as $col => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (get_class($in) == 'FieldInput' && $in->type == 'label') continue;\r\n\r\n\t\t\t\t\t$value = Server::GetVar($this->Name.'_'.$col);\r\n\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'date')\r\n\t\t\t\t\t\t$update[$col] = date('Y-m-d', strtotime($value));\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'datetime')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($value[5][0] == 1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//time is in PM\r\n\t\t\t\t\t\t\tif ($value[3][0] != 12) $value[3][0] += 12;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$time_portion = \" {$value[3][0]}:{$value[4][0]}:00\";\r\n\t\t\t\t\t\t$update[$col] = $value[2].'-'.$value[0].'-'.$value[1].$time_portion;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'label')\r\n\t\t\t\t\t\tunset($update[$col]);\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'password')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!empty($value)) $update[$col] = md5($value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'checkbox')\r\n\t\t\t\t\t\t$update[$col] = ($value == 1) ? 1 : 0;\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'selects')\r\n\t\t\t\t\t\t$update[$col] = $value;\r\n\t\t\t\t\telse if ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!empty($value['tmp_name']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$vp = new VarParser();\r\n\t\t\t\t\t\t\t$src = $value['tmp_name'];\r\n\t\t\t\t\t\t\t$vars = $update;\r\n\t\t\t\t\t\t\t$vars[$this->ds->id] = $ci;\r\n\t\t\t\t\t\t\t$val = $in->attr('VALUE');\r\n\r\n\t\t\t\t\t\t\t# File Handler\r\n\t\t\t\t\t\t\tif (is_object($val)) $val->Update($src, $vars);\r\n\t\t\t\t\t\t\telse # String Based\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$dst = $vp->ParseVars($val, $vars);\r\n\t\t\t\t\t\t\t\tmove_uploaded_file($src, $dst);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tunset($update[$col]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse $update[$col] = $value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (count($this->handlers) > 0)\r\n\t\t\t{\r\n\t\t\t\t$q['match'][$this->ds->id] = $ci;\r\n\t\t\t\t$data = $this->ds->GetOne($q);\r\n\t\t\t\t$update[$this->ds->id] = $ci;\r\n\t\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t{\r\n\t\t\t\t\t$res = $handler->Update($this, $ci, $data, $update);\r\n\t\t\t\t\t// Returns false, simple failure.\r\n\t\t\t\t\tif (!$res) { $this->Reset(); return; }\r\n\t\t\t\t\t// Returns an array of errors.\r\n\t\t\t\t\tif (is_array($res))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->state = STATE_EDIT;\r\n\t\t\t\t\t\t$this->Errors = $res;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($this->type == CONTROL_BOUND)\r\n\t\t\t\t$context->ds->Update(array($context->ds->id => $ci), $update);\r\n\r\n\t\t\t$this->Reset();\r\n\t\t}\r\n\r\n\t\telse if ($act == 'delete')\r\n\t\t{\r\n\t\t\t$ci = Server::GetState($this->Name.'_ci');\r\n\r\n\t\t\t$child_id = Server::GetVar('child');\r\n\t\t\t$context = isset($child_id) ? $this->ds->children[$child_id] : $this;\r\n\r\n\t\t\t$data = $context->ds->GetOne(array($context->ds->id => $ci));\r\n\r\n\t\t\tif (count($this->handlers) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach ($this->handlers as $handler)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!$handler->Delete($this, $ci, $data)) return;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!empty($context->ds->FieldInputs))\r\n\t\t\tforeach ($context->ds->FieldInputs as $name => $in)\r\n\t\t\t{\r\n\t\t\t\tif (is_object($in) && strtolower(get_class($in)) == 'forminput')\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($in->attr('TYPE') == 'file')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$vp = new VarParser();\r\n\t\t\t\t\t\t$val = $in->attr('VALUE');\r\n\t\t\t\t\t\t# File handler\r\n\t\t\t\t\t\tif (is_object($val))\r\n\t\t\t\t\t\t\t$val->Delete($data);\r\n\t\t\t\t\t\telse # Regular string file\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$files = glob($vp->ParseVars($val, $data).\".*\");\r\n\t\t\t\t\t\t\tforeach ($files as $file) unlink($file);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$context->ds->Remove(array($context->ds->id => $ci));\r\n\t\t}\r\n\r\n\t\tif ($this->type == CONTROL_SIMPLE)\r\n\t\t{\r\n\t\t\t$ci = Server::GetState($this->Name.'_ci');\r\n\r\n\t\t\tif (file_exists($ci))\r\n\t\t\t\t$this->values = unserialize(file_get_contents($ci));\r\n\t\t\telse\r\n\t\t\t\t$this->values = array();\r\n\t\t}\r\n\t}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "function _prepare() {\n\t\tif (!in_array($this->action, $this->unprotected_actions) && !isset($_SESSION['admin'])) {\n\t\t\t$this->session('return_to', $this->route);\n\t\t\t$this->redirect('admin/index');\n\t\t}\n\t}", "protected function _prepareMassaction()\n {\n if (Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion()) {\n $this->setMassactionIdField('version_id');\n $this->getMassactionBlock()->setFormFieldName('version');\n\n $this->getMassactionBlock()->addItem('delete', array(\n 'label' => Mage::helper('gri_cms')->__('Delete'),\n 'url' => $this->getUrl('*/*/massDeleteVersions', array('_current' => true)),\n 'confirm' => Mage::helper('gri_cms')->__('Are you sure?'),\n 'selected' => true,\n ));\n }\n return $this;\n }", "function process_bulk_action() {\n global $catpdf_templates;\n if ('delete' === $this->current_action()) {\n if (count($_POST['template']) > 0) {\n foreach ($_POST['template'] as $template) {\n $catpdf_templates->delete_template($template);\n }\n }\n }\n }", "protected function initializeAction() {\n\t\t/* Merge flexform and setup settings\n\t\t * \n\t\t */\n\t\t$this->settings['action'] = $this->actionMethodName;\n\t}", "function execute()\r\n\t\t{\r\n\t\t\tforeach($this->data as $actionType => $action)\r\n\t\t\t{\r\n\t\t\t\tif(isset($actionType)) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tswitch($actionType)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcase \"destroy\":\r\n\t\t\t\t\t\t\t\t$this->remove($action);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}catch(Exception $e) {\r\n\t\t\t\t\t\tdump('item module error', 'item module error');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function setAllAction($action){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('UPDATE bot_action SET action = :action');\n\t\t$statement->execute(array(':action'=>$action));\n\t}", "function process_bulk_action()\n {\n global $wpdb;\n $table_name = $wpdb->prefix . 'google_location_form'; // do not forget about tables prefix\n\n if ('delete' === $this->current_action()) {\n $ids = isset($_REQUEST['id']) ? $_REQUEST['id'] : array();\n if (is_array($ids)) $ids = implode(',', $ids);\n\n if (!empty($ids)) {\n $wpdb->query(\"DELETE FROM $table_name WHERE id IN($ids)\");\n }\n }\n }", "public function xactions() {\n\t\t\n\t\t/* Load Model */\n\t\t$actions = $this->getModel ( 'action' );\n\t\t\n\t\t/* Get all rows */\n\t\t$actions->getAll ( 'form_id = \"' . $this->_getFormId () . '\"' );\n\t\t\n\t\tif (! count ( $actions->rows )) {\n\t\t\t$this->_redirect ( '_newAction' );\n\t\t\treturn;\n\t\t}\n\t\t/* set the view file (optional) */\n\t\t$this->setView ( 'actions' );\n\t\t\n\t\t/* set last view into session */\n\t\t$this->session->returnto ( $this->getView () );\n\t}", "protected function get_bulk_actions() {\n\t\t// We don't want bulk actions, we have our own UI\n\t\treturn array();\n\t}", "protected function initializeActionEntries() {}", "public function\n\t\tdo_actions()\n\t{\n\t}", "protected function _addMassItem($action)\n {\n $this->_block->addItem('simple_relevance_send', array(\n 'label' => Mage::helper('simple_relevance')->__('Send to SimpleRelevance'),\n 'url' => Mage::helper('adminhtml')->getUrl(\"simple_relevance/adminhtml_export/{$action}\")\n ));\n }", "public function admin_table_bulk_actions($actions)\n {\n }", "protected function prepareItemActions()\n {\n if (!empty($this->_actions)) {\n return;\n }\n \n $currentType = FormUtil::getPassedValue('type', 'user', 'GETPOST', FILTER_SANITIZE_STRING);\n $currentFunc = FormUtil::getPassedValue('func', 'main', 'GETPOST', FILTER_SANITIZE_STRING);\n $dom = ZLanguage::getModuleDomain('SurveyManager');\n if ($currentType == 'admin') {\n if (in_array($currentFunc, array('main', 'view'))) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'survey', 'id' => $this['id'], 'slug' => $this->slug)),\n 'icon' => 'preview',\n 'linkTitle' => __('Open preview page', $dom),\n 'linkText' => __('Preview', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n $component = 'SurveyManager:Survey:';\n $instance = $this->id . '::';\n if (SecurityUtil::checkPermission($component, $instance, ACCESS_EDIT)) {\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'survey', 'id' => $this['id'])),\n 'icon' => 'edit',\n 'linkTitle' => __('Edit', $dom),\n 'linkText' => __('Edit', $dom)\n );\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => array('ot' => 'survey', 'astemplate' => $this['id'])),\n 'icon' => 'saveas',\n 'linkTitle' => __('Reuse for new item', $dom),\n 'linkText' => __('Reuse', $dom)\n );\n }\n }\n \n // more actions for adding new related items\n $authAdmin = SecurityUtil::checkPermission($component, $instance, ACCESS_ADMIN);\n \n $uid = UserUtil::getVar('uid');\n if ($authAdmin || (isset($uid) && isset($this->createdUserId) && $this->createdUserId == $uid)) {\n \n $urlArgs = array('ot' => 'page',\n 'survey' => $this->id);\n if ($currentFunc == 'view') {\n $urlArgs['returnTo'] = 'adminViewSurvey';\n } elseif ($currentFunc == 'display') {\n $urlArgs['returnTo'] = 'adminDisplaySurvey';\n }\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => $urlArgs),\n 'icon' => 'add',\n 'linkTitle' => __('Create page', $dom),\n 'linkText' => __('Create page', $dom)\n );\n \n $urlArgs = array('ot' => 'response',\n 'survey' => $this->id);\n if ($currentFunc == 'view') {\n $urlArgs['returnTo'] = 'adminViewSurvey';\n } elseif ($currentFunc == 'display') {\n $urlArgs['returnTo'] = 'adminDisplaySurvey';\n }\n $this->_actions[] = array(\n 'url' => array('type' => 'admin', 'func' => 'edit', 'arguments' => $urlArgs),\n 'icon' => 'add',\n 'linkTitle' => __('Create response', $dom),\n 'linkText' => __('Create response', $dom)\n );\n }\n }\n if ($currentType == 'user') {\n if (in_array($currentFunc, array('main', 'view'))) {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'display', 'arguments' => array('ot' => 'survey', 'id' => $this['id'], 'slug' => $this->slug)),\n 'icon' => 'display',\n 'linkTitle' => str_replace('\"', '', $this->getTitleFromDisplayPattern()),\n 'linkText' => __('Details', $dom)\n );\n }\n if (in_array($currentFunc, array('main', 'view', 'display'))) {\n }\n if ($currentFunc == 'display') {\n $this->_actions[] = array(\n 'url' => array('type' => 'user', 'func' => 'view', 'arguments' => array('ot' => 'survey')),\n 'icon' => 'back',\n 'linkTitle' => __('Back to overview', $dom),\n 'linkText' => __('Back to overview', $dom)\n );\n }\n }\n }", "function bulk_actions() {\n\t\t$screen = get_current_screen();\n\n\t\tif ( is_null( $this->_actions ) ) {\n\t\t\t$no_new_actions = $this->_actions = $this->get_bulk_actions();\n\t\t\t// This filter can currently only be used to remove actions.\n\t\t} else {\n\t\t\t$two = '2';\n\t\t}\n\n\t\tif ( empty( $this->_actions ) )\n\t\t\treturn;\n\n\t\techo \"<select name='ep-reg-bulk[action$two]'>\\n\";\n\t\techo \"<option value='-1' selected='selected'>\" . __( 'Bulk Actions' ) . \"</option>\\n\";\n\t\tforeach ( $this->_actions as $name => $title )\n\t\t\techo \"\\t<option value='$name'>$title</option>\\n\";\n\t\techo \"</select>\\n\";\n\n\t\tsubmit_button( __( 'Apply' ), 'button-secondary action', false, false, array( 'id' => \"ep-bulk-reg-doaction$two\" ) );\n\t\techo \"\\n\";\n\t}", "public function pesquisarAction() {\r\n \r\n }", "abstract public function mass_update();", "public function prepare_items() {\n\n\t\t\t$columns = $this->get_columns();\n\n\t\t\t$hidden = array(); // No hidden columns\n\n\t\t\t$sortable = $this->get_sortable_columns();\n\n\t\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\n\n\n\t\t\t// Process bulk action\n\n\t\t\t$this->process_bulk_action();\n\n\n\n\t\t\t$current_page = $this->get_pagenum();\n\n\t\t\t$total_items = self::record_count();\n\n\n\n\t\t\t$this->items = self::get_topics( 20, $current_page );\n\n\n\n\t\t\t$this->set_pagination_args( [\n\n\t\t\t\t'total_items' => $total_items,\n\n\t\t\t\t'per_page' => 20\n\n\t\t\t] );\n\n\t\t}", "public function bulk_actions( $which = '' ) {\n\t\t//edd_log_views();\n\t}", "protected function createAction()\n {\n }", "protected function initAction()\n {\n }", "public function prepare_items()\r\r\n {\r\r\n\r\r\n $this->_column_headers = $this->get_column_info();\r\r\n\r\r\n /** Process bulk action */\r\r\n //\t$this->process_bulk_action();\r\r\n $per_page = $this->get_items_per_page('data_logs_per_page', 5);\r\r\n $current_page = $this->get_pagenum();\r\r\n $total_items = self::record_count();\r\r\n $this->set_pagination_args(array(\r\r\n 'total_items' => $total_items,\r\r\n 'per_page' => $per_page,\r\r\n ));\r\r\n\r\r\n $this->items = self::get_Data($per_page, $current_page);\r\r\n }", "public function allAction() {}", "public function tempAction()\n\t{\n\t}", "public function prepare()\n {\n $this->getInstruction()->execute();\n }", "public function prepare_items() {\n\n\t\t$columns = $this->get_columns();\n\t\t$hidden = get_hidden_columns( $this->screen );\n \t\t$sortable = $this->get_sortable_columns();\n \t\t$this->_column_headers = array($columns, $hidden, $sortable);\n \t\t//$this->_column_headers = $this->get_column_info();\n\t\t/** Process bulk action */\n\t\t$this->process_bulk_action();\n\n\t\t$per_page = $this->get_items_per_page( 'transactions_per_page', 10 );\n\t\t$current_page = $this->get_pagenum();\n\t\t$total_items = self::record_count();\n\n\t\t$this->set_pagination_args( array(\n\t\t\t'total_items' => $total_items, //WE have to calculate the total number of items\n\t\t\t'per_page' => $per_page //WE have to determine how many items to show on a page\n\t\t));\n\n\t\t$this->items = self::get_customers( $per_page, $current_page );\n\t}", "public function gridAction()\n {\n $this->loadLayout();\n $this->renderLayout();\n }", "public static function mla_admin_init_action( ) {\r\n\t\tself::$default_columns =& MLAQuery::$default_columns;\r\n\t\tself::$default_hidden_columns =& MLAQuery::$default_hidden_columns;\r\n\t\tself::$default_sortable_columns =& MLAQuery::$default_sortable_columns;\r\n\t}", "function _action($action)\n\t{\n\t // Lay input\n\t $ids = $this->uri->rsegment(3);\n\t $ids = (!$ids) ? $this->input->post('id') : $ids;\n\t $ids = (!is_array($ids)) ? array($ids) : $ids;\n\t\n\t // Thuc hien action\n\t foreach ($ids as $id)\n\t {\n\t // Xu ly id\n\t $id = (!is_numeric($id)) ? 0 : $id;\n\t \t\n\t // Kiem tra id\n\t $info = model('user_bank')->get_info($id);\n\t if (!$info) continue;\n\t \n\t // Chuyen den ham duoc yeu cau\n\t $this->{'_'.$action}($info);\n\t }\n\t}", "private function add_actions()\n {\n }", "public function prepare_items()\r\n {\r\n if( !count( $this->columns ) )\r\n $this->set_columns();\r\n\r\n $per_page = 20;\r\n\r\n $columns = $this->get_columns();\r\n $hidden = array();\r\n $sortable = $this->get_sortable_columns();\r\n\r\n $this->_column_headers = array( $columns, $hidden, $sortable );\r\n\r\n $this->process_bulk_action();\r\n\r\n $data = $this->values;\r\n\r\n usort( $data, array( $this, 'usort_reorder' ) );\r\n\r\n $current_page = $this->get_pagenum();\r\n\r\n $total_items = count( $data );\r\n\r\n $data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );\r\n\r\n $this->items = $data;\r\n\r\n if( $total_items > $per_page ) {\r\n $this->set_pagination_args( array(\r\n 'total_items' => $total_items,\r\n 'per_page' => $per_page,\r\n 'total_pages' => ceil( $total_items / $per_page ),\r\n ) );\r\n }\r\n }", "public function actions();", "public function run()\n {\n //\n DB::table('actions')->truncate();\n DB::table('actions')->insert([['action' => \"SEARCH\"],['action' => \"MAIL_DELETE\"],['action' => \"MAIL_FETCH\"]]);\n }", "public function gridtableAction()\n\t{\n\t\t$this->loadLayout();\n\t\t$this->renderLayout();\n\t\t\n\t}", "public function prepare_items()\n {\n $columns = $this->get_columns();\n $hidden = $this->get_hidden_columns();\n $sortable = $this->get_sortable_columns();\n $data = $this->table_data();\n usort( $data, array( &$this, 'sort_data' ) );\n $perPage = 10;\n $currentPage = $this->get_pagenum();\n $totalItems = count($data);\n $this->set_pagination_args( array(\n 'total_items' => $totalItems,\n 'per_page' => $perPage\n ) );\n $data = array_slice($data,(($currentPage-1)*$perPage),$perPage);\n $this->_column_headers = array($columns, $hidden, $sortable);\n $this->process_bulk_action();\n $this->items = $data;\n }", "protected function getActions() {}", "public function addShipmentGridMassActionAndColumns(Varien_Event_Observer $observer)\n {\n /** @var Mage_Adminhtml_Block_Sales_Shipment_Grid $block */\n $block = $observer->getBlock();\n if ($this->config->isEnabled()\n && $block instanceof Mage_Adminhtml_Block_Sales_Shipment_Grid\n && Mage::getSingleton('admin/session')->isAllowed('sales/shipment/create_hermes_shipments')\n ) {\n $block->getMassactionBlock()->addItem('cancelHermesParcels', array(\n 'label' => Mage::helper('hermes')->__('Cancel Hermes shipments'),\n 'url' => $block->getUrl('adminhtml/parcel/massCancel'),\n )\n );\n\n $logo = '<img src=\"' . $block->getSkinUrl('images/hermes/logo_small.png') .\n '\" alt=\"Hermes\" title=\"Hermes\" height=\"12\" align=\"top\" id=\"hermes_logo_small\" />';\n\n $block->addColumn('status_code', array(\n 'header' => $logo . Mage::helper('hermes')->__('Hermes Status'),\n 'index' => 'status_code',\n 'type' => 'options',\n 'options' => Mage::getSingleton('hermes/parcel')->getStatusCodes(),\n 'sortable' => true,\n 'is_system' => false,\n ));\n\n }\n return $this;\n }", "public function action(){\r\n\t\t\tif ( !isset($_GET['post_type']) || $_GET['post_type'] != 'shop_order' ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif ( isset($_GET['action']) && $_GET['action'] === $this->id) {\r\n\r\n\t\t\t\tif ( !check_admin_referer(\"bulk-posts\") ) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$data = $_REQUEST['post'];\r\n\t\t\t\t$this->do_action($data);\r\n\t\t\t}\r\n\t\t}", "public function sourcinggridAction() {\n\t\t\n\t\t$this->getLayout()->createBlock('dropship360/adminhtml_sourcing_grid')->toHtml();\n\t\t$this->loadLayout()->renderLayout();\n\t\t\n\t}", "public function sendAction() {\n\t\t$this->certificateAction(TRUE);\n\t\t$this->groupAction(TRUE);\n\t\t$this->statAction(TRUE);\n\t}", "protected function get_available_actions()\n {\n }", "protected function get_available_actions()\n {\n }", "protected function executeAction() {\r\n\t\t$this->objectAction->validateAction();\r\n\t\t$this->objectAction->executeAction();\r\n\t\t\r\n\t\t$this->handleResult();\r\n\t}", "protected function afterConstruct() {\n\t\t$current = strtolower(Yii::app()->controller->id.'/'.Yii::app()->controller->action->id);\n\t\tif(count($this->defaultColumns) == 0) {\n\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t'header' => 'No',\n\t\t\t\t'value' => '$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1'\n\t\t\t);\n\t\t\t$this->defaultColumns[] = 'title';\n\t\t\t//$this->defaultColumns[] = 'alias_url';\n\t\t\t$this->defaultColumns[] = 'description';\n\t\t\t$this->defaultColumns[] = 'image';\n\t\t\t//$this->defaultColumns[] = 'image_position';\n\t\t\t$this->defaultColumns[] = 'published';\n\t\t\t$this->defaultColumns[] = 'ordering';\n\t\t\t//$this->defaultColumns[] = 'access';\n\t\t\t//$this->defaultColumns[] = 'params';\n\t\t}\n\t\tparent::afterConstruct();\n\t}", "public function getMassactionBlockName()\n {\n return 'M2ePro/adminhtml_grid_massaction';\n }", "private function prepareColumns()\n {\n $readOnlyAttribute = $this->readOnlyAttribute;\n\n $columns = [];\n if ($this->canMove) {\n $columns[] = [\n 'class' => MovingColumn::className(),\n 'movingDisabledAttribute' => $readOnlyAttribute,\n ];\n }\n foreach ($this->columns as $column) {\n if (is_string($column)) {\n $column = ['attribute' => $column];\n }\n\n if (empty($column['class'])) {\n $column['class'] = isset($column['items']) ? DropdownInputColumn::className() : TextInputColumn::className();\n }\n\n if ($this->itemClass === null && empty($column['label'])) {\n $column['label'] = Inflector::camel2words($column['attribute'], true);\n }\n\n $column = array_merge([\n 'readOnlyAttribute' => $readOnlyAttribute,\n ], $column);\n\n $columns[] = $column;\n }\n\n if ($this->canRemove) {\n $columns[] = [\n 'class' => 'smart\\grid\\ActionColumn',\n 'options' => ['style' => 'width: 25px;'],\n 'template' => '{remove}',\n 'buttons' => [\n 'remove' => function ($url, $model, $key) use ($readOnlyAttribute) {\n $readOnly = false;\n if ($readOnlyAttribute !== null) {\n $readOnly = ArrayHelper::getValue($model, $readOnlyAttribute);\n }\n\n if ($readOnly) {\n return '';\n }\n\n return Html::a('<span class=\"fas fa-remove\"></span>', '#', [\n 'class' => 'item-remove',\n 'title' => $this->removeLabel,\n ]);\n },\n ],\n ];\n }\n\n $this->_columns = $columns;\n }" ]
[ "0.72056645", "0.68229085", "0.6796899", "0.6792566", "0.6792566", "0.6605793", "0.65013355", "0.64521503", "0.64088", "0.64088", "0.632653", "0.6274415", "0.62468255", "0.62168664", "0.6200478", "0.6172912", "0.6107809", "0.6101546", "0.6101546", "0.6101546", "0.6100957", "0.6093937", "0.6075433", "0.60703075", "0.60406506", "0.60299736", "0.5999898", "0.5999804", "0.5999679", "0.592051", "0.5907294", "0.589599", "0.58928496", "0.58785343", "0.58510405", "0.5811754", "0.579075", "0.5787167", "0.5785749", "0.57268965", "0.5724048", "0.57234293", "0.5713196", "0.56920713", "0.56575984", "0.56496894", "0.5634798", "0.5614405", "0.5607593", "0.56026894", "0.5600747", "0.55879354", "0.55868673", "0.55868673", "0.55787146", "0.55502206", "0.5547622", "0.5543076", "0.5523036", "0.55230117", "0.549692", "0.5492753", "0.5487946", "0.5482583", "0.54824454", "0.5482189", "0.54730076", "0.54590315", "0.54441845", "0.54393363", "0.5435529", "0.5424932", "0.5416288", "0.53853863", "0.5372749", "0.5363741", "0.5358004", "0.5347305", "0.5342175", "0.534141", "0.5323778", "0.5319701", "0.53180325", "0.5309712", "0.5306929", "0.53032756", "0.5296721", "0.52927023", "0.5274081", "0.52711785", "0.525065", "0.52368927", "0.52352244", "0.523083", "0.5227025", "0.5227025", "0.5220604", "0.5210221", "0.5206101", "0.5205663" ]
0.65210474
6
get url for each row in grid
public function getRowUrl($row) { return $this->getUrl('*/*/edit', array('id' => $row->getId())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRowUrl($row)\n {\n }", "public function getGridUrl()\n {\n // it maybe nice for filter several grids on one page\n // if needed return false. it will allow multiple grid urls... till url max length reached\n return $this->getUrl('*/*/*', array('_current'=>true));\n }", "public function getRowUrl($row)\n {\n return '';//$this->getUrl('*/*/detail', array('id' => $row->getId()));\n }", "public function getGridUrl()\n {\n return $this->getUrl('*/*/*', array('_current' => true));\n }", "public function getGridUrl()\n {\n return $this->getUrl('*/*/grid', array('_current'=>true));\n }", "public function getGridUrl()\n {\n return $this->getUrl('*/*/grid', array('_current'=>true));\n }", "public function getRowUrl()\n {\n return $this->rowUrl;\n }", "public function getRowUrl($row) {\n return $this->getUrl ( '*/*/edit', array (\n \n 'id' => $row->getId () \n ) );\n }", "public function getRowUrl($row)\n {\n return false;//$this->getUrl('*/*/edit', array('id' => $row->getId()));\n }", "public function getGridUrl()\n {\n return $this->getUrl('*/*/versions', array('_current'=>true));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/view', array('id' => $row->getId()));\n }", "public function getRowUrl($row) {\n return $this->getUrl ( '*/*/edit', array (\n 'id' => $row->getId () \n ) );\n }", "public function getRowUrl($row)\n\t{\n\t\t//return $this->getUrl('*/*/edit', array('id' => $row->getId()));\n\t\treturn false;\n\t}", "public function getRowUrl($row)\n\t{\n\t\treturn $this->getUrl('*/*/edit', array('id' => $row->getId()));\n\t}", "public function getRowUrl($row)\n {\n return false;\n }", "public function getRowUrl($row)\n {\n return false;\n }", "public function getRowUrl($row) {\n return $this->getUrl(\"*/*/edit\", array('ticket_id' => $row->getTicketId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', array('attribute_id' => $row->getAttributeId()));\n }", "public function getRowUrl($row) {\r\n $customer_id = $row->getCustomer()->getId();\r\n return $this->getUrl('CrmTicket/Admin_Ticket/Edit', array('ticket_id' => $row->getct_id(), 'customer_id' => $customer_id));\r\n }", "public function getGridUrl() {\n $params = array(\n 'product_id' => $this->getProduct()->getId(),\n 'store' => $this->getRequest()->getParam('store', 0),\n );\n return $this->getUrl('vidtest_admin/admin_product/grid', $params);\n }", "public function getRowUrl($row) {\n $params = array(\n 'id' => $row->getId(),\n AW_Vidtest_Block_Adminhtml_Video_Grid::RETURN_FROM_KEY => AW_Vidtest_Block_Adminhtml_Video_Grid::RETURN_FROM_PRODUCT,\n 'product_id' => $this->getProduct()->getId(),\n 'store' => $this->getRequest()->getParam('store', 0),\n );\n return $this->getUrl('vidtest_admin/admin_video/edit', $params);\n }", "public function getUrl()\n\t{\n\t\tif ($this->isVisible()) {\n\t\t\t$sort = $this->isSortAsc() ? Sorter::DESC : Sorter::ASC;\n\t\t} else {\n\t\t\t$sort = $this->ascByDefault ? Sorter::ASC : Sorter::DESC;\n\t\t}\n\n\t\treturn $this->dataGrid->getControl()->link('this', ['orderBy' => $this->sortableColumn, 'sort' => $sort]);\n\t}", "public function getRowUrl($row)\n {\n return $this->getUrl('*/catalog_product/edit', array('id' => $row->getProductId()));\n }", "public function getRowUrl($gridId, $rowIndex) {\n $rows = $this->getGridRows($gridId);\n return $rows[$rowIndex]['title'];\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/*/edit', ['attribute_code' => $row->getAttributeCode()]);\n }", "public function column_url($link)\n {\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('*/cms_page_version/edit', array('page_id' => $row->getPageId(), 'version_id' => $row->getVersionId()));\n }", "public function getRowUrl($row)\n {\n return $this->getUrl('adminhtml/productreviews/edit', array(\n 'id'=>$row->getId(),\n 'productId' => $this->getProductId(),\n 'customerId' => $this->getCustomerId(),\n ));\n }", "public function getRowUrl($row)\n {\n if (!Mage::getSingleton('admin/session')->isAllowed('sales/order/shipment')) {\n return false;\n }\n\n return $this->getUrl('*/sales_shipment/view',\n array(\n 'shipment_id'=> $row->getEntityId(),\n )\n );\n }", "protected function get_url_this_view(){ return $this->input ['table_url'] ;}", "protected function getPostItemUrl($row)\n {\n $date = new \\DateTime();\n $date->setTimestamp($row['date']);\n\n $linkParameters = GeneralUtility::implodeArrayForUrl('tx_t3extblog_blogsystem', array(\n 'post' => $row['uid'],\n 'day' => $date->format('d'),\n 'month' => $date->format('m'),\n 'year' => $date->format('Y'),\n ));\n\n $conf = array(\n 'additionalParams' => $linkParameters,\n 'forceAbsoluteUrl' => 1,\n 'parameter' => $this->singlePid,\n 'returnLast' => 'url',\n 'useCacheHash' => true,\n );\n $link = htmlspecialchars($this->cObj->typoLink('', $conf));\n\n return $link;\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 getRowUrl($item)\n {\n return $this->getUrl('*/*/edit', ['todo_id' => $item->getId()]);\n }", "public function get_url();", "public function getColumnLink(): HrefElement;", "function get_url($column){\r\n\r\n\t\tif(strpos($this->sort_url,'#COLUMN_ID#')!==false){\r\n\r\n\t\t\treturn str_replace('#COLUMN_ID#',$column,$this->sort_url);\r\n\r\n\t\t}else{\r\n\r\n\t\t\treturn $this->sort_url.(strpos($this->sort_url,'?')!==false ? '&' : '?').'sort='.$this->sort;\r\n\t\t}\r\n\r\n\t}", "public function getItemLinkUrl()\n {\n return $this->escapeXssInUrl($this->getEntity()->getData('list_item_url'));\n }", "public function render()\n {\n $this->view->setData(call_user_func($this->getUrlGenerator(), $this->getGrid()->getCurrentRow()));\n return SolidRow::render();\n }", "public function url()\n {\n return $this->factory->getUrl($this->handle);\n }", "private function _getURL()\n {\n\n $url = $this->_ect . '?';\n foreach ($this as $name => $var) {\n if ($name == 'ect') {\n continue;\n }\n $url .= \"$name=$var&\";\n }\n\n $this->url = $url;\n\n return $this->url;\n }", "function format_round_link($row) {\n // return $row['round_id'];\n return format_link(\n url_textblock($row['round_page_name']),\n $row['round_title']);\n }", "public function url()\n\t{\n\t\treturn Url::to($this->id);\n\t}", "public function get_url()\n {\n }", "public function getURL();", "public function getURL();", "public function getUrl()\n\t{\n\t\treturn rtrim(Mage::helper('wordpress')->getUrlWithFront($this->getId()), '/') . '/';\n\t}", "public function getURL ();", "public function getUrl()\n {\n if (method_exists($this->getPolymorphicRelation(), 'getUrl')) {\n return $this->getPolymorphicRelation()->getUrl();\n }\n\n $firstWallEntryId = $this->getFirstWallEntryId();\n\n if ($firstWallEntryId == \"\") {\n throw new Exception(\"Could not create url for content!\");\n }\n\n return \\yii\\helpers\\Url::toRoute(['/content/perma/wall-entry', 'id' => $firstWallEntryId]);\n }", "function column_image($item){\n return sprintf('<img src=\"%1$s\">',\n /*$1%s*/ site_url().$item['image']\n );\n }", "protected function getUrlKey($rowData)\n {\n if (!empty($rowData[self::URL_KEY])) {\n return strtolower($rowData[self::URL_KEY]);\n }\n\n if (!empty($rowData[self::COL_NAME])) {\n return $this->productUrl->formatUrlKey($rowData[self::COL_NAME]);\n }\n\n return '';\n }", "public function getUrl() {\n\t\treturn $this->rawUrl;\n\t}", "public abstract function getURL();", "public function render(Varien_Object $row)\n {\n $fileName = preg_replace('/^\\//', '', $row->getPath() . $row->getFilename());\n \n $url = $this->htmlEscape(Mage::app()->getStore($row->getStoreId())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . $fileName);\n\n if (file_exists(BP . DS . $fileName)) {\n return sprintf('<a href=\"%1$s\" target=\"_blank\">%1$s</a>', $url);\n }\n return $url;\n }", "public function getUrl()\n {\n $query = array(\n $this->getFilter()->getRequestVar()=>htmlentities($this->getLabel()),\n Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls\n );\n return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));\n }", "protected function getUrl() {\n\t\treturn $this->getQueryParam ( self::URL_PARAM );\n\t}", "public function url()\n {\n return $this->data['url'];\n }", "protected function getUrl() {\r\n\t\treturn $this->url;\r\n\t}", "function getImage($row) {\n if ($row['image'] != '') {\n\t$result = '<a href=\"http://commons.wikimedia.org/wiki/File:' . rawurlencode($row['image']) . '\">';\n\t$result = $result . '<img src=\"' . getImageFromCommons(str_replace(' ', '_', $row['image']), 200) . '\" align=\"right\" />';\n\t$result = $result . '</a>';\n } else {\n\t$result = '<a href=\"' . makeUploadLink($row) .'\" title=\"Upload een zelfgemaakte foto van dit monument naar Commons\" target=\"_blank\">';\n\t$result = $result . '<img src=\"' . getImageFromCommons('Crystal_Clear_app_lphoto.png', 100) . '\" align=\"right\" />';\n\t$result = $result . '</a>';\n }\n return $result;\n}", "public function url(){\r\n\t\treturn $this->_url;\r\n\t}", "public function getUrlData()\n\t{\n\t\t$b = $this->getCommentableBehavior();\n\t\tif ($urlFunc = $b->commentableUrl) {\n\t\t\t$commentable = @$this->items[0];\n\t\t\t$data = $urlFunc($commentable);\n\t\t} else {\n\t\t\t$route = Yii::app()->controller->id.'/'.Yii::app()->controller->action->id;\n\t\t\t$data = array_merge(array($route), $_GET);\n\t\t}\n\t\t$data['#'] = 'c'.$this->id;\n\t\treturn $data;\n\t}", "public function getUrl()\n {\n return Yii::app()->createUrl('/forum/thread/view', array('id' => $this->id));\n }", "protected function _getUrl(): string\n {\n property_exists_or_fail($this, ['id', 'album']);\n\n return Router::url(['_name' => 'photo', 'slug' => $this->get('album')->get('slug'), 'id' => (string)$this->get('id')], true);\n }", "function format_task_link($row) {\n if (!identity_can(\"job-view\", $row)){\n return \"...\";\n }\n return format_link(\n url_textblock($row['task_page_name']),\n $row['task_title']);\n }", "public function getGridNameLink()\n\t{\n\t\t$markup = CHtml::link($this->owner->name, array(\n\t\t\t'tab/update',\n\t\t\t'id'=>urlencode($this->owner->id),\n\t\t));\n\n\t\t$markup .= $this->childCount();\n\t\t$markup .= $this->sortableId();\n\n\t\treturn $markup;\n\t}", "protected function _getUrl()\n {\n return Router::url([\n '_name' => 'wikiPages',\n 'id' => $this->id,\n 'slug' => Inflector::slug($this->title)\n ]);\n }", "public function getUrl()\n {\n return $this->getProperty()->url;\n }", "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() {\n if ($this->no_results)\n return false;\n\n $config = Config::current();\n\n return url(\"view/\".$this->url, ExtendController::current());\n }", "public function getValue()\n {\n //get value\n $value = $this->getValueFromRow($this->getData(), $this->dataIndex);\n\n if ($this->formater) {\n $value = call_user_func_array($this->formater, [$value, $this->getData(), $this->dataIndex]);\n }\n\n //render link\n if ($url = $this->getUrl()) {\n $href = is_array($url) ? $url['href'] : $url;\n $target = is_array($url) && !empty($url['target']) ? $url['target'] : '';\n\n $href = $href . (strpos($href, '?') === false ? '?' : '&') . 'return=' . urlencode($this->getGrid()->getUrl());\n //замена конструкций {{param}} на значение\n if (preg_match_all('#{{([\\d\\w_]+)}}#', $href, $m)) {\n foreach ($m[1] as $key) {\n $href = str_replace('{{' . $key . '}}', $this->getValueFromRow($this->getData(), $key), $href);\n }\n }\n $value = '<a ' . ($target ? 'target=\"' . $target . '\"' : '') . ' href=\"' . $href . '\">' . $value . '</a>';\n }\n\n return $value;\n }", "protected function column_uri( $item ) {\n\t\treturn esc_html( $item['uri_decoded'] ) . $this->column_actions( $item );\n\t}", "private function writeUrl($row, $col, $url): void\n {\n // Add start row and col to arg list\n $this->writeUrlRange($row, $col, $row, $col, $url);\n }", "public function getUrl()\n {\n return Mage::getUrl('magna_news', array('news_id' => $this->getId(), '_secure' => true));\n }", "public function getUrl() {\n return \"posts.php?p=\" . $this->id . \"&u=\" . $this->userId;\n }", "public function url();", "public function url();", "public function url();", "public function get_url () {\r\n\t\treturn $this->url;\r\n\t}", "public function getColumnSortingUrl($column);", "protected function grid()\n {\n $grid = new Grid(new Poster);\n\n $grid->id('ID')->sortable();\n $grid->column('title','海报名称');\n $grid->column('bg_image','背景图片')->display(function($bg_image){\n\n return '<img class=\"bg\" src=\"/storage/'.$bg_image.'\" height=\"50px\" width=\"50px\"> ';\n });;\n $grid->column('code_image','二维码')->display(function($code_image){\n // $url=Storage::disk('qiniu')->url($code_image);\n \\Log::error($code_image);\n $div='';\n $code_images=collect($code_image);\n\n foreach ($code_images->chunk(3) as $images){\n\n foreach ($images as $image){\n $div.='<img src=\"/storage/'.$image.'\" height=\"50px\" width=\"50px\"> ';\n }\n $div.='<hr>';\n }\n return $div;\n });\n $grid->column('poster_image','合成海报')->display(function($poster_image){\n $poster_images=collect($poster_image);\n $div='';\n foreach ($poster_images->chunk(3) as $images){\n\n foreach ($images as $image){\n $url=Storage::disk('qiniu')->url($image);\n $div.= '<img class=\"bg\" src=\"'.$url.'\" height=\"50px\" width=\"50px\"> <button class=\"poster_button btn-group t btn btn-sm btn-success\" data-url=\"'.$image.'\">下载</button>';\n }\n $div.='<hr>';\n\n }\n return $div;\n\n });\n $grid->column('download','打包下载海报')->display(function(){\n return '<button data-url=\"'.$this->id.'\" class=\"poster-package btn-group t btn btn-sm btn-success\" data-id=\"'.$this->id.'\">打包下载</button>';\n });\n $grid->created_at('创建时间');\n $grid->updated_at('修改时间');\n $grid->disableExport();\n $grid->disableActions();\n $grid->model()->orderBy('id','desc');\n Admin::script($this->layerPhote());\n return $grid;\n }", "public function getURL() {\n\t\treturn $this->urlStub() .'/' . $this->publicContainer .'/' . $this->getId();\n\t}", "public function getUrl()\n {\n return $this->createUrl();\n }", "function getUrl()\n {\n return partial_url($this->getNodeType(), $this->m_action, $this->m_partial, $this->m_params, $this->m_sessionStatus);\n }", "public function getUrl()\n \t{\n \t\t$url=Yii::app()->createUrl(\"markingUpSkill/view\",array('id'=>$this->id));\n\t\treturn $url;\n \t}", "public function getUrl() {\r\n\t}", "function getUrl() {\n\t\treturn $this->repoObj->lobUrltitle;\n\t}", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn '/images/blog/' . $this->name;\n\t}" ]
[ "0.7567916", "0.7382718", "0.72861236", "0.7272688", "0.72467065", "0.72467065", "0.72159165", "0.6936886", "0.684897", "0.68174016", "0.6806642", "0.6800535", "0.6792919", "0.6732704", "0.65458864", "0.65458864", "0.6541915", "0.6526752", "0.6498405", "0.6480194", "0.6454495", "0.6440241", "0.6423352", "0.64092094", "0.6345593", "0.63157314", "0.6260799", "0.6228859", "0.6179947", "0.6109209", "0.60973805", "0.5817404", "0.58117783", "0.57843006", "0.5784294", "0.57583916", "0.5756886", "0.5661826", "0.5642587", "0.56409025", "0.5614825", "0.55928504", "0.55609", "0.55199647", "0.55199647", "0.5493111", "0.54717696", "0.54638785", "0.54604876", "0.54550195", "0.54479957", "0.5437395", "0.5419871", "0.5412107", "0.54032505", "0.5401786", "0.5400704", "0.53997743", "0.53871995", "0.5371965", "0.53690636", "0.5358321", "0.53570217", "0.53545976", "0.5353616", "0.5341396", "0.5338187", "0.5338187", "0.5338187", "0.5338187", "0.5338187", "0.5338187", "0.5338187", "0.5338187", "0.5336853", "0.53243035", "0.5321743", "0.5317563", "0.5316808", "0.5315741", "0.53104424", "0.53104424", "0.53104424", "0.5304853", "0.53036934", "0.5298164", "0.5289907", "0.52860796", "0.5284133", "0.5283328", "0.5280554", "0.5278947", "0.52663153", "0.52663153", "0.5265644" ]
0.6602054
18
Make header search in OceanWP theme compatible with JetMenu
function jet_menu_oceanwp_fix_header_search( $items, $args ) { if ( ! isset( $args->menu_class ) || 'jet-menu' !== $args->menu_class ) { return $items; } $items = str_replace( array( 'search-toggle-li', 'site-search-toggle', ), array( 'search-toggle-li jet-menu-item jet-simple-menu-item jet-regular-item jet-responsive-menu-item', 'site-search-toggle top-level-link', ), $items ); return $items; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function techmarket_navbar_search() {\n\t\ttechmarket_get_template( 'sections/navbar-search.php' );\n\t}", "function cosmetro_top_search( $format = '%s' ) {\n\t$is_enabled = get_theme_mod( 'top_panel_search', cosmetro_theme()->customizer->get_default( 'top_panel_search' ) );\n\n\tif ( ! $is_enabled ) {\n\t\treturn;\n\t}\n\n\tprintf( $format, do_action('cosmetro_menu_shop_header') );\n}", "function pro_header_search_display()\n{\n\t$pro = get_option('up_themes_betty_commerce_wordpress_theme');\n\t\n\tif( !empty( $pro['header_search'] ) )\n\t{\n\t\treturn $pro['header_search'];\n\t}\n\treturn false;\n}", "function v2_mumm_menu_link__menu_header(&$variables) {\n\n $element = $variables ['element'];\n $sub_menu = '';\n\n if ($element ['#below']) {\n $sub_menu = drupal_render($element ['#below']);\n }\n\n if (in_array('search-btn', $element['#localized_options']['attributes']['class'])) {\n\n $output = '<button id=\"search-btn\" class=\"icon icon-search-gray search-btn\" data-trigger-toggle=\"search-box\" title=\"\" name=\"search-btn\" type=\"button\"\n data-tracking data-track-action=\"click\" data-track-category=\"header\" data-track-label=\"search\" data-track-type=\"event\">\n </button>';\n }\n else {\n $class = $element['#localized_options']['attributes']['class'];\n $element['#localized_options']['attributes'] = array(\n 'class' =>$class,\n 'data-tracking' => '',\n 'data-track-action' => 'click',\n 'data-track-category' => 'header',\n 'data-track-label' => 'book_a_visit',\n 'data-track-type' => 'event',\n );\n\n $output = l($element ['#title'], $element ['#href'] , $element['#localized_options']);\n }\n return $output;\n}", "function wpgood_nav_search($items, $args) {\n // If this isn't the primary menu, do nothing\n if( !($args->theme_location == 'primary') ) \n return $items;\n // Otherwise, add search form\n return $items . '<li>' . get_search_form(false) . '</li>';\n}", "function wpex_add_search_to_menu ( $items, $args ) {\n\n\t// Only used on main menu\n\tif ( 'main_menu' != $args->theme_location ) {\n\t\treturn $items;\n\t}\n\n\t// Get search style\n\t$search_style = wpex_global_obj( 'menu_search_style' );\n\n\t// Return if disabled\n\tif ( ! $search_style || 'disabled' == $search_style ) {\n\t\treturn $items;\n\t}\n\n\t// Get header style\n\t$header_style = wpex_global_obj( 'header_style' );\n\t\n\t// Get correct search icon class\n\tif ( 'overlay' == $search_style) {\n\t\t$class = ' search-overlay-toggle';\n\t} elseif ( 'drop_down' == $search_style ) {\n\t\t$class = ' search-dropdown-toggle';\n\t} elseif ( 'header_replace' == $search_style ) {\n\t\t$class = ' search-header-replace-toggle';\n\t} else {\n\t\t$class = '';\n\t}\n\n\t// Add search item to menu\n\t$items .= '<li class=\"search-toggle-li wpex-menu-extra\">';\n\t\t$items .= '<a href=\"#\" class=\"site-search-toggle'. $class .'\">';\n\t\t\t$items .= '<span class=\"link-inner\">';\n\t\t\t\t$items .= '<span class=\"fa fa-search\"></span>';\n\t\t\t\tif ( 'six' == $header_style ) {\n\t\t\t\t\t$items .= '<span class=\"wpex-menu-search-text\">'. _x( 'Search', 'Navbar Search Text For Vertical Nav', 'wpex' ) .'</span>';\n\t\t\t\t}\n\t\t\t$items .= '</span>';\n\t\t$items .= '</a>';\n\t$items .= '</li>';\n\t\n\t// Return nav $items\n\treturn $items;\n\n}", "function genesisawesome_do_before_header() {\n\n\techo '<div id=\"ga-topbar\">';\n\t\techo '<div class=\"wrap\">';\n\n\t\t\techo '<ul id=\"social-profiles\">';\n\t\t\t$soc_urls = array(\n\t\t\t\t'rssfeed_url' => __( 'Rss Feeds', 'genesisawesome' ),\n\t\t\t\t'twitter_url' => __( 'Twitter', 'genesisawesome' ),\n\t\t\t\t'facebook_url' => __( 'Facebook', 'genesisawesome' ),\n\t\t\t\t'dribbble_url' => __( 'Dribbble', 'genesisawesome' ),\n\t\t\t);\n\t\t\tforeach ( $soc_urls as $soc_opt => $soc_name ) {\n\n\t\t\t\tif ( ! $soc_url = genesis_get_option( $soc_opt, GA_CHILDTHEME_FIELD ) )\n\t\t\t\t\tcontinue;\n\t\t\t\t?>\n\t\t\t\t<li class='<?php echo sanitize_title( $soc_name );?>'>\n\t\t\t\t\t<a href='<?php echo esc_url( $soc_url ) ?>' target='_blank' title='<?php echo esc_attr( $soc_name );?>'><?php echo esc_attr( $soc_name );?></a>\n\t\t\t\t</li>\n\t\t\t\t<?php\n\n\t\t\t}\n\t\t\techo '</ul>';\n\t\t\t\n\t\t\tget_search_form();\n\n\t\techo '</div>';\n\techo '</div>';\n\n}", "function farmhouse_primary_nav_extras( $menu, $args ) {\n if ( 'primary' !== $args->theme_location ) {\n return $menu;\n }\n\n ob_start();\n get_search_form();\n $search = ob_get_clean();\n $menu .= '<li class=\"right search\">' . $search . '</li>';\n\n return $menu;\n}", "function do_header_search(){\n\techo\"\n\t\t<html>\n\t\t<title> Race Search </title>\n\t\t<h1> Search: </h1>\n\t\";\n}", "function _mai_add_widget_header_menu_args() {\n\tadd_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );\n\tadd_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );\n}", "function px_add_search_menu_item($items, $args)\n{\n\treturn $items;\n\t\n if( 'primary-nav' != $args->theme_location )\n return $items;\n\n ob_start();\n ?>\n <li id=\"menu-item-search\" class=\"menu-item menu-item-search\">\n <a href=\"#\"><span class=\"icon-search\"></span></a>\n <div class=\"search-template\">\n <?php get_search_form(); ?>\n </div>\n </li>\n <?php\n $items .= ob_get_clean();\n return $items;\n}", "function erp_add_menu_header( $component, $title, $icon = \"\" ) {\n add_filter('erp_menu_headers', function($menu) use( $component, $title, $icon ) {\n $menu[ $component ] = [ 'title' => $title, 'icon' => $icon ];\n return $menu;\n });\n}", "function mr_theme_header() {\n\t$facebook_url = '#';\n\t$instagram_url = '#';\n\tif ( get_option( 'mr-social-links' )['facebook'] ) {\n\t\t$facebook_url = get_option( 'mr-social-links' )['facebook'];\n\t}\n\tif ( get_option( 'mr-social-links' )['instagram'] ) {\n\t\t$instagram_url = get_option( 'mr-social-links' )['instagram'];\n\t}\n\n\t?>\n\t\t<nav class=\"mr-nav-top\">\n\t\t\t<div class=\"mr-social\">\n\t\t\t\t<a target=\"_blank\" href=\"<?php echo esc_attr( $facebook_url ); ?>\"><i class=\"fab fa-facebook\"></i></a>\n\t\t\t\t<a target=\"_balnk\" href=\"<?php echo esc_attr( $instagram_url ); ?>\"><i class=\"fab fa-instagram\"></i></a>\n\t\t\t</div>\n\t\t\t<div class=\"mr-logo\" >\n\t\t\t\t<?php the_custom_logo(); ?>\n\t\t\t\t<p><?php echo esc_attr__( get_bloginfo( 'name' ) ); ?></p>\n\t\t\t</div>\n\t\t\t\t<button class=\"navbar-toggler\" type=\"button\" id=\"menuMobileBtnShow\">\n\t\t\t\t\t<i class=\"fal fa-bars\"></i>\n\t\t\t\t</button>\t\n\n\t\t\t<div class=\"mr-search\">\n\t\t\t<?php mr_search_form(); ?>\n\t\t\t\t<i id=\"searchToggleForm\" class=\"fal fa-search\"></i>\n\t\t\t</div>\n\t\t</nav>\n\t<?php\n}", "function register_header_menu() {\r\n register_nav_menu('header-menu',__( 'Header Menu' ));\r\n}", "function erp_get_menu_headers() {\n $menu = [];\n return apply_filters( 'erp_menu_headers', $menu );\n}", "function poco_handheld_footer_bar_search() {\n echo '<a href=\"\"><span class=\"title\">' . esc_attr__('Search', 'poco') . '</span></a>';\n poco_product_search();\n }", "function custom_nav_item( $menu, stdClass $args ){\n if ( 'primary' != $args->theme_location )\n\n return $menu; \n\t\t// $menu .= '</ul><ul class=\"search-form-container\"><div class=\"search-toggle\"><i class=\"dashicons dashicons-search\"></i>\n\t\t$menu .= '</ul><ul class=\"search-form-container\"><div class=\"search-toggle\"><i class=\"fa fa-search\"></i>\n\t\t\t\t<a href=\"#search-container\" class=\"screen-reader-text\"></a>\n\t\t\t\t</div>'; \n return $menu; \n}", "function refined_magazine_main_header_right_menu()\r\n {\r\n $has_header_image = has_header_image();\r\n global $refined_magazine_theme_options;\r\n $search_class = '';\r\n if ($refined_magazine_theme_options['refined-magazine-enable-menu-section-search'] == 1):\r\n $show_search = 1;\r\n $search_class = 'ct-show-search';\r\n else:\r\n $show_search = 0;\r\n endif;\r\n $sticky_header_option = $refined_magazine_theme_options['refined-magazine-enable-sticky-primary-menu'];\r\n if($sticky_header_option == 1){\r\n $sticky_header_class = 'sticky-header';\r\n\r\n }else{\r\n $sticky_header_class = '';\r\n }\r\n\r\n $menu_alignment = $refined_magazine_theme_options['refined-magazine-change-primary-menu-position'];\r\n if ($menu_alignment == 'default-menu-position') {\r\n $menu_alignment_class = \"ct-center-aligned\";\r\n }else{\r\n $menu_alignment_class = 'ct-left-aligned';\r\n }\r\n if(!empty($search_class)){\r\n $menu_class = $menu_alignment_class.' '.$search_class;\r\n }else{\r\n $menu_class = $menu_alignment_class;\r\n }\r\n ?>\r\n <div class=\"refined-magazine-header-left-logo-wrapper logo-wrapper-block <?php echo $sticky_header_class; ?>\">\r\n <div class=\"site-branding\" <?php if (!empty($has_header_image)) { ?> style=\"background-image: url(<?php echo header_image(); ?>);\" <?php } ?>>\r\n <div class=\"container-inner\">\r\n <div class=\"refined-magazine-header-block refined-magazine-header-left-logo\" id=\"site-navigation\">\r\n <div class=\"refined-magazine-logo-main-container\">\r\n <div class=\"refined-magazine-logo-container text-center\">\r\n <?php\r\n if (function_exists('the_custom_logo')) {\r\n\r\n the_custom_logo();\r\n\r\n }\r\n if (is_front_page() && is_home()) : ?>\r\n <h1 class=\"site-title\"><a href=\"<?php echo esc_url(home_url('/')); ?>\"\r\n rel=\"home\"><?php bloginfo('name'); ?></a></h1>\r\n <?php else : ?>\r\n <p class=\"site-title\"><a href=\"<?php echo esc_url(home_url('/')); ?>\"\r\n rel=\"home\"><?php bloginfo('name'); ?></a></p>\r\n <?php\r\n endif;\r\n\r\n $description = get_bloginfo('description', 'display');\r\n if ($description || is_customize_preview()) : ?>\r\n <p class=\"site-description\"><?php echo $description; /* WPCS: xss ok. */ ?></p>\r\n <?php\r\n endif; ?>\r\n </div> <!-- refined-magazine-logo-container -->\r\n\r\n\r\n <div class=\"navbar-header clear\">\r\n <button class=\"menu-toggle\" aria-controls=\"primary-menu\"\r\n aria-expanded=\"false\"><i class=\"fa fa-bars\" aria-hidden=\"true\"></i></button>\r\n </div>\r\n </div> <!-- .refined-magazine-logo-main-container -->\r\n <div class=\"refined-magazine-menu-container clear <?php echo $menu_class; ?>\">\r\n <nav id=\"\" class=\"main-navigation\">\r\n <ul id=\"primary-menu\" class=\"nav navbar-nav nav-menu\">\r\n <?php\r\n if ($refined_magazine_theme_options['refined-magazine-enable-menu-home-icon'] == 1):\r\n if (is_front_page()) {\r\n $home_class = 'current-menu-item';\r\n } else {\r\n $home_class = '';\r\n }\r\n\r\n ?>\r\n <li class=\"<?php echo $home_class; ?>\"><a href=\"<?php echo esc_url(home_url('/')); ?>\">\r\n <i class=\"fa fa-home\"></i> </a></li>\r\n <?php\r\n endif;\r\n ?>\r\n <?php\r\n wp_nav_menu(array(\r\n 'theme_location' => 'menu-1',\r\n 'items_wrap' => '%3$s',\r\n 'container' => false\r\n ));\r\n ?>\r\n </ul>\r\n </nav><!-- #site-navigation -->\r\n <?php\r\n if ($show_search == 1):\r\n ?>\r\n <div class=\"ct-menu-search\"><a class=\"search-icon-box\" href=\"#\"> <i class=\"fa fa-search\"></i>\r\n </a></div>\r\n <div class=\"top-bar-search\">\r\n <?php get_search_form(); ?>\r\n <button type=\"button\" class=\"close\">\r\n </button>\r\n </div>\r\n <?php\r\n endif;\r\n ?>\r\n </div> <!-- refined-magazine-menu-container -->\r\n </div> <!-- .header-block -->\r\n </div>\r\n </div> <!-- .site-branding -->\r\n <?php\r\n //Check if header advertisement is enabled from customizer\r\n if ($refined_magazine_theme_options['refined-magazine-enable-ads-header'] == 1):\r\n ?>\r\n <div class=\"header-adv-section text-center\">\r\n <div class=\"container-inner clear\">\r\n <?php\r\n\r\n /**\r\n * refined_magazine_header_ads hook.\r\n *\r\n * @since 1.0.0\r\n *\r\n */\r\n do_action('refined_magazine_header_ads');\r\n ?>\r\n </div>\r\n </div>\r\n <?php\r\n\r\n\r\n endif;\r\n ?>\r\n </div>\r\n <?php\r\n\r\n }", "function voyage_mikado_get_search() {\n\n\t\tif(voyage_mikado_active_widget(false, false, 'mkd_search_opener')) {\n\n\t\t\t$search_type = voyage_mikado_options()->getOptionValue('search_type');\n\n\t\t\tvoyage_mikado_load_search_template();\n\n\t\t}\n\t}", "function add_search_form($items, $args) {\nif( $args->theme_location == 'menu-principal' )\n\t $items .= '<li class=\"search\">\n\t\t\t\t\t<a class=\"search_icon\">\n\t\t\t\t\t\t<span class=\"spicewpsearch_icon\"></span>\n\t\t\t\t\t</a>\n\t\t\t\t\t<div style=\"display:none;\" class=\"spicewpsearchform\">'. get_search_form(false) .'</div>\n\t\t\t\t</li>';\n return $items;\n}", "function customPageHeader() {\n echo osc_apply_filter('custom_plugin_title', __('Plugins'));\n }", "function fluid_edge_load_search_template() {\n fluid_edge_get_module_template_part('templates/types/fullscreen', 'search');\n }", "function theme_hbmode_process_header($app, &$vars) {\n $entries = $app->module('collections')->find(\"main_menu\");\n foreach ($entries as $entry) {\n $vars['links'][$entry['_id']] = [\n 'title' => $entry['title'],\n 'slug' => $entry['link'],\n ];\n }\n}", "private function search_bar()\n\t{\n\n\t\t# code...\n\t}", "function bj_homeheader_setup(){\n\t\tif(function_exists('the_custom_header')){\n\t\t\tthe_custom_header();\n\t\t}\n\tadd_theme_support('custom-header',array(\n\t\t'flex-height' => true,\n\t\t'flex-width'=> true,\n\t));\n}", "function agriflex4_search_results_header() {\n\n\t$title = sprintf(\n\t\t'<div class=\"entry-header\"><h1 class=\"entry-title\">Search Results for: %s</h1></div>',\n\t\tget_search_query()\n\t);\n\n\techo wp_kses_post( $title );\n\n}", "function in_admin_header()\n {\n }", "function voyage_mikado_load_search_template() {\n\t\tglobal $voyage_mikado_IconCollections;\n\n\t\t$search_type = voyage_mikado_options()->getOptionValue('search_type');\n\n\t\t$search_icon = '';\n\t\tif(voyage_mikado_options()->getOptionValue('search_icon_pack') !== '') {\n\t\t\t$search_icon = $voyage_mikado_IconCollections->getSearchIcon(voyage_mikado_options()->getOptionValue('search_icon_pack'), true);\n\t\t}\n\n\t\t$parameters = array(\n\t\t\t'search_in_grid' => voyage_mikado_options()->getOptionValue('search_in_grid') == 'yes' ? true : false,\n\t\t\t'search_icon' => $search_icon,\n\t\t);\n\n\t\tvoyage_mikado_get_module_template_part('templates/types/'.$search_type, 'search', '', $parameters);\n\n\t}", "function setwood_handheld_footer_bar_search() {\n\techo '<a href=\"#\">' . esc_attr__( 'Search', 'setwood' ) . '</a>';\n\tsetwood_product_search();\n}", "function get_custom_header()\n {\n }", "function flatsome_custom_blog_header(){\n\tif(flatsome_option('blog_header') && is_home()){\n\t\techo '<div class=\"blog-header-wrapper\">'.do_shortcode(flatsome_option('blog_header')).'</div>';\n\t}\n}", "public function wordpress_default_header(){\n\t\tif(is_home() && $this->_template_builder->get_specific_option('carousel_global')){\r\n\t\t\tif(!$this->_template_builder->get_specific_option('jumbotron')){\r\n\t\t\t\t$this->_build_header();\r\n\t\t\t}else{\r\n\t\t\t\t$this->_template_builder->render_view('jumbotron');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($this->_template_builder->get_specific_option('socialbar')){\r\n\t\t\t\t$this->_template_builder->render_view('socialbar');\t\r\n\t\t\t}\r\n\t\t}\n\t}", "function the_custom_header_markup()\n {\n }", "function add_custom_news_header(){ ?>\n \n<!--\n <?php \n\t // Set the Default Title\n\t $title = 'Invotec <strong>News</strong>'; \n\t \n\t // If we are on a single post, change the title to the\n\t // title of the post\n\t \n\t if( is_singular( 'post' ) ){\n\t\t $title = get_the_title();\n\t }\n\t \n ?>\n-->\n \n \n <?php if ( is_home() || is_singular( 'post' ) || is_search() || is_archive() || is_singular( 'mec-events' ) ) : ?>\n \n \t<!-- our custom header codes here -->\n\t\t \n\t<div class=\"e242-1 x-section _before _gradient-overlay newsheader\" id=\"inner-hero\">\n \t\t \n\t\t<div class=\"e242-2 x-container max width\">\n\t\t\t<div class=\"e242-3 x-column x-sm x-1-1\">\n\t\t\t <div class=\"x-text -white head-title _max-1000 _center\"><h1>News</h1></div>\n\t\t\t</div>\n\t\t</div>\n </div>\n\t\t \n <?php endif; ?>\n \n<?php }", "function customtheme_search_filter($query) {\n\t\tif (isset($_GET['s']) && empty($_GET['s']) && $query->is_main_query()){\n\t\t\t$query->is_search = true;\n\t\t\t$query->is_home = false;\n\t\t}\n\t\treturn $query;\n\t}", "function get_custom_header_markup()\n {\n }", "function search(){\n echo\"\n <header class=\\\"header-area\\\">\n\n <!-- Top Header Area -->\n <div class=\\\"top-header\\\">\n <div class=\\\"container\\\">\n <div class=\\\"row\\\">\n <div class=\\\"col-12\\\">\n <div class=\\\"top-header-content d-flex align-items-center justify-content-between\\\">\n <!-- Search Form -->\n <div class=\\\"search-form\\\">\n <form action=\\\"#\\\" method=\\\"get\\\">\n <input type=\\\"search\\\" name=\\\"search\\\" class=\\\"form-control\\\" placeholder=\\\"Search and hit enter...\\\">\n <button type=\\\"submit\\\"><i class=\\\"fa fa-search\\\"></i></button>\n </form>\n </div>\n\n <!-- Social Button -->\n <div class=\\\"top-social-info\\\">\n <a href=\\\"#\\\"><i class=\\\"fa fa-facebook\\\" aria-hidden=\\\"true\\\"></i></a>\n <a href=\\\"#\\\"><i class=\\\"fa fa-twitter\\\" aria-hidden=\\\"true\\\"></i></a>\n <a href=\\\"#\\\"><i class=\\\"fa fa-instagram\\\" aria-hidden=\\\"true\\\"></i></a>\n <a href=\\\"#\\\"><i class=\\\"fa fa-pinterest\\\" aria-hidden=\\\"true\\\"></i></a>\n <a href=\\\"#\\\"><i class=\\\"fa fa-rss\\\" aria-hidden=\\\"true\\\"></i></a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Logo Area -->\n <div class=\\\"logo-area text-center\\\">\n <div class=\\\"container\\\">\n <div class=\\\"row\\\">\n <div class=\\\"col-12\\\">\n <!-- Nav brand -->\n <a href=\\\"index.html\\\" class=\\\"nav-brand\\\"><img src=\\\"img/core-img/logo.png\\\" alt=\\\"\\\"></a>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Navbar Area -->\n <div class=\\\"foode-main-menu\\\">\n <div class=\\\"classy-nav-container breakpoint-off\\\">\n <div class=\\\"container\\\">\n <!-- Menu -->\n <nav class=\\\"classy-navbar\\\" id=\\\"foodeNav\\\">\n\n <!-- Nav brand -->\n <a href=\\\"index.html\\\" class=\\\"nav-brand\\\"><img src=\\\"img/core-img/logo.png\\\" alt=\\\"\\\"></a>\n\n <!-- Navbar Toggler -->\n <div class=\\\"classy-navbar-toggler\\\">\n <span class=\\\"navbarToggler\\\"><span></span><span></span><span></span></span>\n </div>\n\n <!-- Menu -->\n <div class=\\\"classy-menu\\\">\n\n <!-- close btn -->\n <div class=\\\"classycloseIcon\\\">\n <div class=\\\"cross-wrap\\\"><span class=\\\"top\\\"></span><span class=\\\"bottom\\\"></span></div>\n </div>\n\n <!-- Nav Start -->\n <div class=\\\"classynav\\\">\n <ul>\n <li><a href=\\\"index.html\\\">Home</a></li>\n <li><a href=\\\"index.html\\\">My Family</a></li>\n <li><a href=\\\"#\\\">DISCIPLINES</a>\n <div class=\\\"megamenu\\\">\n <ul class=\\\"single-mega cn-col-4\\\">\n <li><a href=\\\"#\\\">- HISTOIRE</a></li>\n <li><a href=\\\"#\\\">- LITERATURE</a></li>\n <li><a href=\\\"#\\\">- PHILOSOPHIE</a></li>\n <li><a href=\\\"#\\\">- LEGENDE</a></li>\n <li><a href=\\\"#\\\">- Bread</a></li>\n <li><a href=\\\"#\\\">- Breakfast</a></li>\n <li><a href=\\\"#\\\">- Meat</a></li>\n <li><a href=\\\"#\\\">- Fastfood</a></li>\n <li><a href=\\\"#\\\">- Salad</a></li>\n <li><a href=\\\"#\\\">- Soup</a></li>\n </ul>\n <ul class=\\\"single-mega cn-col-4\\\">\n <li><a href=\\\"#\\\">- SCIENCE</a></li>\n <li><a href=\\\"#\\\">- MATHEMATIC</a></li>\n <li><a href=\\\"#\\\">- TECHNOLOGIE</a></li>\n <li><a href=\\\"#\\\">- MEDECINE</a></li>\n <li><a href=\\\"#\\\">- Bread</a></li>\n <li><a href=\\\"#\\\">- Breakfast</a></li>\n <li><a href=\\\"#\\\">- Meat</a></li>\n <li><a href=\\\"#\\\">- Fastfood</a></li>\n <li><a href=\\\"#\\\">- Salad</a></li>\n <li><a href=\\\"#\\\">- Soup</a></li>\n </ul>\n <ul class=\\\"single-mega cn-col-4\\\">\n <li><a href=\\\"#\\\">- GEOLOGIE</a></li>\n <li><a href=\\\"#\\\">- GEOGRAPHIE</a></li>\n <li><a href=\\\"#\\\">- ARCHEOLOGIE</a></li>\n <li><a href=\\\"#\\\">- Recipe</a></li>\n <li><a href=\\\"#\\\">- Bread</a></li>\n <li><a href=\\\"#\\\">- Breakfast</a></li>\n <li><a href=\\\"#\\\">- Meat</a></li>\n <li><a href=\\\"#\\\">- Fastfood</a></li>\n <li><a href=\\\"#\\\">- Salad</a></li>\n <li><a href=\\\"#\\\">- Soup</a></li>\n </ul>\n <ul class=\\\"single-mega cn-col-4\\\">\n <li><a href=\\\"#\\\">- ROMAN</a></li>\n <li><a href=\\\"#\\\">- CONTE</a></li>\n <li><a href=\\\"#\\\">- Travel</a></li>\n <li><a href=\\\"#\\\">- Recipe</a></li>\n <li><a href=\\\"#\\\">- Bread</a></li>\n <li><a href=\\\"#\\\">- Breakfast</a></li>\n <li><a href=\\\"#\\\">- Meat</a></li>\n <li><a href=\\\"#\\\">- Fastfood</a></li>\n <li><a href=\\\"#\\\">- Salad</a></li>\n <li><a href=\\\"#\\\">- Soup</a></li>\n </ul>\n </div>\n </li>\n <li><a href=\\\"#\\\">QUIZ</a></li>\n <li><a href=\\\"about-us.html\\\">PROFILE</a></li>\n </ul>\n\n </div>\n <!-- Nav End -->\n </div>\n </nav>\n </div>\n </div>\n </div>\n</header>\n \";\n\n\n}", "function includeSearch($query) {\n \n\tif ($query->is_search) {\n\t \n\t\t$query->set('post_type', array('post', 'produtos'));\n\t\t//$query->set('tag', '%'.get_search_query().'%');\n\t \n\t}\n\t return $query;\n\t \n\t}", "function _wp_ajax_menu_quick_search($request = array())\n {\n }", "function wp_admin_bar_header()\n {\n }", "function theme_features() {\n register_nav_menu('headerMenu', 'Header Menu Location');\n // relevant titles to the browsers tab\n add_theme_support('title-tag');\n}", "function nicholls_move_search_title() {\n\t// Website Title\n\tremove_action( 'fnbx_header', 'fnbx_default_title' );\n\t// Website Description\n\tremove_action( 'fnbx_header', 'fnbx_default_description' );\n\t// Entry title\n\tremove_action( 'fnbx_template_loop_entry_title', 'fnbx_entry_title' );\n\t// Move the entry-title\n\tadd_action( 'fnbx_header', 'fnbx_entry_title' );\n}", "function genesis_do_search_title() {\n\n\t$title = sprintf( '<div class=\"archive-description\"><h1 class=\"archive-title\">%s %s</h1></div>', apply_filters( 'genesis_search_title_text', __( 'Search results for: ', 'genesis' ) ), get_search_query() );\n\n\techo apply_filters( 'genesis_search_title_output', $title ) . \"\\n\";\n\n}", "function wp_ajax_menu_quick_search()\n {\n }", "function thiredtheme_menu_item()\n {\n register_nav_menus(\n array(\n 'header'=>__('header menu'),\n 'footer'=>__('footer menu'))); \n }", "function top_news_custom_header_setup() {\n\tadd_theme_support( 'custom-header', apply_filters( 'top_news_custom_header_args', array(\n\t\t'default-image' => '',\n\t\t'width' => 1200,\n\t\t'height' => 120,\n\t\t'wp-head-callback' => 'top_news_header_style',\n\t) ) );\n}", "function lightseek_homepage_header() {\n\techo '<header class=\"entry-header\">';\n\t\tlightseek_post_header();\n\techo '</header>';\n}", "function uvasomrfd_do_search_title() {\n\t$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );\n\tif(!is_page('27718')){\n\t//if (!strpos($_SERVER[\"REQUEST_URI\"], 'faculty-mentoring-undergraduates')) {\n\tif (is_tax( 'primary')||is_tax( 'training-grant')) {$preterm='Department of ';}\n\tif (is_tax( 'research-discipline')) {$preterm='Research Discipline: ';}\n\tif (is_tax( 'training-grant')) {$preterm='Training Program: ';}\n\t//if (strpos($_SERVER[\"REQUEST_URI\"], '?undergraduates')){$preterm='Faculty Accepting Undergraduates';$term->name='';}\n$title = sprintf( '<div class=\"clearfix\"></div><div id=\"uvasom_page_title\">'.genesis_do_breadcrumbs().'<h1 class=\"archive-title\">%s %s</h1>', apply_filters( 'genesis_search_title_text', __( $preterm, 'genesis' ) ), $term->name).'</div>';\n\techo apply_filters( 'genesis_search_title_output', $title ) . \"\\n\";\n\t}\n}", "function fluid_edge_get_search() {\n fluid_edge_load_search_template();\n }", "function register_menu() {\n\n register_nav_menu('header-menu',__('Header Menu'));\n\n}", "function bb_customize_search_query ($query) {\n //$search_query = get_search_query();\n // $meta_query = array(\n // array(\n // 'key' => 'editorial_style_definition',\n // 'value' => $search_query,\n // 'compare' => 'EXISTS'\n // )\n // );\n \n // Change the query parameters\n $query->set( 'posts_per_page', -1 );\n $query->set( 'orderby', 'meta_value' );\n $query->set( 'order', 'ASC' );\n \n \n\n \n }", "function get_header($title, $login = 0) {\r\n\t\trequire_once('theme_parts/header.php');\r\n\t}", "function tac_after_setup_theme() {\n\tadd_theme_support( 'html5', array( 'search-form' ) );\n}", "function quadro_site_menu() {\n\tglobal $quadro_options;\n\tif ( $quadro_options['menu_header_display'] == 'hide' ) return false;\n\t?>\n\t<h1 class=\"menu-toggle\">\n\t\t<a href=\"#msite-navigation\">\n\t\t\t<span class=\"menu-toggle-icon menu-toggle-icon-1\"></span>\n\t\t\t<span class=\"menu-toggle-icon menu-toggle-icon-2\"></span>\n\t\t\t<span class=\"menu-toggle-icon menu-toggle-icon-3\"></span>\n\t\t</a>\n\t</h1>\n\t<nav id=\"site-navigation\" class=\"main-navigation\">\n\t\t<div class=\"inner-nav\">\n\t\t\t<a class=\"skip-link screen-reader-text\" href=\"#content\"><?php esc_html_e( 'Skip to content', 'indigo' ); ?></a>\n\t\t\t<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>\n\t\t</div>\n\t</nav><!-- #site-navigation -->\n\t<?php\n}", "function iver_select_get_header_minimal_full_screen_menu() {\n\t\t$parameters = array(\n\t\t\t'fullscreen_menu_in_grid' => iver_select_options()->getOptionValue( 'fullscreen_in_grid' ) === 'yes' ? true : false\n\t\t);\n\t\t\n\t\tiver_select_get_module_template_part( 'templates/full-screen-menu', 'header/types/header-minimal', '', $parameters );\n\t}", "function vodi_page_header() {\n if ( is_page() && apply_filters( 'vodi_show_site_content_page_header', true ) ) : ?>\n <header class=\"page__header stretch-full-width\">\n <div class=\"container\">\n <?php if ( apply_filters( 'vodi_show_site_content_page_title', true ) ) : ?>\n <h1 class=\"page__title\"><?php echo esc_html( apply_filters( 'vodi_site_content_page_title', get_the_title() ) ); ?></h1>\n <?php endif; ?>\n <div class=\"page__header--aside\"><?php do_action( 'vodi_page_header_aside' ); ?></div>\n </div>\n </header><!-- .entry-header -->\n <?php endif;\n }", "function charity_aboveheader() {\n do_action('charity_aboveheader');\n}", "function filter_menu_items( $args ) {\r\n $args['show_home'] = false;\r\n return $args;\r\n}", "function dokan_header_user_menu() {\n global $current_user;\n $user_id = $current_user->ID;\n $nav_urls = dokan_get_dashboard_nav();\n\n dokan_get_template_part( 'global/header-menu', '', array( 'current_user' => $current_user, 'user_id' => $user_id, 'nav_urls' => $nav_urls ) );\n}", "function core_admin_header_style() {\r\n }", "public function optin_theme_sub_header()\n {\n if (!empty($_GET['page']) && $_GET['page'] == 'mailoptin-optin-campaigns') : ?>\n <div class=\"mailoptin-optin-new-list mailoptin-optin-clear\">\n <h4><?php _e('Optin Campaign Title', 'mailoptin'); ?>\n <input type=\"text\" name=\"mailoptin-optin-campaign\" id=\"mailoptin-add-optin-campaign-title\"\n placeholder=\"Enter name for your optin campaign...\">\n </h4>\n </div>\n <div id=\"mailoptin-sub-bar\">\n <div class=\"mailoptin-new-toolbar mailoptin-clear\">\n <h4><?php _e('Select Optin Type', 'mailoptin'); ?>\n <i class=\"fa fa-spinner fa-pulse fa-spin\"></i>\n </h4>\n <span class=\"sr-only\"><?php __('Loading...', 'mailoptin'); ?></span>\n <ul class=\"mailoptin-design-options\">\n <li>\n <a href=\"#\" class=\"mo-select-optin-type mailoptin-type-active\" data-optin-type=\"lightbox\">\n <?php _e('Lightbox', 'mailoptin'); ?>\n </a>\n </li>\n <li>\n <a href=\"#\" class=\"mo-select-optin-type\" data-optin-type=\"inpost\">\n <?php _e('In-Post', 'mailoptin'); ?>\n </a>\n </li>\n <li>\n <a href=\"#\" class=\"mo-select-optin-type\" data-optin-type=\"sidebar\">\n <?php _e('Sidebar/Widget', 'mailoptin'); ?>\n </a></li>\n <li>\n <a href=\"#\" class=\"mo-select-optin-type\" data-optin-type=\"bar\">\n <?php _e('Notification-Bar', 'mailoptin'); ?>\n </a>\n </li>\n <li>\n <a href=\"#\" class=\"mo-select-optin-type\" data-optin-type=\"slidein\">\n <?php _e('Slide-In', 'mailoptin'); ?>\n </a>\n </li>\n </ul>\n </div>\n </div>\n <?php endif;\n }", "function SKEL_THEME_PREFIX_search_filter($query) {\n\t\tif (isset($_GET['s']) && empty($_GET['s']) && $query->is_main_query()){\n\t\t\t$query->is_search = true;\n\t\t\t$query->is_home = false;\n\t\t}\n\t\treturn $query;\n\t}", "function ve_get_header_section_other() {\n\t/**\n\t * DEFAULT colors:\n\t */\n\t$background_color = '#ffffff';\n\t$header_text_color = '#4e1185';\n\t$slogan_text_color = '#4e1185';\n\tif (get_field('header_background_color')) {\n\t\t$background_color = get_field('header_background_color');\n\t}\n\n\tif (get_field('header_text_color')) {\n\t\t$header_text_color = get_field('header_text_color');\n\t}\n\tif (get_field('slogan_text_color')) {\n\t\t$slogan_text_color = get_field('slogan_text_color');\n\t}\n\tif ( is_user_logged_in() ) {\n\t\tif ( wp_is_mobile() ){\n\t\t\t?>\n\t\t\t<div class=\"full-width header-section-mobile\" style=\"background-color: <?php echo $background_color;?>\">\n\t\t\t\t<nav class=\"navbar navbar-default navbar-fixed-top\">\n\t\t\t\t <div class=\"container-fluid\">\n\t\t\t\t\t<!-- Brand and toggle get grouped for better mobile display -->\n\t\t\t\t\t<div class=\"navbar-header\">\n\t\t\t\t\t <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\" aria-expanded=\"false\">\n\t\t\t\t\t\t<span class=\"sr-only\">Toggle navigation</span>\n\t\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t </button>\n\t\t\t\t\t <a class=\"navbar-brand\" href=\"<?php echo site_url() ?>\">\n\t\t\t\t\t\t<img class=\"logo-area\" src=\"<?php echo get_template_directory_uri().'/images/logo.png'; ?>\">\n\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Collect the nav links, forms, and other content for toggling -->\n\t\t\t\t\t<div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\n\t\t\t\t\t\t<?php ve_get_header_navigation() ?>\n\t\t\t\t\t</div><!-- /.navbar-collapse -->\n\t\t\t\t </div><!-- /.container-fluid -->\n\t\t\t\t</nav>\n\t\t\t</div>\n\t\t\t<?php\n\t\t} else {\n\t\t\t?>\n\t\t\t<div class=\"full-width header-section logged-in-content\" style=\"background-color: <?php echo $background_color;?>\">\n\t\t\t\t<nav class=\"navbar navbar-default navbar-fixed-top\">\n\t\t\t\t <div class=\"container-fluid\">\n\t\t\t\t\t<!-- Brand and toggle get grouped for better mobile display -->\n\t\t\t\t\t<div class=\"navbar-header\">\n\t\t\t\t\t <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\" aria-expanded=\"false\">\n\t\t\t\t\t\t<span class=\"sr-only\">Toggle navigation</span>\n\t\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t </button>\n\t\t\t\t\t <a class=\"navbar-brand\" href=\"<?php echo site_url() ?>\">\n\t\t\t\t\t\t<img class=\"logo-area\" src=\"<?php echo get_template_directory_uri().'/images/logo.png'; ?>\">\n\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Collect the nav links, forms, and other content for toggling -->\n\t\t\t\t\t<div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\n\t\t\t\t\t\t<?php ve_get_header_navigation() ?>\n\t\t\t\t\t</div><!-- /.navbar-collapse -->\n\t\t\t\t </div><!-- /.container-fluid -->\n\t\t\t\t</nav>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t} else {\n\t\t?>\n\t\t<div class=\"full-width header-section\" style=\"background-color: <?php echo $background_color;?>\">\n\t\t\t<nav class=\"navbar navbar-default navbar-fixed-top\">\n\t\t\t <div class=\"container-fluid\">\n\t\t\t\t<!-- Brand and toggle get grouped for better mobile display -->\n\t\t\t\t<div class=\"navbar-header\">\n\t\t\t\t <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\" aria-expanded=\"false\">\n\t\t\t\t\t<span class=\"sr-only\">Toggle navigation</span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t </button>\n\t\t\t\t <a class=\"navbar-brand\" href=\"<?php echo site_url() ?>\">\n\t\t\t\t\t<img class=\"logo-area\" src=\"<?php echo get_template_directory_uri().'/images/logo.png'; ?>\">\n\t\t\t\t</a>\n\t\t\t\t</div>\n\n\t\t\t\t<!-- Collect the nav links, forms, and other content for toggling -->\n\t\t\t\t<div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\n\t\t\t\t\t<?php ve_get_header_navigation() ?>\n\t\t\t\t</div><!-- /.navbar-collapse -->\n\t\t\t </div><!-- /.container-fluid -->\n\t\t\t</nav>\n\t\t</div>\n\t\t<?php\n\t}\n\t?>\n\t<script type=\"application/javascript\">\n\t\t$(document).ready(function($) {\n\t\t\t$(\".company-title-text\").css({\"color\":\"<?php echo $header_text_color;?>\"});\n\t\t\t$(\".company-slogan-text\").css({\"color\":\"<?php echo $slogan_text_color;?>\"});\n\t\t});\n\t</script>\n\t<?php\n}", "function newsroom_elated_get_mobile_nav() {\n\n $slug = 'header-type3';\n\n newsroom_elated_get_module_template_part('templates/parts/mobile-navigation', 'header', $slug);\n }", "function wp_admin_headers()\n {\n }", "function do_header_found(){\n\techo\"\n\t\t<html>\n\t\t<title> Race Search </title>\n\t\t<h1> Search Results: </h1>\n\t\";\n}", "function scribbles_add_search_form() {\n\n\tget_template_part( 'templates/parts/search' );\n\n}", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "function omfg_mobile_pro_header() {\n\tdo_action('omfg_mobile_pro_header');\n}", "function vodi_page_header_home_archive_templates() {\n if ( is_page() && apply_filters( 'vodi_show_site_content_page_header', true ) ) : ?>\n <header class=\"page-header\">\n <?php if ( apply_filters( 'vodi_show_site_content_page_title', true ) ) : ?>\n <h1 class=\"page-title\"><?php echo esc_html( apply_filters( 'vodi_site_content_page_title', get_the_title() ) ); ?></h1>\n <?php endif; ?>\n </header><!-- .entry-header -->\n <?php endif;\n }", "function childtheme_override_search_loop() {\r\n\tglobal $post;\r\n\tglobal $wp_query;\r\n\t$post_type = false;\r\n\r\n\t$rendered_terms = array();\r\n\t$search = urldecode( $_GET['s'] );\r\n\t$search = sanitize_text_field( $search );\r\n\r\n\tif ( ! empty( $_GET['filter'] ) ) {\r\n\t\t$post_type = urldecode( $_GET['filter'] );\r\n\t\t$post_type = sanitize_key( $post_type );\r\n\t}\r\n\r\n\tif ( $post_type ) {\r\n\t\t$post_type_object = get_post_type_object($post_type);\r\n\t\t$categories = array ( $post_type => $post_type_object->labels->name );\r\n\t} else {\r\n\t\t$categories = array(\r\n\t\t\t'destinations' => __('Destination Guides','indagare'), // destination taxonomy\r\n\t\t\t'hotel' => __('Hotels','indagare'),\r\n\t\t\t'restaurant' => __('Restaurants','indagare'),\r\n\t\t\t'shop' => __('Shops','indagare'),\r\n\t\t\t'activity' => __('Activities','indagare'),\r\n\t\t\t'article' => __('Articles','indagare'),\r\n\t\t\t'itinerary' => __('Itineraries','indagare'),\r\n\t\t\t'library' => __('Libraries','indagare'),\r\n\t\t\t'offer' => __('Offers','indagare'),\r\n\t\t\t'insidertrip' => __('Insider Trips','indagare'),\r\n\t\t);\r\n\t}\r\n\r\n\t$searchresults = array();\r\n\t$loaded_pid = array();\r\n\r\n\t$homeid = get_option('page_on_front');\r\n\r\n\twhile ( have_posts() ) {\r\n\t\tthe_post();\r\n\t\t// remove home from results\r\n\t\t$postid = get_the_ID();\r\n\t\tif ( $homeid !== $postid ) {\r\n\t\t\t$termid = false;\r\n\t\t\tif($postid == -1) {\r\n\t\t\t\t$postid = 'term:'.$post->term_id;\r\n\t\t\t\t$termid = true;\r\n\t\t\t}\r\n\t\t\tif ( !in_array( $postid, $loaded_pid ) ) {\r\n\t\t\t\t$loaded_pid[] = $postid;\r\n\t\t\t\tif($termid) {\r\n\t\t\t\t\t$searchresults[$post->post_type][] = $post;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$sort = $post->post_title . ' '. $post->ID;\r\n\t\t\t\t\tif($post->post_type == 'article') {\r\n\t\t\t\t\t\t$sort = $post->post_date . ' '. $post->ID;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$searchresults[$post->post_type][$sort] = $post;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tforeach ($categories as $group => $t) {\r\n\r\n\t\t/* We'll also perform a check to see if there are results for a post type. If there isn't, we'll omit it from the results */\r\n\r\n\t\tif (!array_key_exists($group, $searchresults))\r\n\t\t\tcontinue;\r\n\r\n\t\tif ( $group !== 'destinations' ) {\r\n\t\t\techo '<section class=\"related-articles contain results\">'.\"\\n\";\r\n\t\t}\r\n\r\n\t\techo '<div class=\"header divider\">';\r\n\r\n\t\tif ( $group == 'destinations' ) {\r\n\t\t\techo '<h2>'.__('Destination Guides','indagare').'</h2>'.\"\\n\";\r\n\t\t} else {\r\n\t\t\techo '<h2>'.$t.'</h2>'.\"\\n\";\r\n\t\t}\r\n\r\n\t\tif ( $group !== 'destinations' ) {\r\n\t\t\tif ( empty( $_GET['filter'] ) ) {\r\n\t\t\t\tif ( count( $searchresults[$group] ) > INDG_SEARCHPAGE_SECTIONCOUNT ) {\r\n\t\t\t\t\techo '<p class=\"view-more\"><a href=\"/?s='.urlencode( $search ).'&filter='.$group.'\">'.__('View All Results','indagare').'</a></p>'.\"\\n\";\r\n\t\t\t\t\tif($group == 'article') {\r\n\t\t\t\t\t\tksort($searchresults[$group]);\r\n\t\t\t\t\t\t$newarray = array_slice($searchresults[$group],-8,8,true);\r\n\t\t\t\t\t\trsort($newarray);\r\n\t\t\t\t\t\t$searchresults[$group] = $newarray;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$keys = array_rand($searchresults[$group],INDG_SEARCHPAGE_SECTIONCOUNT);\r\n\t\t\t\t\t\t$newarray = array();\r\n\t\t\t\t\t\tforeach($keys as $k) {\r\n\t\t\t\t\t\t\t$newarray[$k] = $searchresults[$group][$k];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$searchresults[$group] = $newarray;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if ($group == 'article') {\r\n\t\t\t\tksort($searchresults[$group]);\r\n\t\t\t\trsort($searchresults[$group]);\r\n\t\t\t}\r\n\t\t\tksort($searchresults[$group]);\r\n\t\t}\r\n\r\n\t\techo '</div>'.\"\\n\";\r\n\r\n\t\tif ( $group == 'destinations' ) {\r\n\t\t\techo '<section class=\"all-destinations contain\" location=\"AAAA\">'.\"\\n\";\r\n\t\t}\r\n\r\n\t\t/* Ok, we now need to spit out any post data we want to display in our results */\r\n\r\n\t\t$destlist = array();\r\n\t\t$destcount = 0;\r\n\t\t$destskip = 0;\r\n\r\n\t\tforeach ($searchresults[$group] as $post) {\r\n\t\t\tif ( $group == 'destinations' && empty( $_GET['filter'] ) ) {\r\n\r\n\t\t\t\t$destination = get_term_by( 'name', $post->post_title, 'destinations' );\r\n\t\t\t\t$destinationid = $destination->term_id;\r\n\t\t\t\t$destinationstree = destinationstaxtree($destination->term_id);\r\n\t\t\t\t$dest = $destinationstree['dest'];\r\n\t\t\t\t$reg = $destinationstree['reg'];\r\n\t\t\t\t$top = $destinationstree['top'];\r\n\t\t\t\t$depth = $destinationstree['depth'];\r\n\r\n\t\t\t\tif ( $depth!==3 && $destcount > 0 && !in_array($destinationid,$destlist) ) {\r\n\t\t\t\t\t$destlist[] = $destinationid;\r\n\t\t\t\t\t$destskip = 0;\r\n\t\t\t\t} else if ( $depth!==3 && $destcount == 0 ) {\r\n\t\t\t\t\t$destlist[] = $destinationid;\r\n\t\t\t\t\t$destskip = 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$destskip = 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$destcount++;\r\n\r\n//\t\t\t\techo $depth;\r\n\r\n\t\t\t\tif ( $depth == 1 ) {\r\n\t\t\t\t\t$destinations = get_terms( 'destinations', array( 'child_of' => $reg->term_id , 'parent' => $reg->term_id, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => false) );\r\n\t\t\t\t} else if ( $depth == 2 ) {\r\n\t\t\t\t\t$destinations = get_terms( 'destinations', array( 'include' => array($destination->term_id), 'hide_empty' => false) );\r\n\t\t\t\t}\r\n\r\n//\t\t\t\t\t\tif ( $destinations && $depth !== 3 && $destskip == 0 ) {\r\n\t\t\t\tif ( $destinations && $destskip == 0 ) {\r\n\t\t\t\t\tforeach ( $destinations as $term ) {\r\n\t\t\t\t\t\tif(!in_array($term->term_id, $rendered_terms)) {\r\n\t\t\t\t\t\t\t$rendered_terms[] = $term->term_id;\r\n\t\t\t\t\t\t\tprint render_destination_term($top, $reg, $term);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\techo '<article id=\"post-'.get_the_ID().'\" ';\r\n\t\t\t\tpost_class('contain');\r\n\t\t\t\techo '>';\r\n\t\t\t\tthematic_postheader();\r\n\t\t\t\techo '<div class=\"entry-content\">';\r\n\t\t\t\tthematic_content();\r\n\t\t\t\techo '</div><!-- .entry-content -->';\r\n\t\t\t\tthematic_postfooter();\r\n\t\t\t\techo '</article><!-- #post -->';\r\n\t\t\t}\r\n\t\t}\r\n\t\techo '</section>'.\"\\n\";\r\n\r\n\t}\r\n\r\n}", "public function optin_theme_sub_header()\n {\n if (!empty($_GET['page']) && $_GET['page'] == MAILOPTIN_OPTIN_CAMPAIGNS_SETTINGS_SLUG) : ?>\n <div class=\"mailoptin-optin-new-list mailoptin-optin-clear\">\n <h4><?php _e('Title', 'mailoptin'); ?>\n <input type=\"text\" name=\"mailoptin-optin-campaign\" id=\"mailoptin-add-optin-campaign-title\" placeholder=\"<?php _e('Enter a name...', 'mailoptin') ?>\">\n </h4>\n </div>\n <div id=\"mailoptin-sub-bar\">\n <div class=\"mailoptin-new-toolbar mailoptin-clear\">\n <h4><?php _e('Select Optin Type', 'mailoptin'); ?>\n <span class=\"spinner mo-dash-spinner\"></span>\n </h4>\n <span class=\"sr-only\"><?php __('Loading...', 'mailoptin'); ?></span>\n <ul class=\"mailoptin-design-options\">\n <li>\n <a href=\"#\" class=\"mo-select-optin-type mailoptin-type-active\" data-optin-type=\"lightbox\">\n <?php _e('Lightbox', 'mailoptin'); ?>\n </a>\n </li>\n <li>\n <a href=\"#\" class=\"mo-select-optin-type\" data-optin-type=\"inpost\">\n <?php _e('In-Post', 'mailoptin'); ?>\n </a>\n </li>\n <li>\n <a href=\"#\" class=\"mo-select-optin-type\" data-optin-type=\"sidebar\">\n <?php _e('Sidebar/Widget', 'mailoptin'); ?>\n </a></li>\n <li>\n <a href=\"#\" class=\"mo-select-optin-type\" data-optin-type=\"bar\">\n <?php _e('Notification-Bar', 'mailoptin'); ?>\n </a>\n </li>\n <li>\n <a href=\"#\" class=\"mo-select-optin-type\" data-optin-type=\"slidein\">\n <?php _e('Slide-In', 'mailoptin'); ?>\n </a>\n </li>\n </ul>\n </div>\n </div>\n <?php endif;\n }", "function theme_features()\n{\n register_nav_menu('headerMenuLocation', 'Header Menu Location');\n register_nav_menu('footerLocationOne', 'Footer Location One');\n register_nav_menu('footerLocationTwo', 'Footer Location Two');\n add_theme_support('title-tag');\n}", "function windsor_hovers_theme_setup3() {\n\t\twindsor_storage_set_array_before('options', 'search_style', array(\n\t\t\t'menu_hover' => array(\n\t\t\t\t\"title\" => esc_html__('Menu hover', 'windsor'),\n\t\t\t\t\"desc\" => wp_kses_data( __('Select hover effect to decorate main menu', 'windsor') ),\n\t\t\t\t\"std\" => 'fade',\n\t\t\t\t\"options\" => array(\n\t\t\t\t\t'fade'\t\t\t=> esc_html__('Fade',\t\t'windsor'),\n\t\t\t\t\t'fade_box'\t\t=> esc_html__('Fade Box',\t'windsor'),\n\t\t\t\t\t'slide_line'\t=> esc_html__('Slide Line',\t'windsor'),\n\t\t\t\t\t'slide_box'\t\t=> esc_html__('Slide Box',\t'windsor'),\n\t\t\t\t\t'zoom_line'\t\t=> esc_html__('Zoom Line',\t'windsor'),\n\t\t\t\t\t'path_line'\t\t=> esc_html__('Path Line',\t'windsor'),\n\t\t\t\t\t'roll_down'\t\t=> esc_html__('Roll Down',\t'windsor'),\n\t\t\t\t\t'color_line'\t=> esc_html__('Color Line',\t'windsor'),\n\t\t\t\t),\n\t\t\t\t\"type\" => \"select\"\n\t\t\t\t),\n\t\t\t'menu_animation_in' => array( \n\t\t\t\t\"title\" => esc_html__('Submenu show animation', 'windsor'),\n\t\t\t\t\"desc\" => wp_kses_data( __('Select animation to show submenu ', 'windsor') ),\n\t\t\t\t\"std\" => \"fadeInUpSmall\",\n\t\t\t\t\"options\" => windsor_get_list_animations_in(),\n\t\t\t\t\"type\" => \"select\"\n\t\t\t\t),\n\t\t\t'menu_animation_out' => array( \n\t\t\t\t\"title\" => esc_html__('Submenu hide animation', 'windsor'),\n\t\t\t\t\"desc\" => wp_kses_data( __('Select animation to hide submenu ', 'windsor') ),\n\t\t\t\t\"std\" => \"fadeOutDownSmall\",\n\t\t\t\t\"options\" => windsor_get_list_animations_out(),\n\t\t\t\t\"type\" => \"select\"\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t// Add 'Buttons hover' option\n\t\twindsor_storage_set_array_before('options', 'sidebar_widgets', array(\n\t\t\t'button_hover' => array(\n\t\t\t\t\"title\" => esc_html__(\"Button's hover\", 'windsor'),\n\t\t\t\t\"desc\" => wp_kses_data( __('Select hover effect to decorate all theme buttons', 'windsor') ),\n\t\t\t\t\"std\" => 'slide_left',\n\t\t\t\t\"options\" => array(\n\t\t\t\t\t'default'\t\t=> esc_html__('Fade',\t\t\t\t'windsor'),\n\t\t\t\t\t'slide_left'\t=> esc_html__('Slide from Left',\t'windsor'),\n\t\t\t\t\t'slide_right'\t=> esc_html__('Slide from Right',\t'windsor'),\n\t\t\t\t\t'slide_top'\t\t=> esc_html__('Slide from Top',\t\t'windsor'),\n\t\t\t\t\t'slide_bottom'\t=> esc_html__('Slide from Bottom',\t'windsor'),\n//\t\t\t\t\t'arrow'\t\t\t=> esc_html__('Arrow',\t\t\t\t'windsor'),\n\t\t\t\t),\n\t\t\t\t\"type\" => \"select\"\n\t\t\t),\n\t\t\t'image_hover' => array(\n\t\t\t\t\"title\" => esc_html__(\"Image's hover\", 'windsor'),\n\t\t\t\t\"desc\" => wp_kses_data( __('Select hover effect to decorate all theme images', 'windsor') ),\n\t\t\t\t\"std\" => 'dots',\n\t\t\t\t\"override\" => array(\n\t\t\t\t\t'mode' => 'page',\n\t\t\t\t\t'section' => esc_html__('Content', 'windsor')\n\t\t\t\t),\n\t\t\t\t\"options\" => array(\n\t\t\t\t\t'dots'\t=> esc_html__('Dots',\t'windsor'),\n\t\t\t\t\t'icon'\t=> esc_html__('Icon',\t'windsor'),\n\t\t\t\t\t'icons'\t=> esc_html__('Icons',\t'windsor'),\n\t\t\t\t\t'zoom'\t=> esc_html__('Zoom',\t'windsor'),\n\t\t\t\t\t'fade'\t=> esc_html__('Fade',\t'windsor'),\n\t\t\t\t\t'slide'\t=> esc_html__('Slide',\t'windsor'),\n\t\t\t\t\t'pull'\t=> esc_html__('Pull',\t'windsor'),\n\t\t\t\t\t'border'=> esc_html__('Border',\t'windsor')\n\t\t\t\t),\n\t\t\t\t\"type\" => \"select\"\n\t\t\t) )\n\t\t);\n\t}", "function quadro_social_icons_header() {\n\tquadro_social_icons('social_header_display', 'header-social-icons', 'header_icons_scheme', 'header_icons_color_type');\n}", "function universityFeatures() {\n add_theme_support('title-tag');\n}", "function install_theme_search_form($type_selector = \\true)\n {\n }", "function smarty_outputfilter_admintitle($source, $view)\n{\n // get all the matching H1 tags\n $regex = \"/<h1>[^<]*<\\/h1>/\";\n preg_match_all($regex, $source, $h1);\n $regex = \"/<h2>[^<]*<\\/h2>/\";\n preg_match_all($regex, $source, $h2);\n $regex = \"/<h3>[^<]*<\\/h3>/\";\n preg_match_all($regex, $source, $h3);\n\n // init vars\n $titleargs = array();\n $header1 = $header2 = $header3 = '';\n\n // set the title\n // header level 1\n if (isset($h1[0]) && isset($h1[0][1])) {\n $header1 = $h1[0][1];\n }\n if (isset($header1) && !empty($header1)) {\n $titleargs[] = $header1;\n }\n // header level 2\n if (isset($h2[0][0])) {\n $header2 = $h2[0][0];\n }\n if (isset($header2) && !empty($header2)) {\n $titleargs[] = $header2;\n }\n // header level 3\n if (isset($h3[0]) && isset($h3[0][1])) {\n $header3 = $h3[0][1];\n }\n if (isset($header3) && !empty($header3)) {\n $titleargs[] = $header3;\n }\n\n if (!empty($titleargs)) {\n PageUtil::setVar('title', System::getVar('sitename') . ' - ' . strip_tags(implode(' / ', $titleargs)));\n }\n\n // return the modified source\n return $source;\n}", "function emc_project_header() {\r\n\r\n\t$term = get_queried_object();\r\n\t$term_id = $term->taxonomy . '_' . $term->term_id;\r\n\t$content = get_field( 'project_contacts', $term_id );\r\n\t$html = apply_filters( 'the_content', $content );\r\n\r\n\techo $html;\r\n\r\n}", "function Get_Search_Box_HTML()\n{\n $html = \"\";\n $html .= '<div class=\"Left_Search_Box left_box_menu\">';\n $html .= '<h3 class=\"Small_Bottom_Margin Standard_Padding\">Search</h3>';\n $html .= Get_Search_Form_HTML();\n $html .= '</div>';\n return $html;\n}", "function base_registerMenus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Header Menu' ),\n )\n );\n}", "function YOUR_THEME_theme() {\n return array(\n 'ecl_search_form_wrapper' => array(\n 'render element' => 'element',\n ),\n );\n}", "function cera_grimlock_header_callback() {\n\t\tif ( apply_filters( 'grimlock_navigation_has_position_top', true ) ) :\n\t\t\tdo_action( 'grimlock_navigation' );\n\t\tendif;\n\n\t\tdo_action( 'grimlock_custom_header' );\n\n\t\tif ( apply_filters( 'grimlock_navigation_has_position_bottom', true ) ) :\n\t\t\tdo_action( 'grimlock_navigation' );\n\t\tendif;\n\t}", "function _or_chart_url_build_header($user_page_user = NULL) {\n\n $header = array();\n if (user_access('manage and filter site statistics')) { \n //$header[] = theme('table_select_header_cell');\n }\n $header[] = array('data' => t('url'), 'field' => 'url');\n $header[] = array('data' => t('url名'), 'field' => 'urlname');\n $header[] = array('data' => t('时间'), 'field' => 'created', 'sort' => 'desc');\n $header[] = array('data' => t('总访问量'), 'field' => 'visit_num');\n if (user_access('manage and filter site statistics')) {\n $header[] = array('data' => t('操作'));\n }\n\n //add table select all\n drupal_add_js('misc/tableselect.js');\n array_unshift($header, array('class' => array('select-all')));\n return $header;\n}", "function add_custom_shop_header(){ ?>\n \n \n <?php if ( is_woocommerce() || is_shop() || is_cart() || is_product() || is_checkout() ) : ?>\n \n \t<!-- our custom header codes here -->\n\t\t \n\t<div class=\"e242-1 x-section _before _gradient-overlay\" id=\"inner-hero\">\n \t\t \n\t\t<div class=\"e242-2 x-container max width\">\n\t\t\t<div class=\"e242-3 x-column x-sm x-1-1\">\n\t\t\t <div class=\"x-text -white head-title _max-1000 _center\"><h1>Bookstore</h1></div>\n\t\t\t</div>\n\t\t</div>\n </div>\n\t\t \n <?php endif; ?>\n \n<?php }", "function add_admin_header() {\n }", "function pgsf_get_byu_navigation() { \n\n\n\n\t\tif ( get_field( 'display_header_sub-navigation', 'parent_options' ) ) { ?>\n\t\t\t<byu-menu slot=\"nav\"> \n\n\t\t\t\t<?php // loop through the rows of data\n\t\t\t \twhile ( have_rows( 'sub-navigation', 'parent_options' ) ) { the_row();\n\n\t\t\t\t\t// check current row layout\n\t\t\t\t\tif ( 'link_information' === get_row_layout() ) {\n\n\t\t\t\t\t\t$link_title = get_sub_field( 'title' );\n\t\t\t\t\t\t$link_url = get_sub_field( 'url' ); ?>\n\n\t\t\t\t\t\t<li><a href=\" <?php echo esc_url( $link_url ); ?>\"><?php echo esc_html( $link_title ); ?></a></li>\n\t\t\t\t\t\n\t\t\t\t\t<?php }\n\t\t\t\t} ?>\n\t\t\t</byu-menu>\n\t\t<?php }\n}", "function add_specific_menu_location_atts( $atts, $item, $args ) {\n if( $args->theme_location == 'header' ) {\n // add the desired attributes:\n $atts['class'] = 'navbar-item';\n }\n return $atts;\n}", "function ind_header( ) {\n\t$css = get_theme_root().\"/\".get_template().\"/indizar.css\";\n\tif(file_exists($css)) {\n\t\t$css_register = get_bloginfo('template_directory').'/indizar.css';\n\t} else {\n\t\t$css_register = ind_plugin_url('/css/indizar.css');\n\t}\n\t\n\tif((is_single() || is_page()) && INDIZAR_DIV) {\n\t\t//Define custom JavaScript options\n\t\t//$div = str_replace(array('%id%'), array(get_the_ID()), INDIZAR_DIV);\n\t\t$div = INDIZAR_DIV;\n\t\t$top = INDIZAR_DIV;\n\t\tif(INDIZAR_TOPDIV)\n\t\t\t$top = INDIZAR_TOPDIV;\n\t\t//$top = str_replace(array('%id%'), array(get_the_ID()), $top);\n\t\techo \"<script type='text/javascript'>\n\t\tindizar_div = '$div';\n\t\tindizar_top = '$top';\n\t\t</script>\n\t\t\";\n\n\t\t//Declare javascript\n\t\twp_register_script('scrollto', $url.'/wp-content/plugins/indizar/scripts/jquery.scrollTo-min.js', array('jquery'), INDIZAR_HEADER_V);\n\t\twp_register_script('indizar', $url.'/wp-content/plugins/indizar/indizar.js', array('scrollto'), INDIZAR_HEADER_V);\n\t\twp_enqueue_script('indizar');\n\t\twp_print_scripts( array( 'indizar' ));\n\t}\n\t\n\t//Declare style\n\twp_register_style('indizar', $css_register, false, INDIZAR_HEADER_V);\n\twp_enqueue_style('indizar');\n\twp_print_styles( array( 'indizar' ));\n}", "function HookResourceConnectAllSearchfiltertop()\n\t{\n\tglobal $lang,$language,$resourceconnect_affiliates,$baseurl,$resourceconnect_selected;\n\tif (!checkperm(\"resourceconnect\")) {return false;}\n\t?>\n<script>\n $( function() {\n $( document ).tooltip();\n } );\n </script>\n\t<div class=\"SearchItem ResourceConnectSearch\"><?php echo $lang[\"resourceconnect_search_database\"];?>&nbsp;<a href=\"#\" onClick=\"styledalert('<?php echo $lang[\"resourceconnect_search_database\"] ?>','<?php echo $lang[\"resourceconnect_search_info\"] ?>');\" title=\"<?php echo $lang[\"resourceconnect_search_info\"] ?>\"><i class=\"fa fa-info-circle\"></i></a><br />\n\t<select class=\"SearchWidth\" name=\"resourceconnect_selected\">\n\t\n\t<?php for ($n=0;$n<count($resourceconnect_affiliates);$n++)\n\t\t{\n\t\t?>\n\t\t<option value=\"<?php echo $n ?>\" <?php if ($resourceconnect_selected==$n) { ?>selected<?php } ?>><?php echo i18n_get_translated($resourceconnect_affiliates[$n][\"name\"]) ?></option>\n\t\t<?php\t\t\n\t\t}\n\t?>\n\t</select>\n\t</div>\n\t<?php\n\t}", "function oh_nav()\n{\n\twp_nav_menu(\n\tarray(\n\t\t'theme_location' => 'header-menu',\n\t\t'menu' => '',\n\t\t'container' => 'div',\n\t\t'container_class' => 'menu-{menu slug}-container',\n\t\t'container_id' => '',\n\t\t'menu_class' => 'menu',\n\t\t'menu_id' => '',\n\t\t'echo' => true,\n\t\t'fallback_cb' => 'wp_page_menu',\n\t\t'before' => '',\n\t\t'after' => '',\n\t\t'link_before' => '',\n\t\t'link_after' => '',\n\t\t'items_wrap' => '<ul class=\"nav navbar-nav navbar-right no-margin alt-font text-normal\" data-in=\"fadeIn\" data-out=\"fadeOut\">%3$s</ul>',\n\t\t'depth' => 0,\n\t\t'walker' => ''\n\t\t)\n\t);\n}", "public function haz_eff_hea(){\n $this->search_list();\n\t}", "function ks_nav() {\n\twp_nav_menu(\n\t\tarray(\n\t\t\t'theme_location' => 'header-menu',\n\t\t\t'menu' => '',\n\t\t\t'container' => 'div',\n\t\t\t'container_class' => 'menu-{menu slug}-container',\n\t\t\t'container_id' => '',\n\t\t\t'menu_class' => 'menu',\n\t\t\t'menu_id' => '',\n\t\t\t'echo' => true,\n\t\t\t'fallback_cb' => 'wp_page_menu',\n\t\t\t'before' => '',\n\t\t\t'after' => '',\n\t\t\t'link_before' => '',\n\t\t\t'link_after' => '',\n\t\t\t'items_wrap' => '<ul>%3$s</ul>',\n\t\t\t'depth' => 0,\n\t\t\t'walker' => ''\n\t\t)\n\t);\n}", "function myplugin_custom_walker( $args ) {\n if($args['theme_location']==\"\")\n {\n return array_merge( $args, array(\n 'container_class'=>\"menu_list\",\n 'menu_class'=>'',\n ) );\n } else {\n return array_merge( $args, array(\n 'theme_location' => 'primary',\n 'menu_class' => 'nav navbar-nav',\n ) );\n }\n}", "function studio_before_header_widget_area() {\n\n\tgenesis_widget_area( 'before-header', array(\n\t 'before' => '<div class=\"before-header\"><div class=\"wrap\">',\n\t 'after'\t => '</div></div>',\n\t) );\n}", "function printHeaderItems() {\n\t\t\t?>\n\t\t\t<!--[if lte IE 7]>\n\t\t\t<script type=\"text/javascript\">\n\t\t\tsfHover=function(){var sfEls=document.getElementById(\"nav\").getElementsByTagName(\"LI\");for(var i=0;i<sfEls.length;i++){sfEls[i].onmouseover=function(){this.className+=\" sfhover\";}\n\t\t\tsfEls[i].onmouseout=function(){this.className=this.className.replace(new RegExp(\" sfhover\\\\b\"),\"\");}}}\n\t\t\tif (window.attachEvent)window.attachEvent(\"onload\",sfHover);\n\t\t\t</script>\n\t\t\t<![endif]-->\n\t\t\t<?php\n\t\t}", "function modemaken_main_search() {\n\t?>\n\t<form class=\"search-form first\" method=\"get\" action=\"<?php echo home_url(); ?>\" role=\"search\">\n\t\t<label for=\"main-search-mvs-bedrijf\">Zoek een (web)winkel, naailes of modeopleiding</label>\n\t\t<input type=\"hidden\" name=\"post_type\" value=\"mvs_bedrijf\">\n\t\t<input type=\"search\" name=\"s\" id=\"main-search-mvs-bedrijf\" autocomplete=\"off\" value=\"\" placeholder=\"bijvoorbeeld: naailes Amsterdam\"><button type=\"submit\">Zoek</button>\n\t</form>\n\t<?php\n}", "function SetupSearchOptions() {\n\t\tglobal $Language;\n\t\t$this->SearchOptions = new cListOptions();\n\t\t$this->SearchOptions->Tag = \"div\";\n\t\t$this->SearchOptions->TagClassName = \"ewSearchOption\";\n\n\t\t// Search button\n\t\t$item = &$this->SearchOptions->Add(\"searchtoggle\");\n\t\t$SearchToggleClass = ($this->SearchWhere <> \"\") ? \" active\" : \" active\";\n\t\t$item->Body = \"<button type=\\\"button\\\" class=\\\"btn btn-default ewSearchToggle\" . $SearchToggleClass . \"\\\" title=\\\"\" . $Language->Phrase(\"SearchPanel\") . \"\\\" data-caption=\\\"\" . $Language->Phrase(\"SearchPanel\") . \"\\\" data-toggle=\\\"button\\\" data-form=\\\"fuserslistsrch\\\">\" . $Language->Phrase(\"SearchBtn\") . \"</button>\";\n\t\t$item->Visible = TRUE;\n\n\t\t// Show all button\n\t\t$item = &$this->SearchOptions->Add(\"showall\");\n\t\t$item->Body = \"<a class=\\\"btn btn-default ewShowAll\\\" title=\\\"\" . $Language->Phrase(\"ShowAll\") . \"\\\" data-caption=\\\"\" . $Language->Phrase(\"ShowAll\") . \"\\\" href=\\\"\" . $this->PageUrl() . \"cmd=reset\\\">\" . $Language->Phrase(\"ShowAllBtn\") . \"</a>\";\n\t\t$item->Visible = ($this->SearchWhere <> $this->DefaultSearchWhere && $this->SearchWhere <> \"0=101\");\n\n\t\t// Button group for search\n\t\t$this->SearchOptions->UseDropDownButton = FALSE;\n\t\t$this->SearchOptions->UseImageAndText = TRUE;\n\t\t$this->SearchOptions->UseButtonGroup = TRUE;\n\t\t$this->SearchOptions->DropDownButtonPhrase = $Language->Phrase(\"ButtonSearch\");\n\n\t\t// Add group option item\n\t\t$item = &$this->SearchOptions->Add($this->SearchOptions->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->Visible = FALSE;\n\n\t\t// Hide search options\n\t\tif ($this->Export <> \"\" || $this->CurrentAction <> \"\")\n\t\t\t$this->SearchOptions->HideAllOptions();\n\t\tglobal $Security;\n\t\tif (!$Security->CanSearch()) {\n\t\t\t$this->SearchOptions->HideAllOptions();\n\t\t\t$this->FilterOptions->HideAllOptions();\n\t\t}\n\t}", "function SetupSearchOptions() {\n\t\tglobal $Language;\n\t\t$this->SearchOptions = new cListOptions();\n\t\t$this->SearchOptions->Tag = \"div\";\n\t\t$this->SearchOptions->TagClassName = \"ewSearchOption\";\n\n\t\t// Search button\n\t\t$item = &$this->SearchOptions->Add(\"searchtoggle\");\n\t\t$SearchToggleClass = ($this->SearchWhere <> \"\") ? \" active\" : \" active\";\n\t\t$item->Body = \"<button type=\\\"button\\\" class=\\\"btn btn-default ewSearchToggle\" . $SearchToggleClass . \"\\\" title=\\\"\" . $Language->Phrase(\"SearchPanel\") . \"\\\" data-caption=\\\"\" . $Language->Phrase(\"SearchPanel\") . \"\\\" data-toggle=\\\"button\\\" data-form=\\\"fsolicitudlistsrch\\\">\" . $Language->Phrase(\"SearchLink\") . \"</button>\";\n\t\t$item->Visible = TRUE;\n\n\t\t// Show all button\n\t\t$item = &$this->SearchOptions->Add(\"showall\");\n\t\t$item->Body = \"<a class=\\\"btn btn-default ewShowAll\\\" title=\\\"\" . $Language->Phrase(\"ShowAll\") . \"\\\" data-caption=\\\"\" . $Language->Phrase(\"ShowAll\") . \"\\\" href=\\\"\" . $this->PageUrl() . \"cmd=reset\\\">\" . $Language->Phrase(\"ShowAllBtn\") . \"</a>\";\n\t\t$item->Visible = ($this->SearchWhere <> $this->DefaultSearchWhere && $this->SearchWhere <> \"0=101\");\n\n\t\t// Button group for search\n\t\t$this->SearchOptions->UseDropDownButton = FALSE;\n\t\t$this->SearchOptions->UseImageAndText = TRUE;\n\t\t$this->SearchOptions->UseButtonGroup = TRUE;\n\t\t$this->SearchOptions->DropDownButtonPhrase = $Language->Phrase(\"ButtonSearch\");\n\n\t\t// Add group option item\n\t\t$item = &$this->SearchOptions->Add($this->SearchOptions->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->Visible = FALSE;\n\n\t\t// Hide search options\n\t\tif ($this->Export <> \"\" || $this->CurrentAction <> \"\")\n\t\t\t$this->SearchOptions->HideAllOptions();\n\t\tglobal $Security;\n\t\tif (!$Security->CanSearch()) {\n\t\t\t$this->SearchOptions->HideAllOptions();\n\t\t\t$this->FilterOptions->HideAllOptions();\n\t\t}\n\t}", "function newsroom_elated_get_main_menu($additional_class = 'eltd-default-nav') {\n newsroom_elated_get_module_template_part('templates/parts/navigation', 'header', '', array('additional_class' => $additional_class));\n }" ]
[ "0.7333754", "0.7208384", "0.70770043", "0.68466973", "0.67504126", "0.6710541", "0.6684724", "0.66337186", "0.653288", "0.6329191", "0.6309149", "0.6306499", "0.6290177", "0.62791806", "0.6261569", "0.62576604", "0.6240682", "0.6239846", "0.62398326", "0.6220703", "0.6214041", "0.61734056", "0.6171491", "0.6146453", "0.6122779", "0.61151814", "0.6098094", "0.6079715", "0.6057016", "0.59550923", "0.5944104", "0.59292185", "0.59060615", "0.5899192", "0.5889725", "0.5889045", "0.5874335", "0.5872479", "0.5868798", "0.5859821", "0.5845624", "0.5842902", "0.58285713", "0.57844675", "0.576616", "0.57631826", "0.57630813", "0.5758443", "0.57564473", "0.5754973", "0.57540154", "0.57431954", "0.5735592", "0.57312924", "0.57200855", "0.57196176", "0.57089037", "0.57061553", "0.5703422", "0.5701724", "0.5701111", "0.5689555", "0.5686396", "0.5685868", "0.568177", "0.5680396", "0.56786966", "0.5675148", "0.56673265", "0.56659096", "0.5665361", "0.56508267", "0.5650703", "0.56464124", "0.5645", "0.56433326", "0.5633812", "0.56323093", "0.5627209", "0.5622281", "0.56212234", "0.5619631", "0.56139916", "0.56044716", "0.55969965", "0.5586758", "0.5583521", "0.55802757", "0.55721325", "0.55648816", "0.5560719", "0.55555344", "0.55540943", "0.5552571", "0.5542734", "0.55388445", "0.55368495", "0.5530204", "0.5530139", "0.5529994" ]
0.7612716
0
Fix nav menu arguments
function jet_menu_oceanwp_fix_menu_args( $args ) { if ( ! isset( $args['menu_class'] ) || 'jet-menu' !== $args['menu_class'] ) { return $args; } $args['link_before'] = ''; $args['link_after'] = ''; return $args; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modify_nav_arguments($arguments){\n\n $arguments['walker'] \t\t\t\t= new accesspress_mag_walker();\n //$arguments['container_class'] \t\t= $arguments['container_class'] .= 'mega-menu-wrapper';\n $arguments['menu_class']\t\t\t= 'menu accesspress_mag_mega_menu';\n\n return $arguments;\n }", "function sic_page_menu_args( $args ) {\n\t$args['menu_class'] = 'nav';\n\t$args['container'] = FALSE;\n\n\n\treturn $args;\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n $args['menu_class'] = 'nav-list';\n return $args;\n}", "function aw2_navwalker_modify_nav_menu_args( $args )\n{\n\n\tif(!isset($args['container']))\n\t{\n\t\t$args['container'] ='div';\n\t}\n\tif(!isset($args['container_class']) || empty($args['container_class']))\n\t{\n\t\t$args['container_class'] = 'collapse navbar-collapse';\n\t}\n\n\tif(!isset($args['walker']) || empty($args['walker']))\n\t{\n\t\t\n\t\tif ( !class_exists( 'wp_bootstrap_navwalker' ) ) {\n\t\t\trequire('wp_bootstrap_navwalker.php');\n\t\t}\n\t\t\n\t\t$args['walker'] = new wp_bootstrap_navwalker();\n\t\t$args['fallback_cb']='wp_bootstrap_navwalker::fallback';\n\t\t@$args['menu_class'] =$args['menu_class'].' nav navbar-nav';\n\t}\n\t\n\tif(isset($args['walker']) && $args['walker']=='default')\n\t{\n\t\t$args['walker'] = new Walker_Nav_Menu;\n\t\t$args['fallback_cb']='';\n\t\t$args['menu_class'] =$args['menu_class'].' nav navbar-nav';\n\t\t$args['container_class'] =$args['container_class'].' navbar-collapse ';\n\t}\n\n\treturn $args;\n}", "function revo_nav_menu_args($args = '') {\n\t$revo_nav_menu_args['container'] = false;\n\t$revo_theme_locates = array();\n\t$revo_menu = sw_options( 'menu_location' );\n\tif( !is_array( $revo_menu ) ){\n\t\t$revo_theme_locates[] = $revo_menu;\n\t}else{\n\t\t$revo_theme_locates = $revo_menu;\n\t}\n\tif (!$args['items_wrap']) {\n\t\t$revo_nav_menu_args['items_wrap'] = '<ul class=\"%2$s\">%3$s</ul>';\n\t}\n\tif (!$args['walker']) {\n\t\tif ( 'mega' == sw_options( 'menu_type' ) && $revo_theme_locates[0] != NULL && in_array( $args['theme_location'], $revo_theme_locates ) ){\n\t\t\t$args['menu_class'] .= ' revo-mega';\n\t\t\t$revo_nav_menu_args['walker'] = new Revo_Mega_Menu_Walker();\n\t\t\t\n\t\t\tif( !revo_mobile_check() ) :\n\t\t\t\twp_enqueue_script('revo_megamenu', get_template_directory_uri() . '/js/megamenu.js', array(), null, true);\n\t\t\tendif;\n\t\t\t\n\t\t} else {\n\t\t\t$revo_nav_menu_args['walker'] = new Revo_Menu_Walker();\n\t\t}\n\t}\n\n\treturn array_merge($args, $revo_nav_menu_args);\n}", "public function filter_wp_nav_menu_args($args)\n {\n }", "function nav_menu_args($args = '') {\n\t$nav_menu_args = array();\n\n\t$nav_menu_args['container'] = false;\n\n\tif (!$args['items_wrap']) {\n\t\t$nav_menu_args['items_wrap'] = '<ul class=\"%2$s\">%3$s</ul>';\n\t}\n\n\tif (!$args['depth']) {\n\t\t$nav_menu_args['depth'] = 2;\n\t}\n\n\treturn array_merge($args, $nav_menu_args);\n}", "public function hash_nav_menu_args($args)\n {\n }", "function ks_wp_nav_menu_args( $args = '' ) {\n\t$args['container'] = false;\n\n\treturn $args;\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n return $args;\n}", "function my_wp_nav_menu_args( $args = '' ) {\n\t$args['container'] = false;\n\treturn $args;\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n return $args;\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n return $args;\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n return $args;\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n return $args;\n}", "function new_spa_menu_items($items, $args) {\n\n if( get_option('is_single_page') && $args->theme_location == 'header-menu' ){\n\n $myItems = wp_get_nav_menu_items($args->menu);\n foreach ($myItems as $item) {\n if ($item->post_parent){\n $auxUrl = str_replace(get_site_url().'/','#post-', $item->url);\n $auxUrl = str_replace('#post-home/','#post-', $auxUrl);\n $auxUrl = str_replace('#post-inicio/','#post-', $auxUrl);\n $auxUrl = str_replace('/','', $auxUrl);\n $auxUrl = str_replace('#post-',get_site_url().'#post-', $auxUrl);\n\n $items = str_replace($item->url, $auxUrl, $items);\n }\n }\n\n return $items;\n }\n else{\n return $items;\n }\n}", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"Notifiable Diseases\", \"LIBRARIES\", \"_notifiable\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "protected function setup_menu() {\n\t\t$nag = '';\n\n\t\tif ( $this->has_notices() ) {\n\t\t\t$nag = \" <span class='wp-shp-browser-info dashicons dashicons-info' style='line-height: 0.8em'></span>\";\n\t\t}\n\n\t\t$defaults = array(\n\t\t\t'menu_title' => __( 'Showcase', 'wp-shp-browser' ),\n\t\t\t'page_title' => $this->get_page_title(),\n\t\t\t'page_slug' => $this->page_slug,\n\t\t\t'action_link' => false,\n\t\t\t'admin_action_priority' => 99,\n\t\t);\n\t\t$this->args = wp_parse_args( $this->args, $defaults );\n\n\t\t$this->args['menu_title'] .= $nag;\n\t}", "function charity_page_menu_args() {\n\t$args = array (\n\t\t'sort_column' => 'menu_order',\n\t\t'menu_class' => 'menu',\n\t\t'include' => '',\n\t\t'exclude' => '',\n\t\t'echo' => FALSE,\n\t\t'show_home' => FALSE,\n\t\t'link_before' => '',\n\t\t'link_after' => ''\n\t);\n\treturn $args;\n}", "public function nav_menu_args( $args = [] ) {\n\n\t\t\t// Filterable menu args\n\t\t\t$nav_clean = apply_filters( 'ipress_nav_clean', false );\n\t\t\tif ( $nav_clean ) { $args['container'] = false; }\n\n\t\t\t// Return menu args\n\t\t\treturn $args;\n\t\t}", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"RAD Facility\", \"LIBRARIES\", \"_rad_facility\");\n module::set_menu($this->module, \"RAD DX Codes\", \"LIBRARIES\", \"_rad_dxcodes\");\n module::set_menu($this->module, \"RAD DX Codes\", \"LIBRARIES\", \"_rad_\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "function my_wp_nav_menu_args( $args = '' ) {\n $args['container'] = false;\n return $args;\n}", "function uwmadison_page_menu_args( $args ) {\n\t\t$args['show_home'] = true;\n\t\t$args['menu_class'] = $args['container_class'];\n\t\treturn $args;\n\t}", "function nav(array $navLinks, $name = null, array $args = array())\n{\n if ($name !== null) {\n $navLinks = apply_filters($name, $navLinks, $args);\n }\n\n $menu = get_view()->navigation()->menu(new Omeka_Navigation($navLinks));\n\n if ($acl = get_acl()) {\n $menu->setRole(current_user())->setAcl($acl);\n }\n\n return $menu;\n}", "function custom_nav_item( $menu, stdClass $args ){\n if ( 'primary' != $args->theme_location )\n\n return $menu; \n\t\t// $menu .= '</ul><ul class=\"search-form-container\"><div class=\"search-toggle\"><i class=\"dashicons dashicons-search\"></i>\n\t\t$menu .= '</ul><ul class=\"search-form-container\"><div class=\"search-toggle\"><i class=\"fa fa-search\"></i>\n\t\t\t\t<a href=\"#search-container\" class=\"screen-reader-text\"></a>\n\t\t\t\t</div>'; \n return $menu; \n}", "protected function set_new_menu_params() {\n\t\t$this->menu_args['menu-item-title'] = !empty( $_POST['premise_post_title'] ) ? $_POST['premise_post_title'] : '';\n\t\t$this->menu_args['menu-item-url'] = !empty( $_POST['premise_post_url'] ) ? $_POST['premise_post_url'] : '';\n\t\t$this->menu_args['menu-item-object-id'] = !empty( $_POST['premise_post_object_id'] ) ? $_POST['premise_post_object_id'] : '';\n\t\t$this->menu_args['menu-item-object'] = !empty( $_POST['premise_post_object'] ) ? $_POST['premise_post_object'] : '';\n\t}", "function wp_nav_menu_setup()\n {\n }", "function lkdkamp_page_menu_args( $args ) {\n\t$args['show_home'] = false;\n\treturn $args;\n}", "function custom_nav_menu_args( $args ) {\n\tif ( $args['walker'] == '' ) {\n\t\t$args['walker'] = new Custom_Walker_Nav_Menu;\n\t}\n\n\treturn $args;\n}", "protected function menus()\n {\n\n }", "function modify_nav_menu_args( $args )\n{\n$args['exclude'] = get_option('spreadshop_product_detail_page').','.get_option('spreadshop_article_detail_page');\nreturn $args;\n}", "function eval_guide_menu() {\n\twp_nav_menu(array(\n\t\t'container'\t\t\t=> false,\t\t\t\t\t\t\t// Remove nav container\n\t\t'menu_id'\t\t\t=> 'evaluation-guide-nav',\t\t\t// Adding custom nav id\n\t\t'menu_class'\t\t=> 'vertical menu accordion-menu',\t// Adding custom nav class\n\t\t'items_wrap'\t\t=> '<ul id=\"%1$s\" class=\"%2$s\" data-accordion-menu data-submenu-toggle=\"true\">%3$s</ul>',\n\t\t'theme_location'\t=> 'evaluation-guide',\t\t\t\t// Where it's located in the theme\n\t\t'depth'\t\t\t\t=> 5,\t\t\t\t\t\t\t\t// Limit the depth of the nav\n\t\t'fallback_cb'\t\t=> false,\t\t\t\t\t\t\t// Fallback function (see below)\n\t\t'walker'\t\t\t=> new MX_TOPBAR_MENU_WALKER()\n\t));\n}", "public function filter_wp_nav_menu($nav_menu_content, $args)\n {\n }", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"Drug Formulation\", \"LIBRARIES\", \"_drug_formulation\");\n module::set_menu($this->module, \"Drug Preparation\", \"LIBRARIES\", \"_drug_preparation\");\n module::set_menu($this->module, \"Drug Manufacturer\", \"LIBRARIES\", \"_drug_manufacturer\");\n module::set_menu($this->module, \"Drug Source\", \"LIBRARIES\", \"_drug_source\");\n module::set_menu($this->module, \"Drugs\", \"LIBRARIES\", \"_drugs\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"Drug Formulation\", \"LIBRARIES\", \"_drug_formulation\");\n module::set_menu($this->module, \"Drug Preparation\", \"LIBRARIES\", \"_drug_preparation\");\n module::set_menu($this->module, \"Drug Manufacturer\", \"LIBRARIES\", \"_drug_manufacturer\");\n module::set_menu($this->module, \"Drug Source\", \"LIBRARIES\", \"_drug_source\");\n module::set_menu($this->module, \"Drugs\", \"LIBRARIES\", \"_drugs\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "function wp_get_nav_menus($args = array())\n {\n }", "function labs_page_menu_args( $args ) {\n\t$args['show_home'] = true;\n\treturn $args;\n}", "function adwr_menu_link($vars) {\n //gs\n $menu_class = str_replace(' ', '-', strtolower($vars['element']['#original_link']['link_title']));\n $vars['element']['#attributes']['class'][] = 'menu-li-' . $menu_class;\n if (isset($variables['element']['#localized_options'])) {\n $vars['element']['#localized_options']['attributes']['class'][] = 'menu-' . $menu_class;\n }\n return theme_menu_link($vars);\n}", "function kstWpNavMenuFallbackCb(){\n $list_args['echo'] = false;\n $list_args['title_li'] = '';\n $list_args['depth'] = 1;\n $menu = str_replace( array( \"\\r\", \"\\n\", \"\\t\" ), '', wp_list_pages($list_args) );\n $menu = str_replace(\"page_item\", \"menu-item\", $menu ); // to match the wp_nav_menu for styling\n $menu = '<ul class=\"menu\">' . $menu . '</ul>';\n echo $menu;\n }", "public function admin_menu(&$menu)\n {\n\n\t}", "function wp_setup_nav_menu_item($menu_item)\n {\n }", "function _mai_add_widget_header_menu_args() {\n\tadd_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );\n\tadd_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );\n}", "function cera_grimlock_vertical_navbar_nav_menu( $args ) {\n\t\tif ( has_nav_menu( 'primary' ) ) :\n\t\t\twp_nav_menu( wp_parse_args( $args, array(\n\t\t\t\t'theme_location' => 'primary',\n\t\t\t) ) );\n\t\tendif;\n\t}", "function cera_grimlock_navbar_nav_menu( $args ) {\n\t\tif ( has_nav_menu( 'primary' ) ) :\n\t\t\twp_nav_menu( wp_parse_args( $args, array(\n\t\t\t\t'theme_location' => 'primary',\n\t\t\t) ) );\n\t\tendif;\n\t}", "function fix_no_menu_warning( $args ) {\n\t\tif ( get_class( $args['walker'] ) == 'WFIM_Walker_Nav_Menu_With_Icon' )\n\t\t\t$args['walker'] = null;\n\n\t\treturn $args;\n\t}", "function cmsmasters_page_menu_args($args) {\n $args['show_home'] = true;\n \n return $args;\n}", "public function menuConfig() {}", "public function menuConfig() {}", "public function menuConfig() {}", "public function menuConfig() {}", "public function menuConfig() {}", "public function menuConfig() {}", "function elijah_wp_nav_menu_args( $args = '' ) {\n\n\tif ($args['theme_location'] == 'topbar_navigation') {\n\t\tif( is_user_logged_in()) {\n\t\t\t$args['menu'] = 'topbar';\n\t\t}else{\n\t\t\t$args['menu'] = 'topbar-topbar-navigation-logged-out';\n\t\t}\n\t}\n\treturn $args;\n}", "function simpleton_navmenu() {\n\nif ( function_exists( 'wp_nav_menu' ) )\n\twp_nav_menu( 'menu_class=toppagenavi&fallback_cb=simpleton_navmenu_fallback&theme_location=mainmenu' );\nelse\n\tsimpleton_navmenu_fallback();\n}", "function wp_get_nav_menu_items($items, $menu, $args)\n {\n }", "function hotfix_menu( $p_event, $p_params ) {\n $project_id = helper_get_current_project();\n $p_option = 'p' . $project_id . '_hotfix_versions';\n if (plugin_config_get($p_option, '') != '') {\n\n \t\t// check if we are the currently selected menu item\n \t\tif ($_SERVER[\"REQUEST_URI\"] == plugin_page( 'hotfix_overview.php')) {\n \t\t\t$current_page = plugin_page( 'hotfix_overview.php');\n \t\t} else {\n \t\t\t$current_page = '';\n \t\t}\n \t\n \t\tlayout_sidebar_menu( plugin_page( 'hotfix_overview.php'), plugin_lang_get( 'sidebar_title' ), 'fa-fire-extinguisher', $current_page );\t\t\t\t\n }\n\t}", "function clean_custom_menus($menuOptions) {\n\n if (!empty($menuOptions['menuName'])) {\n $menuName = $menuOptions['menuName'];\n $navClass = (!empty($menuOptions['navClass']) ? $menuOptions['navClass'] : '');\n $aClass = (!empty($menuOptions['aClass']) ? $menuOptions['aClass'] : '');\n $showTitle = (empty($menuOptions['showTitle']) ? false : $menuOptions['showTitle']);\n\n $locations = get_nav_menu_locations();\n\n if (($locations = get_nav_menu_locations()) && isset($locations[$menuName])) {\n $menu = wp_get_nav_menu_object($locations[$menuName]);\n $menu_items = wp_get_nav_menu_items($menu->term_id);\n $menu_list = '';\n\n\n if ($showTitle) {\n $menu_list .= \"<h5 class='title_menu'>{$menu->name}</h5>\";\n }\n\n $menu_list .= \"<nav class='{$navClass}'>\";\n foreach ((array) $menu_items as $menu_item) {\n $title = $menu_item->title;\n $url = $menu_item->url;\n $menu_list .= \"<a class='{$aClass}' href='{$url}'>{$title}</a>\";\n }\n $menu_list .= \"</nav>\";\n } else {\n // empty\n }\n \n echo $menu_list;\n }\n}", "function tierone_delta_menu(){\n\twp_nav_menu(\n\t\tarray(\n\t\t\t'theme_location' => 'primary-menu', /* where in the theme it's assigned */\n\t\t\t'menu'\t\t\t => 'main_nav', /* menu name */\n\t\t\t'menu_class'\t => 'nav navbar-nav',\n\t\t\t'container'\t\t => false, /* container class */\n\t\t\t'items_wrap'\t => '<ul id=\"%1$s\" class=\"%2$s\">%3$s</ul>',\n\t\t\t'depth' => 2,\n\t\t\t'walker' => new tierone_walker_menu() /* custom walker */\n\t\t)\n\t);\n}", "function thememove_page_menu_args( $args ) {\n\t$args['show_home'] = true;\n\n\treturn $args;\n}", "function menu($position){\n $arg = array(\n 'theme_location' => $position,\n 'container'=> false, \n 'menu_class' => '', \n 'echo'=> true,\n );\n\n echo wp_nav_menu($arg);\n}", "protected function prepareMenuItemsForRootlineMenu() {}", "function jn_menu_setup() {\n register_nav_menu('primary', __('Primary Menu', 'jn'));\n}", "function material_press_page_menu_args($args)\n {\n $args['show_home'] = true;\n return $args;\n }", "function admin_menu()\n {\n }", "function admin_menu()\n {\n }", "function admin_menu()\n {\n }", "function emc_nav_menu_args( $args ) {\r\n\r\n\t$args[ 'theme_location' ] = 'primary';\r\n\t$args[ 'container_class' ] = 'container';\r\n\t/**\r\n\t * Set our new walker only if a menu is assigned,\r\n\t * and a child theme hasn't modified it to one level\r\n\t * (naughty child theme...)\r\n\t */\r\n\tif ( 1 !== $args[ 'depth' ] && has_nav_menu( 'primary' ) ) {\r\n\t\t$args[ 'walker' ] = new EMC_Page_Navigation_Walker;\r\n\t}\r\n\treturn $args;\r\n}", "function menuConfig()\t{\n\t\t\t\t\tglobal $LANG;\n\t\t\t\t\t$this->MOD_MENU = Array (\n\t\t\t\t\t\t'function' => Array (\n\t\t\t\t\t\t\t'1' => $LANG->getLL('function1')/*,\n\t\t\t\t\t\t\t'2' => $LANG->getLL('function2'),\n\t\t\t\t\t\t\t'3' => $LANG->getLL('function3'),*/\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tparent::menuConfig();\n\t\t\t\t}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "function oylg2013_page_menu_args( $args ) {\n\t$args['show_home'] = false;\n\treturn $args;\n}", "public function filter_nav_menu_options($nav_menu_options)\n {\n }", "function primary_add_menu_atts( $atts, $item, $args ) {\r\n\tif( $args->theme_location == 'primary-menu' ) {\r\n\t$atts['class=\"nav-link js-scroll-trigger\"'] = 'return true';\r\n}\r\n return $atts;\r\n}", "function menuConfig() {\n global $LANG;\n $this->MOD_MENU = Array (\n \"function\" => Array (\n \"1\" => $LANG->getLL(\"overview\"),\n \"2\" => $LANG->getLL(\"new\"),\n \"3\" => $LANG->getLL(\"function3\"),\n )\n );\n parent::menuConfig();\n }", "function menuConfig()\t{\n\t\tglobal $LANG;\n\t\t$this->MOD_MENU = Array (\n\t\t\t'function' => Array (\n\t\t\t\t/*'1' => $LANG->getLL('function1'),\n\t\t\t\t'2' => $LANG->getLL('function2'),\n\t\t\t\t'3' => $LANG->getLL('function3'),*/\n\t\t\t)\n\t\t);\n\t\tparent::menuConfig();\n\t}", "function wp_nav_menu_update_menu_items($nav_menu_selected_id, $nav_menu_selected_title)\n {\n }", "function change_default_menu_walker( $args ) {\n\t\t$args = (object) $args;\n\t\t$args->walker = new WFIM_Walker_Nav_Menu_With_Icon();\n\t\treturn $args;\n\t}", "function menuConfig()\t{\n\t\tglobal $LANG;\n\t\t$this->MOD_MENU = Array (\n\t\t\t'function' => Array (\n\t\t\t\t'1' => $LANG->getLL('function1'),\n\t\t\t\t'2' => $LANG->getLL('function2'),\n\t\t\t\t'3' => $LANG->getLL('function3'),\n\t\t\t)\n\t\t);\n\t\tparent::menuConfig();\n\t}", "function menuConfig()\t{\n\t\tglobal $LANG;\n\t\t$this->MOD_MENU = Array (\n\t\t\"function\" => Array (\n\t\t\"1\" => $LANG->getLL(\"function1\"),\n\t\t\"2\" => $LANG->getLL(\"function2\"),\n\t\t)\n\t\t);\n\t\tparent::menuConfig();\n\t}", "function register_my_menus() {\n register_nav_menus(\n array('primary' => ( 'To display menu properly please select \"Main menu\" from list below.' ))\n );\n}", "public function modMenu() {}", "public function modMenu() {}", "public function modMenu() {}", "function rusticmodern_page_menu_args( $args ) {\n\tif ( ! isset( $args['show_home'] ) )\n\t\t$args['show_home'] = true;\n\treturn $args;\n}", "function ks_nav() {\n\twp_nav_menu(\n\t\tarray(\n\t\t\t'theme_location' => 'header-menu',\n\t\t\t'menu' => '',\n\t\t\t'container' => 'div',\n\t\t\t'container_class' => 'menu-{menu slug}-container',\n\t\t\t'container_id' => '',\n\t\t\t'menu_class' => 'menu',\n\t\t\t'menu_id' => '',\n\t\t\t'echo' => true,\n\t\t\t'fallback_cb' => 'wp_page_menu',\n\t\t\t'before' => '',\n\t\t\t'after' => '',\n\t\t\t'link_before' => '',\n\t\t\t'link_after' => '',\n\t\t\t'items_wrap' => '<ul>%3$s</ul>',\n\t\t\t'depth' => 0,\n\t\t\t'walker' => ''\n\t\t)\n\t);\n}", "function register_nav_menu($location, $description)\n {\n }", "function register_nav_menus($locations = array())\n {\n }", "function rw_page_menu_args( $args )\n{\n $args['show_home'] = true;\n return $args;\n}", "public function add_menus()\n {\n }", "function at_try_menu()\n{\n add_menu_page('signup_list', //page title\n 'Sign Up List', //menu title\n 'manage_options', //capabilities\n 'Signup_List', //menu slug\n Signup_list //function\n );\n}", "function erp_menu() {\n $menu = [];\n return apply_filters( 'erp_menu', $menu );\n}", "function power_do_nav() {\n\n\t// Do nothing if menu not supported.\n\tif ( ! power_nav_menu_supported( 'primary' ) || ! has_nav_menu( 'primary' ) ) {\n\t\treturn;\n\t}\n\n\t$class = 'menu power-nav-menu menu-primary';\n\tif ( power_superfish_enabled() ) {\n\t\t$class .= ' js-superfish';\n\t}\n\n\tpower_nav_menu(\n\t\t[\n\t\t\t'theme_location' => 'primary',\n\t\t\t'menu_class' => $class,\n\t\t]\n\t);\n\n}", "function register_po_nav_menus() {\n\n $locations = array(\n 'main-navi' => __( 'Site main navigations', 'text_domain' ),\n 'footer-link' => __( 'Site secondary links', 'text_domain' ),\n 'cart-link' => __( 'Cart links', 'text_domain' ),\n 'socmed-link' => __( 'Social media links', 'text_domain' )\n );\n register_nav_menus( $locations );\n}", "function emc_page_menu_args( $args ) {\r\n\t$args['show_home'] = true;\r\n\treturn $args;\r\n}", "function artspace_aboutmenu() {\n\n\t$locations = array(\n\t\t'orange' => __( 'Top About Menu', 'text_domain' ),\n\t);\n\tregister_nav_menus( $locations );\n\n}", "function oh_nav()\n{\n\twp_nav_menu(\n\tarray(\n\t\t'theme_location' => 'header-menu',\n\t\t'menu' => '',\n\t\t'container' => 'div',\n\t\t'container_class' => 'menu-{menu slug}-container',\n\t\t'container_id' => '',\n\t\t'menu_class' => 'menu',\n\t\t'menu_id' => '',\n\t\t'echo' => true,\n\t\t'fallback_cb' => 'wp_page_menu',\n\t\t'before' => '',\n\t\t'after' => '',\n\t\t'link_before' => '',\n\t\t'link_after' => '',\n\t\t'items_wrap' => '<ul class=\"nav navbar-nav navbar-right no-margin alt-font text-normal\" data-in=\"fadeIn\" data-out=\"fadeOut\">%3$s</ul>',\n\t\t'depth' => 0,\n\t\t'walker' => ''\n\t\t)\n\t);\n}" ]
[ "0.74896514", "0.7166882", "0.7108001", "0.7035943", "0.69678605", "0.69671065", "0.6921737", "0.6907766", "0.6883245", "0.6865129", "0.6849561", "0.68393326", "0.68393326", "0.68393326", "0.68393326", "0.67384404", "0.670297", "0.6644116", "0.6643656", "0.6622157", "0.66120845", "0.6578095", "0.6558702", "0.65452266", "0.6541236", "0.65121937", "0.65078616", "0.64810115", "0.64803416", "0.6464881", "0.6464872", "0.6462883", "0.63938564", "0.63883007", "0.63883007", "0.6373855", "0.6372896", "0.6352084", "0.633689", "0.63320214", "0.63166386", "0.63127756", "0.6305332", "0.6297575", "0.6273382", "0.62696844", "0.62674505", "0.6265799", "0.6265799", "0.6265799", "0.626383", "0.626383", "0.6261394", "0.62443584", "0.6231747", "0.6206362", "0.61990845", "0.6198974", "0.61933607", "0.61896956", "0.6183799", "0.6183452", "0.61816406", "0.61811507", "0.61811507", "0.61811507", "0.6180889", "0.61766", "0.6176558", "0.6176558", "0.6176558", "0.6176558", "0.6176558", "0.6176558", "0.61732066", "0.6172937", "0.6170959", "0.6167557", "0.61615294", "0.6160731", "0.61543465", "0.615321", "0.6145842", "0.6144557", "0.6138328", "0.61369693", "0.6136614", "0.61322075", "0.613174", "0.61263776", "0.6116863", "0.61116725", "0.61075497", "0.61011964", "0.60899353", "0.6089227", "0.60801846", "0.6067171", "0.6065213", "0.6050812" ]
0.72354436
1
Enqueue oceanwp compatibility styles
function jet_menu_oceanwp_styles() { wp_enqueue_style( 'jet-menu-oceanwp', jet_menu()->get_theme_url( 'assets/css/style.css' ), array(), jet_menu()->get_version() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function twentytwentyone_enqueue_jetpack_style() {\n\t$version = Jetpack::is_development_version()\n\t\t? filemtime( JETPACK__PLUGIN_DIR . 'modules/theme-tools/compat/twentytwentyone.css' )\n\t\t: JETPACK__VERSION;\n\n\twp_enqueue_style( 'twentytwentyone-jetpack', plugins_url( 'twentytwentyone.css', __FILE__ ), array(), $version );\n\twp_style_add_data( 'twentytwentyone-jetpack', 'rtl', 'replace' );\n}", "function jet_woo_oceanwp_enqueue_styles() {\n\twp_enqueue_style(\n\t\t'jet-woo-builder-oceanwp',\n\t\tjet_woo_builder()->plugin_url( 'includes/integrations/themes/oceanwp/assets/css/style.css' ),\n\t\tfalse,\n\t\tjet_woo_builder()->get_version()\n\t);\n}", "function wp_register_styles() {\n // Developer Tier Admin Stylesheet\n wp_register_style( \"{$this->namespace}-admin\", SLIDEDECK2_DEVELOPER_URLPATH . \"/css/admin.css\", array(), '2.1', 'screen' );\n // CodeMirror Library\n wp_register_style( \"codemirror\", SLIDEDECK2_DEVELOPER_URLPATH . \"/css/codemirror.css\", array(), '2.25', 'screen' );\n }", "function ecomaster_scripts() {\n wp_enqueue_style( 'ecomaster-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ) );\n}", "function ruven_register_styles() {\n\n\t$theme_version = wp_get_theme()->get( 'Version' );\n\t$env = ( wp_get_environment_type() === 'local') ? 'min.' : '';\n\n\twp_enqueue_style( 'ruven-style', get_template_directory_uri() . '/assets/css/style.'. $env .'css', array(),\n\t$theme_version );\n\twp_style_add_data( 'ruven-style', 'rtl', 'replace' );\n\n\n}", "function vslider_admin_styles() {\r\n wp_enqueue_style('thickbox');\r\n wp_register_style('colorpicker-css', WP_PLUGIN_URL.'/vslider/picker/colorpicker.css');\r\n wp_enqueue_style( 'colorpicker-css');\r\n wp_register_style('tooltip-css', WP_PLUGIN_URL.'/vslider/css/tooltip.css');\r\n wp_enqueue_style( 'tooltip-css');\r\n}", "public function enqueue_elementor_styles() {\n\t\t$disabled_color_schemes = get_option( 'elementor_disable_color_schemes' );\n\t\t$disabled_typography_schemes = get_option( 'elementor_disable_typography_schemes' );\n\n\t\tif ( $disabled_color_schemes === 'yes' && $disabled_typography_schemes === 'yes' ) {\n\t\t\twp_enqueue_style( 'hestia-elementor-style', get_template_directory_uri() . '/assets/css/page-builder-style.css', array(), HESTIA_VERSION );\n\t\t}\n\t}", "function fzproject_register_styles()\n{\n // register \n //wp_register_style('zoneslider_styles', plugins_url('zoneslider/style.css', __FILE__)); \n wp_register_style('fzproject_styles_theme', plugins_url('css/style.css', __FILE__));\n // enqueue \n //wp_enqueue_style('fzproject_styles'); \n wp_enqueue_style('fzproject_styles_theme');\n}", "function dos_styles() {\n\n wp_enqueue_style('dos-flexboxgrid', plugins_url('../assets/styles/flexboxgrid.min.css', __FILE__) );\n wp_enqueue_style('dos-core-css', plugins_url('../assets/styles/core.css', __FILE__) );\n\n}", "function enqueues() {\n\t\twp_register_style( 'ks-thematic-actions', plugin_dir_url( __FILE__ ) . 'style.css' );\n\t wp_enqueue_style( 'ks-thematic-actions' );\n\t}", "function hookRegisterStyles() {\n\t \tif (!is_admin() && get_option('fse_load_fc_libs') == true) {\n\t \t\t// Check if user has its own CSS file in the theme folder\n\t \t\t$custcss = get_template_directory().'/fullcalendar.css';\n\t \t\tif (file_exists($custcss))\n\t \t\t$css = get_bloginfo('template_url').'/fullcalendar.css';\n\t \t\telse\n\t \t\t$css = self::$plugin_css_url.'fullcalendar.css';\n\t \t\twp_enqueue_style('fullcalendar', $css);\n\t \t}\n\t }", "function wdtLiteVSPremiumEnqueue()\n{\n WDTTools::wdtUIKitEnqueue();\n wp_enqueue_style('wdt-lite-vs-premium-css', WDT_CSS_PATH . 'admin/lite-vs-premium.css', array(), WDT_CURRENT_VERSION);\n wp_enqueue_script('wdt-common');\n wp_enqueue_script('wdt-doc-js');\n}", "public function addStyling()\n {\n \\wp_enqueue_style(self::REACT_WP_THEME, \\get_template_directory_uri() . '/frontend/dist/style.css', [], '0.1');\n }", "function propanel_of_style_only() {\n\twp_enqueue_style('admin-style', get_stylesheet_directory_uri().'/admin/admin-style.css');\n\twp_enqueue_style('color-picker', get_stylesheet_directory_uri().'/admin/colorpicker.css');\n}", "public function enqueue() {\r\n\t\twp_enqueue_style( 'wfct-ei', WFC_EI_CSS_URL . 'environment-indicator.css', array(), WFC_EI_VERSION );\r\n\t}", "public function enqueue_styles_and_stuffs() {\n\t\t // libraries\n\t\t wp_enqueue_style( 'woocommerce_prettyPhoto_css' );\n\t\t\twp_enqueue_style( 'jquery-selectBox' );\n\t\t\twp_enqueue_style( 'yith-wcwl-font-awesome' );\n\n\t\t\t// main plugin style\n\t\t\tif ( ! wp_style_is( 'yith-wcwl-user-main', 'registered' ) ) {\n\t\t\t\twp_enqueue_style( 'yith-wcwl-main' );\n\t\t\t}\n\t\t\telse {\n\t\t\t\twp_enqueue_style( 'yith-wcwl-user-main' );\n\t\t\t}\n\n\t\t\t// theme specific style\n\t\t\tif( wp_style_is( 'yith-wcwl-theme', 'registered' ) ){\n\t\t\t wp_enqueue_style( 'yith-wcwl-theme' );;\n }\n\n\t\t\t// custom style\n\t\t\t$this->enqueue_custom_style();\n\t\t}", "function extamus_enqueue_admin_styles()\n {\n $the_theme = wp_get_theme();\n wp_enqueue_style('animate-on-scroll', \"https://unpkg.com/[email protected]/dist/aos.css\", array(), $the_theme->get('Version'));\n wp_enqueue_style('google-fonts', \"https://fonts.googleapis.com/css?family=Staatliches|Crushed|Abril+Fatface|Gothic+A1\", array(), $the_theme->get('Version'));\n if (is_singular() && comments_open() && get_option('thread_comments')) {wp_enqueue_script('comment-reply');\n }\n wp_enqueue_script('AOS', \"https://unpkg.com/[email protected]/dist/aos.js\", array(), $the_theme->get('Version'), false);\n }", "function thrive_theme_pack_scripts() {\n\n wp_register_style( 'thrive-theme-pack-stylesheet', plugins_url( '/assets/css/themepack.css', __FILE__ ), array( 'thrive-style' ), '1.0' );\n wp_enqueue_style( 'thrive-theme-pack-stylesheet' );\n\n\treturn;\n}", "function cloud4all_dequeue_styles() {\n\twp_dequeue_style('twentytwelve-ie');\n}", "public function registerStylesFrontend() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style('wpjb-css', $p.\"frontend.css\", array('wpjb-glyphs'), $v );\n }", "public function registerStylesAdmin() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style(\"wpjb-admin-css\", $p.\"admin.css\", array(), $v);\n wp_register_style(\"wpjb-colorpicker-css\", $p.\"colorpicker.css\", array(), $v);\n wp_register_style(\"wpjb-vendor-ve-css\", $x.\"visual-editor/visual-editor.css\", array(), $v);\n wp_register_style(\"wpjb-multi-level-accordion-menu\", $p.\"multi-level-accordion-menu.css\", array(), $v);\n }", "function rhd_enqueue_styles(){\n\tglobal $theme_opts;\n\n\twp_register_style( 'rhd-sitewide', content_url() . '/global/sitewide.css', array(), '1', 'all' );\n\twp_register_style( 'rhd-main', RHD_THEME_DIR . '/css/main.css', array(), '1', 'all' );\n\twp_register_style( 'rhd-enhanced', RHD_THEME_DIR . '/css/enhanced.css', array(), '1', 'all' );\n\twp_register_style( 'Slidebars', RHD_THEME_DIR . '/js/vendor/Slidebars/dist/slidebars.min.css', array(), null, 'all' );\n\n\t$normalize_deps = array();\n\t$normalize_deps[] = 'Slidebars';\n\n\tif ( !rhd_is_mobile() ) {\n\t\twp_enqueue_style( 'rhd-enhanced' );\n\t}\n\n\twp_register_style( 'normalize', RHD_THEME_DIR . '/css/normalize.css', $normalize_deps, null, 'all' );\n\n\twp_enqueue_style( 'rhd-main' );\n\twp_enqueue_style( 'rhd-sitewide' );\n\twp_enqueue_style( 'normalize' );\n\twp_enqueue_style( 'google-fonts' );\n}", "function html5blank_styles()\n{\n wp_register_style('normalize', get_template_directory_uri() . '/normalize.css', array(), '1.0', 'all');\n wp_enqueue_style('normalize');\n\t\n\t//wp_enqueue_style( 'fancybox', get_stylesheet_directory_uri() . '/js/lib/jquery.fancybox.min.css' );\n\t\n\t//wp_enqueue_style( 'slick', get_template_directory_uri() . '/js/lib/slick.css' );\n\t\n\twp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.10.0/css/all.css' );\n\n wp_register_style('html5blank', get_template_directory_uri() . '/style.css', array(), '1.0', 'all');\n wp_enqueue_style('html5blank');\n}", "function wpstandard_files() {\n\n $parent_style = 'twentynineteen-style'; // This is 'twentynineteen-style' for the Twenty nineteen theme.\n \n wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );\n \n wp_enqueue_style( 'child-style',\n get_stylesheet_directory_uri() . '/style.css',\n array( $parent_style ),\n wp_get_theme()->get('Version') \n );\n \n \n wp_enqueue_script('main-chealeyv2-js', get_theme_file_uri('/js/scripts-bundled.js'), NULL, microtime(), true);\n wp_enqueue_style('custom-google-fonts', '//fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i|Roboto:100,300,400,400i,700,700i');\n wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');\n wp_enqueue_style( 'dashicons' );\n\n wp_enqueue_style('chealeyv2_main_styles', get_stylesheet_uri(), NULL, microtime());\n\n wp_localize_script('main-chealeyv2-js', 'chealeyv2Data', array(\n 'root_url' => get_site_url(),\n 'nonce' => wp_create_nonce('wp_rest')\n ));\n}", "function egg_styles()\n{\n\tglobal $wp_styles; // call global $wp_styles variable to add conditional wrapper around ie stylesheet\n\n\t// register main stylesheet\n\twp_register_style( 'egg-stylesheet', get_stylesheet_directory_uri() . '/assets/css/style.css?091714', array(), '', 'all' );\n\t// wp_register_style( 'egg-stylesheet', get_stylesheet_directory_uri() . '/assets/css/style.min.css', array(), '', 'all' );\n\n\t// ie-only style sheet\n\twp_register_style( 'egg-ie-only', get_stylesheet_directory_uri() . '/assets/css/ie.css', array(), '' );\n\n\twp_enqueue_style( array(\n\t\t'egg-stylesheet',\n\t\t'egg-ie-only'\n\t) );\n\t\n\t$wp_styles->add_data( 'egg-ie-only', 'conditional', 'lt IE 9' ); // add conditional wrapper around ie stylesheet\n}", "function capstone_frontend_styles() {\n\t\tif ( !is_admin() ) {\n\n\t\t\t// Libraries Styles\n\t\t\twp_enqueue_style('fontawesome', CAPSTONE_CSS_URI . '/lib/font-aswesome.css');\n\t\t\twp_enqueue_style('icheck', CAPSTONE_JS_URI . '/lib/icheck/square/blue.css');\n\t\t\twp_enqueue_style('material-icons', 'https://fonts.googleapis.com/icon?family=Material+Icons');\n\t\t\twp_enqueue_style('flickity', CAPSTONE_CSS_URI . '/lib/flickity.min.css');\n\t\t\twp_enqueue_style('mapbox', 'https://api.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css');\n\t\t\twp_enqueue_style('mapbox-geocoder', 'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v2.3.0/mapbox-gl-geocoder.css');\n\t\t\t\n\t\t\t// Theme Styles\n\t\t\twp_enqueue_style('capstone-main', CAPSTONE_CSS_URI . '/main.min.css', array('wp-mediaelement'));\n\t\t\t\n\t\t\t// Google Fonts\n\t\t\twp_enqueue_style('capstone-fonts', capstone_fonts_url(), array(), '1.0.0');\n\t\t\t\n\t\t\t// Add Inline Styles (dynamic)\n\t\t\tob_start();\n\t\t\trequire( get_template_directory() .'/styles/dynamic.php' );\n\t\t\t$dynamic_css = ob_get_clean();\n\t wp_add_inline_style('capstone-main', $dynamic_css);\n\t\t}\n\t}", "function enqueue_styles() {\n\t// Style taken from wp.org.\n\twp_enqueue_style( 'wporg-developer-style', get_stylesheet_directory_uri() . '/assets/css/wp4.css', [], '77' );\n}", "function twentytwentyone_styles() {\n\twp_enqueue_style( 'child-style', get_stylesheet_uri(),\n\tarray( 'twenty-twenty-one-style' ), wp_get_theme()->get('Version') );\n}", "function wdtSupportEnqueue()\n{\n WDTTools::wdtUIKitEnqueue();\n wp_enqueue_style('wdt-support-css', WDT_CSS_PATH . 'admin/support.css', array(), WDT_CURRENT_VERSION);\n wp_enqueue_script('wdt-common');\n wp_enqueue_script('wdt-doc-js');\n}", "function rusticmodern_styles_scripts() {\n\t// Theme stylesheet.\n\twp_enqueue_style( 'rusticmodern-style', get_stylesheet_uri() );\n\n\t// Load the Internet Explorer specific stylesheet.\n\twp_enqueue_style( 'rusticmodern-ie', get_template_directory_uri() . '/css/ie/ie.css', array( 'rusticmodern-style' ), '20150930' );\n\twp_style_add_data( 'rusticmodern-ie', 'conditional', 'lt IE 10' );\n\n\t// Load the Internet Explorer 8 specific stylesheet.\n\twp_enqueue_style( 'rusticmodern-ie8', get_template_directory_uri() . '/css/ie/ie8.css', array( 'rusticmodern-style' ), '20151230' );\n\twp_style_add_data( 'rusticmodern-ie8', 'conditional', 'lt IE 9' );\n\n\t// Load the Internet Explorer 7 specific stylesheet.\n\twp_enqueue_style( 'rusticmodern-ie7', get_template_directory_uri() . '/css/ie/ie7.css', array( 'rusticmodern-style' ), '20150930' );\n\twp_style_add_data( 'rusticmodern-ie7', 'conditional', 'lt IE 8' );\n\n\t// Load the html5 shiv.\n\twp_enqueue_script( 'rusticmodern-html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3' );\n\twp_script_add_data( 'rusticmodern-html5', 'conditional', 'lt IE 9' );\n\n\n\n\n\n\n\t// Add bootstrap css.\n\twp_enqueue_style( 'bootstrap-style', get_template_directory_uri() . '/library/bootstrap/css/bootstrap.css', array(), '3.3.6' );\n\t// Add custom normalize css.\n\twp_enqueue_style( 'normalize-style', get_template_directory_uri() . '/css/normal.css', array( 'bootstrap-style' ) );\n\t// Add main css.\n\twp_enqueue_style( 'main-style', get_template_directory_uri() . '/css/main.css', array( 'normalize-style' ) );\n\n\twp_enqueue_script( 'main-script', get_template_directory_uri() . '/js/script.js', array( 'jquery' ) );\n\n\tif( is_page_template( 'page-home.php' ) || is_page( 'home' ) ) { \n\t \twp_enqueue_style( 'home-style', get_template_directory_uri() .'/css/home.css', array( 'main-style' ) );\t\t\n\t \twp_enqueue_script( 'home-script', get_template_directory_uri() .'/js/home.js', array( 'main-script' ) );\t\t\n\t}\n\t\n\t// wp_localize_script( 'rusticmodern-script', 'screenReaderText', array(\n\t// \t'expand' => __( 'expand child menu', 'rusticmodern' ),\n\t// \t'collapse' => __( 'collapse child menu', 'rusticmodern' ),\n\t// ) );\n}", "function basestation_theme_styles() {\n\n $basestation = wp_get_theme();\n\n wp_enqueue_style( 'foundation', basestation_locate_template_uri( 'css/foundation.css' ), array(), $basestation['Version'], 'all' );\n\n wp_enqueue_style( 'offcanvas', basestation_locate_template_uri( 'css/offcanvas.css' ), array( 'foundation' ), $basestation['Version'], 'all' );\n\n wp_enqueue_style( 'custom', basestation_locate_template_uri( 'custom/custom.css' ), array(), $basestation['Version'], 'all' );\n\n wp_enqueue_style( 'basestation-glyphs', basestation_locate_template_uri( 'css/entypo-glyphs.css' ), array(), $basestation['Version'], 'all' );\n\n wp_enqueue_style( 'basestation-style', get_stylesheet_uri(), array( 'foundation' ), $basestation['Version'], 'all' );\n}", "function monza_mod_enqueue_styles() {\n\n $parent_style = 'monza-style';\n $parent_dir = get_template_directory_uri();\n\n wp_enqueue_style('bootstrap', get_template_directory_uri() . '/libs/bootstrap/css/bootstrap.min.css');\n wp_enqueue_style('font-awesome', get_template_directory_uri() . '/libs/font-awesome/css/font-awesome.min.css');\n wp_enqueue_style('owl-carousel', get_template_directory_uri() . '/libs/owl/owl.carousel.css');\n wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );\n\n if ( function_exists('monza_custom_style')) {\n wp_add_inline_style( 'monza-style', monza_custom_style() );\n }\n\n // enqueue the modification last\n wp_enqueue_style( 'monza-mod-vyh-style',\n get_stylesheet_directory_uri() . '/style.css',\n array( $parent_style ),\n wp_get_theme()->get('Version')\n );\n// wp_enqueue_style( 'monza-mod-vyh-style',\n// get_stylesheet_directory_uri() . '/style.css',\n// array( $parent_style )\n// );\n}", "function wp_enqueue_classic_theme_styles()\n {\n }", "function ct_include_style () {\n\tif ( !is_admin() ) {\n\t\twp_enqueue_style( 'christatimmer', get_stylesheet_uri() );\n\t}\n}", "function plugin_admin_styles() {\r\n\t\t\t// used by media upload\r\n\t\t\twp_enqueue_style('thickbox');\r\n\t\t\t// Register & enqueue our admin.css file \r\n\t\t\twp_register_style('framework', $this->framework_url .'framework.css');\r\n\t\t\twp_enqueue_style('framework');\r\n\t\t\t// color picker\r\n\t\t\twp_enqueue_style( 'farbtastic' );\r\n\t\t\r\n\t\t}", "function register_non_admin_styles(){\r\n\t\r\n\t\t$cp_page_xml = '';\r\n\t\t$slider_type = '';\r\n\t\r\n\t\tglobal $post,$post_id,$cp_page_xml,$slider_type;\r\n\t\t\r\n\t\t$cp_page_xml = get_post_meta($post_id,'page-option-item-xml', true);\r\n\t\t$slider_type = get_post_meta ( $post_id, \"page-option-top-slider-types\", true );\r\n\t\t\r\n\t\t\r\n\t\twp_enqueue_style( 'default-style', get_stylesheet_uri() ); //Default Stylesheet\r\n\t\t\r\n\t\t//Woo-commerce Required 2 Files\r\n\t\twp_enqueue_style('woocommerce_frontend_styles',CP_PATH_URL.'/frontend/css/woocommerce.css');\r\n\t\twp_enqueue_style('cp-woocommerce',CP_PATH_URL.'/frontend/css/wp-commerce.css');\r\n\t\t\r\n\t\t// Politicize Update Responsive file\r\n\t\twp_enqueue_style('cp-woocommerce',CP_PATH_URL.'/frontend/css/update-responsive.css');\r\n\r\n\t\t\r\n\t\t//Bx-slider scripts\r\n\t\twp_register_script('cp-bx-slider', CP_PATH_URL.'/frontend/js/bxslider.min.js', false, '1.0', true);\r\n\t\twp_enqueue_script('cp-bx-slider');\t\r\n\t\twp_register_script('jquery.bxslider', CP_PATH_URL.'/frontend/js/jquery.bxslider.js', false, '1.0', true);\r\n\t\twp_enqueue_script('jquery.bxslider');\t\r\n\t\t\r\n\t\t//wp_enqueue_style('cp_default',CP_PATH_URL.'/frontend/css/cp_default.css'); //Include Default Widgets and Other settings\r\n\t\twp_enqueue_style('cp-bootstrap',CP_PATH_URL.'/frontend/css/bootstrap.css'); //Bootstrap Grid\r\n\t\twp_enqueue_style('cp-bootstrap-res',CP_PATH_URL.'/frontend/css/bootstrap-responsive.css'); //Bootstrap responsive\r\n\t\twp_enqueue_style('cp-jplayer-res',CP_PATH_URL.'/frontend/css/jplayer.css'); //Bootstrap responsive\r\n\t\r\n\t\twp_enqueue_style('cp-fontAW',CP_PATH_URL.'/frontend/cp_font/css/font-awesome.css');\r\n\t\twp_enqueue_style('cp-fontAW',CP_PATH_URL.'/frontend/cp_font/css/font-awesome-ie7.css');\r\n\t\r\n\t\t$rtl_layout = '';\r\n\t\t$site_loader = '';\r\n\t\t$element_loader = '';\r\n\t\t//General Settings Values\r\n\t\t$cp_general_settings = get_option('general_settings');\r\n\t\tif($cp_general_settings <> ''){\r\n\t\t\t$cp_logo = new DOMDocument ();\r\n\t\t\t$cp_logo->loadXML ( $cp_general_settings );\r\n\t\t\t$rtl_layout = find_xml_value($cp_logo->documentElement,'rtl_layout');\r\n\t\t\t$site_loader = find_xml_value($cp_logo->documentElement,'site_loader');\r\n\t\t\t$element_loader = find_xml_value($cp_logo->documentElement,'element_loader');\r\n\t\t}\r\n\t\t\r\n\t\t//Responsive stylesheet\r\n\t\t\r\n\t\t\r\n\t\twp_deregister_style('woocommerce-general');\r\n\t\twp_deregister_style('woocommerce-layout');\r\n\t\twp_deregister_style('woocommerce_frontend_styles');\t\t\r\n\t\twp_deregister_style('events-manager');\t\t\r\n\t\r\n\t\t\r\n\t\twp_enqueue_style('cp-event-manager',CP_PATH_URL.'/frontend/css/event-manager.css'); //Event Manager\r\n\t\twp_enqueue_style('woocommerce_frontend_styles',CP_PATH_URL.'/frontend/css/woocommerce.css');\t\t\t\r\n\t\t//Call own css for prayer box\r\n\t\tif(function_exists('pb_includePublicCSS')){\r\n\t\t\twp_enqueue_style('cp-prayer-box',CP_PATH_URL.'/frontend/css/gd-praybox-sc.css'); //prayer Manager\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//RTL Layouts\r\n\t\tif($rtl_layout == 'enable'){\r\n\t\t\twp_enqueue_style('cp-rtl',CP_PATH_URL.'/rtl.css');\r\n\t\t}\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Facebook Fan Page Script\r\n\t\tif(isset($post->ID)){\r\n\t\t\t$facebook_fan = '';\r\n\t\t\t$facebook_fan = get_post_meta ( $post->ID, \"page-option-item-facebook-selection\", true );\r\n\t\t\tif($facebook_fan == 'Yes'){$facebook_fan = 'facebook_fan';\r\n\t\t\t\twp_enqueue_style('style_810',CP_PATH_URL.'/frontend/css/style810.css');\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t\r\n\t\t$maintenance_mode = get_themeoption_value('maintenance_mode','general_settings');\t\t\t\t\r\n\t\tif($maintenance_mode == 'enable'){\t\t\r\n\t\t\twp_enqueue_style('cp-countdown',CP_PATH_URL.'/frontend/css/jquery.countdown.css');\r\n\t\t}\r\n\r\n\t\t$twitter_feed = get_themeoption_value('twitter_feed','general_settings');\r\n\t\tif($twitter_feed == 'enable'){ \r\n\t\t\twp_enqueue_style('cp-bx-slider',CP_PATH_URL.'/frontend/css/bxslider.css');\r\n\t\t}\r\n\r\n\t\tif(isset($post)){\r\n\t\t\t$content = strip_tags(get_the_content());\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif ( has_shortcode( $post->post_content, 'event_counter_box' ) ) { \t\t\r\n\t\t\t\twp_enqueue_style('cp-countdown',CP_PATH_URL.'/frontend/css/jquery.countdown.css');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( has_shortcode( $post->post_content, 'slider' ) ) { \t\t\r\n\t\t\t\twp_enqueue_style('cp-bx-slider',CP_PATH_URL.'/frontend/shortcodes/bxslider.css');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( has_shortcode( $post->post_content, 'counter_circle' ) ) { \t\t\r\n\t\t\t\twp_enqueue_style('cp-easy-chart',CP_PATH_URL.'/frontend/shortcodes/chart.css');\r\n\t\t\t}\r\n\r\n\t\t\tif ( has_shortcode( $post->post_content, 'counters_circle' ) ) { \t\t\r\n\t\t\t\twp_enqueue_style('cp-easy-chart',CP_PATH_URL.'/frontend/shortcodes/chart.css');\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Widget Active\r\n\t\tif(is_active_widget( '', '', 'twitter_widget')){\t\t\t\r\n\t\t\twp_enqueue_style('cp-bx-slider',CP_PATH_URL.'/frontend/shortcodes/bxslider.css');\r\n\t\t}\r\n\t\r\n\t\tif( is_search() || is_archive() ){\r\n\t\t\r\n\t\t\twp_enqueue_style('cp-anything-slider',CP_PATH_URL.'/frontend/anythingslider/css/anythingslider.css');\r\n\t\r\n\t\t\r\n\t\r\n\t\t// Post post_type\r\n\t\t}else if( isset($post) && $post->post_type == 'post' || \r\n\t\t\tisset($post) && $post->post_type == 'event' ){\r\n\t\t\r\n\t\t\t\t// If using slider (flex slider)\t\r\n\t\t\t\tif(!is_home()){\r\n\t\t\t\t\t$thumbnail_types = '';\r\n\t\t\t\t\t$post_detail_xml = get_post_meta($post->ID, 'post_detail_xml', true);\r\n\t\t\t\t\tif($post_detail_xml <> ''){\r\n\t\t\t\t\t\t$cp_post_xml = new DOMDocument ();\r\n\t\t\t\t\t\t$cp_post_xml->loadXML ( $post_detail_xml );\r\n\t\t\t\t\t\t$thumbnail_types = find_xml_value($cp_post_xml->documentElement,'post_thumbnail');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif( $thumbnail_types == 'Slider'){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\twp_enqueue_style('cp-bx-slider',CP_PATH_URL.'/frontend/css/bxslider.css');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$event_detail_xml = get_post_meta($post->ID, 'event_detail_xml', true);\r\n\t\t\t\t\tif($event_detail_xml <> ''){\r\n\t\t\t\t\t\t$cp_event_xml = new DOMDocument ();\r\n\t\t\t\t\t\t$cp_event_xml->loadXML ( $event_detail_xml );\r\n\t\t\t\t\t\t$event_thumbnail = find_xml_value($cp_event_xml->documentElement,'event_thumbnail');\r\n\t\t\t\t\t\t//Call the CountDown Style\r\n\t\t\t\t\t\twp_enqueue_style('cp-countdown',CP_PATH_URL.'/frontend/css/jquery.countdown.css'); //Load Style\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t// Page post_type\r\n\t\t}else if( isset($post) && $post->post_type == 'page' ){\r\n\t\t\r\n\t\t\tglobal $post,$cp_page_xml, $slider_type, $cp_top_slider_type;\r\n\t\t\t$cp_page_xml = get_post_meta($post->ID,'page-option-item-xml', true);\r\n\t\t\t$cp_top_slider_switch = get_post_meta($post->ID,'page-option-top-slider-on', true);\r\n\t\t\t$slider_type = get_post_meta ( $post->ID, \"page-option-top-slider-types\", true );\r\n\t\t\t$cp_top_slider_type = get_post_meta($post->ID,'page-option-top-slider-types', true);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//Layer Slider\r\n\t\t\tif(strpos($cp_page_xml,'<slider-type>Layer-Slider</slider-type>') > -1 || $slider_type == 'Layer-Slider'){\r\n\t\t\t\t//wp_enqueue_style('layerslider_js', CP_PATH_URL.'/frontend/css/layerslider.css');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If using carousel slider\r\n\t\t\tif(\tstrpos($cp_page_xml,'<slider-type>Flex-Slider</slider-type>') > -1 || $slider_type == 'Flex-Slider'){\r\n\t\t\t\t\r\n\t\t\t\twp_enqueue_style('cp-flex-slider',CP_PATH_URL.'/frontend/css/flexslider.css');\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t//Bx Slider Condition\r\n\t\t\tif(strpos($cp_page_xml,'<slider-type>Bx-Slider</slider-type>') > -1 || $slider_type == 'Bx-Slider' ){\r\n\t\t\t\twp_enqueue_style('cp-bx-slider',CP_PATH_URL.'/frontend/css/bxslider.css');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(strpos($cp_page_xml,'<Column>') > -1){\r\n\t\t\t\twp_enqueue_style('cp-easy-chart',CP_PATH_URL.'/frontend/shortcodes/chart.css');\r\n\t\t\t\twp_enqueue_style('cp-bx-slider',CP_PATH_URL.'/frontend/shortcodes/bxslider.css');\r\n\t\t\t\twp_enqueue_style('cp-countdown',CP_PATH_URL.'/frontend/css/jquery.countdown.css');\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tif( strpos($cp_page_xml,'<eventview>Calendar View</eventview>') > -1 ){\r\n\t\t\r\n\t\t\t\twp_enqueue_style('cp-calender-view', CP_PATH_URL.'/framework/javascript/fullcalendar/fullcalendar.css');\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t// If using filterable plugin\r\n\t\t\tif( strpos($cp_page_xml,'<show-filterable>') > -1 ){\r\n\t\t\t\r\n\t\t\t\twp_enqueue_style('cp-style-view', CP_PATH_URL.'/frontend/css/style_animate.css');\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// If using filterable plugin\r\n\t\t\tif( strpos($cp_page_xml,'<filterable>Yes</filterable>') > -1 ){\r\n\t\t\t\r\n\t\t\t\twp_register_script('filterable', CP_PATH_URL.'/frontend/shortcodes/jquery-filterable.js', false, '1.0', true);\r\n\t\t\t\twp_enqueue_script('filterable');\r\n\t\t\t\t\r\n\t\t\t\twp_register_script('jquery-easing-1.3', CP_PATH_URL.'/frontend/js/jquery-easing-1.3.js', false, '1.0', true);\r\n\t\t\t\twp_enqueue_script('jquery-easing-1.3');\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If using Services\r\n\t\t\tif( strpos($cp_page_xml,'<service-widget-style>Circle-Icon</service-widget-style>') > -1 ){\r\n\t\t\t\r\n\t\t\t\twp_enqueue_style('circle-hover',CP_PATH_URL.'/frontend/css/circle-hover.css');\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If using Events\r\n\t\t\tif( strpos($cp_page_xml,'<Events>') > -1 ){\r\n\t\t\t\twp_enqueue_style('cp-countdown',CP_PATH_URL.'/frontend/css/jquery.countdown.css'); //Load Style\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If using NewsSlider\r\n\t\t\tif( strpos($cp_page_xml,'<News-Slider>') > -1 ){\r\n\t\t\t\r\n\t\t\t\twp_enqueue_style('cp-bx-slider',CP_PATH_URL.'/frontend/css/bxslider.css');\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If using NewsSlider\r\n\t\t\tif( strpos($cp_page_xml,'<Client-Slider>') > -1 ){\r\n\t\t\t\r\n\t\t\t\twp_enqueue_style('cp-content-slider',CP_PATH_URL.'/frontend/css/content_slider_style.css');\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t \r\n\t\t\tif( strpos($cp_page_xml,'<Portfolio>') > -1 || strpos($cp_page_xml,'<Portfolio-Gallery>') > -1){\r\n\t\t\t\r\n\t\t\t\twp_enqueue_style('prettyPhoto',CP_PATH_URL.'/frontend/css/prettyphoto.css');\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t// if using timeline\r\n\t\t\tif( strpos($cp_page_xml,'<Timeline>') > -1 ){\r\n\t\t\t\twp_enqueue_style('cp-bx-slider',CP_PATH_URL.'/frontend/css/bxslider.css');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// if using timeline\r\n\t\t\tif( strpos($cp_page_xml,'<Woo-Products>') > -1 ){\r\n\t\t\t\twp_enqueue_style('cp-woocommerce',CP_PATH_URL.'/frontend/css/wp-commerce.css');\r\n\t\t\t\twp_enqueue_style('prettyPhoto',CP_PATH_URL.'/frontend/css/prettyphoto.css');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( strpos($cp_page_xml,'<Sermons>') > -1 || strpos($cp_page_xml,'<Gallery>') > -1 || strpos($cp_page_xml,'<Our-Team>') > -1 || strpos($cp_page_xml,'<News>') > -1 || strpos($cp_page_xml,'<Events>') > -1){\r\n\t\t\t\twp_enqueue_style('prettyPhoto',CP_PATH_URL.'/frontend/css/prettyphoto.css');\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( strpos($cp_page_xml,'<Woo-Products>') > -1 ){\r\n\t\t\t\t//WooCommerce Style\r\n\t\t\t\twp_enqueue_style('woocommerce_frontend_styles',CP_PATH_URL.'/frontend/css/woocommerce.css');\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$font_google = '';\r\n\t\t$font_size_normal = '';\r\n\t\t$menu_font_google = '';\r\n\t\t$fonts_array = '';\r\n\t\t$font_google_heading = '';\r\n\t\t$heading_h1 = '';\r\n\t\t$heading_h2 = '';\r\n\t\t$heading_h3 = '';\r\n\t\t$heading_h4 = '';\r\n\t\t$heading_h5 = '';\r\n\t\t$heading_h6 = '';\r\n\t\t$embed_typekit_code = '';\r\n\t\t$cp_typography_settings = get_option('typography_settings');\r\n\t\t\r\n\t\t//$dd = find_xml_node($logo_uploa_d,'logo_upload');\r\n\t\tif($cp_typography_settings <> ''){\r\n\t\t\t$cp_typo = new DOMDocument ();\r\n\t\t\t$cp_typo->loadXML ( $cp_typography_settings );\r\n\t\t\t$font_google = find_xml_value($cp_typo->documentElement,'font_google');\r\n\t\t\t$font_size_normal = find_xml_value($cp_typo->documentElement,'font_size_normal');\r\n\t\t\t$menu_font_google = find_xml_value($cp_typo->documentElement,'menu_font_google');\r\n\t\t\t$font_google_heading = find_xml_value($cp_typo->documentElement,'font_google_heading');\r\n\t\t\t$heading_h1 = find_xml_value($cp_typo->documentElement,'heading_h1');\r\n\t\t\t$heading_h2 = find_xml_value($cp_typo->documentElement,'heading_h2');\r\n\t\t\t$heading_h3 = find_xml_value($cp_typo->documentElement,'heading_h3');\r\n\t\t\t$heading_h4 = find_xml_value($cp_typo->documentElement,'heading_h4');\r\n\t\t\t$heading_h5 = find_xml_value($cp_typo->documentElement,'heading_h5');\r\n\t\t\t$heading_h6 = find_xml_value($cp_typo->documentElement,'heading_h6');\r\n\t\t\t$embed_typekit_code = find_xml_value($cp_typo->documentElement,'embed_typekit_code');\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Body Font Installing\r\n\t\tif(cp_get_font_type($font_google) == 'Google_Font'){\r\n\t\t\t//Google Font Body\r\n\t\t\tif($font_google <> ''){\r\n\t\t\t\twp_enqueue_style('googleFonts', get_google_font_url($font_google));\r\n\t\t\t}\t\r\n\t\t} else{\r\n\t\t\t//Adobe Edge Font (TypeKit) \r\n\t\t\tif($font_google <> ''){\r\n\t\t\t\twp_register_script( 'adobe-edge-font', \"http://use.edgefonts.net/\".$font_google.\".js\", false, '1.0', false);\r\n\t\t\t\twp_enqueue_script('adobe-edge-font');\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(cp_get_font_type($font_google_heading) == 'Google_Font'){\r\n\t\t\tif($font_google_heading <> ''){\t\t\t\t\r\n\t\t\t\twp_enqueue_style('googleFonts-heading', get_google_font_url($font_google_heading) );\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif($font_google_heading <> ''){\r\n\t\t\t\twp_register_script( 'adobe-edge-heading', \"http://use.edgefonts.net/\".$font_google_heading.\".js\", false, '1.0', false);\r\n\t\t\t\twp_enqueue_script('adobe-edge-heading');\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Menu Font Installing\r\n\t\t//verify_google_menu($menu_font_google);\r\n\t\tif(cp_get_font_type($menu_font_google) == 'Google_Font'){\r\n\t\t\tif($menu_font_google <> ''){\r\n\t\t\t\twp_enqueue_style('menu-googleFonts-heading', get_google_font_url($menu_font_google));\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif($menu_font_google <> ''){\r\n\t\t\t\twp_register_script( 'menu-edge-heading', \"http://use.edgefonts.net/\".$menu_font_google.\".js\", false, '1.0', false);\r\n\t\t\t\twp_enqueue_script('menu-edge-heading');\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "function wp_enqueue_block_support_styles($style, $priority = 10)\n {\n }", "function realEDU_theme_enqueue_styles(){\n\t\twp_enqueue_style('bootstrap-base', get_template_directory_uri() . \"/node_modules/bootstrap/dist/css/bootstrap.css\");\n\t\twp_enqueue_style('font-awesome', get_template_directory_uri() . \"/node_modules/font-awesome/css/font-awesome.css\");\n\n\t\twp_enqueue_style('stylesheet-default', get_template_directory_uri() . \"/style.css\");\n\t\twp_enqueue_style('custom-styles', get_template_directory_uri() . \"/css/app.css\");\n\t}", "function cg_framework_admin_styles($hook)\n{\n // LOADING BOOTSTRAP 4 ON THE WP ADMIN SIDE\n // wp_register_style(\n // 'wpplugin-admin-bootstrap',\n // 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css',\n // [],\n // time()\n // );\n\n // wp_enqueue_style('wpplugin-admin-bootstrap');\n\n // LOADING MAIN PLUGIN ADMIN SIDE STYLES\n wp_register_style(\n 'cg-framework-admin',\n CG_FRAMEWORK_URL . 'admin/assets/dist/css/admin.min.css',\n [],\n time()\n );\n\n wp_enqueue_style('cg-framework-admin');\n}", "function aitRevSliderAdminStyles(){ wp_enqueue_style('ait-revolution-slider-admin-css', THEME_URL . '/design/admin-plugins/revslider.css'); }", "function uvasomcmedept_styles() {\n\twp_enqueue_style( 'uvasomcmedept', plugins_url(). '/uvasomcmedept/uvasomcmedept.css');\n}", "public function registerStylesCommon() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style(\"wpjb-vendor-datepicker\", $x.\"date-picker/css/datepicker.css\");\n wp_register_style('wpjb-glyphs', $p.\"wpjb-glyphs.css\", array(), $v );\n wp_register_style('wpjb-stripe-elements', $p.\"wpjb-stripe-elements.css\", array(), $v );\n }", "function hotel_lux_gutenberg_frontend_styles() {\r\n\twp_enqueue_style('hotel-lux-gutenberg-frontend-style', get_template_directory_uri() . '/gutenberg/cmsmasters-framework/theme-style' . CMSMASTERS_THEME_STYLE . '/css/frontend-style.css', array(), '1.0.0', 'screen');\r\n\t\r\n\t\r\n\tif (is_rtl()) {\r\n\t\twp_enqueue_style('hotel-lux-gutenberg-frontend-rtl', get_template_directory_uri() . '/gutenberg/cmsmasters-framework/theme-style' . CMSMASTERS_THEME_STYLE . '/css/module-rtl.css', array(), '1.0.0', 'screen');\r\n\t}\r\n}", "function weeklypowerup_enqueue_styles()\n{\n\n\t wp_enqueue_style(\"add_normalize\", \t\tget_template_directory_uri() \t. \"/assets/css/normalize.css\");\n\n\t wp_enqueue_style(\"add_webflow_css\", \tget_template_directory_uri() \t. \"/assets/css/webflow.css\");\n\n\t wp_enqueue_style(\"add_weekly_css\", \tget_template_directory_uri() \t. \"/assets/css/weeklypowerup.webflow.css\");\n\n\t wp_enqueue_style(\"add_nunito_font\", \t\t\t\t\t\t\t\t'https://fonts.googleapis.com/css?family=Nunito', false); \n\n\t wp_enqueue_script('add_prism_js', \t\tget_template_directory_uri() \t. '/assets/js/prism.js');\n\t\n\t wp_enqueue_style(\"add_prism_css\", \tget_template_directory_uri() \t. \"/assets/css/prism.css\");\n\n wp_enqueue_style(\"frontpage-custom\", \tget_template_directory_uri() . \"/assets/css/frontpage.css\");\n\n\t wp_enqueue_script('add_webflow_js', \tget_template_directory_uri() \t. '/assets/js/webflow.js', array( 'jquery' ));\n \n wp_enqueue_style(\"weeklypowerup-style\", get_stylesheet_uri());\n \n \n}", "function wcfm_csm_load_styles( $end_point ) {\r\n\tglobal $WCFM, $WCFMu;\r\n\t$plugin_url = trailingslashit( plugins_url( '', __FILE__ ) );\r\n\r\n\tswitch( $end_point ) {\r\n\t\tcase 'wcfm-build':\r\n\t\t\twp_enqueue_style( 'wcfmu_build_css', $plugin_url . 'css/wcfm-style-build.css', array(), $WCFM->version );\r\n\t\tbreak;\r\n\t}\r\n}", "function cbusds_styles()\n{\n\n wp_register_style('w3css', get_template_directory_uri() . '/css/w3.css', array(), '', 'all');\n wp_enqueue_style('w3css'); // Enqueue it!\n\n wp_register_style('normalize', get_template_directory_uri() . '/normalize.css', array(), '1.0', 'all');\n wp_enqueue_style('normalize'); // Enqueue it!\n\n wp_register_style('cbusdscss', get_template_directory_uri() . '/style.css', array(), '1.0', 'all');\n wp_enqueue_style('cbusdscss'); // Enqueue it!\n}", "function html5blank_styles() {\n if ( HTML5_DEBUG ) {\n // normalize-css\n // wp_register_style( 'normalize', get_template_directory_uri() . '/bower_components/normalize.css/normalize.css', array(), '3.0.1' );\n\n // Slick\n wp_register_style( 'slick', get_theme_root_uri() . '/REPLACEMEPLEASE/node_modules/slick-carousel/slick/slick.css', array(), '1.8.1' );\n wp_register_style( 'slick-theme', get_theme_root_uri() . '/REPLACEMEPLEASE/node_modules/slick-carousel/slick/slick-theme.css', array(), '1.8.1' );\n\n // Custom CSS\n wp_register_style( 'html5blank', get_template_directory_uri() . '/style.css', array(), THE_VERSION_NUMBER );\n\n // Register CSS\n wp_enqueue_style( 'slick' );\n wp_enqueue_style( 'slick-theme' );\n wp_enqueue_style( 'html5blank' );\n } else {\n\n // Custom CSS\n wp_register_style( 'html5blankcssmin', get_template_directory_uri() . '/style.css', array(), THE_VERSION_NUMBER );\n\n // Register CSS\n wp_enqueue_style( 'html5blankcssmin' );\n }\n}", "function tcb_enqueue_admin()\r\n{\r\n wp_enqueue_style('thickbox');\r\n\r\n wp_enqueue_script('thickbox');\r\n\r\n wp_enqueue_style('thrive-theme-options', tve_editor_url() . '/admin/css/theme-options.css');\r\n\r\n wp_enqueue_style('thrive-admin-colors', tve_editor_url() . '/admin/css/thrive_admin_colours.css');\r\n wp_enqueue_style('thrive-base-css', tve_editor_url() . '/admin/css/pure-base-min.css');\r\n wp_enqueue_style('thrive-pure-css', tve_editor_url() . '/admin/css/pure-min.css');\r\n\r\n wp_enqueue_script('wp-color-picker');\r\n wp_enqueue_style('wp-color-picker');\r\n}", "function sss_kk_styles() {\n\twp_register_style('kk-social-share-starter-styles', plugins_url('kk-social-share-starter.css', __FILE__));\n\twp_enqueue_style('kk-social-share-starter-styles');\n}", "function styles() {\n\twp_register_style(\n\t\t'fontawesome',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/fontawesome/css/font-awesome.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'ionicons',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/ionicons/css/ionicons.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'bootstrap',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/bootstrap/dist/css/bootstrap.min.css\",\n\t\tarray( 'fontawesome' ),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'sanitize',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/sanitize/sanitize.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_enqueue_style(\n\t\t'vincentragosta',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/css/vincentragosta---twenty-seventeen.css\",\n\t\tarray( 'bootstrap', 'fontawesome', 'ionicons', 'sanitize' ),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n}", "function my_theme_enqueue_styles() {\n\n\t$parent_style = 'twentytwenty-style';\n\n\n\n\twp_register_style( 'uikit', get_stylesheet_directory_uri() . '/assets/lib/uikit/css/uikit.min.css', array(), false, 'all' );\n\twp_enqueue_style('uikit');\n\t\n\twp_register_style( 'style', get_template_directory_uri() . '/style.css', array(), false, 'all' );\n\twp_enqueue_style('style');\n\n\n\n\twp_enqueue_style($parent_style, get_template_directory_uri() . '/style.css');\n\twp_enqueue_style('child-style', \n\t\tget_stylesheet_directory_uri() . '/style.css',\n\t\tarray($parent_style),\n\t\twp_get_theme()->get('version')\n\t);\n\n\n\twp_register_script( 'uikit', get_stylesheet_directory_uri() . '/assets/lib/uikit/js/uikit.min.js', '', 2, true );\n\twp_enqueue_script('uikit');\n\n\n\n}", "function dequeue_header_styles_yapp()\r\n{\r\n wp_dequeue_style('yarppWidgetCss');\r\n}", "function zweidrei_eins_register_styles() {\n\n\t$theme_version = wp_get_theme()->get( 'Version' ); \n\twp_enqueue_style( 'style', get_stylesheet_uri(), array(), $theme_version );\n\n\t/** \t\n\t * Add custom css\n\t * Bulma: Free, open source, and modern CSS framework based on Flexbox\n\t * https://bulma.io/ \n\t * Version: 0.9.0\n\t * Child: custom.css\n\t */\n\twp_enqueue_style( 'style1', get_template_directory_uri() . '/assets/css/bulma.min.css', array(), $theme_version );\n\twp_enqueue_style( 'style2', get_template_directory_uri() . '/assets/css/custom.css', array(), $theme_version );\n\n\t\n\n}", "function enqueue_admin_styles() {\n\t\twp_enqueue_style( 'lcarsframework', plugin_dir_url( dirname(__FILE__) ) . 'css/lcarsframework.css', array(), lcars_Framework::VERSION );\n\t\twp_enqueue_style( 'wp-color-picker' );\n\t}", "function wp_enqueue_style() {\n\t}", "function theme_enqueue_styles() {\n\t$the_theme = wp_get_theme();\n\n wp_enqueue_style( 'child-understrap-styles', get_stylesheet_directory_uri() . '/css/child-theme-min.css', array(), $the_theme->get( 'Version' ) );\n wp_enqueue_style( 'dev-css', get_stylesheet_directory_uri() . '/css/dev.css', array(), $the_theme->get( 'Version' ) );\n wp_enqueue_script( 'child-understrap-scripts', get_stylesheet_directory_uri() . '/js/child-theme-min.js', array(), $the_theme->get( 'Version' ), true );\n}", "public function register_scripts()\n {\n wp_register_style(\n 'fau-oembed-style',\n plugins_url('assets/css/fau-oembed.css', plugin()->getBasename()),\n [],\n plugin()->getVersion()\n ); \n }", "function Of_Metabox_admin_styles() {\n wp_enqueue_style( 'easyMetabox_Stylesheet' );\n}", "function hotel_lux_gutenberg_editor_styles() {\r\n\twp_deregister_style('wp-block-library-theme');\r\n\twp_register_style('wp-block-library-theme', '');\r\n\t\r\n wp_enqueue_style('hotel-lux-gutenberg-editor-style', get_theme_file_uri( '/gutenberg/cmsmasters-framework/theme-style' . CMSMASTERS_THEME_STYLE . '/css/editor-style.css' ), false, '1.0', 'all');\r\n\t\r\n\t\r\n\tif (is_rtl()) {\r\n\t\twp_enqueue_style('hotel-lux-gutenberg-editor-style-rtl', get_template_directory_uri() . '/gutenberg/cmsmasters-framework/theme-style' . CMSMASTERS_THEME_STYLE . '/css/module-rtl.css', array(), '1.0.0', 'screen');\r\n\t}\r\n\t\r\n\t\r\n\t// Scripts\r\n\twp_enqueue_script('hotel-lux-gutenberg-editor-options-script', get_template_directory_uri() . '/gutenberg/cmsmasters-framework/theme-style' . CMSMASTERS_THEME_STYLE . '/js/editor-options.js', array('jquery'), '1.0.0', true);\r\n\t\r\n\t\r\n\t$gutenberg_module_styles = hotel_lux_gutenberg_module_colors('', true);\r\n\t$gutenberg_module_styles .= hotel_lux_gutenberg_module_fonts('', true);\r\n\t\r\n\twp_add_inline_style('hotel-lux-gutenberg-editor-style', $gutenberg_module_styles);\r\n}", "public function registerStyles()\n {\n wp_register_style('swiper-css', THEME_DIR_URI .'/assets/css/swiper.min.css', [], false, 'all');\n wp_register_style('dist-css', THEME_DIR_URI .'/assets/css/dist.css', [], false, 'all');\n wp_register_style('regional-css', THEME_DIR_URI .'/regional.css', [], false, 'all');\n wp_register_style('regional-style', THEME_DIR_URI .'/style.css', [], false, 'all');\n\n // Default app style file\n //wp_enqueue_style('style-css');\n\n // App styles\n wp_enqueue_style('swiper-css');\n wp_enqueue_style('dist-css');\n wp_enqueue_style('regional-css');\n wp_enqueue_style('regional-style');\n }", "function dseven_enqueue_style() {\n\twp_enqueue_style( 'dizzyseven', get_stylesheet_uri() ); \n\twp_enqueue_style( 'dizzyseven-guttenberg', get_template_directory_uri() . '/dizzy-gutenberg.css' );\n\twp_enqueue_style( 'dizzyseven-animateit', get_template_directory_uri() . '/include/animate-it/css/animations.css' );\n\tif (get_theme_mod('diz-custom-typography-css')) {\n\t wp_enqueue_style( 'dizzyseven-guttenberg-custom-editor', get_template_directory_uri() . '/custom-styles.css.php', false, true );\n\t }\n\tif (get_theme_mod('google_font_setting')) {\n\t wp_enqueue_style( 'dizzyseven-google-font', get_theme_mod( 'google_font_setting', '' ), false, true );\n\t }\n\tif (get_theme_mod('custom_font_setting')) {\n\t wp_enqueue_style( 'dizzyseven-custom-font', get_theme_mod( 'custom_font_setting', '' ), false, true );\n\t }\n}", "function register_crunchpress_panel_styles(){\r\n\t\r\n\t\twp_enqueue_style('jquery-ui',CP_PATH_URL.'/framework/stylesheet/jquery-ui.css');\r\n\t\twp_enqueue_style('cp-panel',CP_PATH_URL.'/framework/stylesheet/cp-panel.css');\r\n\t\twp_enqueue_style('mini-color',CP_PATH_URL.'/framework/stylesheet/jquery.miniColors.css');\r\n\t\twp_enqueue_style('confirm-dialog',CP_PATH_URL.'/framework/stylesheet/jquery.confirm.css');\r\n\t\twp_enqueue_style('jquery-timepicker',CP_PATH_URL.'/framework/stylesheet/jquery.ui.timepicker.css');\r\n\t\t\r\n\t}", "function thrive_dashboard_enqueue_style($handle, $src, $deps = array(), $ver = false, $media = 'all')\n{\n if ($ver === false) {\n $ver = \"1.0\";\n }\n wp_enqueue_style($handle, $src, $deps, $ver, $media);\n}", "function gt_setup(){\n wp_enqueue_style('style',get_stylesheet_uri(),NULL, microtime(),'all');\n wp_enqueue_script(\"main\",get_theme_file_uri('/js/main.js'),NULL,microtime(),true);\n\n\n // if (is_page(11)) {\n // wp_register_style('dhaniya', get_theme_file_uri() . '/style/dhaniya.css');\n // wp_enqueue_style('dhaniya', get_theme_file_uri() . '/style/dhaniya.css');\n // }\n \n}", "function twentytwentyone_styles() {\n wp_enqueue_style( 'child-style', get_stylesheet_uri(),\n array( 'twenty-twenty-one-style' ),\n wp_get_theme()->get('Version') // only works if Version is in the style header\n );\n}", "public function enqueueStyles() {\n\t\t\twp_enqueue_style('app', self::asset(\"css/app.css\"), NULL, '1.0.0', 'all');\n\t\t}", "function vacatures_single_style_scripts() {\n //wp_enqueue_style( 'vacatures-single-page-template-theme-style' );\n wp_enqueue_style('vacatures-single-page-template-theme-style',content_url( 'templates/assets/css/vacatures-single-page-template-theme-style.css' , __FILE__ ) );\n}", "function theme_enqueue_styles() {\n\n // Enqueue the parent theme style\n $parent_style = 'parent-style';\n wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );\n wp_enqueue_style( 'foundation', get_stylesheet_directory_uri() . '/css/foundation.min.css' );\n wp_enqueue_style( 'chocolatcss', get_stylesheet_directory_uri() . '/css/chocolat.css' );\n\n wp_register_script( 'modernizr', get_stylesheet_directory_uri() . '/js/modernizr-custom.js', array(), null, false );\n wp_register_script( 'what-input', get_stylesheet_directory_uri() . '/js/vendor/what-input.min.js', array(), null, true );\n wp_register_script( 'jQuery', get_stylesheet_directory_uri() . '/js/vendor/jquery.min.js', array(), null, true );\n wp_register_script( 'foundation-js', get_stylesheet_directory_uri() . '/js/foundation.min.js', array(), null, true );\n wp_register_script( 'chocolat-js', get_stylesheet_directory_uri() . '/js/chocolat.min.js', array('jQuery'), null, true );\n wp_register_script( 'app', get_stylesheet_directory_uri() . '/js/app.js', array('chocolat-js'), null, true );\n\n wp_enqueue_script( 'modernizr' );\n\n if ( !is_admin() ) {\n wp_dequeue_script('jquery');\n wp_enqueue_script( 'jQuery' );\n }\n\n wp_enqueue_script( 'what-input' );\n wp_enqueue_script( 'foundation-js' );\n wp_enqueue_script( 'app' );\n\n\n}", "function horse_manager_stylesheet() {\n wp_register_style( 'horse-style', plugins_url('/inc/horse_styles.css', __FILE__) );\n wp_enqueue_style( 'horse-style' );\n}", "function vp_admin_styles(){\n global $typenow;\n\n if( $typenow == 'wellgorithms' || $typenow == 'my_wellgorithms' ) {\n wp_enqueue_style( 'vp_admin_styles', plugins_url( 'css/style.css', __FILE__ ));\n }\n\n if( $typenow == 'color_template' ) {\n wp_enqueue_style( 'vp_admin_styles', plugins_url( 'css/color-templates.css', __FILE__ ));\n }\n}", "function womendevs_enqueue_style() {\n \n // Bootstrap CSS\n wp_enqueue_style( 'bootstrap', '//stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' , false ); \n\n // Google Font\n wp_enqueue_style( 'googlefont', '//fonts.googleapis.com/css?family=Roboto' , false ); \n \n // Font Awesome\n wp_enqueue_style( 'fontawesome', '//use.fontawesome.com/releases/v5.8.1/css/all.css' , false );\n\n // Ma feuille CSS\n wp_enqueue_style( 'core', get_stylesheet_uri() , false ); \n}", "function indosEnqueue() {\n global $app_base_url;\n\n\tif(! is_admin()){\n\t wp_register_style('indoshipping_css',$app_base_url.'assets/indoshipping.css');\n\t wp_register_script('indoshipping_js',$app_base_url.'assets/indoshipping.js',array('jquery'));\n\t wp_localize_script('indoshipping_js','indoshipping',array('pluginurl'=>$app_base_url,'ajaxurl'=>admin_url('admin-ajax.php')));\n\t wp_enqueue_style('indoshipping_css');\n\t wp_enqueue_script('indoshipping_js');\n\t}\n}", "function csu_hcfw_resources_load_scripts() {\n\twp_enqueue_style( 'csu-hcfw-resources-styles', plugin_dir_url( __FILE__ ) . 'includes/css/styles.css' );\n}", "function total_child_enqueue_parent_theme_style() {\n\t$theme = wp_get_theme( 'Total' );\n\t$version = $theme->get( 'Version' );\n\n\t// Load the stylesheet\n\twp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css', array(), $version );\n\tif ( defined( 'WPEX_THEME_STYLE_HANDLE' ) ) {\n\t\twp_dequeue_style( WPEX_THEME_STYLE_HANDLE );\n\t\twp_enqueue_style(\n\t\t\tWPEX_THEME_STYLE_HANDLE,\n\t\t\tget_stylesheet_uri(),\n\t\t\tarray(),\n\t\t\tEASL_THEME_VERSION\n\t\t);\n\t}\n wp_register_style( 'vc_tta_style', get_stylesheet_directory_uri() . '/assets/css/js_composer_tta.css', false, EASL_THEME_VERSION );\n}", "function wagw_scripts() {\n\t\t$theme = wp_get_theme();\n\t\t$ver = $theme->get( 'Version' );\n\t$themecsspath = get_stylesheet_directory() . '/style.css';\n\t$style_ver = filemtime( $themecsspath );\n\twp_enqueue_style( 'wagw-style', get_stylesheet_uri(),array(),$style_ver );\n\n\twp_enqueue_script( 'wagw-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );\n\n\twp_enqueue_script( 'wagw-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n\n\twp_enqueue_script( 'thickbox', true );\n\twp_enqueue_style( 'thickbox' );\n\n\tif ( is_page_template( 'slider-page.php' ) ) {\n\t\twp_enqueue_style( 'flexslider-css', get_stylesheet_directory_uri() . '/flexslider/flexslider.css' );\n\t}\n\n}", "function blueauthentic_load_styles() {\n\t$theme_version = wp_get_theme()->get( 'Version' );\n\twp_enqueue_style( 'blueauthentic-css', get_template_directory_uri() . '/style.css', array( 'blueauthentic-bootstrap', 'blueauthentic-fontawesome' ), $theme_version, 'all' );\n\twp_enqueue_style( 'blueauthentic-bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css', array(), '4.5.2', 'all' );\n\twp_enqueue_style( 'blueauthentic-fontawesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css', array(), '5.15.1', 'all' );\n}", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in SpaceAPI_WP_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The SpaceAPI_WP_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/spaceapi-wp-admin.css', array(), $this->version, 'all' );\n\n\t}", "function mastertimecenter_scripts(){\n wp_enqueue_style('mastertimecenter-style', get_stylesheet_uri());\n}", "public function enqueue_styles() {\n\n\t\twp_register_style( 'wpaddons_io_sitestyle', plugins_url( 'wpaddons-io-sdk/css/wpaddons-io.css', __FILE__ ) );\n\n\t\twp_enqueue_style( 'wpaddons_io_sitestyle' );\n\n\t}", "function WPThemeDevPrac_resources(){\n\n\twp_enqueue_style('style', get_stylesheet_uri());\n\n}", "function WDA_admin_css_all_page() { \n wp_register_style($handle = 'WDA_admin-css-all', $src = plugins_url('css/WDA_style.css', __FILE__), $deps = array(), $ver = '1.0.0', $media = 'all');\n wp_enqueue_style('WDA_admin-css-all');\n}", "function register_css_styles() {\n\tif (!is_admin()) {\n\t\tglobal $wp_styles;\n\t\t\n\t\t\n\t\t$cmsms_option = cmsms_get_global_options();\n\t\t\n\t\t\n\t\twp_register_style('theme-style', get_stylesheet_uri(), array(), '1.0.0', 'screen');\n\t\twp_register_style('theme-fonts', get_template_directory_uri() . '/css/fonts.php', array(), '1.0.0', 'screen');\n\t\twp_register_style('theme-adapt', get_template_directory_uri() . '/css/adaptive.css', array(), '1.0.0', 'screen');\n\t\twp_register_style('theme-retina', get_template_directory_uri() . '/css/retina.css', array(), '1.0.0', 'screen');\n\t\twp_register_style('jackbox', get_template_directory_uri() . '/css/jackbox.css', array(), '1.0.0', 'screen');\n\t\twp_register_style('fontello', get_template_directory_uri() . '/css/fonts/css/fontello.css', array(), '1.0.0', 'screen');\n\t\twp_register_style('jPlayer', get_template_directory_uri() . '/css/jquery.jPlayer.css', array(), '2.1.0', 'screen');\n\t\twp_register_style('isotope', get_template_directory_uri() . '/css/jquery.isotope.css', array(), '1.5.19', 'screen');\n\t\twp_register_script('respond', get_template_directory_uri() . '/js/respond.min.js', array(), '1.1.0', false);\n\t\t\n\t\twp_enqueue_style('theme-style');\n\t\twp_enqueue_style('theme-fonts');\n\t\twp_enqueue_style('fontello');\n\t\t\n\t\tif ($cmsms_option[CMSMS_SHORTNAME . '_responsive']) {\n\t\t\twp_enqueue_style('theme-adapt');\n\t\t}\n\t\t\n\t\tif ($cmsms_option[CMSMS_SHORTNAME . '_retina']) {\n\t\t\twp_enqueue_style('theme-retina');\n\t\t}\n\t\n\t\t\n\t\twp_enqueue_style('jackbox');\n\t\twp_enqueue_style('jPlayer');\n\t\twp_enqueue_style('isotope');\n\t\t\n\t\twp_register_style('jackbox-ie8', get_template_directory_uri() . '/css/jackbox-ie8.css', array(), '1.0.0', 'screen');\n\t\twp_register_style('jackbox-ie9', get_template_directory_uri() . '/css/jackbox-ie9.css', array(), '1.0.0', 'screen');\n\t\t\n\t\twp_enqueue_style('theme-ie', get_template_directory_uri() . '/css/ie.css', array(), '1.0.0', 'screen');\n\t\twp_enqueue_style('theme-ieCss3', get_template_directory_uri() . '/css/ieCss3.php', array(), '1.0.0', 'screen');\n\t\t\n\t\t$wp_styles->add_data('jackbox-ie8', 'conditional', 'lt IE 9');\n\t\t$wp_styles->add_data('jackbox-ie9', 'conditional', 'gt IE 8');\n\t\t\n\t\t$wp_styles->add_data('theme-ie', 'conditional', 'lt IE 9');\n\t\t$wp_styles->add_data('theme-ieCss3', 'conditional', 'lt IE 9');\n\t}\n}", "function ezbreezies_styles() {\n\n\twp_enqueue_style( 'ezbreezies-style', get_template_directory_uri() . '/style.css' );\n\twp_enqueue_style( 'ezbreezies-main-style', get_template_directory_uri() . '/library/css/main-min.css' );\n\n}", "function admin_print_styles() {\n global $SlideDeckPlugin;\n\n wp_enqueue_style( \"{$this->namespace}-admin\" );\n\n if( $SlideDeckPlugin->is_plugin() ) {\n wp_enqueue_style( 'codemirror' );\n wp_enqueue_style( 'codemirror-theme-default' );\n wp_enqueue_style( 'jquery-minicolors' );\n }\n }", "function cinerama_edge_enqueue_admin_styles() {\n\t\twp_enqueue_style( 'wp-color-picker' );\n\n\t\t/**\n\t\t * @see CineramaEdgeClassSkinAbstract::enqueueStyles - hooked with 10\n\t\t */\n\t\tdo_action( 'cinerama_edge_action_enqueue_admin_styles' );\n\t}", "public function widget_styles() {\n\t\twp_register_style( 'elementor-addons', plugins_url( '/assets/css/frontend.css', __FILE__ ) , array() ,ELEMENT_ADDON_VER );\n\t\twp_register_style( 'elementor-addons-custom-frontend', plugins_url( '/assets/css/custom-frontend.css', __FILE__ ) , array() , ELEMENT_ADDON_VER);\n\t\twp_register_style( 'elementor-addons-content-filter', plugins_url( '/assets/widgets/content-filter.css', __FILE__ ) , array() , ELEMENT_ADDON_VER );\n\t}", "public function vpup_load_styles() \n {\n // Enqueue our styles.\n wp_enqueue_style( 'vpup-main-styles', VPUP_URL . 'wp-vue/src/assets/css/main.css' );\n wp_enqueue_style( 'vpup-font-awesome', 'https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );\n }", "function cosmetics_register_back_end_scripts(){\n wp_enqueue_style( 'cosmetics-admin-styles', get_theme_file_uri( '/extension/assets/css/admin-styles.css' ) );\n\n}", "function register_Oldsinks_admin_styles() {\n wp_enqueue_style('widget-Oldsinks-admin', plugins_url('Oldsinksplugins/css/admin.min.css'));\n}", "function additional_styles() {\n\t\tJetpack_Admin_Page::load_wrapper_styles();\n\t}", "public function register_styles() {\n\t\t\t$woocommerce_base = WC()->template_path();\n\t\t\t$assets_path = str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/';\n\n\t\t\t// register dependencies\n\t\t\twp_register_style( 'jquery-selectBox', YITH_WCWL_URL . 'assets/css/jquery.selectBox.css', array(), '1.2.0' );\n\t\t\twp_register_style( 'yith-wcwl-font-awesome', YITH_WCWL_URL . 'assets/css/font-awesome.min.css', array(), '4.7.0' );\n\t\t\twp_register_style( 'woocommerce_prettyPhoto_css', $assets_path . 'css/prettyPhoto.css' );\n\n\t\t\t// register main style\n\t\t\t$located = locate_template( array(\n\t\t\t\t$woocommerce_base . 'wishlist.css',\n\t\t\t\t'wishlist.css'\n\t\t\t) );\n\n\t\t\tif( ! $located ){\n\t\t\t wp_register_style( 'yith-wcwl-main', YITH_WCWL_URL . 'assets/css/style.css', array( 'jquery-selectBox', 'yith-wcwl-font-awesome' ), $this->version );\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$stylesheet_directory = get_stylesheet_directory();\n\t\t\t\t$stylesheet_directory_uri = get_stylesheet_directory_uri();\n\t\t\t\t$template_directory = get_template_directory();\n\t\t\t\t$template_directory_uri = get_template_directory_uri();\n\n\t\t\t\t$style_url = ( strpos( $located, $stylesheet_directory ) !== false ) ? str_replace( $stylesheet_directory, $stylesheet_directory_uri, $located ) : str_replace( $template_directory, $template_directory_uri, $located );\n\n\t\t\t\twp_register_style( 'yith-wcwl-user-main', $style_url, array( 'jquery-selectBox', 'yith-wcwl-font-awesome' ), $this->version );\n }\n\n\t\t\t// theme specific assets\n $current_theme = wp_get_theme();\n\n\t\t\tif( $current_theme->exists() ){\n\t\t\t $theme_slug = $current_theme->Template;\n\n\t\t\t if( file_exists( YITH_WCWL_DIR . 'assets/css/themes/' . $theme_slug . '.css' ) ){\n\t\t\t wp_register_style( 'yith-wcwl-theme', YITH_WCWL_URL . 'assets/css/themes/' . $theme_slug . '.css', array( $located ? 'yith-wcwl-user-main' : 'yith-wcwl-main' ), $this->version );\n }\n }\n\t\t}", "function wp_register_style($handle, $src, $deps = array(), $ver = \\false, $media = 'all')\n {\n }", "function cg_framework_frontend_styles()\n{\n\n wp_register_style(\n 'cg-framework-frontend',\n CG_FRAMEWORK_URL . 'frontend/assets/dist/css/frontend.min.css',\n [],\n time()\n );\n\n wp_enqueue_style('cg-framework-frontend');\n}", "public function frontend_styles() {\n wp_enqueue_style( 'wc-label-gallery', $this->plugin_url() . '/assets/css/label-frontend.css' );\n }", "function twentynineteen_setup() {\n\t\tadd_theme_support( 'wp-block-styles' );\n\t\t// Add support for full and wide align images.\n\t\tadd_theme_support( 'align-wide' );\n\t\t// Add support for editor styles\n\t\tadd_theme_support( 'editor-styles' );\n\t\t// Enqueue editor styles\n\t\tadd_editor_style( 'style-editor.css' );\n }", "public function add_theme_support() {\n\t}", "function wp_roni_photo_contest_frontend_scripts_and_styles() {\n wp_enqueue_style( 'wpphotocontest_frontend_bootstrap_css', plugins_url( 'css/bootstrap.min.css', __FILE__ ) );\n wp_enqueue_style( 'wpphotocontest_frontend_font_awesome_css', plugins_url( 'css/font-awesome.min.css', __FILE__ ) );\n wp_enqueue_style( 'wpphotocontest_frontend_lightbox_css', plugins_url( 'css/lightbox.css', __FILE__ ) );\n wp_enqueue_style( 'wpphotocontest_frontend_custom_css', plugins_url( 'css/styles.css', __FILE__ ) );\n wp_enqueue_script( 'wpphotocontest_frontend_custom_script', plugins_url( 'wp_roni_photo_contest/js/scripts.js' ), array('jquery'), '', true);\n wp_enqueue_script( 'wpphotocontest_frontend_lightbox_script', plugins_url( 'wp_roni_photo_contest/js/lightbox.js' ), array('jquery'), '', true);\n }", "function mokore_admin_enqueue_style(){\n\t\twp_register_style('mokore_admin_css', get_template_directory_uri() . '/inc/css/admin.css', false);\n\t\twp_enqueue_style('mokore_admin_css');\n\t}", "function front_end_styles()\n{\n\twp_register_style( 'front-end-normalize', get_template_directory_uri() . '/css/reset.css', array(), null, 'all' );\n wp_register_style( 'front-end-styles', get_template_directory_uri() . '/css/styles.css', array(), null, 'all' );\n wp_register_style( 'front-end-plugins', get_template_directory_uri() . '/css/plugins.css', array(), null, 'all' );\n wp_register_style( 'front-end-media-queries', get_template_directory_uri() . '/css/media-queries.css', array(), null, 'all' );\n \n \n wp_enqueue_style( 'front-end-normalize' );\n wp_enqueue_style( 'front-end-styles' );\n wp_enqueue_style( 'front-end-plugins' );\n wp_enqueue_style( 'front-end-media-queries' );\n}", "function setup() {\n\tadd_filter( 'fl_builder_render_css', __NAMESPACE__ . '\\\\styles', 10, 3 );\n}" ]
[ "0.73010033", "0.7144791", "0.68605906", "0.6853663", "0.68032867", "0.67808634", "0.6656834", "0.66367674", "0.663439", "0.6628089", "0.6610452", "0.6608668", "0.6607253", "0.65924436", "0.65861315", "0.6585555", "0.6581671", "0.65763617", "0.65743333", "0.65738714", "0.6572609", "0.65705526", "0.65587986", "0.6552427", "0.65443426", "0.6539314", "0.6530958", "0.6528785", "0.652664", "0.65201265", "0.65174234", "0.65070724", "0.65041065", "0.6503199", "0.6500841", "0.64992774", "0.64916986", "0.64877266", "0.64849085", "0.64752626", "0.64741004", "0.64696", "0.645696", "0.64553005", "0.645343", "0.6450598", "0.6441907", "0.64393455", "0.6429095", "0.6428868", "0.64229524", "0.6414429", "0.64112705", "0.6407165", "0.6402734", "0.64015484", "0.63998777", "0.63926476", "0.6376954", "0.6376314", "0.6368509", "0.6367995", "0.63657326", "0.6364575", "0.6358933", "0.6355539", "0.63552403", "0.6353271", "0.63517004", "0.6347966", "0.6343768", "0.6338564", "0.6335207", "0.6331161", "0.63311374", "0.63309604", "0.6328991", "0.6328734", "0.6326014", "0.6321284", "0.63196594", "0.63149536", "0.63114464", "0.6311139", "0.6305548", "0.63003385", "0.62962437", "0.6293049", "0.62923163", "0.62911624", "0.6289291", "0.6284779", "0.62768126", "0.6271001", "0.62686753", "0.62603354", "0.6260071", "0.62578416", "0.6256619", "0.6252649" ]
0.6795193
5
check whether stripe token is not empty
public function check() { if(!empty($_POST['stripeToken'])) { //get token, card and user info from the form $token = $_POST['stripeToken']; $name = $_POST['name']; $email = $_POST['email']; $card_num = $_POST['card_num']; $card_cvc = $_POST['cvc']; $card_exp_month = $_POST['exp_month']; $card_exp_year = $_POST['exp_year']; //include Stripe PHP library require_once APPPATH."third_party/stripe/init.php"; //set api key $stripe = array( "secret_key" => "sk_test_nnmQWZLnOjqPlHJgSeDFkXeJ", "publishable_key" => "pk_test_sUecrNfyh01OK648Nn6jmVAO" ); \Stripe\Stripe::setApiKey($stripe['secret_key']); //add customer to stripe $customer = \Stripe\Customer::create(array( 'email' => $email, 'source' => $token )); //item information $itemName = "Stripe Donation"; $itemNumber = "PS123456"; $itemPrice = 500; $currency = "usd"; $orderID = "SKA92712382139"; //charge a credit or a debit card $charge = \Stripe\Charge::create(array( 'customer' => $customer->id, 'amount' => $itemPrice, 'currency' => $currency, 'description' => $itemNumber, 'metadata' => array( 'item_id' => $itemNumber ) )); //retrieve charge details $chargeJson = $charge->jsonSerialize(); //check whether the charge is successful if($chargeJson['amount_refunded'] == 0 && empty($chargeJson['failure_code']) && $chargeJson['paid'] == 1 && $chargeJson['captured'] == 1) { //order details $amount = $chargeJson['amount']; $balance_transaction = $chargeJson['balance_transaction']; $currency = $chargeJson['currency']; $status = $chargeJson['status']; $date = date("Y-m-d H:i:s"); //insert tansaction data into the database $dataDB = array( 'name' => $name, 'email' => $email, 'card_num' => $card_num, 'card_cvc' => $card_cvc, 'card_exp_month' => $card_exp_month, 'card_exp_year' => $card_exp_year, 'item_name' => $itemName, 'item_number' => $itemNumber, 'item_price' => $itemPrice, 'item_price_currency' => $currency, 'paid_amount' => $amount, 'paid_amount_currency' => $currency, 'txn_id' => $balance_transaction, 'payment_status' => $status, 'created' => $date, 'modified' => $date, 'card_brand' => $chargeJson['source']['brand'] ); if ($this->db->insert('orders', $dataDB)) { if($this->db->insert_id() && $status == 'succeeded'){ $new_pass = rand(11111111111111,999999999999999); $this->load->library('email'); // from address $this->email->from('[email protected]', 'Mahir Valiyev'); $this->email->to($_POST['email']); // to Email address $this->email->cc('[email protected]'); // cc Email address (optional) $this->email->bcc('[email protected]'); // BCC Email Address (optional) $this->email->subject('Email Test'); // email Subject $this->email->message('Pasha Bank ViP Hesab uğurla əlavə olundu.'.$_POST['mobile'].' -ilə hesaba daxil ola bilərsiniz. İstifadəçi adı : '.$_POST['mobile'].'. Şifrə : '.$new_pass); // email Body or Message $this->email->send(); // send Email // $this->load->library('email'); // //SMTP & mail configuration // $config = array( // 'protocol' => 'smtp', // 'smtp_host' => 'ssl://smtp.gmail.com', // 'smtp_port' => 465, // 'smtp_user' => '[email protected]', // 'smtp_pass' => '?-?-?!?!0510', // 'mailtype' => 'html', // 'charset' => 'utf-8' // ); // $this->email->initialize($config); // $this->email->set_mailtype("html"); // $this->email->set_newline("\r\n"); // $new_pass = rand(11111111111111,999999999999999); // //Email content // $htmlContent = '<h1>Təbriklər!!!</h1>'; // $htmlContent .= '<p>Pasha Bank ViP Hesab uğurla əlavə olundu.</p>'.$_POST['mobile'].' -ilə hesaba daxil ola bilərsiniz. İstifadəçi adı : '.$_POST['mobile'].'. Şifrə : '.$new_pass; // $this->email->to('[email protected]'); // $this->email->from('[email protected]'); // $this->email->subject('Pasha Bank ViP Hesab'); // $this->email->message($htmlContent); // //Send email // $this->email->send(); $data = array( 'c_name' => $_POST['name'], // 'c_surname' => $surname, 'c_email' => $_POST['email'], 'c_mobile' => $_POST['mobile'], 'c_fincode' => $_POST['fincode'], 'c_password' => md5($new_pass), 'c_image' => 'default_profile.jpg' ); $this->db->insert('customers',$data); $data['insertID'] = $this->db->insert_id(); $this->load->view('payment_success', $data); // redirect('Welcome/payment_success','refresh'); }else{ echo "Transaction has been failed"; } } else { echo "not inserted. Transaction has been failed"; } } else { echo "Invalid Token"; $statusMsg = ""; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validateTokens()\n {\n $whoami = $this->getJson('/ping/whoami');\n if (isset($whoami['authenticated']) && $whoami['authenticated'])\n {\n syslog(LOG_DEBUG, \"Monzo: Token is still valid\");\n return true;\n }\n else\n {\n return false;\n }\n }", "public function testIfCustomerHasToken()\n {\n $this->assertNotNull($this->customersInstance->getToken());\n }", "public function hasToken(){\n return ( $this->token and $this->token->isValid() );\n }", "function isTokenValid($token){\n if(!empty($_SESSION['tokens'][$token])){\n unset($_SESSION['tokens'][$token]);\n return true;\n }\n return false;\n}", "public function hasToken();", "public static function validToken()\r\n {\r\n $header = apache_request_headers();\r\n if(!isset($_SESSION['CSRF_TOKEN']) || !isset($header['CSRF_TOKEN']) || $header['CSRF_TOKEN'] != $_SESSION['CSRF_TOKEN']){\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public function token_is_valid() {\n $token = $this->ci->input->post(\"token\");\n\n $this->ci->load->helper(\"access\");\n return check_token($token);\n }", "protected function _isNewToken()\n {\n $info = $this->_quote->getPayment();\n Mage::helper('ewayrapid')->unserializeInfoInstace($info);\n if ($token = Mage::getSingleton('core/session')->getData('newToken')) {\n Mage::getSingleton('core/session')->unsetData('newToken');\n return true;\n }\n return false;\n }", "public static function check_xsrf_token() {\n\t\t\n\t\t# only check POST requests\n\t\tif(self::$check_xsrf && !empty($_POST)) {\n\t\t\t\n\t\t\t# verify the token\n\t\t\tSession::check_xsrf_token_string($_POST[self::Token_Variable]);\n\t\t\t\n\t\t}\n\t}", "public function isTokenValid() {\n if (!isset($_SESSION['token']) || $this->_token != $_SESSION['token'])\n \n\t\t\t$this->_errors[] = 'invalid submission';\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }", "public function hasToken(){\n return $this->_has(2);\n }", "public function hasToken(){\n return $this->_has(2);\n }", "private function tokenExist() {\n if (!$this->webhook->token) {\n // throw an exception\n $this->missingEx('token');\n }\n }", "public function is_valid($token) {\n\t\treturn ! empty($token) &&\n\t\t\t ! empty($_COOKIE[self::$csrf_cookie]) && \n\t\t\t hash_equals($_COOKIE[self::$csrf_cookie], $token);\n\t}", "function isValidToken($token){\r\n global $pdo;\r\n\t\t$select = $pdo->prepare(\"SELECT 1 FROM device_registry \r\n\t\t\tWHERE token = ?\");\r\n\t\t$select->execute(array($token));\r\n \tif($select->fetchColumn()){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private function validateTokenRequest(): bool\n {\n $validator = new Validator([\n 'required' => ':attribute — обязательное поле.',\n 'numeric' => ':attribute — поле должно содержать только цифры.',\n ]);\n\n $validator->addValidator('plain', new PlainRule());\n\n $validation = $validator->make([\n 'shop_id' => $this->getRouteParam('id'),\n 'secret_key' => $this->http_request->query->get('secret_key'),\n ], [\n 'shop_id' => 'required|numeric',\n 'secret_key' => 'required|plain',\n ]);\n\n $validation->setAliases([\n 'shop_id' => 'Идентификатор магазина',\n 'secret_key' => 'Секретный ключ',\n ]);\n\n $validation->validate();\n\n if ($validation->fails()) {\n $errors = $validation->errors()->toArray();\n\n foreach ($errors as $key => $error) {\n foreach ($error as $message) {\n $this->errors[] = [\n 'code' => 'invalid-field',\n 'message' => $message,\n 'field' => $key,\n ];\n }\n }\n\n return false;\n }\n\n return true;\n }", "function csrf_token_is_valid() {\n\tif(isset($_POST['csrf_token'])) {\n\t\t$user_token = $_POST['csrf_token'];\n\t\t$stored_token = $_SESSION['csrf_token'];\n\t\treturn $user_token === $stored_token;\n\t} else {\n\t\treturn false;\n\t}\n}", "function validate_token() {\n\n global $token;\n\n // If the user passed a username and password in this request\n // and did not login via a session, then token validation is not\n // necessary, so return true.\n if (defined('API_USERNAME')) {\n return true;\n }\n\n // If the token does not exist in the session,\n // or the passed token does not match the token from the session,\n // then this might be a CSRF attack so respond with an error.\n if (\n ($_SESSION['software']['token'] == '')\n || ($token != $_SESSION['software']['token'])\n ) {\n respond(array(\n 'status' => 'error',\n 'message' => 'Invalid token.'));\n }\n}", "public function validate ( $token ) { return $this->server->token2uid( $token ) > 0; }", "public function validateToken($token)\n\t{\n\t\t$valid = false;\n\t\t$passwordResetInfo = $this->entityManager->getRepository('BugglMainBundle:PasswordResetInfo')->findOneBy(array('token' => $token));\n\t\tif(!is_null($passwordResetInfo) and $token != ''){\n\t\t\t$valid = strtotime($passwordResetInfo->getTokenExpiration()->format('Y-m-d H:i:s')) >= strtotime(date('Y-m-d H:i:s'));\n\t\t}\n\n\t\treturn $valid;\n\t}", "private function checkShopToken() \n\t{\t\n\t\t$shop_token = Shopware()->Front()->Request()->getParam('shop_token');\n\t\t\n if(isset($shop_token) && !empty($shop_token)) \n\t\t{\n $config = EasymarketingConfig::getInstance();\n\n if($shop_token != $config->getShopToken()) \n\t\t\t{\n header('HTTP/1.0 400 Bad Request');\n echo 'Wrong Shop Token!';\n die;\n }\n } else {\n header('HTTP/1.0 400 Bad Request');\n echo 'Shop Token Missing!';\n die;\n }\n \n return true;\n }", "protected function check_tok($token)\r\n {\r\n if (isset($_SESSION['token']) && $token === $_SESSION['token'])\r\n {\r\n unset($_SESSION['token']);\r\n return true;\r\n }\r\n return false;\r\n }", "public function checkToken( )\n {\n\n $this->getTokenPost();\n if ( $this->token_post && $this->is_active() ) {\n if (empty($this->project_id) || $this->project_id != $this->token_post['meta_data']['pr-projekt'][0]) {\n $this->set_result_error('notfound');\n return false;\n }\n return $this->result;\n } else {\n return false;\n }\n\n }", "public function is_check_divesToken($device_token) {\n $ret = $this->db->select('*')->\n from('device_details')->\n where('device_id', $device_token)->\n get()->row();\n\n if (empty($ret)) {\n return true;\n } else {\n return false;\n }\n }", "public function isValidCSRFToken(string $token):bool;", "function token_exist($token): bool\r\n{\r\n\tglobal $DATABASE;\r\n\t\r\n\ttoken_invalidate();\r\n\t\r\n\tif($token == NULL) return false;\r\n\t\r\n\tforeach($DATABASE->execute_query(\"SELECT token FROM `logged_in`\") as $value)\r\n\t\tif(strcmp($value[0], $token) == 0)\r\n\t\t\treturn true;\r\n\t\r\n\treturn false;\r\n}", "function validarToken($token)\n{\n\trequire_once \"api_conf.php\";\n\tif($token == $api_token)\n\t{\n\t\treturn true;\n\t}\n\n\t//cambiar a False en producción\n\treturn true;\n}", "function csrf_token_is_valid()\r\n{\r\n if (isset($_POST['csrf_token'])) {\r\n $user_token = $_POST['csrf_token'];\r\n $stored_token = $_SESSION['csrf_token'];\r\n return $user_token === $stored_token;\r\n }\r\n\r\n return false;\r\n}", "public function getIsValid(): bool\n {\n $token = $this->getToken();\n\n return !empty($token) && !$this->getIsExpired();\n }", "public function validateToken($token)\n {\n if (isset($_SESSION['MFW_csrf-token']) && $_SESSION['MFW_csrf-token'] == $token) {\n return true;\n }\n\n return false;\n }", "public static function checkToken(string $api_token = null) : bool\n {\n $token = DB::table('api_tokens')\n ->where('token', $api_token)\n ->where('expires_at', '>', now()->toDateTimeString())\n ->first();\n if ($token) {\n return true;\n }\n return false;\n }", "public function isValid()\n {\n return !empty($this->_data[OAuth::PARAM_TOKEN])\n && !empty($this->_data[OAuth::PARAM_VERIFIER]);\n }", "public static function hasToken(Request $request);", "public function checkToken() {\n if (!isset($this->requestToken)) {\n trigger_error(tr('Request token missing. Is the session module missing?'), E_USER_WARNING);\n return false;\n }\n if (!isset($this->data['access_token'])) {\n return false;\n }\n return $this->requestToken->getToken() === $this->data['access_token'];\n }", "public function oauthRequestTokenVerify($token)\n {\n\t $sql = 'SELECT request_token FROM oauth_request_tokens\n WHERE request_token = ' . $this->db->escape($token) . '\n AND authorised_user_id IS NULL';\n $query = $this->db->query($sql);\n\n $result = $query->result();\n if(count($result) > 0) {\n return true;\n }\n return false;\n }", "function checkDeviceToken()\n {\n $sql = $this->db->select('id')->where('deviceToken', $deviceToken)->get('users');\n if($sql->num_rows())\n {\n $id = array();\n foreach($sql->result() as $result)\n {\n $id[] = $result->id;\n }\n $this->db->where_in('id', $id);\n $this->db->update('users',array('deviceToken'=>''));\n\n if($this->db->affected_rows() > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n return true;\n }", "public static function order_has_payment_token( $order ) {\n\n\t\tif ( ! is_object( $order ) )\n\t\t\t$order = new WC_Order( $order );\n\n\t\treturn ( isset( $order->order_custom_fields['_wc_pre_orders_has_payment_token'][0] ) && true === (bool) $order->order_custom_fields['_wc_pre_orders_has_payment_token'][0] );\n\t}", "function valid_token($token = NULL)\n\t{\n\t\t$this->db->from('user_forgot_password');\n\t\t$this->db->where('token', $token);\n\t\t$token = $this->db->get();\n\n\t\tif ($token->num_rows() === 1)\n\t\t{\n\t\t\treturn $token->row_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function checkToken() {\n\t\t\t// Split the token up again to make sure the first 40 chars are the same (TOKEN)\n\t\t\t$splitToken = substr($this->tokenFromCookie, 0, 40);\n\t\t\t\n\t\t\t// Split the token up again to make sure the second 40 chars are the same (ZIPPED)\n\t\t\t$splitZipped = substr($this->tokenFromCookie, 40, 40);\n\t\t\t\n\t\t\t// Unzip the second 40 chars\n\t\t\t$result = $this->unzip($splitZipped);\n\n\t\t\t// Check if the sha of the zipped portion matches the token.\n\t\t\t// If so, no one has messed with the token\n\t\t\tif(strcmp($splitToken, sha1($splitZipped) == 0)) {\n\t\t\t\t// Grab all data from unzip\n\t\t\t\t$ip = base_convert($result[0], IP_ADDRESS, 10);\n\t\t\t\t$time = base_convert($result[1], REQUEST_TIME, 10);\n\t\t\t\t$user = $result[2];\n\t\t\t\t$random = $result[3];\n\t\t\t\t$expires = substr($this->tokenFromCookie, 80, strlen($this->tokenFromCookie));\n\n\t\t\t\t// Check if token is expired after one hour\n\t\t\t\tif(time() - $expires <= 3600) {\n\t\t\t\t\tif(strpos($_SERVER['REMOTE_ADDR'], \":\") !== false) {\n\t\t\t\t\t\t$userIpAddImp = implode(explode(\":\", $_SERVER['REMOTE_ADDR']));\n\t\t\t\t\t}\n\t\t\t\t\telseif(strpos($_SERVER['REMOTE_ADDR'], \".\") !== false) {\n\t\t\t\t\t\t$userIpAddImp = implode(explode(\".\", $_SERVER['REMOTE_ADDR']));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Check if userIp is the same as when s/he originally logged in\n\t\t\t\t\t$validity = (strcmp($ip, $userIpAddImp) == 0) ? true : false;\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\t$validity = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$validity = false;\n\t\t\t}\n\t\t\t\n\t\t\treturn $validity;\n\t\t}", "function Check() {\n\t\t// Check if the token has been sent.\n\t\tif(isset($_REQUEST['spack_token'])) {\n\t\t\t// Check if the token exists\n\t\t\tif(isset($_SESSION[\"spackt_\".$_REQUEST['spack_token']])) {\n\t\t\t\t// Check if the token isn't empty\n\t\t\t\tif(isset($_SESSION[\"spackt_\".$_REQUEST['spack_token']])) {\n\t\t\t\t\t$age = time()-$_SESSION[\"spackt_\".$_REQUEST['spack_token']];\n\t\t\t\t\t// Check if the token did not timeout\n\t\t\t\t\tif($age > $this->timeout*60) $this->error = 4;\n\t\t\t\t}\n\t\t\t\telse $this->error = 3;\n\t\t\t}\n\t\t\telse $this->error = 2;\n\t\t}\n\t\telse $this->error = 1;\n\t\t// Anyway, destroys the old token.\n\t\t$this->tokenDelAll();\n\t\tif($this->error==0) return true;\n\t\telse return false;\n\t}", "protected function checkSessionToken() {}", "public function isStripeCustomer()\n {\n return Auth::user() && \\App\\User::where('id', Auth::user()->id)->whereNotNull('stripe_id')->first();\n }", "public function isTokenValid($token)\n {\n $pdo = static::getDB();\n\n $sql = \"select token, to_char(otp_last_date, 'YYYY-MM-DD HH24:MI:SS') as otp_last_date from users where email = :email\";\n $result = $pdo->prepare($sql);\n $result->execute([$this->email]);\n\n $result = $result->fetchObject();\n\n if($result->TOKEN !== $token){\n return false;\n }\n $currentTime = strtotime(Extra::getCurrentDateTime());\n $time = strtotime($result->OTP_LAST_DATE);\n\n $diff_in_seconds = ($currentTime - $time);\n\n // 7 days\n if($diff_in_seconds > 604800){\n return false;\n }\n return true;\n }", "function GetTokenValidateRequest($Payloads) {\n\n if(!$Payloads ['Email'] || !$Payloads ['Password'] ) {\n Return \"False\" ;\n }\n return \"True\";\n\n}", "public function isLoginDataFilled()\n {\n $client = $this->Client();\n $credentials = $client->getCredentials();\n\n if (!empty($credentials['bearerToken']) || !empty($credentials['login']) || !empty($credentials['password'])) {\n return true;\n }\n\n return false;\n }", "public function signup_token_required() {\n return get_config('auth_enrolkey', 'tokenrequired');\n }", "public function check()\n {\n // TODO : Verif csrf\n // TODO : Oublie de mot de passe & mail divers\n }", "function checkAuthToken() {\n if ( !isset( $_POST['authToken'] ) || $_POST['authToken'] != $_SESSION['authToken'] ) {\n logout();\n return false;\n } else {\n return true;\n }\n}", "public function verify($token):bool;", "private function checkOAuthTokenPresence()\n {\n $client = $this->getOAuthClient();\n \n if (!$client->getOAuthToken() || !$client->getOAuthTokenSecret()) {\n throw new FatException('One or more OAuth tokens were not found.');\n }\n \n return true;\n }", "public static function _CheckToken( $_CSRFToken = '' )\r\n\t\t{\r\n\t\t\t\r\n\t\t\tif ( Session::has( 'CSRFToken' ) && Session::get( 'CSRFToken' ) === Params::get( 'post' )->CSRFToken\r\n\t\t\t || Session::has( 'CSRFToken' ) && Session::get( 'CSRFToken' ) === $_CSRFToken )\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tSession::clear( 'CSRFToken' );\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}", "public function validate()\n {\n // generate Token String\n $idTokenString = $this->getTokenString($this->_key);\n return ($idTokenString == $this->_tokenString);\n }", "public static function order_requires_payment_tokenization( $order ) {\n\n\t\tif ( ! is_object( $order ) )\n\t\t\t$order = new WC_Order( $order );\n\n\t\t// if order already has a payment token, tokenization is not required\n\t\tif ( isset( $order->order_custom_fields['_wc_pre_orders_has_payment_token'][0] ) && true === (bool) $order->order_custom_fields['_wc_pre_orders_has_payment_token'][0] )\n\t\t\treturn false;\n\n\t\t// if the order is charged upon release and no payment token exists then it requires payment tokenization\n\t\treturn self::order_will_be_charged_upon_release( $order );\n\t}", "public function isTokenExpired()\n {\n $expireTime = $this->getDataValue('expiration') - time();\n return $expireTime < 5;\n }", "public function isValidSession(string $token):bool;", "public static function check_token($token)\r\n {\r\n if ($token == $_SESSION['token'])\r\n return true;\r\n\r\n return false;\r\n }", "public function isCsrfTokenValid(string $id, string $token): bool;", "function hasEmptyLogin()\n {\n return empty($this->login);\n }", "public function validateUserIfEX() {\n\t\t\treturn self::$ErrorUserHasToken;\n\t\t}", "public function validate( )\n {\n return count( array_diff( $this->extractTokens( ), $this->getAvailableTokens( ) ) ) == 0;\n }", "function validateToken(){\n $CI = get_instance();\n if (array_key_exists('HTTP_AUTHORIZATION', $_SERVER) && !empty($_SERVER['HTTP_AUTHORIZATION'])) {\n $decodedToken = AUTHORIZATION::validateToken($_SERVER['HTTP_AUTHORIZATION']);\n if ($decodedToken != false) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n}", "private function validate_token( $token ) {\n\t\t$order_id = $this->model->get_order_id_from_token( $token );\n\t\tif ( $order_id && md5( $order_id ) === $token ) {\n\t\t\treturn $order_id;\n\t\t}\n\t\treturn false;\n\t}", "function check_token($token, $form_name)\n{\n if (is_bool($token)) {\n return false;\n }\n return $token === get_token($form_name);\n}", "function isTokenValid($id, $token)\n\t{\n\t\t$sql = 'SELECT users.id FROM users WHERE users.token = \\''.$token.'\\'';\n\n\t\ttry{\n\t\t\t$db= new db();\n\t\t\t$db = $db->connectionDB();\n\t\t\t$result = $db->query($sql);\n\t\t\t$users = $result ->fetchAll(PDO::FETCH_OBJ);\n\n\t\t\tif(count($users) > 0){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}catch(PDOException $e)\n\t\t{\n\t\t\t$response = array(\"code\" => \"500\", \"data\" => $e->getMessage());\n\t\t\tprint_r($response);\n\t\t}\n\t\t$result = null;\n\t\t$db = null;\n}", "public static function hasValidToken() {\n $requestHeaders = Rock::getHeaders();\n\n if (array_key_exists(Config::get('JWT_HEADER'), $requestHeaders) === true) {\n try {\n $decoded = (array)Firebase\\JWT\\JWT::decode($requestHeaders[Config::get('JWT_HEADER')], Config::get('JWT_KEY'), [Config::get('JWT_ALGORITHM')]);\n } catch (Exception $e) {\n return false;\n }\n\n $depth = 1;\n $result = Moedoo::select('user', [Config::get('TABLES')['user']['pk'] => $decoded['id']], null, $depth);\n $included = Moedoo::included(true);\n\n if (count($result) === 1) {\n $user = $result[0];\n $userGroup = $included['user_group'][$user['user_group']];\n\n if ($user['user_status'] === false) {\n //-> user suspended\n return false;\n } elseif (is_null($user['user_group']) === true) {\n //-> user doesn't belong to a user-group\n return false;\n } elseif ($userGroup['user_group_status'] === false) {\n //-> user-group has been suspended\n return false;\n }\n\n return $user;\n }\n\n return false;\n }\n\n return false;\n }", "public static function is_csrf_token_valid() {\n\t\tif (isset ( $_POST ['csrf_token'] )) {\n\t\t\t$user_token = $_POST ['csrf_token'];\n\t\t\t$server_token = $_SESSION ['csrf_token'];\n\t\t\tif ($user_token === $server_token)\n\t\t\t\treturn TRUE;\n\t\t} else\n\t\t\treturn FALSE;\n\t}", "public function checkToken(string $token)\n {\n if ($token = Token::select()->where('token', $token)->first()) {\n if (new DateTime($token->getAttribute('expire')) < $this->timeService->getDate()) {\n $this->deleteToken($token);\n return false;\n } else {\n $this->renewToken($token);\n $token->save();\n return true;\n }\n }\n return false;\n }", "function is_valid_token($request)\n\t{\n\t\tif (!isset($request->token) || empty($request->token))\n\t\t\treturn [FALSE, ['message' => F::lang('err_token_invalid')]];\n\t\t// else\n\t\t\t// $request->token = urldecode($request->token);\n\t\t\n\t\tif ($request->agent == 'android') {\n\t\t\t$token = ['android_token' => $request->token];\n\t\t}\n\t\tif ($request->agent == 'ios') {\n\t\t\t$token = ['ios_token' => $request->token];\n\t\t}\n\t\tif ($request->agent == 'web') {\n\t\t\t$token = ['web_token' => $request->token];\n\t\t}\n\t\t\n\t\t$ci = &get_instance();\n\t\t$ci->load->model('auth_model');\n\t\t$row = $ci->auth_model->get_token($token);\n\t\tif (!$row)\n\t\t\treturn [FALSE, ['message' => F::lang('err_token_invalid')]];\n\n\t\tif ($request->agent == 'android') {\n\t\t\t$token = $row->android_token;\n\t\t\t$token_exp = $row->android_token_expired;\n\t\t}\n\t\tif ($request->agent == 'ios') {\n\t\t\t$token = $row->ios_token;\n\t\t\t$token_exp = $row->ios_token_expired;\n\t\t}\n\t\tif ($request->agent == 'web') {\n\t\t\t$token = $row->web_token;\n\t\t\t$token_exp = $row->web_token_expired;\n\t\t}\n\t\t\n\t\tif ($request->token != $token)\n\t\t\treturn [FALSE, ['result' => NULL, 'message' => F::lang('err_token_invalid')]];\n\t\t\n\t\tif ($token_exp < date('Y-m-d H:i:s'))\n\t\t\treturn [FALSE, ['result' => NULL, 'message' => F::lang('err_token_expired')]];\n\t\t\n\t\treturn [TRUE, ['result' => $row, 'message' => NULL]];\n\t}", "public function accessTokenValid()\n {\n return $this->expireTime > time();\n }", "public function checkToken(): void\n {\n $fromSession = BackendModel::getSession()->get('csrf_token', '');\n $fromGet = $this->getRequest()->query->get('token');\n\n if ($fromSession !== '' && $fromGet !== '' && $fromSession === $fromGet) {\n return;\n }\n\n // clear the token\n BackendModel::getSession()->set('csrf_token', '');\n\n $this->redirect(\n BackendModel::createUrlForAction(\n $this->url->getDefaultActionForCurrentModule(),\n null,\n null,\n [\n 'error' => 'csrf',\n ]\n )\n );\n }", "function has_csrf_token() {\n return array_key_exists(\"csrfToken\", $this->options);\n }", "function checkToken($token){\n\t\tif(checkTimeout($token)){\n\t\t\treturn false;\n\t\t}else{\n\t\t\tif(isset($_SESSION[$token])){\n\t\t\t\tif($_SESSION[$token] == $_GET['token']){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function ensureToken()\n {\n if ($this->tokenExpiry === null) {\n $this->regenerateToken();\n }\n }", "public function valid(): bool\n {\n return !empty($this->clientId) || !empty($this->clientSecret);\n }", "function __validToken($token_created_at) {\n $expired = strtotime($token_created_at) + 86400;\n $time = strtotime(\"now\");\n if ($time < $expired) {\n return true;\n }\n return false;\n }", "public function checkToken(): void\n {\n $fromSession = BackendModel::getSession()->get('csrf_token', '');\n $fromGet = $this->getRequest()->query->get('token');\n\n if ($fromSession !== '' && $fromGet !== '' && $fromSession === $fromGet) {\n return;\n }\n\n // clear the token\n BackendModel::getSession()->set('csrf_token', '');\n\n $this->redirect(\n BackendModel::createUrlForAction(\n $this->getContainer()->get('url')->getDefaultActionForCurrentModule(),\n null,\n null,\n [\n 'error' => 'csrf',\n ]\n )\n );\n }", "private function _isCardSaved() {\n\t $tokenId = (int) $this->getInfoInstance()->getAdditionalInformation('token_id');\n\t return (boolean)($this->getInfoInstance()->getAdditionalInformation('create_token') === 'true') &&\n\t !($tokenId && ($tokenId > 0));\n\t}", "protected function test() {\n $output = true;\n $results = $this->env->post_to_api(\"add-apns-token\", $this->state[\"fields\"]);\n if (!$results) {\n $output = false;\n } else if (property_exists($results, \"error\")) {\n echo \"{$results->error}\\n\";\n echo \"Failed to add APNs token (API level).\\n\";\n $output = false;\n } else if (empty(PushNotification::get_apns_tokens($this->state[\"user\"]->id))) {\n echo \"Failed to add APNs token (Database level).\\n\";\n $output = false;\n }\n return $output;\n }", "private static function isAccessLoginTokenValid($token)\n {\n if (empty($token)) {\n return false;\n }\n $expire = 10;//Validate on 10s\n $parts = explode('_', $token);\n $timestamp = (int)end($parts);\n return $timestamp + $expire >= time();\n }", "protected function verify_csrf_token($token=null) {\n if(!$token and isset($this->POST['csrf_token'])) {\n $token = $this->POST['csrf_token'];\n }\n\n if(isset($_SESSION['rpf_csrf_tokens'])) {\n $key = array_search(\n $this->POST['csrf_token'],\n $_SESSION['rpf_csrf_tokens']\n );\n if($key !== false) {\n unset($_SESSION['rpf_csrf_tokens'][$key]);\n return true;\n }\n }\n return false;\n }", "public function checktoken(){\t\t\n\t\t$token=trim(strtoupper($this->input->post('tokenname')));\t\n\t\t$this->load->model('tokens');\t\n\t\t$data=$this->tokens->CheckToken($token);\n\t\tif(trim($data)==\"\"){\n\t\t\t\techo \"OK\";\n\t\t\t}else{\n\t\t\t\techo $data;\n\t\t\t\t}\n\t\t}", "public function guest()\n {\n $this->checkTimeouts();\n\n return ! $this->session->has('socialite_token');\n }", "public static function validate(string $token = null): bool\n {\n if ($token === null) {\n $postData = HTTPRequest::postData();\n $valid = isset($postData[self::INPUT_NAME]) && $postData[self::INPUT_NAME] === static::get();\n } else {\n $valid = $token === static::get();\n }\n if (!$valid) {\n static::destroy();\n throw new RuntimeException('CSRF token not valid');\n }\n return $valid;\n }", "function verifyFormToken($form) {\n\n\t\t// check if a session is started and a token is transmitted, if not return an error\n\tif(!isset($_SESSION[$form.'_token'])) {\n\t\treturn false;\n\t\t}\n\n\t// check if the form is sent with token in it\n\tif(!isset($_POST['token'])) {\n\t\treturn false;\n\t\t}\n\n\t// compare the tokens against each other if they are still the same\n\tif ($_SESSION[$form.'_token'] !== $_POST['token']) {\n\t\treturn false;\n\t\t}\n\n\treturn true;\n}", "public static function validateResetToken($token)\n {\n if (empty($token)) {\n return false;\n }\n $expire = Yii::$app->params['user.resetTokenExpire'];\n $parts = explode('_', $token);\n $timestamp = (int)end($parts);\n return $timestamp + $expire >= time();\n }", "public static function isKey($token) {\n\t\t\treturn is_string($token) && ($token != '');\n\t\t}", "public function hasTokenExpired()\n {\n $tokenTimestamp = $this->flagManager->getFlagData(self::TOKEN_RECEIVED_TIMESTAMP);\n if ($tokenTimestamp !== null) {\n $date = (new \\DateTime())->getTimestamp();\n $validity = $this->flagManager->getFlagData(self::TOKEN_EXPIRES_IN_FLAG_NAME);\n return $date > $tokenTimestamp + $validity - self::TOKEN_VALIDITY_MARGIN_IN_SECONDS;\n }\n return true;\n }", "public function hasToken ()\n {\n return $this->peekAtToken() !== NULL;\n }", "public function badPaymentProfile()\n {\n\n $payment_profile = $this->payment_profile()->first();\n\n if ($payment_profile === NULL)\n return TRUE;\n\n if (empty($payment_profile->stripe_customer))\n return TRUE;\n\n return FALSE;\n\n }", "private static function validateAction($token){\n if( !isset($token) ) return false;\n //break down the csrf token into parts\n $parts = explode('-', $token);\n if( count($parts) != 3 ) return false;\n list($callback, $token, $hash) = $parts;\n \n $result = (sha1(config::$csrf_form_secret.'-'.$callback.'-'.$token) == $hash);\n if( $result ) $result = $callback;\n return $result;\n }", "public function ssoTokenExists() {\n if ($this->httpSession != null && array_key_exists('maestrano', $this->httpSession)) {\n return true;\n }\n\n return false;\n }", "static function tokenGatekeeper() {\n $token = getInput(\"token\");\n $session_token = Cache::get(\"token\", \"session\");\n if ($token == $session_token) {\n return true;\n }\n return false;\n }", "function media_theplatform_mpx_check_token() {\n if (!media_theplatform_mpx_variable_get('token')) {\n return FALSE;\n }\n // If idleTimeout date has passed, signIn again.\n if (media_theplatform_mpx_variable_get('date_idletimeout') < time()) {\n // Expire the current token.\n media_theplatform_mpx_expire_token();\n // Retrieve and return new token.\n return media_theplatform_mpx_signin();\n }\n else {\n return TRUE;\n }\n}", "protected function user_has_tokens() {\n\n\t\t$token_count = 0;\n\n\t\tif ( $this->get_gateway()->tokenization_enabled() && is_user_logged_in() ) {\n\n\t\t\tforeach ( $this->get_gateway()->get_payment_tokens_handler()->get_tokens( get_current_user_id() ) as $token ) {\n\n\t\t\t\t// skip this token if it's not a PayPal account\n\t\t\t\tif ( ! $token->is_paypal_account() ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$token_count++;\n\t\t\t}\n\t\t}\n\n\t\treturn $token_count > 0;\n\t}", "private function checkCSRFToken() {\r\n\t\t// Check if a form has been sent, and this is not a client init request \r\n\t\tif( $this->input('request', 'submit') &&\r\n\t\t !($this->getClass() === 'ActionsClient' && $this->getMethod() === 'init')) {\r\n\t\t\t// It did, check the token\r\n\t\t\tif( $this->input('session', 'token') !== $this->input('request', 'token') ) {\r\n\t\t\t\t// The token isn't valid! Raise an error but don't log it\r\n\t\t\t\terror('Invalid CSRF token!', false);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function verified()\n {\n return $this->verifyToken === null;\n }", "function verifyFormToken($form) {\r\n\t\t\r\n\t\t// check if a session is started and a token is transmitted, if not return an error\r\n\t\tif(!isset($_SESSION[$form.'_token'])) { \r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// check if the form is sent with token in it\r\n\t\tif(!isset($_POST['token'])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// compare the tokens against each other if they are still the same\r\n\t\tif ($_SESSION[$form.'_token'] !== $_POST['token']) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function hasCardNumber() : bool;", "public function hasToken()\n {\n return $this->tokenFlag;\n }", "public function hasToken()\n {\n return $this->tokenFlag;\n }", "function verify_form_token($form) {\n\t// Check if a session is started and a token is transmitted,\n\t// if not return an error\n\tif(!isset($_SESSION[$form.'_token'])) {\n\t\treturn false;\n\t}\n\n\t// Check if the form is sent with token in it\n\tif(!isset($_POST['token'])) {\n\t\treturn false;\n\t}\n\n\t// Compare the tokens against each other if they are still the same\n\tif ($_SESSION[$form . '_token'] !== $_POST['token']) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}" ]
[ "0.6827877", "0.6771743", "0.67646074", "0.6595165", "0.6556112", "0.6512445", "0.65117997", "0.64507055", "0.6431515", "0.64225185", "0.64088845", "0.64088845", "0.6406562", "0.6388783", "0.62997514", "0.6250243", "0.620953", "0.6185623", "0.61746675", "0.61660796", "0.6165542", "0.6157033", "0.6154604", "0.6146414", "0.61384845", "0.61317414", "0.6128778", "0.61219573", "0.6108033", "0.61010385", "0.6090475", "0.6090019", "0.60781157", "0.6077125", "0.603387", "0.6025666", "0.60252607", "0.60222375", "0.6016988", "0.60063946", "0.5994065", "0.5983816", "0.59788513", "0.5974928", "0.596062", "0.59596467", "0.59470093", "0.594607", "0.5940909", "0.59376884", "0.59311426", "0.5925636", "0.5920092", "0.5913458", "0.5909531", "0.59032506", "0.5887384", "0.588538", "0.587982", "0.5875537", "0.5871151", "0.58544934", "0.5853678", "0.5848681", "0.58437717", "0.5839128", "0.58304924", "0.5813233", "0.5811108", "0.58098966", "0.5809803", "0.5809382", "0.58067715", "0.5802789", "0.58006096", "0.5799482", "0.57913834", "0.5789131", "0.5779524", "0.5779344", "0.57781774", "0.57668006", "0.5761833", "0.574819", "0.5736269", "0.57357895", "0.5726267", "0.57118195", "0.57041156", "0.57035106", "0.5692501", "0.5691757", "0.5690728", "0.56890476", "0.56885135", "0.5687238", "0.56869614", "0.56834954", "0.56722444", "0.56722444", "0.5671015" ]
0.0
-1
Called when import terminates
public function terminate() { $this->endedAt = new DateTime(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function postImport() {\n $this->closeFile();\n }", "public function finalise(Import $import);", "private function postUpdate() {\n\t\t$this->info('Import finished, cleaning up.');\n\t\t$this->reCache();\n\t}", "function import_end() {\n\t\t//wp_import_cleanup( $this->id );\n\n\t\twp_cache_flush();\n\t\tforeach ( get_taxonomies() as $tax ) {\n\t\t\tdelete_option( \"{$tax}_children\" );\n\t\t\t_get_term_hierarchy( $tax );\n\t\t}\n\n\t\twp_defer_term_counting( false );\n\t\twp_defer_comment_counting( false );\n\n\t\techo '<p>导入成功.' . ' <a href=\"' . admin_url() . '\">Have fun!</a>' . '</p>';\n\n\t\tdo_action( 'import_end' );\n\t}", "protected function markImportDatabaseDone() {}", "public function onShutDown()\n {\n }", "public function onShutDown()\n {\n }", "public function extProc_finish() {}", "public function extProc_finish() {}", "protected function finishCoreBootstrap() {}", "public function finish_database_export() {\n $this->importer->finish_database_import();\n }", "protected function _after() {\n\t\t$this->startup = null;\n\t}", "protected function finish() {}", "protected function initializeImport() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function destruct()\n {\n restore_error_handler();\n }", "public function handle()\n {\n $media = Media::all();\n foreach ($media as $item) {\n $item->delete();\n }\n $status = Site::handleImport(glob($this->importPath.DS.\"*\"));\n\n echo \"Import complete.\\n\";\n echo $status;\n }", "public function onShutdown();", "public function onShutdown();", "public function finish_database_export() {\n }", "public static function shutdown()\n {\n Cache::add('scripting.library_paths', static::$libraryPaths, static::DEFAULT_CACHE_TTL);\n Cache::add('scripting.libraries', static::$libraries, static::DEFAULT_CACHE_TTL);\n }", "public function afterLoad() { }", "public function after_run() {}", "public function shutdown() {\n $this->saveStorage();\n }", "public function shutdown()\n {\n // Do nothing. Can be overridden by extending classes.\n }", "protected function _afterInit() {\n\t}", "public function tearDown() {\n foreach ($this->registered as $l) {\n \\lang\\ClassLoader::removeLoader($l);\n }\n }", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {\n\t\t\t//\n\t\t}", "public function after_run(){}", "public function tearDown() {\n \\lang\\ClassLoader::removeLoader($this->libraryLoader);\n }", "protected function handleShutdown(): void\n {\n if (empty($error = \\error_get_last())) {\n return;\n }\n\n try {\n $this->handleError($error['type'], $error['message'], $error['file'], $error['line']);\n } catch (\\Throwable $e) {\n $this->handleGlobalException($e);\n }\n }", "public function executeOnShutdown();", "public function finish() {\r\n\t}", "private function finalize()\n {\n $this->temp_files_path[] = L_FRAME_LIST_FILE;\n $this->delete_files();\n }", "public function import(): void;", "protected function _onStart()\n {\n $this->_raise(self::E_LOAD);\n }", "public function finish(): void\n {\n }", "public function handleShutdown() {\n\t\t$last_error = error_get_last();\n\t\tif ( !empty( $last_error ) ) {\n\t\t\t$this->handleError(\n\t\t\t\t$last_error['type'],\n\t\t\t\t$last_error['message'],\n\t\t\t\t$last_error['file'],\n\t\t\t\t$last_error['line']\n\t\t\t);\n\t\t}\n\t}", "public function finish()\n\t{\n\t\t\n\t}", "protected function afterLoad()\n {\n }", "public function shutdown()\r\n {\r\n }", "protected function onFinishSetup()\n {\n }", "public static function import_process() {}", "public function shutdown()\n {\n }", "public function shutdown()\n {\n }", "public function cleanup(): void\n {\n }", "public function cleanup(): void\n {\n }", "protected static function booted()\n {\n static::addGlobalScope(new DeletedAtScope());\n }", "function shutdown() {\n // Safety for themes not using wp_footer\n SLPlus_Actions::ManageTheScripts();\n\t\t}", "function __destruct() {\r\n $this->Initialize();\r\n }", "public function tear_down() {\n\t\tunset( $GLOBALS['link'] );\n\t\tparent::tear_down();\n\t}", "function wp_import_cleanup($id)\n {\n }", "public function finalize() { }", "protected function _after() {\n\t\t$this->uFileSystem = null;\n\t\tparent::_after ();\n\t}", "public function postImport() {\n parent::postImport();\n if (!civicrm_initialize()) {\n return;\n }\n // Need to clear the cache once the fields are created.\n civicrm_api3('system', 'flush', array('version' => 3));\n }", "public function shutdown();", "public function shutdown();", "protected function shutdown()\n {\n }", "public function __destruct() \n {\n Benchmark::stop('GridModule Loading');\n \n }", "public function finished()\n {\n }", "public function __destruct()\n {\n set_error_handler($this->prevErrorHandler);\n set_exception_handler($this->prevExceptionHandler);\n }", "public function onHandleClosed() {}", "public function onFinish(ImportFinishedEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }", "public function onModuleBoot()\n {\n }", "public function finish();", "public function finish();", "public function reset() : void\n {\n $this->getFilesystemLoader()->reset();\n }", "public function cleanup() {\n\t\t//TODO\n\t}", "public function postLoadCallback()\n {\n $this->performPostLoadCallback();\n }", "public function postLoadCallback()\n {\n $this->performPostLoadCallback();\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function postLoad() {}", "public function onExit()\n\t{\n\t\t$this->raiseEvent('onExit', new TestRunnerEvent($this, $this->collection));\n\t}", "public function onShutdown()\n {\n // Get the last error if there was one, if not, let's get out of here.\n if (!$error = error_get_last()) {\n return;\n }\n\n if (!($error['type'] & (E_ERROR|E_PARSE|E_CORE_ERROR|E_COMPILE_ERROR|E_USER_ERROR|E_RECOVERABLE_ERROR))) {\n return;\n }\n\n $this->notifier->notify(\n new \\ErrorException($error['message'], $error['type'], $error['type'], $error['file'], $error['line'])\n );\n }", "public function handleShutdown()\n {\n if (!is_null($error = error_get_last())) {\n $this->handleException(\n new ErrorException($error['message'], $error['type'], 0, $error['file'], $error['line'])\n );\n }\n }", "private function shutDownFunction() {\n\t\t$error = error_get_last();\n\t\tif ( isset( $error ) ) {\n\t\t\tif ( $error['type'] === E_ERROR ) {\n\t\t\t\tEE::warning( 'An Error occurred. Initiating clean-up.' );\n\t\t\t\t$this->logger->error( 'Type: ' . $error['type'] );\n\t\t\t\t$this->logger->error( 'Message: ' . $error['message'] );\n\t\t\t\t$this->logger->error( 'File: ' . $error['file'] );\n\t\t\t\t$this->logger->error( 'Line: ' . $error['line'] );\n\t\t\t\t$this->rollback();\n\t\t\t}\n\t\t}\n\t}", "public function shutdown()\n {\n \n }", "public function afterInstall()\n\t{}", "public function handleShutdown()\n {\n if (!is_null($error = error_get_last()) && $this->isFatal($error['type'])) {\n $this->handleException($this->fatalExceptionFromError($error, 0));\n }\n\n $this->app->exitObserver->trigger();\n }", "public function handleShutdown()\n {\n $last_error = error_get_last();\n\n if ( ( $last_error !== null ) and ( in_array($last_error['type'], Array ( E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR, E_CORE_WARNING, E_COMPILE_WARNING, E_PARSE )) ) )\n {\n $this->DontShowBacktrace = true;\n $this->handleError($last_error['type'], $last_error['message'], $last_error['file'], $last_error['line']);\n }\n }", "public function tear_down(): void {\n\t\t$this->dispatcher->execute();\n\t}", "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 }", "public function shutdown()\n {\n // do nothing here\n }" ]
[ "0.71770084", "0.6793742", "0.65339416", "0.63247114", "0.62704223", "0.62434", "0.62434", "0.6240216", "0.62398195", "0.615981", "0.6142915", "0.6044968", "0.5995275", "0.5899414", "0.588769", "0.5887388", "0.58861804", "0.5886091", "0.5886091", "0.5886091", "0.5886091", "0.5886091", "0.5869488", "0.58116686", "0.5794852", "0.5794852", "0.5789618", "0.57695687", "0.57521707", "0.57262397", "0.5688681", "0.56740296", "0.56649023", "0.5647494", "0.5629375", "0.5629375", "0.5629375", "0.5629375", "0.5629375", "0.5612285", "0.557313", "0.5572578", "0.5568563", "0.55594915", "0.55588233", "0.5551579", "0.5548595", "0.55434847", "0.5537236", "0.55314815", "0.5523139", "0.55075896", "0.5497315", "0.54886615", "0.54879975", "0.5486594", "0.5465431", "0.54644346", "0.54644346", "0.5462094", "0.54483354", "0.54317373", "0.54290926", "0.5426661", "0.5425859", "0.5417776", "0.54150504", "0.54120916", "0.54120916", "0.54119533", "0.54003936", "0.539804", "0.5393", "0.53886896", "0.5385634", "0.5385285", "0.53847855", "0.53847855", "0.5378025", "0.53730124", "0.53704786", "0.53704786", "0.53650534", "0.53650534", "0.53650534", "0.53534806", "0.5349165", "0.5348409", "0.53463644", "0.5344084", "0.5340866", "0.533987", "0.5338323", "0.53349435", "0.5324132", "0.5311188", "0.5311188", "0.5311188", "0.5311188", "0.5311188", "0.53108513" ]
0.0
-1
Create a new user.
public function __construct(array $attributes = []) { parent::__construct($attributes); if(isset($this->attributes['api_token']) === false || empty($this->attributes['api_token'])) { $this->attributes['api_token'] = str_random(60); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "protected function _createUser()\n {\n $data = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "public function createUser()\n {\n\n $userCurrent = $this->userValidator->validate();\n $userCurrent['password'] = Hash::make($userCurrent['password']);\n $userCurrent = $this->user::create($userCurrent);\n $userCurrent->roles()->attach(Role::where('name', 'user')->first());\n return $this->successResponse('user', $userCurrent, 201);\n }", "public function createUser()\n {\n }", "public function createUser()\n {\n $this->user = factory(Easel\\Models\\User::class)->create();\n }", "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "public function create()\n {\n $this->validate($this->request, User::createRules());\n\n $user = new User;\n $user->name = $this->request->name;\n $user->phone = $this->request->phone;\n $user->dob = $this->request->dob;\n $user->image = $this->request->image_path;\n $plainPassword = $this->request->password;\n $user->password = app('hash')->make($plainPassword);\n\n $user->save();\n\n //return successful response\n return $this->response(201,\"User\", $user);\n }", "protected function createUser()\n {\n $this->question('Enter your details for the admin user.');\n\n $user = \\App\\User::create([\n 'name' => $this->ask('Name', 'Admin'),\n 'email' => $this->ask('Email address', 'noreply@'.str_replace(['http://', 'https://'], '', config('app.url'))),\n 'password' => Hash::make($this->ask('Password')),\n ]);\n \n $this->info(\"Admin user created successfully. You can log in with username {$user->email}\");\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "public function create()\n {\n return $this->userService->create();\n }", "public function createUser()\n {\n return User::factory()->create();\n }", "public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}", "public function create(User $user)\n {\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function create(User $user)\n {\n\n }", "public function create()\n\t{\n\t\t$user = new User;\n\n\t\t$user->username \t\t= Input::get('username');\n\t\t$user->password \t\t= Hash::make(Input::get('password'));\n\t\t$user->email \t\t \t= Input::get('email');\n\n\t\t$user->save();\n\n\t\treturn Redirect::to('user/add')->with('sukses', 'Data User Sudah Tersimpan');\n\t}", "protected function createUser()\n {\n $errors = $this->validate(['username','password','email','group_id']);\n\n if(count($errors) > 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => $errors\n ]);\n }\n\n $arrUserData = [\n 'username' => $this->request->variable('username',''),\n 'user_password' => $this->request->variable('password',''), // already hashed by contao\n 'user_email' => $this->request->variable('email',''),\n 'group_id' => $this->request->variable('group_id',''),\n 'user_type' => USER_NORMAL\n ];\n\n // Create the user and get an ID\n $userID = user_add($arrUserData);\n\n // If user wasn't created, send failed response\n if(!$userID)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'phpbb Could not create user',\n 'error' => ['Could not create phpBB user']\n ]);\n }\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user created',\n 'data' => [\n 'user_id' => $userID\n ]\n ]);\n }", "protected function create()\n {\n// dd(request());\n // create new user in database\n $newUser = User::create([\n 'name' => \\request('name'),\n 'email' => \\request('email'),\n 'student_id' => \\request('student_id'),\n 'phone' => \\request('phone'),\n 'password' => bcrypt(\\request('password')),\n 'remember_token' => \\request('_token'),\n ]);\n\n\n //login the new user\n\n auth()->login($newUser);\n\n }", "function createUser(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\t\t\t\n\t\t\t//Check if username meets minimum requirements\n\t\t\tif($this->username == \"\" || $this->username == null || strlen($this->username) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Username\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t//Check if username already exists\n\t\t\t\tif($db->query('SELECT * FROM user WHERE Username = \"'.$this->username.'\"')->rowCount() > 0){\n\t\t\t\t\t$json->exists(\"Username\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Check if password meets minimum requirements\n\t\t\tif($this->password == \"\" || $this->password == null || strlen($this->password) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Password\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$passHash = generatePassword($this->password);\n\t\t\t\t$this->password = $passHash;\n\t\t\t\t$apiHash = generateApiKey($this->username.\"\".date('Y-m-d'));\n\t\t\t}\n\t\t\t\n\t\t\t//Check if admin is empty or invalid, if so make user non-admin\n\t\t\tif($this->admin == \"\" || $this->admin == null || $this->admin < 0)\n\t\t\t\t$this->admin = 0;\n\t\t\t\n\t\t\tif($this->subject == \"\" || $this->subject == null || $this->subject < 0)\n\t\t\t\t$this->subject = 0;\n\t\t\t\t\n\t\t\t$insert = $db->prepare('INSERT INTO user VALUES (DEFAULT, :username, :password, :subject, :admin, :api)');\n\t\t\t$insert->bindParam(':username', $this->username);\n\t\t\t$insert->bindParam(':password', $this->password);\n\t\t\t$insert->bindParam(':subject', $this->subject);\n\t\t\t$insert->bindParam(':admin', $this->admin);\n\t\t\t$insert->bindParam(':api', $apiHash);\n\t\t\t\n\t\t\tif($insert->execute()){\n\t\t\t\t$json->created(\"User\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$json->server();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "public function create(UserCreateRequest $request): User\n {\n // TODO: Implement create() method.\n }", "public function test_it_creates_a_new_user()\n {\n $user = ['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook'];\n\n $this->json('POST', '/users', $user)\n ->seeJson($user);\n }", "public function actionCreateUser()\n {\n $model = new User();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $model->setPassword($model->password);\n $model->generateAuthKey();\n $model->generateEmailConfirmToken();\n if ($model->save()) {\n // нужно добавить следующие три строки:\n // $auth = Yii::$app->authManager;\n // $authorRole = $auth->getRole('superadmin');\n // $auth->assign($authorRole, $user->getId());\n return $this->redirect(['view-user', 'id' => $model->id]);\n }else{\n print_arr($model->errors);\n die('A');\n }\n } else {\n return $this->render('user/create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(UserCreateRequest $request)\n {\n\t\t\t$user = User::create([\n\t\t\t\t'name' \t\t\t\t=> $request->input('name'),\n\t\t\t\t'lastname' \t\t=> $request->input('lastname'),\n\t\t\t\t'idNumber'\t\t=> $request->input('idNumber'),\n\t\t\t\t'email' \t\t\t=> $request->input('email'),\n\t\t\t\t'phone' \t\t\t=> $request->input('phone'),\n\t\t\t\t'address' \t\t=> $request->input('address'),\n\t\t\t\t'birthdate' \t=> $request->input('birthdate'),\n\t\t\t\t'category_id' => $request->input('category_id'),\n\t\t\t\t'password'\t\t=> 'password', // I NEED TO ADD LOGIN FUNCTIONALITY\n\t\t\t\t'is_admin'\t\t=> 0,\n\t\t\t\t'status' \t\t\t=> 'non live' // As default in the db?\n\t\t\t]);\n\n\t\t\treturn redirect('/users')->with('success', 'User Registered');\n }", "public function newUser() {\n $this->checkValidUser();\n\n $this->db->sql = 'INSERT INTO '.$this->db->dbTbl['users'].' (username, salt, hash) VALUES (:username, :salt, :hash)';\n\n $salt = $this->getNewSalt();\n\n $res = $this->db->execute(array(\n ':username' => $this->getData('username'),\n ':salt' => $salt,\n ':hash' => md5($salt . $this->getData('password'))\n ));\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'xxT5r'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'dU4r5'\n );\n }\n\n $this->renderOutput();\n }", "public function create(){\n \n $data = array();\n $data['login'] = $_POST['login'];\n $data['password'] = Hash::create('sha256', $_POST['password'], HASH_KEY);\n $data['role'] = $_POST['role'];\n \n //Do the Error checking\n \n $this->model->RunCreate($data);\n /*\n * After we Post the user info to create, the header is refereshed so that the data appears dynamically \n * below in the users list\n */\n header('location: ' . URL . 'users');\n }", "public function createUser($name, $pass, $profile, array $extra = []);", "public function creating(User $user)\n {\n\n }", "public function createUser()\n {\n $c = $this->getConnectionWithConfig('default');\n\n // First we create the record that we need to update\n $create = 'CREATE (u:User {name: $name, email: $email, username: $username})';\n // The bindings structure is a little weird, I know\n // but this is how they are collected internally\n // so bare with it =)\n $createCypher = $c->getCypherQuery($create, array(\n 'name' => $this->user['name'],\n 'email' => $this->user['email'],\n 'username' => $this->user['username'],\n ));\n\n return $this->client->run($createCypher['statement'], $createCypher['parameters']);\n }", "public function create ( Request $request )\n {\n\n\n if( $request->isMethod( 'post' ) )\n {\n\n try\n {\n\n $user = new User();\n $user->name = $request->input( 'name' );\n $user->email = $request->input( 'email' );\n $user->password = bcrypt( $request->input( 'password' ) );\n $user->save();\n\n }\n catch( Exception $ex ) \n {\n\n return(\n back()\n ->with(\n [\n 'flash_error' => 'Failed to create new user.',\n 'flash_exception' => $ex->getMessage()\n ]\n )\n );\n\n }\n\n return(\n back()\n ->with( [ 'flash_success' => 'New Users Added' ] )\n );\n\n }\n else\n {\n return(\n view('users.create')\n );\n }\n\n }", "public function create() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"INSERT INTO users (id, mail, name, password, role, state) VALUES (?, ?, ?, ?, ?, ?)\");\n\t\t$stmt->execute(array($this->id, $this->mail, $this->name, $this->password, $this->role, $this->state));\n\t}", "public function create() {\n /*$id = json_decode($_POST['id']);\n $name = json_decode($_POST['name']);\n $usr = User();\n $usr->id = $id;\n $usr->name = $name;\n $usr->save();*/\n }", "public function creat_new_user()\n {\n \n factory(User::class)->create();\n $respone=$this->post('/admin/category/create',[\n 'name' => 'Tuan',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'active'=>1,\n 'password' => '2', // password\n 'remember_token' => Str::random(10),\n ]);\n // $this->assertCount(8,User::all());\n }", "public function create()\n {\n $cmd = $this->artisan('user:create testuser [email protected]');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertNotEmpty($user);\n $this->assertSame('[email protected]', $user->email);\n $this->assertNotEmpty($user->password);\n $this->assertFalse((bool) $user->administrator);\n }", "public function createUser()\n {\n $class = $this->userClass;\n $user = new $class;\n return $user;\n }", "public function creating(User $user): void\n {\n \n }", "public function actionCreate()\n {\n $model = new User();\n if(null !== (Yii::$app->request->post()))\n {\n if($this->saveUser($model))\n {\n Yii::$app->session->setFlash('userUpdated');\n $this->redirect(['update', 'id' => $model->getId()]);\n return;\n }\n\n }\n\n return $this->render('@icalab/auth/views/user/create', ['model' => $model]);\n }" ]
[ "0.85153574", "0.85153574", "0.85153574", "0.85153574", "0.82277685", "0.8069288", "0.7957354", "0.7900486", "0.78813195", "0.7845325", "0.77993155", "0.7786434", "0.77579015", "0.7729928", "0.7729928", "0.77009255", "0.7692633", "0.76830924", "0.76699877", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.7637759", "0.76248693", "0.7608079", "0.7588603", "0.7570699", "0.75380045", "0.75084376", "0.7507428", "0.7502795", "0.7475118", "0.7474601", "0.7454965", "0.7434912", "0.74210197", "0.74170774", "0.73960006", "0.73818344", "0.7363695", "0.7340088", "0.73228496", "0.73153913", "0.7309936", "0.73006576", "0.7296698" ]
0.0
-1
Relationship for models that this model is currently blocking.
public function blocking($model = null) { $modelClass = $this->getModelMorphClass($model); return $this ->morphToMany($modelClass, 'blocker', 'blockers', 'blocker_id', 'blockable_id') ->withPivot('blockable_type') ->wherePivot('blockable_type', $modelClass) ->wherePivot('blocker_type', $this->getMorphClass()) ->withTimestamps(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function blockedUser(): BelongsTo\n {\n return $this->belongsTo(User::class, 'blocked_user_id', 'id');\n }", "public function block() {\n $friendship_relation_exists = $this->micro_relation_exists($this->from, $this->to, \"F\");\n $exists = $this->micro_relation_exists($this->from, $this->to, \"B\");\n\n if($friendship_relation_exists) {\n // Unblock\n if($exists) {\n $this->db->query(\"DELETE FROM user_relation WHERE `from` = ? AND `to` = ? AND `status` = ?\"\n ,array(\n $this->from,\n $this->to,\n \"B\"\n ));\n // Block\n } else {\n $this->db->query(\"INSERT INTO user_relation (`from`, `to`, `status`, `since`) \n VALUES (?, ?, ?, ?)\", array(\n $this->from,\n $this->to,\n \"B\",\n date(\"Y/m/d h:i:s\")\n ));\n }\n\n return true;\n }\n\n return false;\n }", "public function friendsPending()\n\t {\n\t\treturn $this->belongsToMany('User', 'friend_user', 'user_id', 'friend_id')->where('accept','=',0);\n\t }", "public function getBlocking()\n {\n return $this->_blocking;\n }", "public function getBlocked()\n {\n return $this->Blocked;\n }", "public function pending_tasks()\n {\n return $this->hasMany('App\\Models\\Crm\\Task', 'lead_id')->where('is_done', false);\n }", "public function waiting_requested(){\n\n // $waiting = Friendship::find($id);\n $user_auth = Auth::user()->id;\n $friendship = Friendship::with(['requester', 'user_requested'])\n ->where('user_requested', $user_auth);\n\n }", "public function getQueueableRelations();", "public function getQueueableRelations();", "public function getIsBlocked();", "public function isBlocking(): bool\n {\n return $this->pluck('blocking');\n }", "public function isBlocking(): bool\n {\n return $this->pluck('blocking');\n }", "public function receiver()\n\t{\n\t\treturn $this->belongsTo('\\User');\n\t}", "public function isBlocking($model): bool\n {\n if (! $model instanceof Blockable && ! $model instanceof Blocking) {\n return false;\n }\n\n return ! is_null(\n $this\n ->blocking((new $model)->getMorphClass())\n ->find($model->getKey())\n );\n }", "public function isPending()\n {\n // check if model approved by all roles in the model\n return $this->pendingItem($this->approvedByRole());\n }", "public function markAsPending() {\n $this->status = parent::STATUS_PENDING;\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 isBlocked() {\n return $this->user !== null && $this->user->blocked;\n }", "public function getQueueableRelations()\n {\n return [];\n }", "public function isBlocked()\n {\n return $this->getStatus() == self::STATUS_BLOCKED;\n }", "public function getIsBlocked()\n {\n return $this->isBlocked;\n }", "public function getUser()\n {\n return $this->hasOne(User::className(), ['id' => 'user_id'])->inverseOf('waitingLists');\n }", "public function pending() {\n $model = new ReferralModel;\n $refs = $model\n ->tableAlias('r')\n ->join('customers', ['r.customer_id', '=', 'c.id'], 'c')\n // Join to get employee full name\n ->leftOuterJoin('wp_users', ['r.estimator_id', '=', 'wpu.id'], 'wpu')\n ->leftOuterJoin(\n 'wp_usermeta',\n \"wpu.id = wpum1.user_id AND wpum1.meta_key='first_name'\",\n 'wpum1'\n )\n ->leftOuterJoin(\n 'wp_usermeta',\n \"wpu.id = wpum2.user_id AND wpum2.meta_key='last_name'\",\n 'wpum2'\n )\n ->selectMany(\n 'r.id', 'r.address', 'r.city',\n 'r.state', 'r.zip_code', 'r.primary_phone_number',\n 'r.status', 'r.date_requested', 'r.lat', 'r.lng'\n )\n ->selectMany(\n 'r.id', 'r.customer_id', 'r.address', 'r.city',\n 'r.state', 'r.zip_code', 'r.primary_phone_number', 'r.priority',\n 'r.status', 'r.date_requested', 'r.lat', 'r.lng'\n )\n ->selectExpr(\"CONCAT_WS(' ',wpum1.meta_value, wpum2.meta_value)\", 'estimator_full_name')\n ->select('c.display_name', 'customer_display_name')\n ->where('r.status', 'Pending')\n ->whereNull('r.route_id')\n ->orderByDesc('r.date_requested')\n ->findArray();\n $this->renderJson($refs);\n }", "public function isBlocking()\n\t{\n\t\treturn $this->blocking;\n\t}", "public function waiting_requester(){\n\n }", "public function available(): BelongsTo\n {\n return $this->belongsTo(Available::class);\n }", "public function friendRequestsPending() {\n // Returns a pending friend requests to me\n // where accepted = false\n // false, means someone added YOU\n return $this->friendOf()->wherePivot('accepted', false)->get();\n }", "public function requests()\n {\n return $this->hasMany('Restboat\\Models\\Request', 'user_id', 'id');\n }", "public function blocks($model): bool\n {\n return $this->isBlocking($model);\n }", "public function getAllowEntityCancellationAttribute()\n {\n return true;\n }", "public function block($model): bool\n {\n if (! $model instanceof Blockable && ! $model instanceof Blocking) {\n return false;\n }\n\n if ($this->isBlocking($model)) {\n return false;\n }\n\n $this->blocking()->attach($model->getKey(), [\n 'blockable_type' => (new $model)->getMorphClass(),\n ]);\n\n return true;\n }", "public function hasBlocked()\n {\n return $this->blocked !== null;\n }", "public function pending() {\n $results = array();\n foreach ( $this->wrappers as $clazz => $wrappers ) {\n foreach ( $wrappers as $id => $wrapper ) {\n $proxy = $wrapper['proxy'];\n if ( ! $proxy->___repose_isPersisted() ) {\n // We are really only pending if we are not\n // already persisted!\n $results[] = $wrapper['proxy'];\n }\n }\n }\n return $results;\n }", "public function getQueueableRelations()\n {\n // TODO: Implement getQueueableRelations() method.\n }", "public function getQueueableRelations()\n {\n // TODO: Implement getQueueableRelations() method.\n }", "public function getQueueableRelations()\n {\n // TODO: Implement getQueueableRelations() method.\n }", "public function workFromHomeRequests()\n {\n return $this->hasMany(WorkFromHomeRequest::class);\n }", "public function getIsPending() {\n if ($parent = $this->getParentBlock()) {\n return!!$parent->getPending();\n }\n return false;\n }", "public function isBlocked()\n {\n if ($this->status == 2) {\n return true;\n } else {\n return false;\n }\n }", "public function getWaitingFor()\n {\n return $this->waitingFor;\n }", "public function requests()\n {\n return $this->hasMany('App\\request');\n }", "public function moderatorRequests(): MorphToMany\r\n {\r\n return $this->_moderators()->where('status', 'request');\r\n }", "public static function Pending()\n {\n $pending = \\ApprovalSequence\\Models\\Entity::Where('entity_type', self::class)->get();\n $PendingEntity = $pending->map(function ($item) {\n // check every item and check it's pending or not\n if($item->entity && $item->entity->isPending()){\n return $item->entity;\n }\n\n });\n //to avoid duplication\n return $PendingEntity->unique();\n }", "public function block() {\n return $this->belongsTo(Block::class, 'block_id');\n }", "public function model()\n {\n return Broadcast::class;\n }", "public function friendRequestPending() {\n return $this->friendOf()->wherePivot('accepted', false)->get();\n }", "public function getPending()\n\t{\n\t\treturn $this->pending;\n\t}", "public function target()\n {\n return $this->hasMany(\\App\\Target::class)->where('is_decoy', false);\n }", "public function acceptedTasks()\n\t{\n\t\treturn $this->belongsToMany('TGLD\\Tasks\\Task', 'user_accepted_task', 'user_id', 'task_id')\n\t\t\t->with('project')\n\t\t\t->orderBy('priority', 'ASC')\n\t\t\t->latest();\n\t}", "public function needs() {\n return $this->hasMany('Rockit\\Models\\Need');\n }", "protected static function model()\n {\n foreach (self::fetch('resources/models', false) as $file) {\n Bus::need($file);\n }\n }", "public function receiver()\n {\n return $this->belongsTo('App\\User');\n }", "public function resource()\n {\n return $this->belongsTo('WhereYouLeftOff\\Resource');\n }", "public function status()\n {\n return $this->belongsToMany(ThreadStatus::class)\n ->withTimestamps();\n }", "public function loadRelated()\n {\n return;\n }", "public function isModifyRelationship();", "public function requests()\n {\n return $this->hasMany('App\\Request');\n }", "public function notifications_disabled_by()\n {\n return $this->belongsToMany(User::class, 'disabled_notifications', 'disabled_user_id', 'user_id', 'id');\n }", "public function isPending()\n {\n return true;\n }", "public function pending_tickets()\n {\n return $this->hasMany('App\\Models\\Tickets', 'mailbox_id', 'id')->where('status', 'pending');\n }", "public function getMandatoryRelations()\n {\n return $this->with;\n }", "public function blocks()\n {\n return $this->hasMany(Models\\AccountBlock::class, 'account_id');\n }", "public function model()\n {\n return HomeAdsPlacementBlockable::class;\n }", "public function staffer(){\n \treturn $this->belongsTo(Staffer::class);\n }", "public function internal(){\n\n\t\t// belongsTo(RelatedModel, foreignKey = driver_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo(Driver::class, 'internal_driver_id');\n\t}", "public function notify()\n {\n return $this->belongsTo(\\Threef\\Entree\\Database\\Model\\Notify\\Notify::class, 'notify');\n }", "public function friendsAccept()\n\t {\n\t\treturn $this->belongsToMany('User', 'friend_user', 'friend_id', 'user_id')->where('accept','=',0);\n\t }", "public function worker(){ \n return $this->hasOne('App\\Models\\User','id','worker_id');\n }", "public function triggersToFollowUp()\n {\n $relation = $this->hasMany('Acelle\\Model\\AutoTrigger');\n $relation->getQuery()->whereRaw(sprintf('id NOT IN (SELECT COALESCE(preceded_by, 0) FROM %s)', table('auto_triggers')));\n return $relation;\n }", "public function isRelated();", "public function setPending()\n {\n $this->attributes['status'] = 'pending';\n self::save();\n }", "public function incomingEdges()\n {\n return $this->hasMany(Edge::class,'child_id','id');\n }", "public function requests(){\n return $this->hasMany('App\\UserRequest');\n }", "public function isReplaceRelationship();", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "public function allowsCascading()\n {\n return false;\n }", "public function allowsCascading()\n {\n return false;\n }", "public function probe_requests(){\n return $this->hasMany('UserFrosting\\Sprinkle\\GeoSense\\Database\\Models\\ProbeRequest');\n }", "public function locker()\n { return $this->hasOne('App\\User', 'id', 'locked');\n }", "public function rules()\n {\n return [\n 'user_id'=>'required|exists:users,id|not_already_blocked'\n ];\n }", "public function receiver() {\n return $this->belongsTo(User::class, 'receiver_id');\n }", "public function hasRelationship() {\n return $this->_has(1);\n }", "public function getCanDeactivateSelf() {}", "public function notifier() {\n return $this->morphTo();\n }", "public function behavior()\n {\n return $this->action_plan->belongsTo(Behavior::class);\n }", "public function likeable()\n {\n //this is ploymorphic relations and we\n //can apply to other models\n return $this->morphTo();\n }", "public function status()\n {\n return $this->hasOne(StatusRequest::class,\n SchemaConstant::PRIMARY_KEY,\n SchemaConstant::STATUS_FOREIGN_KEY);\n }", "function pending() {\n $this->setStatus(UserpointsTransaction::STATUS_PENDING);\n return $this;\n }", "public function watching()\n {\n return $this->hasMany(watching::class);\n }", "public function getRelationshipStatus()\n\t{\n\t\treturn $this->relationship_status;\n\t}", "public function readOnly(): self\n {\n return $this->only('related', 'read');\n }", "public function receivedInvitations(){\n return $this->hasMany('App\\CollaboratorRequest','inviteTo');\n }", "public function model()\n {\n return LeaveRequest::class;\n }", "public function watchers(){\n\n return $this->hasMany('App\\Watcher');\n }", "private function warnForThroughRelations()\n {\n $this->warn(\"| Make sure that the \\\"{$this->parent}\\\" model has the foreign key \\\"\".Str::lower($this->farParent).\"_id\\\" and the \\\"{$this->throughChild}\\\" model has the foreign key \\\"\".Str::lower($this->parent).\"_id\\\"\\n\");\n }", "public function responsables (){\n return $this->hasMany('App\\Responsable');\n }", "public function receiver()\n {\n return $this->hasMany(\n Message::class,\n 'receiver_id');\n\n }", "public function constrain()\n\t{\n\t\treturn $this->related\n\t\t ->whereEquals($this->relatedKey, $this->model->{$this->localKey})\n\t\t ->whereEquals($this->shifter, strtolower($this->model->getModelName()));\n\t}", "public function getLazyRelationshipsAttribute()\n {\n return ['photo', 'user'];\n }", "public function requireRelationshipDefined()\n {\n if ($this->relationship === null)\n {\n throw new Exception();\n }\n }" ]
[ "0.6185107", "0.5762427", "0.5663475", "0.5565068", "0.55341184", "0.55001926", "0.54354596", "0.54343754", "0.54343754", "0.54339355", "0.5392027", "0.5392027", "0.53639805", "0.53121674", "0.52717906", "0.5270487", "0.5259728", "0.5256038", "0.5234536", "0.52189356", "0.52126575", "0.5203173", "0.51727974", "0.5159992", "0.51574963", "0.51530796", "0.51368487", "0.51314723", "0.5105932", "0.5090622", "0.5090367", "0.50871366", "0.5085714", "0.5085714", "0.5085714", "0.50752115", "0.5074559", "0.50741184", "0.50739855", "0.5002087", "0.49975556", "0.49736366", "0.49671388", "0.49603632", "0.49323094", "0.4926061", "0.491116", "0.49092034", "0.4905561", "0.49028724", "0.4902872", "0.49013996", "0.48995164", "0.48859522", "0.48843998", "0.4883198", "0.4881907", "0.4874064", "0.48652425", "0.48603287", "0.4849591", "0.4846743", "0.48459277", "0.4845697", "0.48442703", "0.48401117", "0.4838938", "0.4835031", "0.48312187", "0.4825135", "0.48184684", "0.48139828", "0.4799898", "0.4798551", "0.4798551", "0.47975513", "0.47975513", "0.47942185", "0.4789079", "0.47849348", "0.47813827", "0.47808203", "0.47787163", "0.47759405", "0.4775303", "0.47746176", "0.47733516", "0.4772216", "0.47705853", "0.476801", "0.47678962", "0.47655955", "0.47649416", "0.47604725", "0.47604543", "0.47468027", "0.47458863", "0.4745415", "0.47425956", "0.4732076" ]
0.608516
1
Check if the current model is blocking another model.
public function isBlocking($model): bool { if (! $model instanceof Blockable && ! $model instanceof Blocking) { return false; } return ! is_null( $this ->blocking((new $model)->getMorphClass()) ->find($model->getKey()) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function blocks($model): bool\n {\n return $this->isBlocking($model);\n }", "public function isBlocked()\n {\n return $this->getStatus() == self::STATUS_BLOCKED;\n }", "public function block($model): bool\n {\n if (! $model instanceof Blockable && ! $model instanceof Blocking) {\n return false;\n }\n\n if ($this->isBlocking($model)) {\n return false;\n }\n\n $this->blocking()->attach($model->getKey(), [\n 'blockable_type' => (new $model)->getMorphClass(),\n ]);\n\n return true;\n }", "public function isBlocked()\n {\n if ($this->status == 2) {\n return true;\n } else {\n return false;\n }\n }", "public function isBlocked() {\n return $this->user !== null && $this->user->blocked;\n }", "public function isBlocking(): bool\n {\n return $this->pluck('blocking');\n }", "public function isBlocking(): bool\n {\n return $this->pluck('blocking');\n }", "public function isBlocking()\n\t{\n\t\treturn $this->blocking;\n\t}", "public function hasBlocked()\n {\n return $this->blocked !== null;\n }", "public function block() {\n $friendship_relation_exists = $this->micro_relation_exists($this->from, $this->to, \"F\");\n $exists = $this->micro_relation_exists($this->from, $this->to, \"B\");\n\n if($friendship_relation_exists) {\n // Unblock\n if($exists) {\n $this->db->query(\"DELETE FROM user_relation WHERE `from` = ? AND `to` = ? AND `status` = ?\"\n ,array(\n $this->from,\n $this->to,\n \"B\"\n ));\n // Block\n } else {\n $this->db->query(\"INSERT INTO user_relation (`from`, `to`, `status`, `since`) \n VALUES (?, ?, ?, ?)\", array(\n $this->from,\n $this->to,\n \"B\",\n date(\"Y/m/d h:i:s\")\n ));\n }\n\n return true;\n }\n\n return false;\n }", "public function getIsBlocked();", "public function isBlocked()\n {\n if ($this->edit_id === 0) {\n return false;\n } else {\n if ($this->edit_time + 7200 > time()) {\n return true;\n } else {\n return false;\n }\n }\n }", "public function unblock($model): bool\n {\n if (! $model instanceof Blockable && ! $model instanceof Blocking) {\n return false;\n }\n\n if (! $this->isBlocking($model)) {\n return false;\n }\n\n return (bool) $this\n ->blocking((new $model)->getMorphClass())\n ->detach($model->getKey());\n }", "public function getIsBlocked()\n {\n return $this->isBlocked;\n }", "public function isBlockable()\n {\n if ($this->_hasVar('user_blockable')) {\n return (boolean) $this->_getVar('user_blockable');\n } else {\n return true;\n }\n }", "public function isBlocked() : bool {\n return $this->delivery_status === WebhookEvent::EVENT_BLOCKED;\n }", "public function blocking($model = null)\n {\n $modelClass = $this->getModelMorphClass($model);\n\n return $this\n ->morphToMany($modelClass, 'blocker', 'blockers', 'blocker_id', 'blockable_id')\n ->withPivot('blockable_type')\n ->wherePivot('blockable_type', $modelClass)\n ->wherePivot('blocker_type', $this->getMorphClass())\n ->withTimestamps();\n }", "public function hasBlockedUserFilter()\n {\n return $this->blocked_user_filter !== null;\n }", "public function isWaiting();", "public function getBlocking()\n {\n return $this->_blocking;\n }", "public function isPending()\n {\n // check if model approved by all roles in the model\n return $this->pendingItem($this->approvedByRole());\n }", "public function getIsBlock();", "public function getIsPending() {\n if ($parent = $this->getParentBlock()) {\n return!!$parent->getPending();\n }\n return false;\n }", "public function isAllow() {\n return !$this->isEnabled();\n }", "public function isBlocked()\n {\n if (!IS_CLI) {\n $userIp = request()->getUserIP();\n\n $command = app()->db->createCommand('SELECT ip_address FROM ' . SecurityBlockedAccess::getTableSchema()->fullName . ' WHERE is_active = 1');\n $blockedIps = $command->queryColumn();\n\n if (!empty($blockedIps)) {\n $validator = new IpValidator([\n 'subnet' => null,\n ]);\n $validator->setRanges($blockedIps);\n\n return $validator->validate($userIp);\n }\n }\n\n return false;\n }", "public function isIgnoreObserver(){\n\t\t$ignore = true;\n\t\t$data = Mage::app()->getRequest()->getParams();\n\t\tif (isset($data['echeck_dropship']) && $data['echeck_dropship'] == 1)$ignore = false;\n\t\treturn $ignore;\n\t}", "public function ownsLock()\n {\n return $this->owner() === $this->id;\n }", "public function hasBaseModel()\n\t{\n\t\treturn ! empty($this->resource->models_base);\n\t}", "public function blockAccount() {\n\t\tif(check($this->_userid)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_MEMBID_.\" = ?\", array(1, $this->_userid));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(check($this->_username)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_USERNM_.\" = ?\", array(1, $this->_username));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(check($this->_email)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_EMAIL_.\" = ?\", array(1, $this->_email));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "public function isBanned() {\n return $this->getStatus() === Status::BANNED;\n }", "public function getBlocked()\n {\n return $this->Blocked;\n }", "public function isWaiting() {\n\t\treturn $this->workflowActivitySpecification->isWaiting();\n\t}", "public function isNot($model);", "public abstract function hasWaitingLobby(): bool;", "public function isPending(): bool;", "public function broadcastWhen() {\n $return = false;\n $ids_to_broadcast = [$this->message->userId, $this->message->receiverUserId];\n if (in_array($this->message->userId, $ids_to_broadcast) || in_array($this->message->receiverUserId, $ids_to_broadcast)) $return = true;\n return $return;\n }", "public function block()\n {\n $blocker = Yii::$app->cache->get('login_blocker_' . $this->getIp());\n \n if ($blocker === false) {\n $blocker = [1, time(), 0];\n } else { \n $blocker[0]++;\n \n if ($blocker[0] == $this->wrong_login_number) {\n $blocker[1] = time() + $this->time; \n }\n }\n \n Yii::$app->cache->set('login_blocker_' . $this->getIp(), $blocker, $this->time);\n\n return true;\n }", "public function hasModel() {\n\t\treturn is_object($this->model) && is_subclass_of($this->model, 'Model');\n\t}", "public function isAncestor()\n {\n $model_ticket_forwarded_to = self::find()->andWhere(['forwarded_from_id' => $this->id])->one();\n\n return !is_null($model_ticket_forwarded_to);\n }", "public function hasModel();", "public function canBeDeclined()\n {\n return $this->isAwaitingFee();\n }", "public function isPending()\n {\n return true;\n }", "public function isStillPending()\n {\n //\n return $this->result == self::RESULT_STILL_PENDING;\n }", "public function isReceiving()\n {\n return ( $this->_stateManager->getState() === self::STATE_RECEIVING );\n }", "public function hasModel()\n\t{\n\t\treturn !empty($this->model);\n\t}", "public function ban(User $user, User $model)\n {\n return $user->isAllowedTo(\"update.user.{$model->id}\");\n }", "public function isLocked()\n {\n return !!$this->special;\n }", "public function _isNot($model)\n {\n return ! $this->_is($model);\n }", "public function testBlocking()\n {\n $this->module->enableBlockingEmail = true;\n\n $this->specify(\"we have block user\", function () {\n /** @var User $user */\n //$user = $this->getFixture('user')->getModel('active');\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can block user\", $user->block())->true();\n $this->tester->seeEmailIsSent();\n });\n\n $this->specify(\"we have block already blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'blocked');\n expect(\"we can't block already blocked user\", $user->block())->false();\n });\n\n $this->specify(\"we have block unconfirmed user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'unconfirmed');\n expect(\"we can't block unconfirmed user\", $user->block())->false();\n });\n\n $this->module->enableUnblockingEmail = true;\n $this->specify(\"we have unblock blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'blocked');\n expect(\"we can unblock blocked user\", $user->unblock())->true();\n $this->tester->seeEmailIsSent();\n });\n\n $this->specify(\"we have unblock not blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'unconfirmed');\n expect(\"we can't unblock not blocked user\", $user->unblock())->false();\n $this->tester->dontSeeEmailIsSent();\n });\n\n $this->specify(\"we have unblock user override mail setting\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can unblock user\", $user->unblock(false))->true();\n $this->tester->dontSeeEmailIsSent();\n });\n\n $this->specify(\"we have block user override global email setting\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can block user\", $user->block(false))->true();\n $this->tester->dontSeeEmailIsSent();\n });\n }", "public function canBackTrack(){\n return !is_null($parent);\n }", "public function isLocked() {}", "public function model_call_is_just_frozen(Jam_Model $model, Jam_Event_Data $data)\n\t{\n\t\tif ($this->_parent)\n\t\t{\n\t\t\t$data->return = $model\n\t\t\t\t->get_insist($this->_parent)\n\t\t\t\t->is_just_frozen();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data->return = $model->is_just_frozen;\n\t\t}\n\t}", "public function setIsBlocked($bool);", "public function isPastBidTime()\n\t{\n\t\t//light check if task is active\n\t\tif (!$this->active)\n\t\t\treturn true;\n\t\t\n\t\t//heavier time check in case time is passed but the sentinel has not caught the task yet\n\t\tif ($this->enddatetime <= time())\n\t\t{\n\t\t\t$this->endTask();\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "protected function isAllowedStatusUsed()\n\t{\n\t\treturn $this->use_allowed_status;\n\t}", "function instance_allow_multiple() { // If yes, then it is assumed that the block WILL USE per-instance configuration\n return false;\n }", "protected function rateLimitingDisabled()\n {\n return $this->config['limit'] == 0;\n }", "function __isVotableModel($modelname){\n\t\t\t\t$submission = $this->Submission;\n\t\t\t\t$topic = $this->Topic;\n\t\t\t\t$models = array(\"Submission\" => $submission, \n\t\t\t\t\t\t\t\t\t\t\t\t \"Topic\" => $topic);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t \tif(!isset($models[$modelname]))\n\t\t\t\t\treturn false;\n\t\t\t\telse\n\t\t\t\t\treturn $models[$modelname];\n\t\t}", "public function model_call_is_frozen(Jam_Model $model, Jam_Event_Data $data)\n\t{\n\t\tif ($this->_parent)\n\t\t{\n\t\t\t$data->return = $model->get_insist($this->_parent)->is_frozen();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data->return = $model->is_frozen;\n\t\t}\n\t}", "public function isPending()\n {\n return static::STATUS_PENDING == $this->getStatus();\n }", "public function isPending()\n {\n if ($this->status == 0) {\n return true;\n } else {\n return false;\n }\n }", "function isPending() {\n return $this->getStatus() == UserpointsTransaction::STATUS_PENDING;\n }", "public function is_blocked_to(Character $character)\n {\n return false;\n }", "public function isLocked();", "public function isLocked();", "public function isLocked();", "public function isBanned() {\n return !! $this->is_banned;\n }", "public function isAcceptable() {\n return !$this->isWip() && !$this->hasConflicts();\n\n }", "public function isUsable(){\n return ($this->isValid() && $this->isEnabled() && !$this->isDeleted());\n }", "public function isPending()\r\n {\r\n return $this->status >= 0 && $this->status < 100;\r\n }", "public function supported(Model $model): bool;", "private function isLocked() {\n return true === $this->status->is_locked;\n }", "public function isOwned()\n {\n return Auth::user() && $this->recipient_id === Auth::id();\n }", "public static function block($id, $blocking_id){\n if(!Auth::check() || !(Auth::user()->id == $id)) return 1;\n if($id === $blocking_id) return 2;\n return 0;\n }", "private function needsServerSideSleep()\n\t{\n\t\t/**\n\t\t * If the part doesn't support tagging, i.e. I can't determine if this is a backend backup or not, I will always\n\t\t * use server-side sleep.\n\t\t */\n\t\tif (!method_exists($this, 'getTag'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * If this is not a backend backup I will always use server-side sleep. That is to say that legacy front-end,\n\t\t * remote JSON API and CLI backups must always use server-side sleep since they do not support client-side\n\t\t * sleep.\n\t\t */\n\t\tif (!in_array($this->getTag(), ['backend', 'restorepoint']))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn Factory::getConfiguration()->get('akeeba.basic.clientsidewait', 0) == 0;\n\t}", "public function isBanned()\n {\n return $this->is_banned;\n }", "public function is_block ()\n {\n return is_a( $this, __NAMESPACE__ . '\\\\Block' );\n }", "public static function is_force_active() {\n\t\treturn false;\n\t}", "public function isPending()\n\t{\n\t\treturn ($this->get('state') == self::STATE_PENDING);\n\t}", "public function wasDeadlock() {\n\t\treturn false;\n\t}", "public function checkModel(): bool\n {\n if (is_null($this->profile)) throw new ProfileModelNotDefined();\n else return true;\n }", "static function check_visitor_ip_and_perform_blocking()\r\n {\r\n global $aio_wp_security, $wpdb;\r\n $visitor_ip = AIOWPSecurity_Utility_IP::get_user_ip_address();\r\n $ip_type = WP_Http::is_ip_address($visitor_ip);\r\n if(empty($ip_type)){\r\n $aio_wp_security->debug_logger->log_debug(\"do_general_ip_blocking_tasks: \".$visitor_ip.\" is not a valid IP!\",4);\r\n return;\r\n }\r\n\r\n //Check if this IP address is in the block list\r\n $blocked = AIOWPSecurity_Blocking::is_ip_blocked($visitor_ip);\r\n //TODO - future feature: add blocking whitelist and check\r\n\r\n if(empty($blocked)){\r\n return; //Visitor IP is not blocked - allow page to load\r\n }else{\r\n //block this visitor!!\r\n AIOWPSecurity_Utility::redirect_to_url('http://127.0.0.1');\r\n }\r\n return;\r\n\r\n }", "protected function shouldProcess(Model $model)\n {\n return AccountPushExecution::isModelTypeValid($model->getType()) && true == static::$enabled;\n }", "public function isBlockGenerationOn()\n {\n return $this->query('getgenerate', false) === 'true';\n }", "public function isLocked()\n\t{\n\t\treturn $this->blnLocked;\n\t}", "public function getCanDeactivateSelf() {}", "protected function inEffect() {\n $url = explode('/', ServerRequestFactory::fromGlobals()->getPath());\n\n // no backend config? abort\n if(!Configure::read('Backend'))\n return false;\n\n // not backend? abort\n if(!($url[1] === 'backend' || ($url[1] === 'unimatrix' && $url[2] === 'backend')))\n return false;\n\n // valid\n return true;\n }", "public function isAllowed()\n {\n return version_compare($this->metadata->getVersion(), '2.3.0', '<');\n }", "public function disableBannedAtScope()\n {\n return true;\n }", "protected function isStatusAllowed()\n {\n return $this->getStatus() === self::STATUS_ALLOWED;\n }", "public function isBanned(){\n return $this->banned;\n }", "public function isBuffered()\n {\n ($this->isBuffered !== null) ?:\n $this->isBuffered =\n !(\n $this->getOrigin()->field_count > 0\n && $this->getOrigin()->num_rows == 0\n );\n\n return $this->isBuffered;\n }", "public function doesntOwn($model, $foreignKey = null, $overrideContract = false)\n {\n return !$this->owns($model, $foreignKey);\n }", "private function isBot()\n {\n if (preg_match('/mediapartners|googlebot|bingbot|bot/i', request()->server('HTTP_USER_AGENT'))) {\n return true;\n }\n }", "protected function isBotRequest() {\n return (\n isset($_SERVER['HTTP_USER_AGENT'])\n && preg_match('/bot|crawl|slurp|spider|mediapartners/i', $_SERVER['HTTP_USER_AGENT'])\n );\n }", "public function can_activate(): bool;", "public function isNotUsing();", "public function isAwaiting()\n {\n return $this->state_id == TransferState::AWAITING;\n }", "public function turnOnWaitingChecks()\n {\n $this->isModal = false;\n return;\n }", "public function allowMultithreading()\n {\n return $this->_allow_multithreading;\n }" ]
[ "0.7495757", "0.69053787", "0.6801635", "0.67990774", "0.666782", "0.66282904", "0.66282904", "0.6483337", "0.64489037", "0.6397326", "0.6258957", "0.61333466", "0.6101863", "0.5955755", "0.5909152", "0.5907648", "0.5903484", "0.56196004", "0.5583856", "0.5568157", "0.5546071", "0.5513709", "0.5469224", "0.5361682", "0.53512204", "0.5336231", "0.53269815", "0.5286806", "0.528536", "0.52774405", "0.5277153", "0.5274399", "0.5272414", "0.5252974", "0.52526045", "0.52343565", "0.5227991", "0.52096623", "0.5193921", "0.5193198", "0.5167097", "0.5165039", "0.51428825", "0.5138114", "0.5137597", "0.51362914", "0.5123771", "0.5121718", "0.51161695", "0.5100175", "0.5080821", "0.5080796", "0.50756806", "0.5064608", "0.5062052", "0.5061518", "0.50581974", "0.50495625", "0.5049401", "0.5042643", "0.5039115", "0.5037314", "0.5036858", "0.5035405", "0.5035405", "0.5035405", "0.50239766", "0.5022686", "0.5021555", "0.50165397", "0.5015883", "0.5009009", "0.5007987", "0.49996743", "0.49984962", "0.4981944", "0.49746183", "0.49730924", "0.4969387", "0.4965873", "0.49593598", "0.49562827", "0.49555948", "0.49533573", "0.49508038", "0.49359813", "0.4933465", "0.49329346", "0.4930281", "0.49268374", "0.49252838", "0.49182844", "0.49136546", "0.49085757", "0.49062097", "0.49030936", "0.49006352", "0.48969334", "0.48961535", "0.489296" ]
0.73818463
1
Check if the current model is blocking another model.
public function blocks($model): bool { return $this->isBlocking($model); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isBlocking($model): bool\n {\n if (! $model instanceof Blockable && ! $model instanceof Blocking) {\n return false;\n }\n\n return ! is_null(\n $this\n ->blocking((new $model)->getMorphClass())\n ->find($model->getKey())\n );\n }", "public function isBlocked()\n {\n return $this->getStatus() == self::STATUS_BLOCKED;\n }", "public function block($model): bool\n {\n if (! $model instanceof Blockable && ! $model instanceof Blocking) {\n return false;\n }\n\n if ($this->isBlocking($model)) {\n return false;\n }\n\n $this->blocking()->attach($model->getKey(), [\n 'blockable_type' => (new $model)->getMorphClass(),\n ]);\n\n return true;\n }", "public function isBlocked()\n {\n if ($this->status == 2) {\n return true;\n } else {\n return false;\n }\n }", "public function isBlocked() {\n return $this->user !== null && $this->user->blocked;\n }", "public function isBlocking(): bool\n {\n return $this->pluck('blocking');\n }", "public function isBlocking(): bool\n {\n return $this->pluck('blocking');\n }", "public function isBlocking()\n\t{\n\t\treturn $this->blocking;\n\t}", "public function hasBlocked()\n {\n return $this->blocked !== null;\n }", "public function block() {\n $friendship_relation_exists = $this->micro_relation_exists($this->from, $this->to, \"F\");\n $exists = $this->micro_relation_exists($this->from, $this->to, \"B\");\n\n if($friendship_relation_exists) {\n // Unblock\n if($exists) {\n $this->db->query(\"DELETE FROM user_relation WHERE `from` = ? AND `to` = ? AND `status` = ?\"\n ,array(\n $this->from,\n $this->to,\n \"B\"\n ));\n // Block\n } else {\n $this->db->query(\"INSERT INTO user_relation (`from`, `to`, `status`, `since`) \n VALUES (?, ?, ?, ?)\", array(\n $this->from,\n $this->to,\n \"B\",\n date(\"Y/m/d h:i:s\")\n ));\n }\n\n return true;\n }\n\n return false;\n }", "public function getIsBlocked();", "public function isBlocked()\n {\n if ($this->edit_id === 0) {\n return false;\n } else {\n if ($this->edit_time + 7200 > time()) {\n return true;\n } else {\n return false;\n }\n }\n }", "public function unblock($model): bool\n {\n if (! $model instanceof Blockable && ! $model instanceof Blocking) {\n return false;\n }\n\n if (! $this->isBlocking($model)) {\n return false;\n }\n\n return (bool) $this\n ->blocking((new $model)->getMorphClass())\n ->detach($model->getKey());\n }", "public function getIsBlocked()\n {\n return $this->isBlocked;\n }", "public function isBlockable()\n {\n if ($this->_hasVar('user_blockable')) {\n return (boolean) $this->_getVar('user_blockable');\n } else {\n return true;\n }\n }", "public function isBlocked() : bool {\n return $this->delivery_status === WebhookEvent::EVENT_BLOCKED;\n }", "public function blocking($model = null)\n {\n $modelClass = $this->getModelMorphClass($model);\n\n return $this\n ->morphToMany($modelClass, 'blocker', 'blockers', 'blocker_id', 'blockable_id')\n ->withPivot('blockable_type')\n ->wherePivot('blockable_type', $modelClass)\n ->wherePivot('blocker_type', $this->getMorphClass())\n ->withTimestamps();\n }", "public function hasBlockedUserFilter()\n {\n return $this->blocked_user_filter !== null;\n }", "public function isWaiting();", "public function getBlocking()\n {\n return $this->_blocking;\n }", "public function isPending()\n {\n // check if model approved by all roles in the model\n return $this->pendingItem($this->approvedByRole());\n }", "public function getIsBlock();", "public function getIsPending() {\n if ($parent = $this->getParentBlock()) {\n return!!$parent->getPending();\n }\n return false;\n }", "public function isAllow() {\n return !$this->isEnabled();\n }", "public function isBlocked()\n {\n if (!IS_CLI) {\n $userIp = request()->getUserIP();\n\n $command = app()->db->createCommand('SELECT ip_address FROM ' . SecurityBlockedAccess::getTableSchema()->fullName . ' WHERE is_active = 1');\n $blockedIps = $command->queryColumn();\n\n if (!empty($blockedIps)) {\n $validator = new IpValidator([\n 'subnet' => null,\n ]);\n $validator->setRanges($blockedIps);\n\n return $validator->validate($userIp);\n }\n }\n\n return false;\n }", "public function isIgnoreObserver(){\n\t\t$ignore = true;\n\t\t$data = Mage::app()->getRequest()->getParams();\n\t\tif (isset($data['echeck_dropship']) && $data['echeck_dropship'] == 1)$ignore = false;\n\t\treturn $ignore;\n\t}", "public function ownsLock()\n {\n return $this->owner() === $this->id;\n }", "public function blockAccount() {\n\t\tif(check($this->_userid)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_MEMBID_.\" = ?\", array(1, $this->_userid));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(check($this->_username)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_USERNM_.\" = ?\", array(1, $this->_username));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(check($this->_email)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_EMAIL_.\" = ?\", array(1, $this->_email));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "public function hasBaseModel()\n\t{\n\t\treturn ! empty($this->resource->models_base);\n\t}", "public function getBlocked()\n {\n return $this->Blocked;\n }", "public function isBanned() {\n return $this->getStatus() === Status::BANNED;\n }", "public function isWaiting() {\n\t\treturn $this->workflowActivitySpecification->isWaiting();\n\t}", "public function isNot($model);", "public abstract function hasWaitingLobby(): bool;", "public function isPending(): bool;", "public function broadcastWhen() {\n $return = false;\n $ids_to_broadcast = [$this->message->userId, $this->message->receiverUserId];\n if (in_array($this->message->userId, $ids_to_broadcast) || in_array($this->message->receiverUserId, $ids_to_broadcast)) $return = true;\n return $return;\n }", "public function block()\n {\n $blocker = Yii::$app->cache->get('login_blocker_' . $this->getIp());\n \n if ($blocker === false) {\n $blocker = [1, time(), 0];\n } else { \n $blocker[0]++;\n \n if ($blocker[0] == $this->wrong_login_number) {\n $blocker[1] = time() + $this->time; \n }\n }\n \n Yii::$app->cache->set('login_blocker_' . $this->getIp(), $blocker, $this->time);\n\n return true;\n }", "public function hasModel() {\n\t\treturn is_object($this->model) && is_subclass_of($this->model, 'Model');\n\t}", "public function isAncestor()\n {\n $model_ticket_forwarded_to = self::find()->andWhere(['forwarded_from_id' => $this->id])->one();\n\n return !is_null($model_ticket_forwarded_to);\n }", "public function hasModel();", "public function canBeDeclined()\n {\n return $this->isAwaitingFee();\n }", "public function isPending()\n {\n return true;\n }", "public function isStillPending()\n {\n //\n return $this->result == self::RESULT_STILL_PENDING;\n }", "public function ban(User $user, User $model)\n {\n return $user->isAllowedTo(\"update.user.{$model->id}\");\n }", "public function isReceiving()\n {\n return ( $this->_stateManager->getState() === self::STATE_RECEIVING );\n }", "public function hasModel()\n\t{\n\t\treturn !empty($this->model);\n\t}", "public function isLocked()\n {\n return !!$this->special;\n }", "public function _isNot($model)\n {\n return ! $this->_is($model);\n }", "public function testBlocking()\n {\n $this->module->enableBlockingEmail = true;\n\n $this->specify(\"we have block user\", function () {\n /** @var User $user */\n //$user = $this->getFixture('user')->getModel('active');\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can block user\", $user->block())->true();\n $this->tester->seeEmailIsSent();\n });\n\n $this->specify(\"we have block already blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'blocked');\n expect(\"we can't block already blocked user\", $user->block())->false();\n });\n\n $this->specify(\"we have block unconfirmed user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'unconfirmed');\n expect(\"we can't block unconfirmed user\", $user->block())->false();\n });\n\n $this->module->enableUnblockingEmail = true;\n $this->specify(\"we have unblock blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'blocked');\n expect(\"we can unblock blocked user\", $user->unblock())->true();\n $this->tester->seeEmailIsSent();\n });\n\n $this->specify(\"we have unblock not blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'unconfirmed');\n expect(\"we can't unblock not blocked user\", $user->unblock())->false();\n $this->tester->dontSeeEmailIsSent();\n });\n\n $this->specify(\"we have unblock user override mail setting\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can unblock user\", $user->unblock(false))->true();\n $this->tester->dontSeeEmailIsSent();\n });\n\n $this->specify(\"we have block user override global email setting\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can block user\", $user->block(false))->true();\n $this->tester->dontSeeEmailIsSent();\n });\n }", "public function canBackTrack(){\n return !is_null($parent);\n }", "public function model_call_is_just_frozen(Jam_Model $model, Jam_Event_Data $data)\n\t{\n\t\tif ($this->_parent)\n\t\t{\n\t\t\t$data->return = $model\n\t\t\t\t->get_insist($this->_parent)\n\t\t\t\t->is_just_frozen();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data->return = $model->is_just_frozen;\n\t\t}\n\t}", "public function isLocked() {}", "public function setIsBlocked($bool);", "public function isPastBidTime()\n\t{\n\t\t//light check if task is active\n\t\tif (!$this->active)\n\t\t\treturn true;\n\t\t\n\t\t//heavier time check in case time is passed but the sentinel has not caught the task yet\n\t\tif ($this->enddatetime <= time())\n\t\t{\n\t\t\t$this->endTask();\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "function instance_allow_multiple() { // If yes, then it is assumed that the block WILL USE per-instance configuration\n return false;\n }", "protected function isAllowedStatusUsed()\n\t{\n\t\treturn $this->use_allowed_status;\n\t}", "protected function rateLimitingDisabled()\n {\n return $this->config['limit'] == 0;\n }", "public function model_call_is_frozen(Jam_Model $model, Jam_Event_Data $data)\n\t{\n\t\tif ($this->_parent)\n\t\t{\n\t\t\t$data->return = $model->get_insist($this->_parent)->is_frozen();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data->return = $model->is_frozen;\n\t\t}\n\t}", "function __isVotableModel($modelname){\n\t\t\t\t$submission = $this->Submission;\n\t\t\t\t$topic = $this->Topic;\n\t\t\t\t$models = array(\"Submission\" => $submission, \n\t\t\t\t\t\t\t\t\t\t\t\t \"Topic\" => $topic);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t \tif(!isset($models[$modelname]))\n\t\t\t\t\treturn false;\n\t\t\t\telse\n\t\t\t\t\treturn $models[$modelname];\n\t\t}", "public function isPending()\n {\n return static::STATUS_PENDING == $this->getStatus();\n }", "public function is_blocked_to(Character $character)\n {\n return false;\n }", "public function isPending()\n {\n if ($this->status == 0) {\n return true;\n } else {\n return false;\n }\n }", "function isPending() {\n return $this->getStatus() == UserpointsTransaction::STATUS_PENDING;\n }", "public function isLocked();", "public function isLocked();", "public function isLocked();", "public function isBanned() {\n return !! $this->is_banned;\n }", "public function isAcceptable() {\n return !$this->isWip() && !$this->hasConflicts();\n\n }", "public function isUsable(){\n return ($this->isValid() && $this->isEnabled() && !$this->isDeleted());\n }", "public function isPending()\r\n {\r\n return $this->status >= 0 && $this->status < 100;\r\n }", "public function supported(Model $model): bool;", "private function isLocked() {\n return true === $this->status->is_locked;\n }", "public function isOwned()\n {\n return Auth::user() && $this->recipient_id === Auth::id();\n }", "public static function block($id, $blocking_id){\n if(!Auth::check() || !(Auth::user()->id == $id)) return 1;\n if($id === $blocking_id) return 2;\n return 0;\n }", "private function needsServerSideSleep()\n\t{\n\t\t/**\n\t\t * If the part doesn't support tagging, i.e. I can't determine if this is a backend backup or not, I will always\n\t\t * use server-side sleep.\n\t\t */\n\t\tif (!method_exists($this, 'getTag'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * If this is not a backend backup I will always use server-side sleep. That is to say that legacy front-end,\n\t\t * remote JSON API and CLI backups must always use server-side sleep since they do not support client-side\n\t\t * sleep.\n\t\t */\n\t\tif (!in_array($this->getTag(), ['backend', 'restorepoint']))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn Factory::getConfiguration()->get('akeeba.basic.clientsidewait', 0) == 0;\n\t}", "public function isBanned()\n {\n return $this->is_banned;\n }", "public function is_block ()\n {\n return is_a( $this, __NAMESPACE__ . '\\\\Block' );\n }", "public static function is_force_active() {\n\t\treturn false;\n\t}", "public function isPending()\n\t{\n\t\treturn ($this->get('state') == self::STATE_PENDING);\n\t}", "public function wasDeadlock() {\n\t\treturn false;\n\t}", "static function check_visitor_ip_and_perform_blocking()\r\n {\r\n global $aio_wp_security, $wpdb;\r\n $visitor_ip = AIOWPSecurity_Utility_IP::get_user_ip_address();\r\n $ip_type = WP_Http::is_ip_address($visitor_ip);\r\n if(empty($ip_type)){\r\n $aio_wp_security->debug_logger->log_debug(\"do_general_ip_blocking_tasks: \".$visitor_ip.\" is not a valid IP!\",4);\r\n return;\r\n }\r\n\r\n //Check if this IP address is in the block list\r\n $blocked = AIOWPSecurity_Blocking::is_ip_blocked($visitor_ip);\r\n //TODO - future feature: add blocking whitelist and check\r\n\r\n if(empty($blocked)){\r\n return; //Visitor IP is not blocked - allow page to load\r\n }else{\r\n //block this visitor!!\r\n AIOWPSecurity_Utility::redirect_to_url('http://127.0.0.1');\r\n }\r\n return;\r\n\r\n }", "public function checkModel(): bool\n {\n if (is_null($this->profile)) throw new ProfileModelNotDefined();\n else return true;\n }", "protected function shouldProcess(Model $model)\n {\n return AccountPushExecution::isModelTypeValid($model->getType()) && true == static::$enabled;\n }", "public function isBlockGenerationOn()\n {\n return $this->query('getgenerate', false) === 'true';\n }", "public function isLocked()\n\t{\n\t\treturn $this->blnLocked;\n\t}", "public function getCanDeactivateSelf() {}", "public function disableBannedAtScope()\n {\n return true;\n }", "protected function inEffect() {\n $url = explode('/', ServerRequestFactory::fromGlobals()->getPath());\n\n // no backend config? abort\n if(!Configure::read('Backend'))\n return false;\n\n // not backend? abort\n if(!($url[1] === 'backend' || ($url[1] === 'unimatrix' && $url[2] === 'backend')))\n return false;\n\n // valid\n return true;\n }", "public function isAllowed()\n {\n return version_compare($this->metadata->getVersion(), '2.3.0', '<');\n }", "public function isBanned(){\n return $this->banned;\n }", "protected function isStatusAllowed()\n {\n return $this->getStatus() === self::STATUS_ALLOWED;\n }", "public function isBuffered()\n {\n ($this->isBuffered !== null) ?:\n $this->isBuffered =\n !(\n $this->getOrigin()->field_count > 0\n && $this->getOrigin()->num_rows == 0\n );\n\n return $this->isBuffered;\n }", "public function doesntOwn($model, $foreignKey = null, $overrideContract = false)\n {\n return !$this->owns($model, $foreignKey);\n }", "private function isBot()\n {\n if (preg_match('/mediapartners|googlebot|bingbot|bot/i', request()->server('HTTP_USER_AGENT'))) {\n return true;\n }\n }", "protected function isBotRequest() {\n return (\n isset($_SERVER['HTTP_USER_AGENT'])\n && preg_match('/bot|crawl|slurp|spider|mediapartners/i', $_SERVER['HTTP_USER_AGENT'])\n );\n }", "public function can_activate(): bool;", "public function isNotUsing();", "public function turnOnWaitingChecks()\n {\n $this->isModal = false;\n return;\n }", "public function isAwaiting()\n {\n return $this->state_id == TransferState::AWAITING;\n }", "public function allowMultithreading()\n {\n return $this->_allow_multithreading;\n }" ]
[ "0.73832715", "0.6907038", "0.6803754", "0.68004143", "0.66683084", "0.66294", "0.66294", "0.6484921", "0.6448815", "0.63986456", "0.6259316", "0.6132957", "0.6103157", "0.59570366", "0.59099674", "0.59087884", "0.59076244", "0.56187606", "0.55834043", "0.5570577", "0.55431736", "0.55136603", "0.54668313", "0.53614676", "0.5351474", "0.53352934", "0.5323857", "0.52872926", "0.52836657", "0.52787745", "0.52783686", "0.5273603", "0.5272214", "0.5252122", "0.5250574", "0.5231607", "0.52301615", "0.5204863", "0.51900744", "0.51884604", "0.51655143", "0.5163223", "0.51417357", "0.51384526", "0.5134776", "0.513271", "0.5122871", "0.51211405", "0.5119385", "0.50963414", "0.5081128", "0.5080325", "0.5077409", "0.50633186", "0.5061279", "0.5060005", "0.50590724", "0.50493324", "0.5046158", "0.50407016", "0.50380886", "0.50373286", "0.5035786", "0.5034986", "0.5034986", "0.5034986", "0.50238985", "0.50214535", "0.5018524", "0.50152415", "0.5012467", "0.50078744", "0.500393", "0.5001194", "0.49978364", "0.49822578", "0.4974102", "0.49713385", "0.4967341", "0.4966125", "0.495818", "0.49548715", "0.4953816", "0.49520367", "0.49507937", "0.49347737", "0.4932495", "0.49322146", "0.49318603", "0.49253914", "0.49251303", "0.49167663", "0.4911994", "0.49063694", "0.49040186", "0.4900825", "0.4900684", "0.48960954", "0.4895591", "0.48930386" ]
0.7497042
0
Block a certain model.
public function block($model): bool { if (! $model instanceof Blockable && ! $model instanceof Blocking) { return false; } if ($this->isBlocking($model)) { return false; } $this->blocking()->attach($model->getKey(), [ 'blockable_type' => (new $model)->getMorphClass(), ]); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function blocks($model): bool\n {\n return $this->isBlocking($model);\n }", "public function blocking($model = null)\n {\n $modelClass = $this->getModelMorphClass($model);\n\n return $this\n ->morphToMany($modelClass, 'blocker', 'blockers', 'blocker_id', 'blockable_id')\n ->withPivot('blockable_type')\n ->wherePivot('blockable_type', $modelClass)\n ->wherePivot('blocker_type', $this->getMorphClass())\n ->withTimestamps();\n }", "public function blockHandle(Request $request) \n {\n // Check parameter\n $ID = $request->get('ID', false);\n \n if (!$ID)\n {\n return App::abort(404);\n }\n\n // Check promotor\n $promotor = $this->promotor->getOne($ID);\n \n if (!$promotor)\n {\n return App::abort(404);\n }\n\n // Get promotor meta data\n $promotor_meta = $this->promotor_meta->get($ID, 'block');\n \n // Set default action log and flash message\n if(!$promotor_meta)\n {\n $this->promotor_meta->set($ID, 'block', 'block');\n \n $flash = 'promotor-block';\n $action = 'Block promotor (ID:'.$ID.')';\n }\n else\n {\n $this->promotor_meta->remove($ID, 'block');\n\n $flash = 'promotor-unblock';\n $action = 'Unblock promotor (ID:'.$ID.')';\n }\n \n // Log request\n $this->log->record($request->userID, $action);\n\n // Set session and redirect\n $request->session()->flash($flash, '');\n return back();\n }", "public function isBlocking($model): bool\n {\n if (! $model instanceof Blockable && ! $model instanceof Blocking) {\n return false;\n }\n\n return ! is_null(\n $this\n ->blocking((new $model)->getMorphClass())\n ->find($model->getKey())\n );\n }", "public function block()\n {\n $this->type = 'block';\n\n return $this;\n }", "public function blockAction()\n {\n $blockId = $this->params()->fromRoute('block');\n $handles = $this->params()->fromQuery('handles', []);\n /* @var $layoutManager LayoutManager */\n $layoutManager = $this->layoutManager();\n foreach ($handles as $handle => $priority) {\n $layoutManager->addHandle(new Handle($handle, $priority));\n }\n if (!$blockId) {\n return $this->blockNotFound($blockId);\n }\n $layoutManager->generate([BlocksGenerator::NAME => true]);\n if (!$block = $layoutManager->getBlock($blockId)) {\n $block = $this->blockNotFound($blockId);\n }\n $block->setVariable('__ESI__', true);\n $block->setTerminal(true);\n return $block;\n }", "public function unblock($model): bool\n {\n if (! $model instanceof Blockable && ! $model instanceof Blocking) {\n return false;\n }\n\n if (! $this->isBlocking($model)) {\n return false;\n }\n\n return (bool) $this\n ->blocking((new $model)->getMorphClass())\n ->detach($model->getKey());\n }", "public function blockStore()\n {\n $this->setBlocking();\n }", "public function block_user(Request $request) {\n\n try {\n\n DB::beginTransaction();\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'blocker_id'=>'required|exists:users,id',\n ));\n\n if ($validator->fails()) {\n // Error messages added in response for debugging\n $errors = implode(',',$validator->messages()->all());\n\n throw new Exception($errors, 101);\n\n } else {\n\n if($request->blocker_id != $request->id) {\n\n $model = BlockList::where('user_id', $request->id)\n ->where('block_user_id', $request->blocker_id)->first();\n\n if (!$model) {\n\n $model = new BlockList;\n\n $model->user_id = $request->id;\n\n $model->block_user_id = $request->blocker_id;\n\n $model->status = DEFAULT_TRUE;\n\n if ($model->save()) {\n\n\n $response_array = ['success'=>true, 'message'=> Helper::get_message(124)];\n\n } else {\n\n throw new Exception(tr('add_block_user'));\n \n }\n\n } else {\n\n throw new Exception(Helper::error_message(153), 153);\n\n }\n\n } else {\n\n throw new Exception(Helper::error_message(155), 155);\n\n }\n }\n\n DB::commit();\n\n return response()->json($response_array, 200);\n\n }catch(Exception $e) {\n\n DB::rollback();\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$message, 'error_code'=>$code];\n\n return response()->json($response_array);\n\n }\n\n }", "public function ajax_block_one() {\n\n $response = array();\n $object_id = json_decode($this->input->post(\"id\"));\n\n // request for approval if not super admin\n if ($this->session->userdata(\"role\") != USER_SUPER_ADMIN) {\n\n // make notification for seatizen block operation.\n\n // request for block this seatizen. (flag: not followed up yet)\n $notification = array(\n \"source\" => $this->session->userdata(\"id\"),\n \"destination\" => NULL,\n \"type\" => NOTIF_BLOCK_SEATIZEN,\n \"target\" => $object_id,\n \"status\" => false // haven't followed up yet\n );\n\n $this->generic->create($this->_notification_table, $notification);\n\n\n $response[\"status\"] = \"success\";\n $response[\"notification\"] = \"Seatizen block is waiting for super admin approval.\";\n\n } else {\n\n // arrange block configuration\n $result = $this->block($object_id);\n\n if ($result) {\n $response[\"status\"] = \"success\";\n $response[\"notification\"] = \"One item has been blocked.\";\n } else {\n $response[\"status\"] = \"error\";\n $response[\"notification\"] = \"Cannot block item\";\n }\n }\n\n $this->output->set_content_type(\"application/json\");\n $this->output->set_status_header(200);\n $this->output->set_output(json_encode($response));\n }", "public function block() {\n $friendship_relation_exists = $this->micro_relation_exists($this->from, $this->to, \"F\");\n $exists = $this->micro_relation_exists($this->from, $this->to, \"B\");\n\n if($friendship_relation_exists) {\n // Unblock\n if($exists) {\n $this->db->query(\"DELETE FROM user_relation WHERE `from` = ? AND `to` = ? AND `status` = ?\"\n ,array(\n $this->from,\n $this->to,\n \"B\"\n ));\n // Block\n } else {\n $this->db->query(\"INSERT INTO user_relation (`from`, `to`, `status`, `since`) \n VALUES (?, ?, ?, ?)\", array(\n $this->from,\n $this->to,\n \"B\",\n date(\"Y/m/d h:i:s\")\n ));\n }\n\n return true;\n }\n\n return false;\n }", "public function action_block(Request $request)\n {\n\n\n $data = DB::table('posts')->where('posts.id_product','=',$request['id']);\n\n $data = $data->select('id')->first();\n\n $post = post::find($data->id);\n\n $post->status_post = $request['action_block'];\n\n $post->save();\n\n return redirect(url('buy_user'));\n }", "protected function _blockAccess()\n\t{\n\t\t// Set the task\n\t\t$this->_task = 'block';\n\n\t\t// Set page title\n\t\t$this->_buildTitle();\n\n\t\t// Set the pathway\n\t\t$this->_buildPathway();\n\n\t\t// Instantiate a new view\n\t\tif (User::isGuest())\n\t\t{\n\t\t\t$this->_msg = Lang::txt('COM_PUBLICATIONS_PRIVATE_PUB_LOGIN');\n\t\t\treturn $this->_login();\n\t\t}\n\n\t\tNotify::error(Lang::txt('COM_PUBLICATIONS_RESOURCE_NO_ACCESS'));\n\n\t\tApp::redirect(\n\t\t\tRoute::url('index.php?option=' . $this->_option, false)\n\t\t);\n\t}", "public function Admin_Action_SetDefaultBlock() {\n $blockId = $this->_getPOSTRequest ( 'blockId', 0 );\n $query = \"UPDATE\" . \" [|PREFIX|]dynamic_content_block \" . \" SET activated = '1' WHERE blockid = '\" . intval($blockId) . \"'\";\n $this->db->Query ( $query );\n return;\n }", "public function blocked(){\n\t\t$data['user'] = $this->db->get_where('users', ['email' => $this->session->userdata('email')])->row_array();\n\t\t$data['title'] = \"BLOCKED\";\n\t\t$this->load->view('maintemplate/header', $data);\n\t\t$this->load->view('maintemplate/sidebar', $data);\n\t\t$this->load->view('maintemplate/topbar', $data);\n\t\t$this->load->view('home/blocked');\n\t\t$this->load->view('maintemplate/footer');\n\t}", "function block(Request $request)\n {\n DB::table('users')\n ->where('id', $request->id)\n ->update([\n 'active' => '0',\n ]); \n\n AuditTrail::create(['user_id' => Auth::user()->id,\n 'username' => Auth::user()->username,\n 'form_name' => 'Account',\n 'activity' => 'Locked ' . 'Account ' . $request->username, \n ]);\n\n return redirect()->back();\n }", "public function blockGateway(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Updated Gateway to be Blocked';\n $this->auditLogs($ip,$host,$module,$instruction);\n\n $gateway = Gateway::findOrFail($request->GATEWAY_ID);\n $gateway->REG_FLAG = 4;\n $gateway->save();\n\n return \"success\";\n }", "public function lockAndBlock()\n {\n $this->lock();\n }", "public function block($id)\n {\n $user = User::findOrFail($id);\n\n if (Auth::user()->id == $id) {\n return response('Unauthorized action.', 403);\n }\n\n if (Gate::allows('admin', auth()->user())) {\n $user->where('users.id', '=', $id)\n ->update(['blocked' => 1]);\n\n return redirect()->action('UserController@index');\n }\n return response('Unauthorized action.', 403);\n }", "public function block($id)\n {\n $block = $this->selectuser($id,'block');\n if($block[0]['block'] == 1)\n {\n $this->updateuser($id,'block',0);\n }\n else\n {\n $this->updateuser($id,'block',1);\n }\n }", "public function block_request($uri)\n {\n }", "public function saveBlock()\n\t{\n\t}", "public function model()\n {\n return HomeAdsPlacementBlockable::class;\n }", "public function blockUser(Request $request)\n {\n if (Auth::user()->role_id == 1) {\n $user = Users::findOrFail($request->input('user_id'));\n $user->valid = $request->input('action');\n $user->save();\n $data = array( 'text' => 'success' );\n } else {\n $data = array( 'text' => 'fail' . $request->input('action') );\n }\n return Response::json($data);\n }", "public function blockUser($id)\n {\n $this->db->set('status_id', '1');\n $this->db->where('id', $id);\n $this->db->update('inm_user');\n return true;\n }", "public function block()\n {\n $blocker = Yii::$app->cache->get('login_blocker_' . $this->getIp());\n \n if ($blocker === false) {\n $blocker = [1, time(), 0];\n } else { \n $blocker[0]++;\n \n if ($blocker[0] == $this->wrong_login_number) {\n $blocker[1] = time() + $this->time; \n }\n }\n \n Yii::$app->cache->set('login_blocker_' . $this->getIp(), $blocker, $this->time);\n\n return true;\n }", "public function block(User $user,$bool = true)\n {\n if($this->isUser($user)) {\n $this->users()->updateExistingPivot($user->id,[\n \"blocked\" => $bool\n ]);\n return $this->save();\n }\n }", "public function blockAccount() {\n\t\tif(check($this->_userid)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_MEMBID_.\" = ?\", array(1, $this->_userid));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(check($this->_username)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_USERNM_.\" = ?\", array(1, $this->_username));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(check($this->_email)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_EMAIL_.\" = ?\", array(1, $this->_email));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "public function model()\n {\n return BlockAnchor::class;\n }", "public function block(Request $request,$enc_id)\n\t{\t\n\t\t$country_id = base64_decode($enc_id);\n\n\t\t$obj_status = $this->BaseModel->where('id',$country_id)->update(['status'=>'0']);\n\n\t\tif($obj_status){\n\t\t\tSession::flash('success', 'Country status updated successfully.');\n\t\t\treturn redirect($this->module_url_path);\n \t}else{\n \t\tSession::flash('error', 'Something went wrong.');\n\t\t\treturn redirect($this->module_url_path);\n \t}\n\t}", "public function testBlockController()\n {\n $listener = $this->getListener();\n $locker = new ArrayLock();\n $manager = new LockerManager($locker);\n $hashLocker = MutexRequestListener::generateLockName(DemoController::class, 'blockAction', '/');\n\n $this->setUpListener($listener, $manager);\n $event = $this->buildFilterEvent('block');\n\n $listener->onKernelController($event);\n $this->assertTrue($manager->isLocked($hashLocker));\n $this->assertTrue($locker->isLocked($hashLocker));\n $this->assertMutexCounters($manager, $hashLocker, 1);\n\n // Mutex will be raise an http exception when try to call endpoint\n $event2 = $this->buildFilterEvent('block');\n $listener->onKernelController($event2);\n }", "public function edit($bid = false)\n {\n $this->load->model('Blockmodel');\n $this->load->model('Blocktemplatemodel');\n $this->load->model('Pagemodel');\n $this->load->helper('text');\n $this->load->library('form_validation');\n\n if (!$this->checkAccess('MANAGE_PAGE_BLOCKS')) {\n $this->utility->accessDenied();\n return;\n }\n\n //fetch the block details\n $block = array();\n $block = $this->Blockmodel->getDetails($bid);\n if (!$block) {\n $this->utility->show404();\n return;\n }\n\n //Get page Detail\n $pages = array();\n $pages = $this->Pagemodel->detail($block['page_id']);\n if (!$pages) {\n $this->utility->show404();\n return;\n }\n\n //fetch page template\n $blocktemplate = '';\n if ($pages['language_code'] == 'en') {\n $file_name = str_ireplace('/', '_', $pages['page_uri']) . '_' . $block['block_alias'] . '.php';\n } else {\n $file_name = str_ireplace('/', '_', $pages['page_uri']) . '_' . $pages['language_code'] . '_' . $block['block_alias'] . '.php';\n }\n\n if (file_exists(ROOT_APPPATH . \"views/themes/\" . THEME . \"/blocks/\" . $file_name)) {\n //echo $file_name;\n $blocktemplate = file_get_contents(ROOT_APPPATH . \"views/themes/\" . THEME . \"/blocks/\" . $file_name);\n }\n\n $block_template = array();\n $rs = $this->Blocktemplatemodel->listAll();\n foreach ($rs as $item) {\n $block_template[$item['block_template_id']] = $item['block_template_name'];\n }\n\n //validation check\n $this->form_validation->set_rules('block_title', 'Block Title', 'trim|required');\n //$this->form_validation->set_rules('block_alias', 'Block Alias', 'trim|required|callback_validBlock');\n $this->form_validation->set_rules('v_image', 'Block Image', 'trim|required|callback_valid_image');\n $this->form_validation->set_rules('block_link', 'Block Link', 'trim');\n $this->form_validation->set_rules('block_image_alt', 'Alt', 'trim');\n $this->form_validation->set_rules('block_template_id', 'Template', 'trim|required');\n $this->form_validation->set_rules('block_contents', 'Contents', 'trim');\n\n $this->form_validation->set_error_delimiters('<li>', '</li>');\n\n //render view\n if ($this->form_validation->run() == false) {\n $inner = array();\n $page = array();\n $inner['block'] = $block;\n $inner['pages'] = $pages;\n $inner['blocktemplate'] = $blocktemplate;\n $inner['block_template'] = $block_template;\n // $inner['block_type'] = array('1' => 'type 1', '2' => 'type 2', '3' => 'type 3', '4' => 'type 4', '5' => 'type 5', '6' => 'type 6');\n $inner['block_type'] = array('text_block' => 'text block', 'usp_block' => 'Usp block', 'full_image' => 'Full image', 'product_block' => 'Product Block', 'distributor-block' => 'Distributor Block');\n $page['content'] = $this->load->view('block/block-edit', $inner, true);\n $this->load->view('shell', $page);\n } else {\n $this->Blockmodel->updateRecord($block, $pages);\n\n $this->session->set_flashdata('SUCCESS', 'block_updated');\n\n redirect(\"cms/block/index/{$block['page_id']}\");\n exit();\n }\n }", "public function testBlocking()\n {\n $this->module->enableBlockingEmail = true;\n\n $this->specify(\"we have block user\", function () {\n /** @var User $user */\n //$user = $this->getFixture('user')->getModel('active');\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can block user\", $user->block())->true();\n $this->tester->seeEmailIsSent();\n });\n\n $this->specify(\"we have block already blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'blocked');\n expect(\"we can't block already blocked user\", $user->block())->false();\n });\n\n $this->specify(\"we have block unconfirmed user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'unconfirmed');\n expect(\"we can't block unconfirmed user\", $user->block())->false();\n });\n\n $this->module->enableUnblockingEmail = true;\n $this->specify(\"we have unblock blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'blocked');\n expect(\"we can unblock blocked user\", $user->unblock())->true();\n $this->tester->seeEmailIsSent();\n });\n\n $this->specify(\"we have unblock not blocked user\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'unconfirmed');\n expect(\"we can't unblock not blocked user\", $user->unblock())->false();\n $this->tester->dontSeeEmailIsSent();\n });\n\n $this->specify(\"we have unblock user override mail setting\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can unblock user\", $user->unblock(false))->true();\n $this->tester->dontSeeEmailIsSent();\n });\n\n $this->specify(\"we have block user override global email setting\", function () {\n /** @var User $user */\n $user = $this->tester->grabFixture('users', 'active');\n expect(\"we can block user\", $user->block(false))->true();\n $this->tester->dontSeeEmailIsSent();\n });\n }", "function model_owner_block_menu($hook, $type, $return, $params) {\n\tif (elgg_instanceof($params['entity'], 'user')) {\n\t\t$url = \"model/owner/{$params['entity']->username}\";\n\t\t$item = new ElggMenuItem('model', elgg_echo('model'), $url);\n\t\t$return[] = $item;\n\t} else {\n\t\tif ($params['entity']->model_enable != \"no\") {\n\t\t\t$url = \"model/group/{$params['entity']->guid}/all\";\n\t\t\t$item = new ElggMenuItem('model', elgg_echo('model:group'), $url);\n\t\t\t$return[] = $item;\n\t\t}\n\t}\n\n\treturn $return;\n}", "function blockSurfer($surferId, $contactId, $block = TRUE) {\n // Make block value numeric for database\n if ($block) {\n $blockValue = 1;\n } else {\n $blockValue = 0;\n }\n // Try to get the surferlists record for this surfer\n $sql = \"SELECT surferlist_id, surferlist_surferid, surferlist_contact\n FROM %s\n WHERE surferlist_surferid='%s'\n AND surferlist_contact='%s'\";\n $sqlParams = array($this->tableSurferLists,\n $surferId,\n $contactId\n );\n $fieldId = 0;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $fieldId = $row['surferlist_id'];\n }\n }\n // Check whether there is a record\n $success = FALSE;\n if ($fieldId) {\n // Update existing record\n $data = array('surferlist_blocked' => $blockValue);\n $success = $this->databaseUpdateRecord(\n $this->tableSurferLists,\n $data,\n 'surferlist_id',\n $fieldId\n );\n } else {\n // Create a new record\n $data = array('surferlist_surferid' => $surferId,\n 'surferlist_contact' => $contactId,\n 'surferlist_blocked' => $blockValue\n );\n $success = $this->databaseInsertRecord(\n $this->tableSurferLists,\n 'surferlist_id',\n $data\n );\n }\n return $success;\n }", "public function toggleblock()\n {\n $this->checkAjaxToken();\n $this->throwForbiddenUnless(SecurityUtil::checkPermission('Blocks::', '::', ACCESS_ADMIN));\n\n $bid = $this->request->getPost()->get('bid', -1);\n\n if ($bid == -1) {\n throw new Zikula_Exception_Fatal($this->__('No block ID passed.'));\n }\n\n // read the block information\n $blockinfo = BlockUtil::getBlockInfo($bid);\n if ($blockinfo == false) {\n throw new Zikula_Exception_Fatal($this->__f('Error! Could not retrieve block information for block ID %s.', DataUtil::formatForDisplay($bid)));\n }\n\n if ($blockinfo['active'] == 1) {\n ModUtil::apiFunc('Blocks', 'admin', 'deactivate', array('bid' => $bid));\n } else {\n ModUtil::apiFunc('Blocks', 'admin', 'activate', array('bid' => $bid));\n }\n\n return new Zikula_Response_Ajax(array('bid' => $bid));\n }", "public function bloquearUsuario() {\n\t\t$this->id_status = self::STATUS_BLOCKED;\n\t\treturn $this->save () ? $this : null;\n\t}", "public function blockUser($user)\r\n {\r\n return $this->exec('block_user ' . $this->escapePeer($user));\r\n }", "public function block()\n {\n return $this->hasOne(Block::class, 'user_id');\n }", "public static function block()\n\t{\n\t\t$msg = 'No posee permisos para realizar esta acción.';\n\t\tthrow new PublicException($msg);\n\t}", "public function block() {\n return $this->belongsTo(Block::class, 'block_id');\n }", "protected function authorizeBlock()\n {\n try {\n $select = $this->db->select();\n $select->from('gems__user_login_attempts', array('UNIX_TIMESTAMP(gula_block_until) - UNIX_TIMESTAMP() AS wait'))\n ->where('gula_block_until is not null')\n ->where('gula_login = ?', $this->getLoginName())\n ->where('gula_id_organization = ?', $this->getCurrentOrganizationId())\n ->limit(1);\n\n // Not the first login\n if ($block = $this->db->fetchOne($select)) {\n if ($block > 0) {\n $minutes = intval($block / 60) + 1;\n\n // Report all is not well\n return sprintf($this->plural('Your account is temporarily blocked, please wait a minute.', 'Your account is temporarily blocked, please wait %d minutes.', $minutes), $minutes);\n\n } else {\n // Clean the block once it's past\n $values['gula_failed_logins'] = 0;\n $values['gula_last_failed'] = null;\n $values['gula_block_until'] = null;\n $where = $this->db->quoteInto('gula_login = ? AND ', $this->getLoginName());\n $where .= $this->db->quoteInto('gula_id_organization = ?', $this->getCurrentOrganizationId());\n\n $this->db->update('gems__user_login_attempts', $values, $where);\n }\n }\n\n } catch (\\Zend_Db_Exception $e) {\n // Fall through as this does not work if the database upgrade did not run\n // \\MUtil_Echo::r($e);\n }\n\n return true;\n }", "public function block($key)\n {\n Argument::i()->test(1, 'string');\n\t\t\t\n\t\t\t$key = str_replace(array('_', '/'), ' ', $key);\n $key = ucwords($key);\n $key = str_replace(' ', '\\\\', $key);\n\t\t\t$class = $key;\n\t\t\t\n\t\t\tif(!class_exists($class)) {\n\t\t\t\t$class = $this->rootNameSpace.'\\\\Block\\\\' . $key;\n\t\n\t\t\t\tif(!class_exists($class)) {\n\t\t\t\t\t$path = $this->rootPath \n\t\t\t\t\t\t. '/Block/' \n\t\t\t\t\t\t. str_replace('\\\\', '/', trim($key, '\\\\')) \n\t\t\t\t\t\t. '.php';\n\t\t\t\t\t\n\t\t\t\t\tif(!file_exists($path)) {\n\t\t\t\t\t\t$path = $this->rootPath \n\t\t\t\t\t\t\t. '/vendor/' \n\t\t\t\t\t\t\t. str_replace('\\\\', '/', trim($key, '\\\\')) \n\t\t\t\t\t\t\t. '.php';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!file_exists($path)) {\n\t\t\t\t\t\t\tthrow new Exception(sprintf(self::NO_BLOCK, $key));\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\treturn include($path);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(strpos($class, '\\\\') === 0) {\n\t\t\t\t//remove starting \\\\\n \t$class = substr($class, 1);\n\t\t\t}\t\t\t\n \n\t\t\treturn $this->$class();\n }", "public function new() {\n $data = [];\n $this->form_validation->set_rules(Front::BLOCK_NAME, 'Name', Front::REQUIRED);\n $this->form_validation->set_rules(Front::BLOCK_ACRONYM, 'Acronym', Front::REQUIRED);\n $smiles = $this->input->post(Front::BLOCK_SMILES);\n if (!isset($smiles) || $smiles === \"\") {\n $this->form_validation->set_rules(Front::BLOCK_FORMULA, 'Formula', Front::REQUIRED);\n }\n if ($this->form_validation->run() === false) {\n $data[Front::ERRORS] = $this->errors;\n $this->renderNew($data);\n return;\n }\n $data[Front::ERRORS] = 'Block correctly saved';\n try {\n $blockTO = $this->setupNewBlock($smiles);\n $this->database->insert($blockTO);\n } catch (IllegalArgumentException $exception) {\n $data[Front::ERRORS] = $exception->getMessage();\n Logger::log(LoggerEnum::WARNING, $exception->getTraceAsString());\n } catch (UniqueConstraintException $exception) {\n $data[Front::ERRORS] = self::BLOCK_WITH_THIS_ACRONYM_ALREADY_IN_DATABASE;\n Logger::log(LoggerEnum::WARNING, $exception->getMessage());\n } catch (Exception $exception) {\n $data[Front::ERRORS] = $exception->getMessage();\n Logger::log(LoggerEnum::ERROR, $exception->getTraceAsString());\n } finally {\n Front::errorsCheck($data);\n $this->renderNew($data);\n }\n }", "public function blockUser($id)\n {\n $this->db->set('status_id', '1');\n $this->db->where('id', $id);\n $this->db->update('temp_user');\n return true;\n }", "public function setStealthModeBlocked($val)\n {\n $this->_propDict[\"stealthModeBlocked\"] = $val;\n return $this;\n }", "function setBlockMode($blockMode)\n {\n $this->_blockMode = $blockMode;\n }", "public function edite_block(){\r\n\t\tif($this->has_admin_panel()){\r\n if(isset($_GET['id'])) return $this->module_edite_block($_GET['id']);\r\n //access denied\r\n return $this->module_no_permission();\r\n }\r\n\t\treturn core\\router::jump_page(404);\t\r\n\t}", "function changeUserBlock( $cid=null, $block=1, $option ) {\r\n\tglobal $database;\r\n\r\n\t$action = $block ? 'блокировки' : 'разблокировки';\r\n\r\n\tif (count( $cid ) < 1) {\r\n\t\techo \"<script type=\\\"text/javascript\\\"> alert('Выберите объект для $action'); window.history.go(-1);</script>\\n\";\r\n\t\texit;\r\n\t}\r\n\r\n\t$msg = checkUserPermissions( $cid, $action );\r\n\tif ($msg) {\r\n\t\techo \"<script type=\\\"text/javascript\\\"> alert('\".$msg.\"'); window.history.go(-1);</script>\\n\";\r\n\t\texit;\r\n\t}\r\n\r\n\tmosArrayToInts( $cid );\r\n\t$cids = 'id=' . implode( ' OR id=', $cid );\r\n\r\n\t$query = \"UPDATE #__users\"\r\n\t. \"\\n SET block = \" . (int) $block\r\n\t. \"\\n WHERE ( $cids )\"\r\n\t;\r\n\t$database->setQuery( $query );\r\n\tif (!$database->query()) {\r\n\t\techo \"<script> alert('\".$database->getErrorMsg().\"'); window.history.go(-1); </script>\\n\";\r\n\t\texit();\r\n\t}\r\n\r\n\t// if action is to block a user\r\n\tif ( $block == 1 ) {\r\n\t\tforeach( $cid as $id ) {\r\n\t\t// delete user acounts active sessions\r\n\t\t\tlogoutUser( $id, 'users', 'block' );\r\n\t\t}\r\n\t}\r\n\r\n\tmosRedirect( 'index2.php?ca='. $option );\r\n}", "public function getIsBlock();", "public function ajax_unblock_one() {\n\n $response = array();\n $object_id = json_decode($this->input->post(\"id\"));\n\n // request for approval if not super admin\n if ($this->session->userdata(\"role\") != USER_SUPER_ADMIN) {\n\n // make notification for seatizen block operation.\n\n // request for unblock this seatizen. (flag: not followed up yet)\n $notification = array(\n \"source\" => $this->session->userdata(\"id\"),\n \"destination\" => NULL,\n \"type\" => NOTIF_UNBLOCK_SEATIZEN,\n \"target\" => $object_id,\n \"status\" => false // haven't followed up yet\n );\n\n $this->generic->create($this->_notification_table, $notification);\n\n $response[\"status\"] = \"success\";\n $response[\"notification\"] = \"Seatizen unblock is waiting for super admin approval.\";\n\n } else {\n // arrange unblock configuration\n $result = $this->unblock($object_id);\n\n if ($result) {\n $response[\"status\"] = \"success\";\n $response[\"notification\"] = \"One item has been unblocked.\";\n } else {\n $response[\"status\"] = \"error\";\n $response[\"notification\"] = \"Cannot unblock item\";\n }\n }\n\n $this->output->set_content_type(\"application/json\");\n $this->output->set_status_header(200);\n $this->output->set_output(json_encode($response));\n }", "public static function admin_user_block(Request $request, $id = null, $status = null) {\n try {\n $user = User::findorfail($id);\n\n if ($status == 1) {\n\n if ($user->status == 'block')\n return Redirect::back()->withErrors(__('admin_user.user_a_block'))->withInput();\n\n DB::Table('users')->where('id', $user->id)->update(array(\n 'status' => 'block',\n 'updated_at' => new \\DateTime\n ));\n\n return Redirect::back()->with('status', __('admin_user.user_block'));\n }\n else {\n if ($user->status == 'active')\n return Redirect::back()->withErrors(__('admin_user.user_a_unblock'))->withInput();\n\n DB::Table('users')->where('id', $user->id)->update(array(\n 'status' => 'active',\n 'updated_at' => new \\DateTime\n ));\n\n return Redirect::back()->with('status', __('admin_user.user_unblock'));\n }\n } catch (\\Exception $e) {\n return Redirect::back()->witherrors($e->getMessage())->withInput();\n }\n }", "public function handle()\n {\n if (env('DONT_ENABLE_BLOCKED_ITEMS', false) === true) {\n\n return;\n }\n\n $L = $this->L = FEGSystemHelper::setLogger($this->L, \"enable-blocked-items.log\", \"FEGEnableBlockedItems/EnableBlockedItems\", \"ENABLE_BLOCKED_ITEMS\");\n $L->log('Start getting blocked items');\n\n //$blocked_items = \\DB::select(\"SELECT id FROM requests WHERE blocked_at <= (NOW() - INTERVAL \".env('ENABLE_BLOCKED_ITEMS_TIME').\" MINUTE )\");\n //$blocked_items = managefegrequeststore::where('blocked_at', '<=',date(\"Y-m-d h:i:s\",strtotime(date(\"Y-m-d h:i:s\").\" +10 minutes\")))->get();\n $blocked_items = managefegrequeststore::whereNotNull('blocked_at')->get();\n $count = count($blocked_items);\n $L->log($count.' Blocked records found');\n $blocked_items_ids = implode(',',$blocked_items->pluck('id')->all());\n $L->log(' Blocked records IDs = '.$blocked_items_ids);\n foreach($blocked_items as $blocked_item)\n {\n $L->log('Checking condition '.date(\"Y-m-d H:i:s\",strtotime($blocked_item->blocked_at.\" +\".env('ENABLE_BLOCKED_ITEMS_TIME',10).\" minutes\")) .' < '. date(\"Y-m-d H:i:s\"));\n $L->log('Checking condition '.date(\"Y-m-d H:i:s\") .' - '. $blocked_item->blocked_at .'>='. env('ENABLE_BLOCKED_ITEMS_TIME',10) );\n\n $blockedDateTime = \\DateTime::createFromFormat('Y-m-d H:i:s',$blocked_item->blocked_at);\n $blockedTimeStamp = $blockedDateTime->getTimestamp();\n $elapsedTime = (time() - $blockedTimeStamp)/60.00;\n if($elapsedTime >= env('ENABLE_BLOCKED_ITEMS_TIME',10))\n {\n \\DB::update('update requests set blocked_at = null WHERE id = '.$blocked_item->id);\n $L->log('table requests blocked_at field set to null where id = '.$blocked_item->id.'and blocked_at = '.$blocked_item->blocked_at );\n }\n else\n {\n $L->log('table requests blocked_at field not set to null where id = '.$blocked_item->id.'and blocked_at = '.$blocked_item->blocked_at );\n }\n }\n\n $L->log('Cron job for updating blocked items END');\n return true;\n }", "public function unblock_user(Request $request) {\n\n try {\n\n DB::beginTransaction();\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'blocker_id'=>'required|exists:users,id',\n ));\n\n if ($validator->fails()) {\n // Error messages added in response for debugging\n $errors = implode(',',$validator->messages()->all());\n\n throw new Exception($errors, 150);\n\n } else {\n\n $model = BlockList::where('block_user_id', $request->blocker_id)\n ->where('user_id', $request->id)->first();\n\n if ($model) {\n\n if ($model->delete()) {\n\n $blocked_user = User::find($request->blocker_id);\n\n $no_of_followers = Follower::where('user_id', $request->blocker_id)->count();\n\n $data = [\n 'id' => $request->id,\n 'name' => $blocked_user->name,\n 'email' => $blocked_user->email,\n 'picture' => $blocked_user->picture,\n 'description' => $blocked_user->description, \n 'follower_id' => $blocked_user->id,\n 'status' => DEFAULT_FALSE,\n 'is_block' => DEFAULT_FALSE,\n 'no_of_followers'=>$no_of_followers ? $no_of_followers : 0\n ];\n\n $response_array = ['success'=>true, 'message'=> Helper::get_message(125), 'data'=>$data];\n\n } else {\n\n throw new Exception(tr('cound_not_unblock'));\n \n }\n\n } else {\n\n throw new Exception(Helper::error_message(150), 150);\n\n }\n\n }\n\n DB::commit();\n\n return response()->json($response_array, 200);\n\n } catch (Exception $e) {\n\n DB::rollback();\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$message, 'error_code'=>$code];\n\n return response()->json($response_array);\n\n }\n\n }", "public function Admin_Action_ShowBlockForm() {\n $ssf = new SendStudio_Functions ( );\n $action = 'new';\n $GLOBALS ['blockid'] = (isset ( $_GET ['id'] ) && $_GET ['id'] > 0) ? $_GET ['id'] : md5(rand ( 1, 100000000 ));\n $GLOBALS ['tagid'] = (isset ( $_GET ['tagId'] ) && $_GET ['tagId'] > 0) ? $_GET ['tagId'] : 0;\n $GLOBALS ['blockaction'] = (isset ( $_GET ['id'] ) && $_GET ['id'] > 0) ? 'edit' : 'new';\n $GLOBALS ['BlockEditor'] = $ssf->GetHTMLEditor ( '', false, 'blockcontent', 'exact', 260, 630 );\n $GLOBALS ['CustomDatepickerUI'] = $this->template_system->ParseTemplate('UI.DatePicker.Custom_IEM', true);\n $this->template_system->ParseTemplate ( 'dynamiccontentblocks_form' );\n }", "public static function deny($gate, $model = null){\n\t\tif( !Gate::allows($gate, $model)){\n\t\t\tabort(401);\n\t\t}\n\t}", "public function ban(User $user, User $model)\n {\n return $user->isAllowedTo(\"update.user.{$model->id}\");\n }", "public function actionCreate()\n {\n $model = new InfoBlocks();\n $model->structure_id = Yii::$app->request->get('structure_id');\n $model->type = Yii::$app->request->get('type');\n $model->is_publish = 1;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if($model->type == 'gallery') {\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n $part = Structure::findOne($model->structure_id);\n if($part->type_id !== 2) {\n return $this->redirect($part->getAdminUrl());\n }\n return $this->redirect(['index', 'id' => $model->structure_id]);\n }\n\n return $this->render('create', [\n 'model' => $model\n ]);\n }", "public function onBlockBreak(\\pocketmine\\event\\block\\BlockBreakEvent $event) {\r\n\r\n if($event->getBlock()->getLevel()->getName() == $this->getName()) {\r\n\r\n $event->setCancelled();\r\n\r\n }\r\n\r\n }", "public function apply_block_supports()\n {\n }", "public function actionCreate()\n {\n $model = new AppBootPictureBlock();\n\n $model->sort = 0;\n $model->status = '1';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $this->success();\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function onBlockReplace(BlockFormEvent $event): void {\n\n $arenaHandler = PracticeCore::getArenaHandler();\n\n $duelHandler = PracticeCore::getDuelHandler();\n\n $arena = $arenaHandler->getArenaClosestTo($event->getBlock());\n $cancel = false;\n if(!is_null($arena) and ($arena->getArenaType() === PracticeArena::DUEL_ARENA)) {\n if($duelHandler->isArenaInUse($arena->getName())) {\n $duel = $duelHandler->getDuel($arena->getName(), true);\n if($duel->isDuelRunning()) {\n if($event->getNewState() instanceof Liquid)\n $duel->addBlock($event->getBlock());\n else $cancel = true;\n }\n else $cancel = true;\n } else {\n $cancel = true;\n }\n } else {\n $cancel = true;\n }\n\n if($cancel === true) $event->setCancelled();\n }", "public function block(): Repository\n {\n return $this->belongsTo('Neoflow\\\\CMS\\\\Model\\\\BlockModel', 'block_id');\n }", "public function getBlock(){\n\t\n\t\tif( empty($this->_block) ){\n\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n\t\t\t\n\t\t\t$query->select( 'b.*, t.*, u.*, m.email AS modified_email, m.username AS modified_username, m.name AS modified_name' );\n\t\t\t\n\t\t\t$query->from( '#__zbrochure_content_blocks AS b' );\n\t\t\t\n\t\t\t$query->join( 'LEFT', '#__users AS u ON u.id = b.content_block_created_by' );\n\t\t\t$query->join( 'LEFT', '#__users AS m ON m.id = b.content_block_modified_by' );\n\t\t\t$query->join( 'LEFT', '#__zbrochure_content_types AS t ON t.content_type_id = b.content_block_type' );\n\t\t\t\n\t\t\t$query->where( 'b.content_block_id = '.$this->_id );\n\t\t\t\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_block = $this->_db->loadObject();\n\t\t\t\n\t\t\t$this->_block->render\t= $this->_getContent();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $this->_block;\n\t\n\t}", "public function actionBlockmatrix($id){\n\n $matrix = $this->findModelMatrix($id);\n if ($matrix->getAttribute('active_flag')) {\n $matrix->setAttribute('active_flag', 0);\n $matrix->save();\n Yii::$app->getSession()->setFlash('success','Matrix has been inactivated');\n } else {\n $Allmatrixes = TestValuesMatrix::find()->where(['and', \"test_id=\" . $matrix->getAttribute('test_id'), \"id<>\" . $matrix->getAttribute('id')])->all();\n\n foreach($Allmatrixes as $model){\n if($model->getAttribute('active_flag')){\n $model->setAttribute('active_flag', 0);\n $model->save();\n }\n }\n\n $matrix->setAttribute('active_flag', 1);\n $matrix->save();\n Yii::$app->getSession()->setFlash('success', 'Matrix has been activated');\n }\n return $this->redirect(['create', 'id' => $matrix->test_id]);\n }", "public function isBlocked()\n {\n return $this->getStatus() == self::STATUS_BLOCKED;\n }", "protected static function model()\n {\n foreach (self::fetch('resources/models', false) as $file) {\n Bus::need($file);\n }\n }", "public function block_restaurant() {\n\n $restaurant = Restaurant::where('id',$_POST['restaurant_id'])->first();\n $restaurant->status = $_POST['status'];\n $restaurant->save();\n\n if(!$restaurant){\n $finalResult = array('msg' => 'error', 'response' => 'Something went');\n echo json_encode($finalResult);\n exit;\n }else{ \n $finalResult = array('msg' => 'success', 'response' => 'Restaurant has been blocked successfully.');\n echo json_encode($finalResult);\n exit;\n }\n }", "public function setIsBlocked($bool);", "public function onclick_btn_do_block($e){\r\n\t\tif($this->has_admin_panel()) return $this->module_onclick_btn_do_block($e);\r\n\t\treturn $this->msg->modal_no_permission($e);\r\n\t}", "public function Admin_Action_UpdateBlock() {\n $blockId = $this->_getPOSTRequest ( 'blockid', 0 );\n $tagId = $this->_getPOSTRequest ( 'tagid', 0 );\n $name = $this->_getPOSTRequest ( 'name', 0 );\n $rules = $this->_getPOSTRequest ( 'rules', 0 );\n $activated = $this->_getPOSTRequest ( 'activated', 0 );\n $sortorder = $this->_getPOSTRequest ( 'sortorder', -1 );\n\n if (intval($activated) == 1) {\n \t$query = \"UPDATE [|PREFIX|]dynamic_content_block \"\n . \" SET activated = '0' \"\n . \" WHERE tagid = '\".intval($tagId).\"'\";\n $result = $this->db->Query ( $query );\n }\n\n\n $query = \"UPDATE [|PREFIX|]dynamic_content_block \"\n . \" SET name = '\".$this->db->Quote($name).\"'\"\n . \", rules = '\".$this->db->Quote($rules).\"'\"\n . \", activated = '\".intval($activated).\"'\"\n . \", sortorder = '\".$sortorder.\"'\"\n . \" WHERE blockid = '\".intval($blockId).\"'\";\n if (strlen($blockId) == 32) {\n $query = \"INSERT INTO [|PREFIX|]dynamic_content_block (tagid, name, rules, activated, sortorder) VALUES ('$tagId', '{$this->db->Quote($name)}', '{$this->db->Quote($rules)}', '$activated', '$sortorder')\";\n }\n $result = $this->db->Query ( $query );\n if ($result && strlen($blockId) == 32) {\n $blockId = $this->db->LastId('[|PREFIX|]dynamic_content_block');\n }\n\n echo $blockId;\n return;\n }", "public function blockUser($id) {\n\t\t//Argument 1 must be a string, integer\n\t\tEden_Twitter_Error::i()->argument(1, 'string', 'int');\t\n\t\t\n\t\t//if it is integer\n\t\tif(is_int($id)) {\n\t\t\t//lets put it in our query\n\t\t\t$this->_query['user_id'] = $id;\n\t\t//else it is string\n\t\t} else {\n\t\t\t//lets put it in our query\n\t\t\t$this->_query['screen_name'] = $id;\n\t\t}\n\t\t\n\t\treturn $this->_post(self::URL_CREATE_BLOCKING, $this->_query);\n\t}", "public function process() \n\t{\n\t\t$aUser = $this->getParam('aUser');\n\t\t$iUserId = (int)$aUser['user_id'];\n\t\t\n\t\t//Get type\n\t\t$sType = $this->request()->get('req3');\n\t\t$bIsVisible = true;\n\t\tif($sType != 'game')\n\t\t{\n\t\t\t$bIsVisible = false;\n\t\t\t\n\t\t\t$this->template()->assign(array(\n\t\t\t'bIsVisible' => $bIsVisible\n\t\t\t));\n\t\t\treturn 'block';\n\t\t}\n\t\t\n\t\t//Security\n\t\tif (!Phpfox::getService('user.privacy')->hasAccess($iUserId, 'profile.view_profile'))\n\t\t\treturn Phpfox::getLib('module')->setController('profile.private');\t\t\t\n\t\t\n\t\tif (!Phpfox::getService('user.privacy')->hasAccess($iUserId, 'medialibrary.display_on_profile'))\n\t\t\treturn;\n\n\t\t//Get plateformes\n\t\t$aPlatforms = Phpfox::getService('medialibrary.game')->getGamePlatformCountsPerUser($iUserId);\n\n\t\t$this->template()->assign(array(\n\t\t\t'aPlatforms' => $aPlatforms,\n\t\t\t'bIsVisible' => $bIsVisible,\n\t\t\t'sHeader' => Phpfox::getPhrase('medialibrary.block_platforms')\n\t\t));\n\t\treturn 'block';\n\t}", "public static function blockSettlementRequest($request, $note = null);", "public function onCollideWithBlock(Block $block) : void {\n\t}", "public function blockPharmacy($pharmacyId)\n {\n $pharmacy = Pharmacist::find($pharmacyId);\n\n $pharmacy->pharmacistStatus = '0';\n $pharmacy->save();\n return redirect('/admin/viewAllPharmacies')->with('message', 'Block successful');\n }", "public function getBlock()\n {\n return $this->block;\n }", "function getBlock()\n {\n\t\t$args = new safe_args();\n\t\t$args->set('app_name', \t$_SESSION['customization']['applications']['app_name'], 'sqlsafe');\n\t\t$args->set('block_id', \tNOTSET, 'sqlsafe');\n\t\t$args = $args->get(func_get_args());\n\t\t$GLOBALS['appshore_data']['server']['xml_render'] = true;\t\n\t\t\n\t\tif( $args['block_id'] )\n\t\t\t$result['customization'] = getManyAssocArrays('select * from db_blocks where app_name = \"'.$args['app_name'].\n\t\t\t\t'\" and block_id = \"'.$args['block_id'].'\"');\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t$result['return'] = 'success';\n\t\t$result['message'] = '';\n \t\treturn $result;\n }", "public function block($context_path, $parameters = array()) \n {}", "public function block($context_path, $parameters = array()) \n {}", "function before_block( $instance ) {\n\t\t}", "public function get_twit_block() {\r\n if (is_ajax_req()) {\r\n $this->load->view('ajax/ajax_get_twit_block_view');\r\n }\r\n }", "public function isBlockable()\n {\n if ($this->_hasVar('user_blockable')) {\n return (boolean) $this->_getVar('user_blockable');\n } else {\n return true;\n }\n }", "public static function FindById($id){\r\n\t\t$block=new GBlock();\r\n\t\t$db=blocks::model()->findByPk($id);\r\n\t\tif ($db==null) return null;\r\n\t\t$block->db=$db;\r\n\t\treturn $block;\r\n\t}", "function myblocks() {\n $this->name=\"myblocks\";\n $this->title=\"<#LANG_MODULE_MYBLOCKS#>\";\n $this->module_category=\"<#LANG_SECTION_SETTINGS#>\";\n $this->checkInstalled();\n}", "function unblock_process($blocker) {\n set_field('block_courseprefs_config', 'value', 'DONE', 'name', $blocker);\n}", "public static function blockFriend($friendUserID)\n {\n if(!Friends::isBlocked($friendUserID))\n return;\n\n if(Friends::isRelationExists($friendUserID))\n $relation = Friends::relation($friendUserID)->first();\n else\n $relation = new Friends();\n\n $relation->addUsers(UserUtil::getUsersIdElseLoggedInUsersId(), $friendUserID);\n\n $relation->setStatus(3);\n\n $relation->save();\n }", "public static function setUserBlock(User $user)\n {\n $user->block = 1;\n $user->update();\n return true;\n }", "public function __construct()\n {\n $this->middleware('view')->except([\"findBlockName\"]);\n }", "public function update(BlockRequest $request, $id)\n {\n $requestData = $request->all();\n $company_id = $this->CurrentCompany->id;\n\n// if($validator->fails()){\n// return $this->sendError('Validation Error.', $validator->errors());\n// }\n\n $block_id = $this->blockRepository->update(\n $id,\n $company_id,\n $requestData\n );\n //output\n return $this->sendResponse('block_id:'.$block_id, 'Block updated successfully.');\n }", "public static function block($id, $blocking_id){\n if(!Auth::check() || !(Auth::user()->id == $id)) return 1;\n if($id === $blocking_id) return 2;\n return 0;\n }", "function checkBlock() {\n global $serendipity;\n\n if (empty($this->staticblock['template'])) {\n $this->staticblock['template'] = 'plugin_staticblock.tpl';\n }\n if (empty($this->staticblock['timestamp'])) {\n $this->staticblock['timestamp'] = time();\n }\n if (empty($this->staticblock['last_modified'])) {\n $this->staticblock['last_modified'] = time();\n }\n if (empty($this->staticblock['authorid'])) {\n $this->staticblock['authorid'] = $serendipity['authorid'];\n }\n if (empty($this->staticblock['author'])) {\n $this->staticblock['author'] = $serendipity['serendipityUser'];\n }\n if (empty($this->staticblock['type'])) {\n if (isset($serendipity['POST']['type'])) {\n $this->staticblock['type'] = $serendipity['POST']['type'];\n } else {\n $this->staticblock['type'] = 'template';\n }\n }\n }", "public function setBlocked($Blocked = null)\n {\n $this->Blocked = $Blocked;\n return $this;\n }", "function block_instance($blockname, $instance = NULL) {\n if(!block_load_class($blockname)) {\n return false;\n }\n $classname = 'CourseBlock_'.$blockname;\n $retval = New $classname;\n if($instance !== NULL) {\n $retval->load_instance($instance);\n }\n return $retval;\n}", "public function blockIllegalRequests(ActionRequest $request);", "public function beforeFilter() {\n parent::beforeFilter();\n $this->loadModel('Label');\n $this->loadModel('Management');\n $this->loadModel('AccessLog');\n $this->loadModel('Bookmark');\n $this->loadModel('Tag');\n $this->loadModel('Device');\n $this->loadModel('User');\n $this->loadModel('Plan');\n $this->loadModel('Link');\n $this->Auth->deny();\n }", "function showblock($block,$editable,$standalone=False)\n\t\t{\n\t\t\tglobal $page_id,$cat_id, $inputblockid;\n\t\t\t//TODO: wrap a module storage around createmodule as in template3,\n\t\t\t//TODO: so that we do not create the same module object twice\n\t\t\t$moduleobject =& $this->modulebo->createmodule($block->module_name);\n\n\t\t\tif (count($this->sitelanguages) > 1)\n\t\t\t{\n\t\t\t\t$langs = array();\n\t\t\t\tforeach ($this->sitelanguages as $lang)\n\t\t\t\t{\n\t\t\t\t\t$langs[$lang] = $GLOBALS['Common_BO']->getlangname($lang);\n\t\t\t\t}\n\t\t\t\t$langselect = html::select('savelanguage',$this->worklanguage,$langs,false,' onchange=\"this.form.submit()\"');\n\t\t\t}\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'moduleinfo' => $block->module_name,\n\t\t\t\t'description' => lang($moduleobject->description),\n\t\t\t\t'savelang' => $langselect\n\t\t\t));\n\n\t\t\t//if the block is in our scope and we are entitled we edit it\n\t\t\tif ($editable)\n\t\t\t{\n\t\t\t\t$editorstandardelements = array(\n\t\t\t\t\tarray('label' => lang('Title'),\n\t\t\t\t\t\t\t'form' => ('<input type=\"text\" name=\"inputblocktitle\" value=\"' .\n\t\t\t\t\t\t\thtmlspecialchars(isset($block->title) ? $block->title : $moduleobject->title) . '\" />')\n\t\t\t\t\t),\n\t\t\t\t\tarray('label' => lang('Seen by'),\n\t\t\t\t\t\t\t'form' => ('<select name=\"inputblockview\">' .\n\t\t\t\t\t\t\t$this->inputviewselect((int)$block->view) . '</select>')\n\t\t\t\t\t),\n\t\t\t\t\tarray('label' => lang('Sort order'),\n\t\t\t\t\t\t\t'form' => ('<input type=\"text\" name=\"inputblocksort\" size=\"2\" value=\"' .\n\t\t\t\t\t\t\t(int)$block->sort_order . '\">')\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tif ($standalone)\n\t\t\t\t{\n\t\t\t\t\t$editorstandardelements[] = array(\n\t\t\t\t\t\t'label' => lang('Scope'),\n\t\t\t\t\t\t'form' => $this->blockscope($block->cat_id,$block->page_id,True)\n\t\t\t\t\t);\n\t\t\t\t\t$editorstandardelements[] = array(\n\t\t\t\t\t\t'label' => lang('Area'),\n\t\t\t\t\t\t'form' => $this->blockarea($block,True)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$moduleobject->set_block($block);\n\n\t\t\t\t$this->t->set_var(Array(\n\t\t\t\t\t'blockid' => $block->id,\n\t\t\t\t\t'validationerror' => (($block->id == $inputblockid) && $this->errormsg) ? join('<br>',$this->errormsg) : '',\n\t\t\t\t));\n\t\t\t\t$this->t->set_var('standardelements','');\n\t\t\t\twhile (list(,$element) = each($editorstandardelements))\n\t\t\t\t{\n\t\t\t\t\t$this->t->set_var(Array(\n\t\t\t\t\t\t'label' => $element['label'],\n\t\t\t\t\t\t'form' => $element['form']\n\t\t\t\t\t));\n\t\t\t\t\t$this->t->parse('standardelements','EditorElement', true);\n\t\t\t\t}\n\n\t\t\t\t$versions = $this->bo->getallversionsforblock($block->id,$this->worklanguage);\n\t\t\t\t$this->t->set_var('EvBlock','');\n\t\t\t\twhile (list($version_id,$version) = each($versions))\n\t\t\t\t{\n\t\t\t\t\t//set the version of the block which is referenced by the moduleobject,\n\t\t\t\t\t//so that we retrieve a interface with the current version's arguments\n\t\t\t\t\t$block->set_version($version);\n\t\t\t\t\t$editormoduleelements = $moduleobject->get_user_interface();\n\t\t\t\t\t$this->t->set_var(array(\n\t\t\t\t\t\t'version_id' => $version_id,\n\t\t\t\t\t\t'state' => $GLOBALS['Common_BO']->inputstateselect($version['state']),\n\t\t\t\t\t\t'deleteversion' => lang('Delete Version'),\n\t\t\t\t\t\t'versionelements' => ''\n\t\t\t\t\t));\n\t\t\t\t\twhile (list(,$element) = each($editormoduleelements))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->t->set_var(Array(\n\t\t\t\t\t\t\t'label' => $element['label'],\n\t\t\t\t\t\t\t'form' => $element['form']\n\t\t\t\t\t\t));\n\t\t\t\t\t\t$this->t->parse('versionelements',$element['large']?'EditorElementLarge':'EditorElement', true);\n\t\t\t\t\t}\n\t\t\t\t\t$this->t->parse('EvBlock','Version', true);\n\t\t\t\t}\n\n\t\t\t\t$this->t->parse('MeBlock','Moduleeditor');\n\t\t\t\t$this->t->set_var('MvBlock','');\n\t\t\t}\n\t\t\t//otherwise we only show it\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($block->page_id)\n\t\t\t\t{\n\t\t\t\t\t$blockscope = lang('Page');\n\t\t\t\t}\n\t\t\t\telseif ($block->cat_id != CURRENT_SITE_ID)\n\t\t\t\t{\n\t\t\t\t\t$cat = $this->cat_bo->getCategory($block->cat_id);\n\t\t\t\t\t$blockscope = lang('Category') . ' - ' . $cat->name;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$blockscope = lang('Site');\n\t\t\t\t}\n\n\t\t\t\t$viewstandardelements = array(\n\t\t\t\t\tarray('label' => lang('Scope'),\n\t\t\t\t\t\t\t'value' => $blockscope\n\t\t\t\t\t),\n\t\t\t\t\tarray('label' => lang('Area'),\n\t\t\t\t\t\t\t'value' => $block->area\n\t\t\t\t\t),\n\t\t\t\t\tarray('label' => lang('Title'),\n\t\t\t\t\t\t\t'value' => ($block->title ? $block->title : $moduleobject->title)\n\t\t\t\t\t),\n\t\t\t\t\tarray('label' => lang('Seen by'),\n\t\t\t\t\t\t\t'value' => $this->viewable[(int)$block->view]\n\t\t\t\t\t),\n\t\t\t\t\tarray('label' => lang('Sort order'),\n\t\t\t\t\t\t\t'value' => (int)$block->sort_order\n\t\t\t\t\t)\n\t\t\t\t);\n// $viewmoduleelements = array();\n// while (list($argument,$argdef) = @each($moduleobject->arguments))\n// {\n// $value = $block->arguments[$argument];\n// $viewmoduleelements[] = array(\n// 'label' => $argdef['label'],\n// 'value' => $GLOBALS['egw']->strip_html($value)\n// );\n// }\n// $interface = array_merge($viewstandardelements,$viewmoduleelements);\n\t\t\t\t$interface = $viewstandardelements;\n\t\t\t\t$this->t->set_var('VeBlock','');\n\t\t\t\twhile (list(,$element) = each($interface))\n\t\t\t\t{\n\t\t\t\t\t$this->t->set_var(Array(\n\t\t\t\t\t\t'label' => $element['label'],\n\t\t\t\t\t\t'value' => $element['value'])\n\t\t\t\t\t);\n\t\t\t\t\t$this->t->parse('VeBlock','ViewElement', true);\n\t\t\t\t}\n\t\t\t\t$this->t->parse('MvBlock','Moduleview');\n\t\t\t\t$this->t->set_var('MeBlock','');\n\t\t\t}\n\t\t}", "function pnCPG_blockblock_init()\n{\n // Security\n pnSecAddSchema('pnCPG:block:', 'Block title::');\n}", "public static function start_block()\n\t{\n\t\tself::$nivel_cabecalho += 1;\n\t}", "public function block(BanUserValidator $input, $userId): RedirectResponse\n {\n $user = $this->usersRepository->find($userId);\n\n if (auth()->user()->id === $user->id) { // The given user is the currently authencated user.\n flash('Je kan jezelf helaas niet blokkeren.')->warning();\n return redirect()->route('users.index');\n\t\t}\n\n // TODO: Implementatie voor de blokkering van alle api keys in het systeem.\n // Omdat wanneer een gebruiker geblokkeerd word mag hij zijn sleutels ook niet gebruiken.\n\n $user->ban(['comment' => $input->reason, 'expired_at' => Carbon::parse($input->eind_datum)]);\n flash(\"{$user->name} is geblokkeerd tot {$input->end_date}.\")->success();\n\n return redirect()->route('users.index');\n }" ]
[ "0.70781046", "0.67674917", "0.66868395", "0.63721085", "0.6241705", "0.6199661", "0.6120879", "0.60077304", "0.5959452", "0.5919647", "0.5855017", "0.5822905", "0.5740309", "0.5712021", "0.5683392", "0.5660049", "0.5628826", "0.56132895", "0.5609749", "0.55894256", "0.5587952", "0.55876845", "0.55863214", "0.55023", "0.5499524", "0.5451815", "0.5435003", "0.5426633", "0.54244477", "0.54235655", "0.54230446", "0.5405641", "0.5405481", "0.53888035", "0.5382025", "0.53799856", "0.5351477", "0.5350334", "0.5347008", "0.5345081", "0.533722", "0.5330127", "0.5327063", "0.5310256", "0.5296907", "0.52766085", "0.5265085", "0.52621007", "0.523628", "0.52260286", "0.521311", "0.5211", "0.5204425", "0.5189148", "0.51643413", "0.51578885", "0.5150989", "0.5139832", "0.5136312", "0.5128431", "0.5126923", "0.5110421", "0.5097338", "0.50926167", "0.5069433", "0.5065371", "0.5049262", "0.50445956", "0.50341994", "0.50212944", "0.49940372", "0.49833947", "0.49737945", "0.4964445", "0.49639", "0.4955565", "0.49539813", "0.49483603", "0.49314424", "0.49314424", "0.49311543", "0.49123025", "0.49085793", "0.49052334", "0.4902122", "0.4897388", "0.48912334", "0.48890695", "0.48878208", "0.48706654", "0.48702565", "0.4860709", "0.4856761", "0.4853417", "0.4853144", "0.48500097", "0.48450905", "0.48407963", "0.48318973", "0.4829673" ]
0.7396769
0
Unblock a certain model.
public function unblock($model): bool { if (! $model instanceof Blockable && ! $model instanceof Blocking) { return false; } if (! $this->isBlocking($model)) { return false; } return (bool) $this ->blocking((new $model)->getMorphClass()) ->detach($model->getKey()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model_call_unfreeze(Jam_Model $model, Jam_Event_Data $data)\n\t{\n\t\t$this->call_associations_method($model, 'unfreeze');\n\n\t\tforeach ($this->_fields as $name)\n\t\t{\n\t\t\t$model->{$name} = NULL;\n\t\t}\n\n\t\tif ( ! $this->_parent)\n\t\t{\n\t\t\t$model->is_frozen = FALSE;\n\t\t\t$model->is_just_frozen = FALSE;\n\t\t}\n\n\t\t$data->return = $model;\n\t}", "function unblock(Request $request)\n {\n DB::table('users')\n ->where('id', $request->id)\n ->update([\n 'active' => '1',\n ]);\n\n //insert into auditrail\n AuditTrail::create(['user_id' => Auth::user()->id,\n 'username' => Auth::user()->username,\n 'form_name' => 'Account',\n 'activity' => 'Unlocked ' . 'Account ' . $request->username, \n ]);\n\n return redirect()->back();\n }", "public function deactivate();", "function unbindAll() {\n foreach (array(\n 'hasOne' => array_keys($this->hasOne),\n 'hasMany' => array_keys($this->hasMany),\n 'belongsTo' => array_keys($this->belongsTo),\n 'hasAndBelongsToMany' => array_keys($this->hasAndBelongsToMany)\n ) as $relation => $model) {\n $this->unbindModel(array($relation => $model));\n }\n }", "public function deactivate(): void;", "public function unblockStore()\n {\n $this->setBlocking(false);\n }", "abstract public function deactivate();", "protected function deactivateSelf() {}", "public function unblockGateway(Request $request)\n {\n //for audit logs\n $ip = $request->ip();\n $username = auth()->user();\n $host = $username->USERNAME;\n $module = 'Gateway Management';\n $instruction = 'Updated Gateway to be Unregistered';\n $this->auditLogs($ip,$host,$module,$instruction);\n\n $gateway = Gateway::findOrFail($request->GATEWAY_ID);\n $gateway->REG_FLAG = 0;\n $gateway->save();\n\n return \"success\";\n }", "public function unlock()\r\n {\r\n frameEbbs::_()->getModule('backup')->unlock();\r\n }", "public function run()\n {\n Model::unguard();\n\n\n\n }", "public function unlockCommand() {\n\t\tif (@is_file((PATH_typo3conf . 'LOCK_BACKEND'))) {\n\t\t\tunlink(PATH_typo3conf . 'LOCK_BACKEND');\n\t\t\tif (@is_file((PATH_typo3conf . 'LOCK_BACKEND'))) {\n\t\t\t\t$message = 'ERROR: Could not remove lock file \\'typo3conf/LOCK_BACKEND\\'!';\n\t\t\t\t$this->outputLine($message);\n\t\t\t\t$this->logger->error($message);\n\t\t\t\t$this->quit(1);\n\t\t\t} else {\n\t\t\t\t$message = 'Removed lock file \\'typo3conf/LOCK_BACKEND\\'';\n\t\t\t\t$this->outputLine($message);\n\t\t\t\t$this->logger->info($message);\n\t\t\t}\n\t\t} else {\n\t\t\t$message = 'No lock file \\'typo3conf/LOCK_BACKEND\\' was found, hence no lock could be removed.';\n\t\t\t$this->outputLine($message);\n\t\t\t$this->logger->info($message);\n\t\t\t$this->quit(1);\n\t\t}\n\t}", "function unblock($ip_address, $filter) {\n\t\t//define the global variables\n\t\tglobal $firewall_path, $firewall_name;\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//unblock the address\n\t\tif ($firewall_name == 'iptables') {\n\t\t\t$command = $firewall_path.'/./iptables -L '.$filter.' -n --line-numbers | grep \"'.$ip_address.' \" | cut -d \" \" -f1';\n\t\t\t$line_number = trim(shell($command));\n\t\t\techo \"\\n\". $command . \" line \".__line__.\" result \".$result.\"\\n\";\n\t\t\tif (is_numeric($line_number)) {\n\t\t\t\t//$result = shell('iptables -D INPUT '.$line_number);\n\t\t\t\t$command = $firewall_path.'/./iptables -D '.$filter.' '.$line_number;\n\t\t\t\t$result = shell($command);\n\t\t\t\techo \"Unblock address \".$ip_address .\" line \".$line_number.\" command \".$command.\" result \".$result.\"\\n\";\n\t\t\t}\n\t\t}\n\n\t\t//unblock the address\n\t\tif ($firewall_name == 'pf') {\n\t\t\t//example: pfctl -t sip-auth-ip -T delete 127.0.0.5/32\n\t\t\t$command = $firewall_path.'/pfctl -t '.$filter.' -T delete '.$ip_address.'/32';\n\t\t\t$result = shell($command);\n\t\t}\n\n\t\t//send debug information to the console\n\t\tif ($debug) {\n\t\t\techo \"Unblock address \".$ip_address .\"\\n\";\n\t\t}\n\t}", "public function unlock(): void;", "public function deactivate() {\n\n }", "public function deactivate() {\n\n }", "public function unblockThirdparty($id) {\n\t\tif( Auth::user()->hasRole(1) || Auth::user()->hasRole(4) || Auth::user()->hasRole(5) || Auth::user()->hasRole(8) ) {\n\t\t\t$thirdparty = Thirdparty::find($id);\n\t\t\t$thirdparty->status = 0;\n\t\t\t$thirdparty->save();\n\t\t\tSession::flash('flashmessagetxt', 'Unblocked Successfully!!');\n\t\t\treturn Redirect::route('third-party-list');\n\t\t}\n\t}", "public static function deactivate(){\n // Do nothing\n }", "public function unlock(): void {}", "public function unlock(): void {}", "public function unlock(): void {}", "public function unlock(): void {}", "public function unlock(): void {}", "public static function deactivate()\n {\n // Do nothing\n }", "public function unlock() {\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 static function deactivate() {\n\n }", "public function unlockSite() {\n\t\tif (is_resource($this->lockResource)) {\n\t\t\tflock($this->lockResource, LOCK_UN);\n\t\t\tfclose($this->lockResource);\n\t\t}\n\t\t@unlink($this->lockFlagPathAndFilename);\n\t}", "public function unregister()\r\n {\r\n $this->unregisterBlock('l');\r\n }", "public function disable(Module $module);", "public static function uninstallModel() {\r\n return GearSection::dropTables() && GearOption::dropTables();\r\n }", "public static function deactivate() {\n\t\t\t// Do nothing\n\t\t}", "public static function deactivate() {\n\t}", "public function run()\n {\n Model::unguard();\n }", "public static function deactivate() {\n\t\t// Do nothing.\n\t}", "public function unbind(string $name): void;", "public function dropTable($model)\n {\n\t$modelName= is_object($model) ? $model->getTableName() : $model;\n\t$hash= $this->fetchSingle('select hash from [tables] where [name] = %s ',\n\t $modelName);\n\t$sql= array();\n\t$sql[] = $this->sql('delete from [tables] where [name] = %s;', $modelName );\n\t$sql[] = $this->sql('delete from [fields] where [table] = %s;', $modelName );\n\t$sql[] = $this->sql('delete from [indexes] where [table] = %s;', $modelName );\n\n\t$this->queue(\n\t PerfORMStorage::TABLE_DROP,\n\t $modelName,\n\t $sql,\n\t array(\n\t\t'model' => $model)\n\t );\n\n\n\t$key= $hash;\n\tif ( key_exists($key, $this->renamedTables))\n\t{\n\t $array= $this->renamedTables[$key];\n\t $array->counter++;\n\t $array->from= $modelName;\n\t}\n\telse\n\t{\n\t $this->renamedTables[$key]= (object) array(\n\t 'counter' => 1,\n\t 'from' => $modelName,\n\t );\n\t}\n }", "public static function deactivate()\n {\n }", "public function unregisterModelMock($modelClass)\n {\n if (isset($this->_registeredModelMocks[$modelClass])) {\n unset($this->_registeredModelMocks[$modelClass]);\n }\n }", "public static function deactivate(){\n }", "public static function deactivate(){\n }", "public function deactivate(): void\n {\n if ($this->selectedRowsQuery->count() > 0) {\n Role::whereIn('id', $this->selectedKeys())->update(['is_active' => 0]);\n }\n\n $this->resetSelected();\n }", "public function unfollow($model): bool\n {\n if (! $model instanceof Followable && ! $model instanceof Following) {\n return false;\n }\n\n if (! $this->isFollowing($model)) {\n return false;\n }\n\n return (bool) $this->following($model->getMorphClass())->detach($model->getKey());\n }", "public function unblockAccount() {\n\t\tif(check($this->_userid)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_MEMBID_.\" = ?\", array(0, $this->_userid));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(check($this->_username)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_USERNM_.\" = ?\", array(0, $this->_username));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(check($this->_email)) {\n\t\t\t$result = $this->db->query(\"UPDATE \"._TBL_MI_.\" SET \"._CLMN_BLOCCODE_.\" = ? WHERE \"._CLMN_EMAIL_.\" = ?\", array(0, $this->_email));\n\t\t\tif(!$result) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "public static function deactivate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function deactivate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "function _deactivate() {}", "public function unlock($force = false)\n {\n if (!$force && $this->isLocked() && !$this->ownsLock()) {\n throw new RuntimeException(\n 'Cannot unlock'\n );\n }\n\n $this->conn->del('lock:' . $this->name);\n }", "public function deactivate() {\n\t\t\t// just in case I want to do anyting on deactivate\n\t\t}", "public function unguard()\n {\n $this->guard = false;\n }", "function undefine($handle)\n {\n unset($this->mBlockHandles[$handle]);\n }", "public static function setUserUnblock(User $user)\n {\n $user->block = 0;\n $user->update();\n return true;\n }", "private function unlock() {\n\t\tif (file_exists($this -> lockfile)) {\n\t\t\tunlink($this -> lockfile);\n\t\t}\n\t}", "public static function deactivate()\n\t{\n\n\t}", "public function disable() {\n\t\t$this->update(TRUE);\n\t}", "public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }", "public function deactivate( $network_wide ) {\n\t}", "public function unblock_user(Request $request) {\n\n try {\n\n DB::beginTransaction();\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'blocker_id'=>'required|exists:users,id',\n ));\n\n if ($validator->fails()) {\n // Error messages added in response for debugging\n $errors = implode(',',$validator->messages()->all());\n\n throw new Exception($errors, 150);\n\n } else {\n\n $model = BlockList::where('block_user_id', $request->blocker_id)\n ->where('user_id', $request->id)->first();\n\n if ($model) {\n\n if ($model->delete()) {\n\n $blocked_user = User::find($request->blocker_id);\n\n $no_of_followers = Follower::where('user_id', $request->blocker_id)->count();\n\n $data = [\n 'id' => $request->id,\n 'name' => $blocked_user->name,\n 'email' => $blocked_user->email,\n 'picture' => $blocked_user->picture,\n 'description' => $blocked_user->description, \n 'follower_id' => $blocked_user->id,\n 'status' => DEFAULT_FALSE,\n 'is_block' => DEFAULT_FALSE,\n 'no_of_followers'=>$no_of_followers ? $no_of_followers : 0\n ];\n\n $response_array = ['success'=>true, 'message'=> Helper::get_message(125), 'data'=>$data];\n\n } else {\n\n throw new Exception(tr('cound_not_unblock'));\n \n }\n\n } else {\n\n throw new Exception(Helper::error_message(150), 150);\n\n }\n\n }\n\n DB::commit();\n\n return response()->json($response_array, 200);\n\n } catch (Exception $e) {\n\n DB::rollback();\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success'=>false, 'error_messages'=>$message, 'error_code'=>$code];\n\n return response()->json($response_array);\n\n }\n\n }", "public function deactivate( $network_wide ){\n\n\t}", "public function deactivate( $network_wide ){\n\n\t}", "public function dropView($model)\n {\n\t$modelName= is_object($model) ? $model->getTableName() : $model;\n\t$hash= $this->fetchSingle('select hash from [views] where [name] = %s ',\n\t $modelName);\n\t$sql= array();\n\t$sql[] = $this->sql('delete from [views] where [name] = %s;', $modelName );\n\n\t$this->queue(\n\t PerfORMStorage::VIEW_DROP,\n\t $modelName,\n\t $sql,\n\t array(\n\t\t'model' => $model)\n\t );\n\n\n\t$key= $hash;\n\tif ( key_exists($key, $this->renamedViews))\n\t{\n\t $array= $this->renamedViews[$key];\n\t $array->counter++;\n\t $array->from= $modelName;\n\t}\n\telse\n\t{\n\t $this->renamedViews[$key]= (object) array(\n\t 'counter' => 1,\n\t 'from' => $modelName,\n\t );\n\t}\n }", "function lock_release($name) {\n global $locks;\n\n unset($locks[$name]);\n db_delete('semaphore')\n ->condition('name', $name)\n ->condition('value', _lock_id())\n ->execute();\n}", "public function deactivate()\n {\n $this->active = 0;\n $this->save();\n\n return $this;\n }", "public static function deny($gate, $model = null){\n\t\tif( !Gate::allows($gate, $model)){\n\t\t\tabort(401);\n\t\t}\n\t}", "public function deactivate($username);", "public function destroy(User $model);", "protected function unlockOldRecord()\n\t{\n\t\tif( $this->lockingObj && $this->keysChanged )\n\t\t\t$this->lockingObj->UnlockRecord($this->tName, $this->oldKeys , \"\");\n\t}", "public function eventUnTaggable($key, $model)\n {\n $model->untag();\n }", "public function restored($model)\n {\n $this->whileForcingUpdate(function () use ($model) {\n $this->saved($model);\n });\n }", "public function destroy(IModel $target);", "public function deactivate( $network_wide ){\n\n\t\t// makes sure our rewrite rules are set\n\t\tflush_rewrite_rules();\n\n\t}", "public function restoring($model)\n\t{\n\t}", "public function blocking($model = null)\n {\n $modelClass = $this->getModelMorphClass($model);\n\n return $this\n ->morphToMany($modelClass, 'blocker', 'blockers', 'blocker_id', 'blockable_id')\n ->withPivot('blockable_type')\n ->wherePivot('blockable_type', $modelClass)\n ->wherePivot('blocker_type', $this->getMorphClass())\n ->withTimestamps();\n }", "public function unlock()\r\n {\r\n $this->locked = false;\r\n\r\n return $this;\r\n }", "function deactivate() {\n\t}", "static function unlock_account() {\n $model = \\Auth::$model;\n\n # hash GET param exists\n if ($hash = data('hash')) {\n\n # verificando se ha algum usuário com a hash.\n $user = $model::first(array(\n 'fields' => 'id, hash_unlock_account',\n 'where' => \"hash_unlock_account = '$hash'\"\n ));\n\n if (!empty($user)) {\n $user->hash_unlock_account = '';\n $user->login_attempts = 0;\n\n $user->edit() ?\n flash('Sua conta foi desbloqueada.') :\n flash('Algo ocorreu errado. Tente novamente mais tarte.', 'error');\n }\n }\n\n go('/');\n }", "public static function forget(Model $sourceObject, array $modelAttributes = null)\n {\n $cacheKeys = static::cacheKeys($sourceObject, $modelAttributes);\n\n foreach ($cacheKeys as $cacheKey) {\n Cache::forget($cacheKey);\n }\n }", "public function disable();", "function unextend() {\n if ($this->observation) {\n $this->observation->cancel();\n $this->observation = NULL;\n }\n }", "public function releaseLock($lockstr)\n {\n if ($this->validateLock($lockstr)) {\n self::$db->query('UPDATE jukebox.playlists SET locktime=NULL WHERE playlistid=$1', [$this->getID()]);\n }\n }", "public function unhold()\n {\n if (!$this->canUnhold()) {\n Mage::throwException(Mage::helper('sales')->__('Unhold action is not available.'));\n }\n $this->setState($this->getHoldBeforeState(), $this->getHoldBeforeStatus());\n $this->setHoldBeforeState(null);\n $this->setHoldBeforeStatus(null);\n\n Mage::dispatchEvent('order_unhold_after', array('order' => $this));\n\n return $this;\n }", "public static function deactivate ()\n\t{\n\t}", "public function deactivate()\r\n\t{\r\n\t\treturn $this->_changeStatus(0);\r\n\t}", "public function unimpersonateUser()\n {\n $realId = $this->session->remove('__realId');\n if ($realId !== null) {\n $this->user->identity->remove();\n $this->session->set($this->user->idParam, $realId);\n $identity = User::findOne($realId);\n $this->user->setIdentity($identity);\n $this->restoreBackedUpToken();\n }\n }", "public function deleteModel($entity){\n $this->entityManager->remove($entity);\n $this->entityManager->flush();\n }", "public static function unblockPurse($purse, $note = null);", "function unlock() {\r\n\t\t$query=new query($this, \"unlock tables\");\r\n\t\t$result=$query->result;\r\n\t\treturn $result;\r\n\t}", "public function unblock($id)\n {\n $user = User::findOrFail($id);\n\n if (Auth::user()->id == $id) {\n return response('Unauthorized action.', 403);\n }\n\n if (Gate::allows('admin', auth()->user())) {\n $user->where('users.id', '=', $id)\n ->update(['blocked' => 0]);\n\n return redirect()->action('UserController@index');\n }\n return response('Unauthorized action.', 403);\n }", "public function disable()\n {\n $this->enabled = false;\n }", "public function unlinkLinkedIn() {\n $this->setLinkedinOauthToken(NULL);\n $this->setLinkedinOauthTokenSecret(NULL);\n $this->setLinkedInId(NULL);\n }", "protected function releaseLock() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n $sql = \"DELETE FROM \".$this->_dbtp.\"locks WHERE \".$this->_dblp.\"name=?\";\n try {\n $db->query($sql, $this->_lock);\n }\n catch(Exception $ex) {\n $log->err($ex);\n $log->err(array(\"Queue releaseLock failed\", $res));\n } \n }", "public function dropIndexFromModel($indexName, $model)\n {\n\t$this->query('delete from [indexes] where [name] = %s and [table] = %s',\n\t $indexName,\n\t $model->getTableName());\n\n\tPerfORMController::getBuilder()->dropIndex($indexName, $model);\n\t$this->updateModelSync($model);\n }", "public function unlockTeam()\n\t\t{\n\t\t\t$lockedteam = array();\n\t\t\t$lockedteam['id'] = $this->team->id;\n\t\t\t$lockedteam['teamvalue'] = ($this->players[0]->playervalue)+($this->team->RR)*($this->team->RRcost)+($this->team->FF)*10000+($this->team->A_Coach)*10000+($this->team->CheerLeader)*10000+($this->team->Apoth)*50000;\n\t\t\t$lockedteam['locked'] = 0;\n\t\t\t$table = $this->getTable('Teams','BloodBowlTable');\n\t\t\treturn $table->updTeam($lockedteam);\n\t\t\t//return true;\n\t\t}", "public function disable() {}", "public function deactivate( $network_wide )\r\n\t{\r\n\t\t// TODO:\tDefine deactivation functionality here\r\n\t}", "public function forceDeleted($model)\n {\n if (static::syncingDisabledFor($model)) {\n return;\n }\n\n $model->unsearchable();\n }", "public function unblock($id) {\n\t\t//Argument 1 must be a string, integer\n\t\tEden_Twitter_Error::i()->argument(1, 'string', 'int');\t\n\t\t\n\t\t//if it is integer\n\t\tif(is_int($id)) {\n\t\t\t//lets put it in our query\n\t\t\t$this->_query['user_id'] = $id;\n\t\t//else it is string\n\t\t} else {\n\t\t\t//lets put it in our query\n\t\t\t$this->_query['screen_name'] = $id;\n\t\t}\n\t\t\n\t\treturn $this->_post(self::URL_REMOVE_BLOCKING, $this->_query);\n\t}", "public function dropFieldFromModel($fieldName, $model)\n {\n\t$hash= $this->fetchSingle('select hash from [fields] where [name] = %s and [table] = %s',\n\t$fieldName,\n\t$model->getTableName());\n\t$sql= $this->sql('delete from [fields] where [name] = %s and [table] = %s',\n\t$fieldName,\n\t$model->getTableName());\n\n\t$this->queue(\n\t PerfORMStorage::FIELD_DROP,\n\t $fieldName.'|'.$model->getTableName(),\n\t $sql,\n\t array(\n \t'fieldName' => $fieldName,\n\t\t'model' => $model\n\t )\n\t);\n\t$key= $hash.'|'. $model->getTableName();\n\tif ( key_exists($key, $this->renamedFields))\n\t{\n\t $array= $this->renamedFields[$key];\n\t $array->counter++;\n\t $array->from= $fieldName;\n\t}\n\telse\n\t{\n\t $this->renamedFields[$key]= (object) array(\n\t 'counter' => 1,\n\t 'from' => $fieldName,\n\t 'modelName' => $model->getTableName(),\n\t );\n\t}\n }", "public abstract function deleteModel(\\MPF\\Db\\Model $model);", "public function unbind($interface, $targetClass = null);" ]
[ "0.5904039", "0.58149767", "0.57980645", "0.56206995", "0.56146276", "0.55990344", "0.5561475", "0.55518764", "0.55389905", "0.55290645", "0.5515547", "0.54373765", "0.54258466", "0.5419757", "0.5404829", "0.5404829", "0.5391785", "0.538996", "0.53700364", "0.53700364", "0.53700364", "0.53700364", "0.53700364", "0.534612", "0.5335573", "0.53336436", "0.53267825", "0.5319799", "0.53165036", "0.5305576", "0.5302948", "0.5296615", "0.5291363", "0.52851814", "0.5257299", "0.5246062", "0.524176", "0.52150494", "0.5211012", "0.5203073", "0.5203073", "0.51937896", "0.5167459", "0.5167289", "0.5158866", "0.5158866", "0.51261896", "0.51050544", "0.51048607", "0.50980383", "0.5093459", "0.5081235", "0.50615436", "0.5055339", "0.5054154", "0.5050665", "0.50452346", "0.504212", "0.50413376", "0.50413376", "0.5022602", "0.5019459", "0.50046337", "0.5001041", "0.4996068", "0.49869162", "0.49852365", "0.49650627", "0.4963884", "0.49601158", "0.49541557", "0.4951297", "0.49503446", "0.49437833", "0.49402043", "0.49395332", "0.49385732", "0.4922243", "0.49207556", "0.49199414", "0.49147412", "0.4912016", "0.49063665", "0.49007636", "0.48972553", "0.4894052", "0.48893583", "0.48808977", "0.48752257", "0.4871973", "0.4869669", "0.48685026", "0.4861936", "0.4846667", "0.484524", "0.48351452", "0.48292905", "0.48254853", "0.4819625", "0.48181623" ]
0.7174353
0
==================================================================================================== GET AS OBJECT ====================================================================================================
public static function getAsObject($records, $fields){ $result = parent::getAsObject($records, $fields); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getObject() {}", "public function getObject() {}", "public function getObject();", "public function getObject();", "public function getObj();", "public function getObject(): object;", "public function toObject();", "public function getObject()\n {\n return $this->forgeObject();\n }", "function getObject();", "function getObject();", "public function toObject()\r\n\t{\r\n\t\treturn (object)$this->m_data;\r\n\t}", "public function get_object()\n {\n return $this->_object;\n }", "public function construct()\n {\n return $this->object;\n }", "public function getObject()\n {\n return $this;\n }", "public function get_object()\n {\n return $this->object;\n }", "private function getObject() {\n return $this->object;\n }", "public function getObject()\n {\n return $this->_object;\n }", "public static function get_object() {\n\t\treturn self::$object;\n\t}", "function get_obj()\n {\n $object = new ApiRest;\n return $object;\n }", "public function as_object()\n {\n $this->return_as = 'object';\n return $this;\n }", "public function getObject() {\n return $this->object;\n }", "public function getObj() {\n return $this->obj;\n }", "public function toObject(){\r\n return json_decode($this->toJson());\r\n }", "protected function asObject()\n\t{\n\t\treturn \\json_decode($this->response);\n\t}", "public function getObject()\n {\n return $this->object;\n }", "public function getObject()\n {\n return $this->object;\n }", "public static function getObject(){\n\t\treturn self::$object_class;\n\t}", "protected function getObject()\n {\n return $this;\n }", "public function getObject(){\n return $this->getCourier();\n }", "public function object()\n {\n return $this->object;\n }", "public function as_object() {\r\n $this->fetch_mode = 'object';\r\n return $this;\r\n }", "public function getBaseObject()\r\n\t{\r\n\t\treturn $this->obj;\r\n\t}", "public function get_instance() {\r\n\t\treturn $this->obj;\r\n\t}", "public function getObject() {\n\n // If there isn't any title, then return null to skip the call.\n if (!$this->title) {\n return false;\n }\n\n // Return the object.\n return array(\n 'title' => $this->title\n );\n }", "public function toObject() \n {\n return $this->toJson();\n }", "function data2Object($data) { \n\t\t\t$class_object = new getData($data); \n\t\t\treturn $class_object; \n\t\t}", "public function GetObject()\n\t{\n\t\tif (!$this->dataRead)\n\t\t\t$this->ReadData();\n\n\t\tif (!$this->object)\n\t\t\t$this->object = $this->project->GetObject($this->objectHash);\n\n\t\treturn $this->object;\n\t}", "abstract public function getJsObjectClass();", "public function toObject(): object\n {\n $body = (string) $this->response->getBody();\n\n return json_decode($body) ?? (object) [];\n }", "public function get_response_object()\n {\n }", "public static function RTEgetObj() {}", "public function asObject(): stdClass\n {\n return json_decode($this->result);\n }", "public function readObject();", "public function fetch_object()\n\t{\n\t\t$object = null;\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$object->$key = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$object = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $object;\n\t}", "public function ExportObject() {\n // Init object\n $plugin = new stdClass();\n // Set values\n $plugin->Name = $this->Name;\n $plugin->Version = $this->Version;\n $plugin->Author = $this->Author;\n $plugin->About = $this->About;\n $plugin->Root = $this->Root;\n $plugin->Identifier = $this->Identifier;\n \n // Return result\n return $plugin;\n }", "public function getInstance(): object;", "public function getIndirectObject() {}", "public function getIndirectObject() {}", "private function obj()\n {\n $object = $this->associative ? [] : new \\stdClass;\n\n if (++$this->depth > $this->maxDepth) {\n $this->throwSyntaxError('Maximum stack depth exceeded');\n }\n\n $this->nextOrFail('{');\n $this->white();\n while ($this->currentByte !== null) {\n if ($this->currentByte === '}') {\n $this->nextOrFail('}');\n $this->depth--;\n return $object; // Potentially empty object\n }\n\n // Keys can be unquoted. If they are, they need to be\n // valid JS identifiers.\n if ($this->currentByte === '\"' || $this->currentByte === \"'\") {\n $key = $this->string();\n } else {\n $key = $this->identifier();\n }\n\n $this->white();\n $this->nextOrFail(':');\n if ($this->associative) {\n $object[$key] = $this->value();\n } else {\n $object->{$key} = $this->value();\n }\n $this->white();\n // If there's no comma after this pair, this needs to be\n // the end of the object.\n if ($this->currentByte !== ',') {\n $this->nextOrFail('}');\n $this->depth--;\n return $object;\n }\n $this->nextOrFail(',');\n $this->white();\n }\n\n $this->throwSyntaxError('Invalid object');\n }", "public function current() {\t\t\n\t\treturn new $this->object_class($this->storage);\n\t}", "public function getObject()\n {\n return mysqli_fetch_object($this->resulset);\n }", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function getInstance(): object\n {\n }", "abstract public function object();", "public function readObject()\n {\n $ref = $this->readInteger();\n\n $refObj = $this->getReferenceObject($ref);\n if($refObj !== false)\n return $refObj;\n\n $ti = $this->readTraits($ref);\n $className = $ti->getClassName();\n $externalizable = $ti->isExternalizable();\n\n // Prepare the parameters for createObjectInstance(). Use an array as a holder\n // to simulate two 'by-reference' parameters className and (initially null) proxy\n $instance = $this->createObjectInstance($className);\n\n $object = $instance['object'];\n // Retrieve any changes to the className and the proxy parameters\n $className = $instance['className'];\n\n // Add the Object to the reference table\n $this->_referenceObjects[] = $object;\n\n if ($externalizable)\n {\n $this->readExternalizable($className, $object);\n }\n else\n {\n $len = $ti->length();\n\n for ($i = 0; $i < $len; $i++)\n {\n $propName = $ti->getProperty($i);\n $value = $this->readTypeMarker();\n $object->$propName = $value;\n }\n\n if ($ti->isDynamic())\n {\n do\n {\n $name = $this->readString();\n if($name != '')\n {\n $value = $this->readTypeMarker();\n $object->$name = $value;\n }\n } while ($name != '');\n }\n }\n\n return $object;\n }", "public function get_base_object() {\n\t\treturn $this->_base_obj;\n\t}", "public function newCObj() {}", "public function __invoke() {\n return (object) $this->data;\n }", "public function fetchObject()\n {\n return sasql_fetch_object($this->result);\n }", "public static function getObject()\n\t{\n\t\tif (class_exists(\"Memcache\"))\n\t\t{\n\t\t\tself::$_memcache = new Memcache;\n\t\t\tif (!self::$_memcache->connect(\"localhost\", 11211)) return self::createObject();\n\n\t\t\tif (self::$_memcache->get(\"customer_object\")) return self::$_memcache->get(\"customer_object\");\n\t\t\telse return self::createObject();\n\t\t}\n\t\telse return self::createObject();\n\t}", "public abstract function getApiObjectClass();", "public function asClass(): \\stdClass {\n\t\treturn (object) $this->asArray();\n\t}", "public function getContentObject() {}", "function _fetch_object()\n\t{\n\t\treturn sqlsrv_fetch_object($this->result_id);\n\t}", "protected function getObject()\n\t{\n\t\tif( !isset( $this->object ) ) {\n\t\t\t$this->object = \\Aimeos\\MAdmin\\Cache\\Manager\\Factory::createManager( $this->context )->getCache();\n\t\t}\n\n\t\treturn $this->object;\n\t}", "final protected function getObject($type){\n\t\t\treturn $this->getFactory()->getObject( $this->getRes(), $type );\n\t\t}", "public function getObject()\n {\n $object = Doctrine::getTable($this->getModel())->findOneById($this->getModelId());\n\n return $object;\n }", "public function getObject()\n\t{\n\t\t// Create the OPF instance.\n\t\treturn new Opf_Class($this->_serviceLocator->get('template.Opt'));\n\t}", "protected function getObject()\n {\n return $this->parentContext->getObject();\n }", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public function getResponseObject()\n {\n return $this->response_object;\n }", "public function createValidObject() : object {\n\t\treturn (object) [\"tweetContent\" => bin2hex(random_bytes(12))];\n\t}", "public function getObject()\n\t{\n\t\t$application = \\Trinity\\Basement\\Application::getApplication();\n\t\t$broker = $this->_serviceLocator->get('web.Broker');\n\t\t$json = new Json($application);\n\n\n\n\t\treturn $json;\n\t}", "public function asObject() {\n\t\treturn $this->_sth->fetchAll(PDO::FETCH_OBJ);\n\t}", "protected function constructExportObject()\n\t{\n\t\t//default export is \"all public fields\"\n\t\treturn (object) Arrays::getPublicPropertiesOfObject($this);\n\t}", "function jsonSerialize()\n {\n return (object) get_object_vars($this);\n }", "function &get_entity()\n {\n return $this->object->_stdObject;\n }", "public function get()\n {\n $object = $this->_object;\n $this->_object = $this->_form;\n return $object;\n }", "function FetchObject() {\n\t\t\treturn pg_fetch_object($this->result);\n\t\t}", "public function GetDbObject() {\n // Init object\n $plugin = new stdClass();\n // Set values\n $plugin->Name = $this->Name;\n $plugin->Version = $this->Version;\n $plugin->Author = $this->Author;\n $plugin->About = $this->About;\n $plugin->Root = $this->Root;\n $plugin->Identifier = $this->Identifier;\n \n // Return result\n return $plugin;\n }", "public function jsonSerialize()\n {\n return (object) get_object_vars($this);\n }", "protected function getObject()\n\t{\n\t\tif( $this->object !== null ) {\n\t\t\treturn $this->object;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function fetchObject(){\n $this->debugBacktrace();\n $this->fetchType = \"fetch_object\";\n return $this;\n }", "public function get_as_object() {\n $lines = $this->lines;\n foreach ($lines as $i => $linha) {\n $lines[$i] = (object) $linha;\n }\n\n return $lines;\n }", "public abstract function FetchObject();", "function FetchObj() {}", "public function objectify(){ return array( 'aID' => $this->ulA()->ID, 'bID' => $this->ulB()->ID, 'connection' => $this->connection() ); }", "public function getCurrentObjectData() {}", "protected function createResultObject() {\n\t\t$result = new Result();\n\t\treturn $result;\n\t}", "public function getExample() : object\n {\n return json_decode(file_get_contents($this->example));\n }", "function newDataObject() {\n\t\t$ofrPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);\n\t\t$ofrPlugin->import('classes.ObjectForReviewPerson');\n\t\treturn new ObjectForReviewPerson();\n\t}", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->number = $this->_number;\n $stdClass->internal = $this->_internal;\n return $stdClass;\n }", "function getObjectIt()\r\n \t{\r\n \t\treturn $this->object_it;\r\n \t}", "public static function getObject()\n {\n return new LookupDataEntry(self::getJson());\n }", "public static function getOI() {\n if (self::$objectInfo === null) {\n self::$objectInfo = self::objectInfo();\n }\n \n return self::$objectInfo;\n }", "function create()\n\t{\n\t\t$names = $this->_fields;\n\t\t$object = new StdClass;\n\t\tforeach ($names as $name)\n\t\t\t$object->$name = \"\";\n\t\treturn $object;\n\t}", "public function getOutputObject()\n {\n $baseObject = parent::getOutputObject();\n $baseObject->name = $this->getName();\n\n return $baseObject;\n }", "public function getStreamObject() {}", "public function GetObj()\n {\n try\n {\n return $this->oRequestObj;\n }\n catch( Exception $oException )\n {\n throw cAnomaly::BubbleException( $oException );\n }\n }", "public function &create()\n {\n $obj = null;\n\n if (class_exists($this->_class_name)) {\n // Assigning the return value of new by reference\n $obj = new $this->_class_name();\n }\n\n return $obj;\n }" ]
[ "0.81084704", "0.81084704", "0.8072411", "0.8072411", "0.7829985", "0.78264683", "0.7621732", "0.7488174", "0.7468041", "0.7468041", "0.7350819", "0.7343397", "0.7340827", "0.7285451", "0.7284351", "0.7241966", "0.7199151", "0.7166856", "0.71648616", "0.71444714", "0.7136796", "0.7123636", "0.7116185", "0.70672536", "0.7047163", "0.7047163", "0.7044196", "0.7024198", "0.69768995", "0.6926694", "0.69096684", "0.68705326", "0.6839586", "0.6782283", "0.67703223", "0.67692935", "0.671228", "0.67108977", "0.6649372", "0.66388816", "0.66334563", "0.6633426", "0.66300637", "0.66026944", "0.657085", "0.6567969", "0.6562619", "0.6562619", "0.6556526", "0.6548652", "0.65376174", "0.6525724", "0.6525724", "0.64947695", "0.64806956", "0.6475891", "0.6460852", "0.64562213", "0.64290726", "0.6413119", "0.640975", "0.63994485", "0.63829446", "0.63814783", "0.63806146", "0.63607913", "0.6347438", "0.6341261", "0.6325717", "0.63240784", "0.6322591", "0.63204306", "0.6316877", "0.63150096", "0.63038975", "0.6277284", "0.6258252", "0.6251608", "0.623865", "0.6225251", "0.6222809", "0.6208778", "0.62079054", "0.61902803", "0.618003", "0.617268", "0.6172351", "0.6170411", "0.61609703", "0.614487", "0.6139822", "0.6139639", "0.6136558", "0.6128111", "0.61239314", "0.61226964", "0.61225826", "0.61134726", "0.61059624", "0.61042386", "0.6100018" ]
0.0
-1
==================================================================================================== END GET AS OBJECT ==================================================================================================== ==================================================================================================== GET AS PARAMETER ====================================================================================================
public static function getAsParameter($request, $fields){ $result = parent::getAsParameter($request, $fields); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getParam() {\n\n\t}", "function getParameters()\r\n {\r\n }", "public function getParameter();", "public function getParameter();", "public function getParameters() {}", "function getParameters();", "function getParameters();", "public function getParameters()\n\t{\n\n\t}", "public function getParameters()\n\t{\n\n\t}", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameter()\n\t{\n\t\treturn $this->parameter;\n\t}", "public function getParam()\n {\n return $this->param;\n }", "public function getParam()\n {\n return $this->param;\n }", "abstract public function getParameters();", "function getParameters(){ return $this->parameters; }", "public function get_params() {\n return $this->param;\n }", "public function get_params()\n {\n }", "public function get_params()\n {\n }", "public function getParams() {}", "function get_parameters()\r\n {\r\n return $this->parameters;\r\n }", "function getParams()\n {\n }", "public function getParameters()\n {\n // TODO: Implement getParameters() method.\n }", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "function getParams()\n {\n }", "private function get_params()\n { \n $params = new stdClass();\n $params->subject = $this->subject;\n return $params;\n }", "public function getParam($param);", "private function get_params()\r\n {\r\n $params = new stdClass();\r\n $params->grade = $this->grade;\r\n $params->ucaspoints = $this->ucaspoints;\r\n $params->bcgttargetqualid = $this->bcgttargetqualid;\r\n $params->upperscore = $this->upperscore;\r\n $params->lowerscore = $this->lowerscore;\r\n $params->ranking = $this->ranking;\r\n return $params;\r\n }", "function getParameters(): array;", "function getParams()\n {\n global $id;\n global $mode;\n global $data_source;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($data_source)) {\n $this->data_source = $data_source;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "public function getParameters(): array;", "public function genericParam() {\n return $this->_genericParam;\n }", "function getParams()\n {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "function getParam($inKey = null) {\n\t\treturn $this->_getItem($inKey);\n\t}", "public function getParam($name);", "public function getParams()\n {\n // TODO: Implement getParams() method.\n }", "public function getParameters(/* ... */)\n {\n return $this->_params;\n }", "function getParameters() {\n\t\treturn $this->inputParameters;\n\t}", "public function parameters();", "public function parameters();", "public function get_parameters() {\r\n\t\treturn $this->parameters;\r\n\t}", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $data_source;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($data_source)) {\r\n $this->data_source=$data_source;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "public function getParameter($name);", "public function getParameter($name);", "public function getParameter($name);", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParameters() {\n return $this->parameters;\n }", "public function getParam1()\n {\n return $this->get(self::_PARAM1);\n }", "public function getParam1()\n {\n return $this->get(self::_PARAM1);\n }", "public function getParam1()\n {\n return $this->get(self::_PARAM1);\n }", "public function getParam1()\n {\n return $this->get(self::_PARAM1);\n }", "public function getParam1()\n {\n return $this->get(self::_PARAM1);\n }", "public function getParam1()\n {\n return $this->get(self::_PARAM1);\n }", "public function GetParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n\t{\n\t\treturn $this->parameters;\n\t}", "public function getParameters()\r\n {\r\n return $this->parameters;\r\n }", "public function getParameters()\n {\n return array();\n }", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "public function getParameters()\n {\n return get_object_vars($this->record);\n }", "public function get_params() {\n\t\treturn $this->params;\n\t}", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "function get_parameter($name)\r\n {\r\n if (array_key_exists($name, $this->parameters))\r\n return $this->parameters[$name];\r\n }", "public function getParameters() {\n \n return $this->params;\n \n }", "private function fetchParameter()\r\n\t{\r\n\t\t//@TODO schlundus, move fetch inside the parameterInfo class\r\n\t\t$parameterSource = $this->parameterInfo->source;\r\n\t\t$parameterName = $this->parameterInfo->name;\r\n\t\t\r\n\t\t$src = null;\r\n\t\tswitch($parameterSource)\r\n\t\t{\r\n\t\t\tcase \"POST\":\r\n\t\t\t\t$src = $_POST;\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t\tcase \"GET\":\r\n\t\t\t\t$src = $_GET;\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t\tcase \"REQUEST\":\r\n\t\t\t\t$src = $_REQUEST;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\r\n\t\t$value = null;\r\n\t\t$fetched = false;\r\n\t\tif ($src)\r\n\t\t{\t\r\n\t\t\tif (isset($src[$parameterName]))\r\n\t\t\t{\r\n\t\t\t\t$value = $src[$parameterName];\r\n\t\t\t\t$fetched = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->bFetched = $fetched;\r\n\t\t$this->taintValue = $value;\r\n\t}", "public function getParams(){\n return $this->params;\n }", "public function paramsGet()\r\n {\r\n return $this->params_get;\r\n }", "public function getTesterParameter();", "public function getParams() :array;", "public function getParams(): array;", "public function getParams(){\n\t\treturn $this->params;\n\t}", "public function transactionGetParameters ();", "protected function parseParameter() {\n $reader = $this->reader; // alias in local\n\n $param = new Param;\n $param->name = $reader->getAttribute('name');\n $param->transfer = $reader->getAttribute('transfer-ownership');\n // get rid of \"floating\" transfer\n if($param->transfer == 'floating') {\n $param->transfer == 'none';\n }\n if($dir = $reader->getAttribute('direction')) {\n $param->direction = $dir;\n }\n\n do {\n if($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'array') {\n $param->container = $reader->getAttribute('c:type');\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'type') {\n $param->nativeType = $reader->getAttribute('c:type');\n $param->type = $reader->getAttribute('name');\n $this->mapType($param);\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'doc') {\n $param->doc = $reader->readString();\n // this will ALWAYS stop our loop\n } elseif($reader->nodeType == XMLReader::END_ELEMENT && $reader->name == 'parameter') {\n break;\n }\n } while($reader->read());\n\n return $param;\n }", "public static function getParams()\n {\n return self::$params;\n }", "public function getParameters() {\n\t\treturn $this->parameters;\n\t}" ]
[ "0.7756441", "0.73747265", "0.7370852", "0.7370852", "0.72905546", "0.72593856", "0.72593856", "0.72315204", "0.72315204", "0.7194614", "0.7194614", "0.7194614", "0.7194614", "0.7194614", "0.7194614", "0.7194614", "0.7194614", "0.7186278", "0.71775323", "0.71775323", "0.7144218", "0.7081849", "0.7074593", "0.7021979", "0.7021979", "0.6976318", "0.6973527", "0.6948717", "0.69309676", "0.6909772", "0.6909772", "0.6909772", "0.6909772", "0.6909772", "0.6909772", "0.6909772", "0.6909772", "0.6909772", "0.6909772", "0.6854252", "0.6771668", "0.6712057", "0.6708796", "0.66750574", "0.66719514", "0.6614726", "0.65957433", "0.6586148", "0.6570643", "0.6562781", "0.6552204", "0.6550863", "0.65470845", "0.65456647", "0.65456647", "0.6522935", "0.6517493", "0.6515521", "0.6515521", "0.6515521", "0.6504232", "0.6504232", "0.6504232", "0.6504232", "0.6476335", "0.6473919", "0.6473919", "0.6473919", "0.6473919", "0.6473919", "0.6473919", "0.64455426", "0.6440449", "0.6440449", "0.64290845", "0.64224136", "0.6421307", "0.6413942", "0.6413942", "0.6413942", "0.6412232", "0.64088416", "0.6408484", "0.6408484", "0.64051944", "0.64051944", "0.64051944", "0.64051944", "0.6397557", "0.6391562", "0.6386508", "0.6372416", "0.63493", "0.63298", "0.63190794", "0.6308321", "0.6305718", "0.6290829", "0.6289666", "0.6288136", "0.6276324" ]
0.0
-1
==================================================================================================== END GET AS PARAMETER ==================================================================================================== ==================================================================================================== GET FIELDS ====================================================================================================
public static function getFields(){ return self::$fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFields();", "public function getFields() {}", "public function getFields() {}", "public function getFields() {}", "public function getField();", "public function getField();", "public function getField();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public static function get_fields()\n {\n }", "abstract public function getFields();", "abstract public function getFields();", "abstract protected function getFields();", "public function get_field(/* .... */)\n {\n return $this->_field;\n }", "public function &getFields();", "public function getField(){\n return $this->field;\n }", "function get_fields() {\n global $Tainacan_Item_Metadata;\n return $Tainacan_Item_Metadata->fetch($this, 'OBJECT');\n\n }", "public function getFields(): array;", "public function getFields(): array;", "public function getFields(): array;", "function getField(){\n\t\treturn $this->Field;\n\t}", "function get_fields( ) {\n\t\treturn $this->fields_list;\n\t\t}", "public function getField($field_name);", "public function fetchField();", "public function fetch_fields() {}", "protected function getCompleteFieldInformation() {}", "public function fetchFields();", "public function getFieldsList(){\n return $this->_get(1);\n }", "public function getField(): string;", "protected function getFields()\n {\n return $this->fields;\n }", "protected function getFields()\n {\n return $this->fields;\n }", "public function getFields() {\n $field = $this->get('field');\n return null !== $field ? $field : array();\n }", "public function getField()\n {\n return $this->_field;\n }", "public function getContactDataFields();", "public function get_fields() {\n return $this->fields;\n }", "public function get_fields() {\r\n\t\treturn $this->fields;\r\n\t}", "abstract public function getFields(): array;", "public function get_fields() {\n\t\treturn $this->fields;\n\t}", "public function getFields(){\n return $this->dbFields;\n }", "public function getFields(){\n\t\treturn $this->Fields;\n\t}", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "public function getField($fieldName) {}", "public function getFields() {\n\t\treturn array(\n\t\t\tself::FIELD_ID,\n\t\t\tself::FIELD_NAME,\n\t\t\tself::FIELD_CREATED_AT,\n\t\t);\n\t}", "public function getUserfield();", "public function getField() {\n\t\treturn $this->field; \n\t}", "public function getListFields();", "public function getFields()\r\n {\r\n return $this->fields;\r\n }", "protected function getFields()\n {\n return $this->Fields;\n }", "public function get_fields() {\n\t\treturn apply_filters( 'wpcd_get_custom_fields', $this->custom_fields );\n\t}", "public function & getFields() {\n\t\treturn $this->fields;\n\t}", "public function getFrontendFields();", "public function getField()\n {\n return $this->field;\n }", "public function getField()\n {\n return $this->field;\n }", "public function getField()\n {\n return $this->field;\n }", "public function getField()\n {\n return $this->field;\n }", "public function &getFields() { return $this->fields; }", "function fields($fldname) {\n\t\treturn $this->fields[$fldname];\n\t}", "public function getCustomFields() {\n }", "public function getCustomFields() {\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields() {\r\n\r\n $fields = array();\r\n\r\n $fields['userid'] = $this->userid;\r\n $fields['itemid'] = $this->itemid;\r\n\r\n $fields['type'] = $this->type;\r\n $fields['detail'] = $this->detail;\r\n $fields['date'] = $this->date;\r\n\r\n $fields['location_simple'] = $this->location_simple;\r\n $fields['location_latlong'] = $this->location_latlong;\r\n\r\n foreach ($this->extra as $key => $value) {\r\n $fields[$key] = $value;\r\n }\r\n\r\n return $fields;\r\n }", "public abstract function FetchField();", "public function fields(){\n\t\treturn array();\n\t}", "public function getField() {\n\t\treturn $this->field;\n\t}", "public function getFields(){ return $this->field_map; }", "public function get_field_name();", "function getFieldValue($field);", "public function getField() {\n\t\treturn $this->_field;\n\t}", "abstract protected function _getFeedFields();", "public function getFieldObject() {}", "public function getFields(): array\n {\n return [\n 'user_id' => 'text',\n 'api_key' => 'text',\n 'shop_id' => 'text',\n 'secret_key' => 'password',\n ];\n }", "public function getAllFields();", "function GetFields($s, &$form, $id, $data) {}", "abstract public function getFields($entity);", "public function getFields()\n\t{\n\t\treturn $this->fields;\n\t}", "public function getFields()\n\t{\n\t\treturn $this->fields;\n\t}", "public function getFieldName() {}", "public function getFields() {\n\t\treturn array(\n\t\t\tself::FIELD_ID,\n\t\t\tself::FIELD_PHRASE_ID,\n\t\t\tself::FIELD_LANGUAGE_ID,\n\t\t\tself::FIELD_TRANSLATION,\n\t\t\tself::FIELD_CREATED_AT,\n\t\t\tself::FIELD_USER_ID,\n\t\t);\n\t}", "public function getField($name) { return $this->fields[$name]; }", "public function getFields() {\n\t\treturn $this->fields;\n\t}", "public function getFields() {\n\t\treturn $this->fields;\n\t}", "function getFieldValues()\n {\n $myvalues = $this->m_oPageHelper->getFieldValues($this->m_protocol_shortname);\n return $myvalues;\n }" ]
[ "0.8020224", "0.79396766", "0.79396766", "0.79396766", "0.78758806", "0.78758806", "0.78758806", "0.7835813", "0.7835813", "0.7835813", "0.7835813", "0.7835813", "0.7835813", "0.7697134", "0.76487684", "0.76487684", "0.7629474", "0.7626955", "0.74148655", "0.7398917", "0.7334467", "0.73269224", "0.73269224", "0.73269224", "0.73188454", "0.72979665", "0.7276187", "0.7252259", "0.7233243", "0.719017", "0.7167485", "0.7163185", "0.7145362", "0.7100189", "0.7100189", "0.7094241", "0.70805806", "0.7079008", "0.7058047", "0.70508313", "0.70491934", "0.7039477", "0.7037909", "0.7023063", "0.70221037", "0.70221037", "0.70221037", "0.70221037", "0.70221037", "0.70025635", "0.69992775", "0.69936216", "0.6987423", "0.6984244", "0.69808584", "0.69760567", "0.6971535", "0.6969718", "0.6939118", "0.69390243", "0.69390243", "0.69390243", "0.69390243", "0.6937232", "0.6923801", "0.6919443", "0.6919443", "0.69097114", "0.69097114", "0.69097114", "0.69097114", "0.69097114", "0.69097114", "0.69097114", "0.69097114", "0.69097114", "0.69097114", "0.69097114", "0.69091374", "0.69089305", "0.6907364", "0.68967867", "0.68963444", "0.68916935", "0.68858767", "0.6885872", "0.6880924", "0.6877852", "0.686581", "0.6864163", "0.6858168", "0.6855777", "0.68488216", "0.68488216", "0.6847132", "0.6842762", "0.68366367", "0.6835275", "0.6835275", "0.68226165" ]
0.7049311
40
==================================================================================================== END GET FIELDS ==================================================================================================== ==================================================================================================== FIND SCHEDULES ====================================================================================================
public function find($parameter, $connection){ $find = $connection->newPerformScriptCommand(self::$layout, self::$api_find, $parameter); $result = $find->execute(); if (Filemaker::isError($result)) { echo $result->getMessage(); } $records = $result->getRecords(); $result = $this->getAsObject($records, self::$fields); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getSchedule()\n {\n // Get frequency and offset from posted data\n $data = Mage::app()->getRequest()->getPost('groups');\n $frequency = !empty($data['emailchef']['fields']['emailchef_cron_frequency']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_frequency']['value'] :\n EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;\n $offset = !empty($data['emailchef']['fields']['emailchef_cron_offset']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_offset']['value'] :\n 0;\n\n // Get period between calls and calculate explicit hours using this and offset\n $period = EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);\n if ($period === null) {\n Mage::log('eMailChef: Could not find cron frequency in valid list. Defaulted to hourly', Zend_Log::ERR);\n $period = 1;\n }\n $hoursStr = $this->_calculateHourFreqString($period, $offset);\n\n return \"0 {$hoursStr} * * *\";\n }", "static function fetchJobSchedules() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \" SELECT job_id, classname, repeat_time_minutes, repeat_daily_at, active_yn, last_run_date \n FROM job_scheduler\n ORDER BY job_id\");\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n $schedule = array();\n foreach( $resultset as $record ) {\n if( false === empty( $record->repeat_time_minutes ) ) {\n $schedule[] = new ScheduledJobRepeat(\n $record->job_id, \n $record->classname, \n $record->repeat_time_minutes, \n $record->active_yn == 'Y',\n $record->last_run_date,\n self::fetchJobScheduleParameters( $record->job_id ));\n }\n else if( false === empty( $record->repeat_daily_at ) ) {\n $schedule[] = new ScheduledJobDaily(\n $record->job_id, \n $record->classname, \n $record->repeat_daily_at,\n $record->active_yn == 'Y',\n $record->last_run_date,\n self::fetchJobScheduleParameters( $record->job_id ));\n }\n }\n return $schedule;\n }", "public function calculateScheduling()\n {\n if (count($this->streetsIn) === 1) {\n $this->greenScheduling = [\n array_values($this->streetsIn)[0],\n ];\n return;\n }\n $this->greenScheduling = [];\n foreach ($this->streetsIn as $streetName => $street) {\n for ($i = 0; $i < $street->semaphore->timeDuration; $i++) {\n $this->greenScheduling[] = $this->streetsIn[$streetName];\n }\n }\n }", "static function process_scheduler(){\n\t\treturn self::process_offline_leads();\n\t}", "function recurringdowntime_get_service_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"servicegroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"host\") {\n continue;\n }\n }\n\n if ($host && !(strtolower($schedule[\"host_name\"]) == strtolower($host))) {\n continue;\n }\n\n if (array_key_exists('host_name', $schedule)) {\n if (array_key_exists('service_description', $schedule)) {\n if ($schedule[\"service_description\"] != '*') {\n $search_str = $schedule[\"service_description\"];\n\n if (strstr($schedule[\"service_description\"], \"*\")) {\n $search_str = \"lk:\" . str_replace(\"*\", \"%\", $schedule[\"service_description\"]);\n }\n if (!is_authorized_for_service(0, $schedule[\"host_name\"], $search_str)) {\n continue;\n }\n }\n }\n\n if (is_authorized_for_host(0, $schedule[\"host_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function filter_cron_schedules($schedules) {\n $schedules['once_half_hour'] = array(\n 'interval' => 1800, // seconds\n 'display' => __('Once Half an Hour')\n );\n $schedules['half_part_time'] = array(\n 'interval' => 900, // seconds\n 'display' => __('Half Part Time')\n );\n\n return $schedules;\n}", "public function getStationsWithSchedules();", "function get_schedule($usrid){\r\n\t\r\n}", "function dcs_dropship_cron_definer($schedules)\r\n{ \r\n\t$schedules['monthly'] = array( \r\n\t\t'interval'=> 2592000, \r\n\t\t'display'=> __('Once Every 30 Days') \r\n\t\t); \r\n\treturn $schedules;\r\n}", "function wp_schedule_update_checks()\n {\n }", "public function getScheduling()\n {\n return $this->scheduling;\n }", "protected function getSendingSchedule()\n\t{\n\t\treturn null;\n\t}", "function emp_cron_schedules($schedules){\n\t$schedules['em_minute'] = array(\n\t\t'interval' => 60,\n\t\t'display' => 'Every Minute'\n\t);\n\treturn $schedules;\n}", "public function wp_cron_scheduled_check()\n {\n }", "public function getScheduled()\n {\n $jobs = array();\n \n $scheduled = $this\n ->_em\n ->getRepository($this->_entityClass)\n ->createQueryBuilder('s')\n ->andWhere('s.schedule is not NULL')\n ->andWhere('s.active = :active')\n ->setParameters(array('active' => 0))\n ->getQuery()\n ->getResult(); \n \n foreach ($scheduled as $record) {\n $job = new $this->_jobClass(call_user_func($this->_adapterClass . '::factory', $this->_options, $record, $this->_em, $this->_logger));\n array_push($jobs, $job);\n }\n return $jobs;\n \n }", "function recurringdowntime_get_host_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"servicegroup\") {\n continue;\n }\n if ($schedule[\"schedule_type\"] == \"service\") {\n continue;\n }\n }\n if ($host && !(strtolower($schedule[\"host_name\"]) == strtolower($host))) {\n continue;\n }\n if (array_key_exists('host_name', $schedule)) {\n if (is_authorized_for_host(0, $schedule[\"host_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function _get_cron_array()\n {\n }", "function has_schedules( $group_id = null ) {\r\n global $bp;\r\n $schedule_ids = null;\r\n $schedules = array();\r\n \r\n if( empty( $group_id ) )\r\n $group_id = $bp->groups->current_group->id;\r\n \r\n $term_id = get_term_by( 'slug', $group_id, 'group_id' );\r\n if( !empty( $term_id ) )\r\n $schedule_ids = get_objects_in_term( $term_id->term_id, 'group_id' );\r\n \r\n if( !empty( $schedule_ids ) )\r\n arsort( $schedule_ids ); // Get latest entries first\r\n else\r\n return null;\r\n \r\n foreach ( $schedule_ids as $sid )\r\n $schedules[] = self::is_schedule( $sid );\r\n \r\n return array_filter( $schedules );\r\n }", "function my_cron_schedules($schedules){\r\n if(!isset($schedules[\"5min\"])){\r\n $schedules[\"5min\"] = array(\r\n 'interval' => 5*60,\r\n 'display' => __('Once every 5 minutes'));\r\n }\r\n if(!isset($schedules[\"15min\"])){\r\n $schedules[\"15min\"] = array(\r\n 'interval' => 15*60,\r\n 'display' => __('Once every 15 minutes'));\r\n }\r\n return $schedules;\r\n}", "public static function getSchedulePattern(): string;", "function getScheduleEntries($ob=0,$masclifor)\n {\n global $gTables;\n switch ($ob) {\n case 1:\n $orderby = \"id_tesdoc_ref, expiry DESC, codice, caucon, datreg, numdoc ASC \";\n break;\n case 2:\n $orderby = \"ragso1, id_tesdoc_ref,caucon, datreg, numdoc ASC \";\n break;\n case 3:\n $orderby = \"ragso1 DESC, id_tesdoc_ref,caucon, datreg, numdoc ASC \";\n break;\n default:\n $orderby = \"id_tesdoc_ref, expiry, codice, caucon, datreg, numdoc ASC \";\n }\n $select = \"*, \".$gTables['tesmov'].\".*, \".$gTables['clfoco'].\".descri AS ragsoc\";\n if ($this->target==0 ) {\n $where = $gTables['clfoco'].\".codice LIKE '$masclifor%' \";\n } else {\n $where = $gTables['clfoco'].\".codice = \".$this->target;\n }\n $table = $gTables['paymov'].\" LEFT JOIN \".$gTables['rigmoc'].\" ON (\".$gTables['paymov'].\".id_rigmoc_pay = \".$gTables['rigmoc'].\".id_rig OR \".$gTables['paymov'].\".id_rigmoc_doc = \".$gTables['rigmoc'].\".id_rig )\"\n .\"LEFT JOIN \".$gTables['tesmov'].\" ON \".$gTables['rigmoc'].\".id_tes = \".$gTables['tesmov'].\".id_tes \"\n .\"LEFT JOIN \".$gTables['clfoco'].\" ON \".$gTables['clfoco'].\".codice = \".$gTables['rigmoc'].\".codcon \"\n .\"LEFT JOIN \".$gTables['anagra'].\" ON \".$gTables['anagra'].\".id = \".$gTables['clfoco'].\".id_anagra \";\n \n $this->Entries=array();\n $rs=gaz_dbi_dyn_query ($select, $table, $where, $orderby);\n while ($r = gaz_dbi_fetch_array($rs)) {\n $this->Entries[] = $r;\n }\n }", "private function __validate_bwsched() {\n if (isset($this->initial_data[\"bwsched\"])) {\n if ($this->is_firewall_schedule($this->initial_data[\"bwsched\"])) {\n $this->validated_data[\"bwsched\"] = $this->initial_data[\"bwsched\"];\n } else {\n $this->errors[] = APIResponse\\get(4150);\n }\n } else {\n $this->validated_data[\"bwsched\"] = \"none\";\n }\n }", "function dayScheduleA()\n\t{\n\t$scheduleDay = array(45, 60, 90, 120, 150, 180, 210, 240);\n\treturn $scheduleDay;\n\t}", "private static function get_events() {\n\t\treturn array(\n\t\t\t'formidable_send_usage' => 'weekly',\n\t\t);\n\t}", "public function setSchedule($schedule)\n\t{\n\t\tif ($schedule === '') {\n\t\t\t$schedule = '* * * * * *';\n\t\t} elseif ($schedule === null) {\n\t\t\t$this->_schedule = $schedule;\n\t\t\treturn;\n\t\t}\n\t\t$schedule = trim($schedule);\n\t\t$this->_schedule = $schedule;\n\t\t$this->_attr = [];\n\t\tif (strlen($schedule) > 1 && $schedule[0] == '@') {\n\t\t\tif (is_numeric($triggerTime = substr($schedule, 1))) {\n\t\t\t\t$this->_triggerTime = (int) $triggerTime;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (self::$_validatorCache) {\n\t\t\t$minuteValidator = self::$_validatorCache['m'];\n\t\t\t$hourValidator = self::$_validatorCache['h'];\n\t\t\t$domValidator = self::$_validatorCache['dom'];\n\t\t\t$monthValidator = self::$_validatorCache['mo'];\n\t\t\t$dowValidator = self::$_validatorCache['dow'];\n\t\t\t$yearValidator = self::$_validatorCache['y'];\n\t\t\t$fullValidator = self::$_validatorCache['f'];\n\t\t} else {\n\t\t\t$minute = '(?:[0-9]|[1-5][0-9])';\n\t\t\t$minuteStar = '\\*(?:\\/(?:[1-9]|[1-5][0-9]))?';\n\t\t\t$minuteRegex = $minute . '(?:\\-(?:[1-9]|[1-5][0-9]))?(?:\\/(?:[1-9]|[1-5][0-9]))?';\n\t\t\t$hour = '(?:[0-9]|1[0-9]|2[0-3])';\n\t\t\t$hourStar = '\\*(?:\\/(?:[1-9]|1[0-9]|2[0-3]))?';\n\t\t\t$hourRegex = $hour . '(?:\\-(?:[1-9]|1[0-9]|2[0-3]))?(?:\\/(?:[1-9]|1[0-9]|2[0-3]))?';\n\t\t\t$dom = '(?:(?:[1-9]|[12][0-9]|3[01])W?)';\n\t\t\t$domWOW = '(?:[1-9]|[12][0-9]|3[01])';\n\t\t\t$domStar = '\\*(?:\\/(?:[1-9]|[12][0-9]|3[01]))?';\n\t\t\t$domRegex = '(?:' . $dom . '(?:\\-' . $dom . ')?(?:\\/' . $domWOW . ')?|' . '(?:L(?:\\-[1-5])?)' . ')';\n\t\t\t$month = '(?:[1-9]|1[012]|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][1] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][2] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][3] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][4] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][5] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][6] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][7] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][8] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][9] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][10] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][11] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][12] . ')';\n\t\t\t$monthStar = '\\*(?:\\/(?:[1-9]|1[012]))?';\n\t\t\t$monthRegex = $month . '(?:\\-' . $month . ')?(?:\\/(?:[1-9]|1[012]))?';\n\t\t\t$dow = '(?:[0-6]|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][0] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][1] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][2] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][3] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][4] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][5] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][6] . ')';\n\t\t\t$dowStar = '\\*(?:\\/[0-6])?';\n\t\t\t$dowRegex = '(?:[0-6]L|' . $dow . '(?:(?:\\-' . $dow . ')?(?:\\/[0-6])?|#[1-5])?)';\n\t\t\t$year = '(?:19[7-9][0-9]|20[0-9][0-9])';\n\t\t\t$yearStar = '\\*(?:\\/[0-9]?[0-9])?';\n\t\t\t$yearRegex = $year . '(?:\\-' . $year . ')?(?:\\/[0-9]?[0-9])?';\n\t\t\t$fullValidator = '/^(?:(@(?:annually|yearly|monthly|weekly|daily|hourly))|' .\n\t\t\t\t'(?#minute)((?:' . $minuteStar . '|' . $minuteRegex . ')(?:\\,(?:' . $minuteStar . '|' . $minuteRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#hour)((?:' . $hourStar . '|' . $hourRegex . ')(?:\\,(?:' . $hourStar . '|' . $hourRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#DoM)(\\?|(?:(?:' . $domStar . '|' . $domRegex . ')(?:,(?:' . $domStar . '|' . $domRegex . '))*))[\\s]+' .\n\t\t\t\t'(?#month)((?:' . $monthStar . '|' . $monthRegex . ')(?:\\,(?:' . $monthStar . '|' . $monthRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#DoW)(\\?|(?:' . $dowStar . '|' . $dowRegex . ')(?:\\,(?:' . $dowStar . '|' . $dowRegex . '))*)' .\n\t\t\t\t'(?#year)(?:[\\s]+' .\n\t\t\t\t\t'((?:' . $yearStar . '|' . $yearRegex . ')(?:\\,(?:' . $yearStar . '|' . $yearRegex . '))*)' .\n\t\t\t\t')?' .\n\t\t\t')$/i';\n\n\t\t\t$minuteValidator = '/^(\\*|' . $minute . ')(?:\\-(' . $minute . '))?(?:\\/(' . $minute . '))?$/i';\n\t\t\t$hourValidator = '/^(\\*|' . $hour . ')(?:\\-(' . $hour . '))?(?:\\/(' . $hour . '))?$/i';\n\t\t\t$domValidator = '/^(\\*|\\?|L|' . $domWOW . ')(W)?(?:\\-(' . $domWOW . ')(W)?)?(?:\\/(' . $domWOW . '))?$/i';\n\t\t\t$monthValidator = '/^(\\*|' . $month . ')(?:\\-(' . $month . '))?(?:\\/(' . $month . '))?$/i';\n\t\t\t$dowValidator = '/^(\\*|\\?|' . $dow . ')(L)?(?:\\-(' . $dow . ')(L)?)?(?:\\/(' . $dow . '))?(?:#([1-5]))?$/i';\n\t\t\t$yearValidator = '/^(\\*|' . $year . ')(?:\\-(' . $year . '))?(?:\\/([1-9]?[0-9]))?$/i';\n\t\t\tself::$_validatorCache = [\n\t\t\t\t\t'm' => $minuteValidator,\n\t\t\t\t\t'h' => $hourValidator,\n\t\t\t\t\t'dom' => $domValidator,\n\t\t\t\t\t'mo' => $monthValidator,\n\t\t\t\t\t'dow' => $dowValidator,\n\t\t\t\t\t'y' => $yearValidator,\n\t\t\t\t\t'f' => $fullValidator,\n\t\t\t\t];\n\t\t}\n\n\t\t$i = 0;\n\t\tdo {\n\t\t\tif (!preg_match($fullValidator, $schedule, $matches)) {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $schedule);\n\t\t\t}\n\t\t\tif ($matches[1]) {\n\t\t\t\tforeach (self::$_intervals as $interval => $intervalSchedule) {\n\t\t\t\t\tif ($interval == $matches[1]) {\n\t\t\t\t\t\t$schedule = $intervalSchedule;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} while ($matches[1]);\n\n\t\t$this->_attr[self::MINUTE] = [];\n\t\tforeach (explode(',', $matches[2]) as $match) {\n\t\t\tif (preg_match($minuteValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['min' => 0, 'end' => 59];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['min' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $data['min'];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 59; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::MINUTE][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::HOUR] = [];\n\t\tforeach (explode(',', $matches[3]) as $match) {\n\t\t\tif (preg_match($hourValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['hour' => 0, 'end' => 23];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['hour' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $m2[1];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 23; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::HOUR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::DAY_OF_MONTH] = [];\n\t\tforeach (explode(',', $matches[4]) as $match) {\n\t\t\tif (preg_match($domValidator, $match, $m2)) {\n\t\t\t\t$data = ['dom' => $m2[1]]; // *, ?, \\d, L\n\t\t\t\t$data['domWeekday'] = $m2[2] ?? null;\n\t\t\t\t$data['end'] = $m2[3] ?? ($m2[1] != 'L' ? $m2[1] : null);\n\t\t\t\t//$data['endWeekday'] = $m2[4] ?? null;\n\t\t\t\t$data['endWeekday'] = $m2[4] ?? (($m2[3] ?? null) ? null : $data['domWeekday']);\n\t\t\t\t$data['period'] = (int) max($m2[5] ?? 1, 1);\n\t\t\t\tif (!($m2[3] ?? 0) && ($m2[5] ?? 0)) {\n\t\t\t\t\t$data['end'] = 31; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::DAY_OF_MONTH][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::MONTH_OF_YEAR] = [];\n\t\tforeach (explode(',', $matches[5]) as $match) {\n\t\t\tif (preg_match($monthValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['moy' => 1, 'end' => 12];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['moy' => (int) $this->translateMonthOfYear($m2[1])];\n\t\t\t\t\t$data['end'] = (isset($m2[2]) && $m2[2]) ? (int) $this->translateMonthOfYear($m2[2]) : $data['moy'];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 12; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::MONTH_OF_YEAR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::DAY_OF_WEEK] = [];\n\t\tforeach (explode(',', $matches[6]) as $match) {\n\t\t\tif (preg_match($dowValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*' || $m2[1] === '?') {\n\t\t\t\t\t$data = ['dow' => 0, 'end' => 6];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['dow' => (int) $this->translateDayOfWeek($m2[1])];\n\t\t\t\t\t$data['end'] = (isset($m2[3]) && $m2[3]) ? (int) $this->translateDayOfWeek($m2[3]) : $data['dow'];\n\t\t\t\t}\n\t\t\t\t$data['lastDow'] = $m2[2] ?? null;\n\t\t\t\t$data['lastEnd'] = $m2[4] ?? null;\n\t\t\t\t$data['period'] = (int) max($m2[5] ?? 1, 1);\n\t\t\t\t$data['week'] = $m2[6] ?? null;\n\t\t\t\tif (!($m2[3] ?? 0) && ($m2[5] ?? 0)) {\n\t\t\t\t\t$data['end'] = 6; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::DAY_OF_WEEK][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::YEAR] = [];\n\t\t$matches[7] ??= '*';\n\t\tforeach (explode(',', $matches[7]) as $match) {\n\t\t\tif (preg_match($yearValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['year' => self::YEAR_MIN];\n\t\t\t\t\t$data['end'] = self::YEAR_MAX;\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['year' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $m2[1];\n\t\t\t\t}\n\t\t\t\t$data['period'] = max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = self::YEAR_MAX; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::YEAR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\t}", "function Analyze_Schedule($schedule, $verify=false, $rules=NULL)\n{\n\n\t$ach_failure_map = Fetch_ACH_Return_Code_Map();\n\t$card_failure_map = Fetch_Card_Return_Code_Map();\n\t$grace_periods = Get_Grace_Periods();\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\n\t$status = new stdClass();\n\n\t// General items or totals\n\n\t// If $verify == false, this will be the position of the first scheduled event (if there is one)\n\t// If $verify == true, this will be the position of the last event in the schedule + 1\n\t$status->stopping_location = 0;\n\t$status->ach_fee_count = 0;\n\t$status->max_reattempt_count = 0;\n\t$status->principal_in_failures = FALSE;\n\t$status->has_arrangements = FALSE;\n\t$status->has_failed_arrangements = FALSE;\n\t$status->has_debt_consolidation_payments = FALSE;\n\t$status->has_manual_renewals = FALSE;\n\t$status->has_scheduled_reattempts = FALSE;\n\t$status->initial_principal = 0.0;\n\t$status->num_qc = 0;\n\t$status->num_ach_card_failures = 0;\n\t$status->num_fatal_failures = 0;\n\t$status->num_registered_events = 0;\n\t$status->num_scheduled_events = 0;\n\t$status->posted_service_charge_count = 0;\n\t$status->attempted_service_charge_count = 0;\n\t$status->num_reg_sc_assessments = 0;\n\t$status->has_failed_int_adj_payout = FALSE;\n\n\t// Client-side information\n\t$status->next_amt_due = 0.0;\n\t$status->next_due_date = \"N/A\";\n\t$status->next_action_date = \"N/A\";\n\t$status->next_principal_due_date = \"N/A\";\n\t$status->last_service_charge_date = 'N/A';\n\t$status->next_service_charge_date = 'N/A';\n\t$status->next_service_charge_id = NULL;\n\t$status->shift_date_range = NULL;\n\t$status->reversible = FALSE;\n\t$status->cancellable = TRUE;\n\t$status->can_chargeback = FALSE;\n\t$status->can_reverse_chargeback = FALSE;\n\t$status->can_renew_loan = FALSE;\n\n\t// Title Loan Fee related items\n\t$status->has_transfer_fee = FALSE;\n\t$status->has_delivery_fee = FALSE;\n\t$status->has_lien_fee = FALSE;\n\n\t// Pending items only *from sum_pending_*\n\t$status->num_pending_items = 0;\n\t$status->pending_principal = 0.0;\n\t$status->pending_fees = 0.0;\n\t$status->pending_interest = 0.0;\n\t$status->pending_total = 0.0;\n\n\t// posted stuff (i.e. only 'complete' items affect these)\n\t// *from balance_complete*\n\t$status->posted_principal = 0.0;\n\t$status->posted_fees = 0.0;\n\t$status->posted_interest = 0.0;\n\t$status->posted_total = 0.0;\n\t$status->paid_interest = 0.0;\n\t$status->paid_interest_count = 0;\n\t$status->paid_principal = 0.0;\n\t$status->paid_principal_count = 0;\n\t$status->paid_fees = 0.0;\n\t$status->paid_fee_count = 0;\n\n\t$status->Completed_SC_Credits = 0;\n\t$status->Completed_SC_Debits =0;\n\t$status->Failed_Princ_non_reatts = 0;\n\t$status->Completed_Reatts = 0;\n\n\t// Posted and pending (for use in payouts and other pending sensitive transactions)\n\t$status->posted_and_pending_principal = 0.0;\n\t$status->posted_and_pending_fees = 0.0;\n\t$status->posted_and_pending_interest = 0.0;\n\t$status->posted_and_pending_total = 0.0;\n\t$status->posted_service_charge_total = 0.0;\n\n\t// running balances (included everything analyzed)\n\t$status->running_principal = 0.0;\n\t$status->running_fees = 0.0;\n\t$status->running_interest = 0.0;\n\t$status->running_total = 0.0;\n\t$status->total_paid = 0.0;\n\n\t// Lists\n\t$status->quickchecks = array();\n\t$outstanding = array('ach' => array(), 'sc' => array());\n\t$fail_set = array();\n\t$debits = array();\n\t$posted_schedule = array();\n\t$oids = array();\n\t$status->failed_partials = array();\n\t// Internal value only\n\t$date_effective_init = $fail_date = '1970-01-01';\n\n\t// If there are no schedule items, you can't cancel - there's nothing to cancel - no items mean no balance too.\n\tif (count($schedule) == 0) $status->cancellable = false;\n\n\t// if we have only cancel type transactions, we can't cancel. This flag is for if we see any.\n\t$non_cancel_trans = false;\n\n\tforeach ($schedule as $e)\n\t{\n\t\t/* We need to make sure we get ALL origin ids to determine\n\t\tthe appropriate failset. */\n\t\tif ($e->origin_id !== null)\n\t\t{\n\t\t\t$oids[] = $e->origin_id;\n\t\t}\n\n\t\t// if we have only cancel type transactions, we can't cancel. Flag if we see any.\n\t\tif (!in_array($e->type, array('cancel','card_cancel'))) $non_cancel_trans = true;\n\n\t\t// Used to determine whether or not the schedule has any\n\t\t// scheduled events\n\t\tif($e->status === 'scheduled')\n\t\t{\n\t\t\t$status->num_scheduled_events++;\n\t\t\tif($e->type == 'assess_service_chg' && $e->service_charge != 0 && $status->next_service_charge_date == 'N/A')\n\t\t\t{\n\t\t\t\t$status->next_service_charge_id = $e->event_schedule_id;\n\t\t\t\t$status->next_service_charge_date = $e->date_event;\n\t\t\t}\n\t\t}\n\n\t\tif($e->status === 'scheduled' && $e->context === 'reattempt') $status->has_scheduled_reattempts = TRUE;\n\n\t\tif(in_array($e->type, array('repayment_principal','card_repayment_principal')) && $e->context === 'manual') $status->has_manual_renewals = TRUE;\n\n\t\tif($e->type === 'payment_debt' || $e->type === 'payment_debt_principal' || $e->type === 'payment_debt_fees')\n\t\t{\n\t\t\t$status->has_debt_consolidation_payments = TRUE;\n\t\t}\n\n\t\t// From this point on, we don't do scheduled items unless we're verifying.\n\t\tif (!($verify) && ($e->status === 'scheduled')) continue;\n\t\tif($e->status !== 'scheduled') $status->num_registered_events++;\n\n\t\t// First add it to the running balances\n\t\tif ($e->status !== 'failed')\n\t\t{\n\t\t\t$status->running_principal = bcadd($status->running_principal,$e->principal,2);\n\t\t\t$status->running_fees = bcadd($status->running_fees,$e->fee,2);\n\t\t\t$status->running_interest = bcadd($status->running_interest,$e->service_charge,2);\n\t\t}\n\n\t\tif($e->type === 'quickcheck') { $status->num_qc++; $status->quickchecks[] = $e; }\n\t\tif ($e->context === 'arrangement' || $e->context === 'partial')\n\t\t{\n\n\t\t\tif ($e->status === 'scheduled')\n\t\t\t$status->has_arrangements = true;\n\n\t\t\t// Mantis:9820 - business rule needs to apply to failed arrangements only. flagging state here.\n\t\t\tif ($e->status === 'failed')\n\t\t\t{\n\t\t\t$status->has_failed_arrangements = true;\n\t\t\t\tif($e->context == 'partial')\n\t\t\t\t{\n\t\t\t\t\t$status->failed_partials[] = $e;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\n\t\t// Determine how it affects aggregates\n\t\tswitch($e->status)\n\t\t{\n\t\t\tcase 'failed':\n\t\t\t\t{\n\t\t\t\t\tif ($e->principal > 0.0) $status->principal_in_failures = true;\n\t\t\t\t\tif (@strtotime($e->return_date) > @strtotime($fail_date))\n\t\t\t\t\t{\n\t\t\t\t\t\t$fail_date = $e->return_date;\n\t\t\t\t\t\t$fail_set = array();\n\t\t\t\t\t}\n\t\t\t\t\t$fail_set[] = $e;\n\n\t\t\t\t\tif($e->context == 'arrangement' || $e->context == 'partial')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->made_arrangement = TRUE;\n\t\t\t\t\t}\n\t\t\t\t\t//add check if fatal ach is on current bank acct\n\t\t\t\t\tif (isset($e->ach_return_code_id) && $ach_failure_map[$e->ach_return_code_id]['is_fatal'] === 'yes' && $e->bank_aba == $e->current_bank_aba && $e->bank_account == $e->current_bank_account) $status->num_fatal_failures++;\n\t\t\t\t\t//add check if fatal card\n\t\t\t\t\tif (isset($e->return_code) && ($e->is_fatal == 1) && ($e->clearing_type == 'card')) $status->num_fatal_failures++;\n\n\t\t\t\t\tif (Is_Service_Charge_Payment($e))\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->attempted_service_charge_count++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (($e->type == 'adjustment_internal' || $e->type == 'adjustment_internal_fees') && $e->context == 'payout')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->has_failed_int_adj_payout = TRUE;\n\t\t\t\t\t}\n\t\t\t\t\t////////////\n\t\t\t\t\tif ($e->clearing_type == 'ach' || $e->clearing_type == 'card')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($e->date_effective > $date_effective_init)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$status->num_ach_card_failures++;\n\t\t\t\t\t\t\t$date_effective_init = $e->date_effective;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'pending':\n\t\t\t\t{\n\t\t\t\t\t$status->num_pending_items++;\n\n\t\t\t\t\t// There was a problem with Complete Schedule not seeing the pending\n\t\t\t\t\t// service charges and would produce additional charges. This appears\n\t\t\t\t\t// to fix it and not cause harm elsewhere. [Mantis:1680]\n\t\t\t\t\tif (Is_Service_Charge_Payment($e))\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->posted_service_charge_count++;\n\t\t\t\t\t\t$status->attempted_service_charge_count++;\n\t\t\t\t\t\t$status->posted_service_charge_total = bcadd($status->posted_service_charge_total,$e->service_charge,2);\n\t\t\t\t\t\t$el = array_shift($outstanding['sc']);\n\t\t\t\t\t\t$el->associated_event = $e;\n\t\t\t\t\t}\n\n\t\t\t\t\t$status->pending_principal = bcadd($status->pending_principal,$e->principal,2);\n\t\t\t\t\t$status->pending_fees = bcadd($status->pending_fees,$e->fee,2);\n\t\t\t\t\t$status->pending_interest = bcadd($status->pending_interest,$e->service_charge,2);\n\t\t\t\t\tif ($e->principal > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->posted_principal = bcadd($status->posted_principal,$e->principal,2);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($e->service_charge <> 0) $status->last_pending_service_charge_date = $e->date_event;\n\n\t\t\t\t\t$status->posted_and_pending_principal = bcadd($status->posted_and_pending_principal,$e->principal);\n\t\t\t\t\t$status->posted_and_pending_fees = bcadd($status->posted_and_pending_fees,$e->fee);\n\t\t\t\t\t$status->posted_and_pending_interest = bcadd($status->posted_and_pending_interest,$e->service_charge);\n\t\t\t\t\t$status->posted_and_pending_total = bcadd($status->posted_and_pending_total,($e->fee + $e->service_charge + $e->principal));\n\n\t\t\t\t\t}\n\t\t\tcase 'new':\n\t\t\tcase 'scheduled':\n\t\t\t\t{\n\t\t\t\t\t$gp = intval($grace_periods[$e->type]->pending_period);\n\t\t\t\t\t$gt = $grace_periods[$e->type]->period_type;\n\t\t\t\t\tswitch($gt)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"calendar\":\t$n = \"Calendar\"; break;\n\t\t\t\t\t\tcase \"business\":\n\t\t\t\t\t\tdefault:\t\t\t$n = \"Business\"; break;\n\t\t\t\t\t}\n\t\t\t\t\t$function_name = \"Get_{$n}_Days_Forward\";\n\t\t\t\t\tif ($e->type === 'quickcheck')\n\t\t\t\t\t{\n\t\t\t\t\t\t// The first condition was wrong when setting it to date_effective... don't\n\t\t\t\t\t\t// know if we need to change anything else here.\n\t\t\t\t\t\tif ($e->status === 'pending') $start_date = $e->date_event;\n\t\t\t\t\t\telse $start_date = $e->date_event;\n\t\t\t\t\t\t$end_date = $pd_calc->$function_name($start_date, $gp);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($e->status === 'pending')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$end_date = $pd_calc->$function_name($e->date_effective, $gp);\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$end_date = $pd_calc->$function_name($e->date_effective, $gp);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$e->pending_end = $end_date;\n\t\t\t\t} break;\n\t\t\tcase 'complete':\n\t\t\t\t{\n\t\t\t\t\tif (preg_match('/refund_3rd_party/', $e->type) != 0) continue;\n\t\t\t\t\t$status->posted_principal = bcadd($status->posted_principal,$e->principal);\n\t\t\t\t\t$status->posted_fees = bcadd($status->posted_fees,$e->fee);\n\t\t\t\t\t$status->posted_interest = bcadd($status->posted_interest,$e->service_charge);\n\t\t\t\t\t$status->posted_total = bcadd($status->posted_total,($e->principal + $e->service_charge + $e->fee));\n\n\t\t\t\t\t$status->posted_and_pending_principal = bcadd($status->posted_and_pending_principal,$e->principal);\n\t\t\t\t\t$status->posted_and_pending_fees = bcadd($status->posted_and_pending_fees,$e->fee);\n\n\t\t\t\t\t$status->posted_and_pending_interest = bcadd($status->posted_and_pending_interest,$e->service_charge) ;\n\n\t\t\t\t\t$status->posted_and_pending_total = bcadd($status->posted_and_pending_total,($e->principal + $e->service_charge + $e->fee));\n\n\t\t\t\t\tif ($e->service_charge <> 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->last_pending_service_charge_date = $e->date_event;\n\t\t\t\t\t\t$status->last_service_charge_date = $e->date_event;\n\t\t\t\t\t}\n\t\t\t\t\tif($e->type == 'assess_service_chg' && $e->service_charge != 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t//$status->next_service_charge_id = $e->event_schedule_id;\n\t\t\t\t\t\t$status->last_service_charge_date = $e->date_event;\n\t\t\t\t\t}\n\t\t\t\t\tif ($e->principal < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->paid_principal = bcadd($status->paid_principal,$e->principal,2);\n\t\t\t\t\t\t$status->paid_principal_count ++;\n\t\t\t\t\t}\n\t\t\t\t\tif ($e->fee < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->paid_fees = bcadd($status->paid_fees,$e->fee,2);\n\t\t\t\t\t\t$status->paid_fee_count ++;\n\t\t\t\t\t}\n\t\t\t\t\tif ($e->service_charge < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->paid_interest = bcadd($status->paid_interest,$e->service_charge,2);\n\t\t\t\t\t\t$status->paid_interest_count ++;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($e->amounts as $a)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($a->amount < 0) $status->total_paid = bcadd($status->total_paid,$a->amount,2);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\tdefault:\n\t\t}\n\n\t\tif (($e->principal + $e->fee + $e->service_charge) < 0.0) $debits[] = $e;\n\n\t\t// Now determine how it affects event breakdown -- only completed items\n\t\t// OR non-failure items if we're verifying\n\t\tif (($e->status === 'complete') || ($verify && ($e->status != 'failed')))\n\t\t{\n\t\t\tif ($e->status === 'scheduled')\n\t\t\t{\n\t\t\t\tif (($status->next_principal_due_date === \"N/A\") &&\n\t\t\t\t$e->principal < 0)\n\t\t\t\t{\n\t\t\t\t\t$status->next_principal_due_date = $e->date_event;\n\t\t\t\t}\n\n\t\t\t\tif (($status->next_action_date === \"N/A\") &&\n\t\t\t\t(($e->principal + $e->service_charge + $e->fee) < 0))\n\t\t\t\t{\n\t\t\t\t\tif (strlen($e->date_event) == 10)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->next_action_date = substr($e->date_event, 5, 2) . '-'\n\t\t\t\t\t\t. substr($e->date_event, -2, 2) . '-'\n\t\t\t\t\t\t. substr($e->date_event, 0, 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$status->next_action_date = $e->date_event;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (strlen($e->date_effective) == 10)\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->next_due_date = substr($e->date_effective, 5, 2) . '-'\n\t\t\t\t\t\t. substr($e->date_effective, -2, 2) . '-'\n\t\t\t\t\t\t. substr($e->date_effective, 0, 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$status->next_due_date = $e->date_effective;\n\t\t\t\t\t}\n\t\t\t\t\t$status->shift_date_range = array();\n\n\t\t\t\t\t// Generate the dates that can be used in the stupid dropdown\n\t\t\t\t\t$adjustment_span = isset($rules['max_sched_adjust']) ? $rules['max_sched_adjust'] : 1;\n\t\t\t\t\t$ending = $pd_calc->Get_Business_Days_Forward($e->date_effective, $adjustment_span);\n\t\t\t\t\t$i = $pd_calc->Get_Closest_Business_Day_Forward(date(\"Y-m-d\"));\n\t\t\t\t\twhile (strtotime($i) < strtotime($ending))\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->shift_date_range[] = $i;\n\t\t\t\t\t\t$i = $pd_calc->Get_Next_Business_Day($i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ((($e->principal + $e->fee + $e->service_charge) < 0) &&\n\t\t\t\t(date(\"m-d-Y\", strtotime($e->date_event)) === $status->next_action_date))\n\t\t\t\t{\n\t\t\t\t\t$status->next_amt_due += abs($e->principal + $e->fee + $e->service_charge);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch($e->type)\n\t\t\t{\n\t\t\t\tcase 'converted_principal_bal':\n\t\t\t\tcase 'loan_disbursement':\n\t\t\t\tcase 'card_disbursement':\n\t\t\t\tcase 'moneygram_disbursement':\n\t\t\t\tcase 'check_disbursement':\n\t\t\t\t\tif (($e->service_charge < 0.00) || ($e->fee < 0.00) || ($e->principal <> 0.00))\n\t\t\t\t\t{\n\t\t\t\t\t\t$cancelation_delay = ($rules['cancelation_delay']) ? $rules['cancelation_delay'] : 3;\n\t\t\t\t\t\t$cancel_limit = $pd_calc->Get_Business_Days_Forward($e->date_event, $cancelation_delay);\n\t\t\t\t\t\t// The rule is \"If it's been less than x days since the last payment.\"\n\t\t\t\t\t\tif (strtotime(\"now\") > (strtotime($cancel_limit) + 86399)) $status->cancellable = false;\n\t\t\t\t\t}\n\t\t\t\t\t$status->initial_principal = $e->principal;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'assess_service_chg':\n\t\t\t\tcase 'converted_service_chg_bal':\n\t\t\t\t\tif($e->status === 'complete')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_SC_Credits = bcadd($status->Completed_SC_Credits,$e->service_charge,2);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$status->num_reg_sc_assessments++;\n\t\t\t\t\t$outstanding['sc'][] = $e;\n\t\t\t\t\tbreak;\n\t\t\t\t\t// Converted sc event means a) they already accrued a sc, and 2) they already paid a sc\n\t\t\t\tcase 'converted_sc_event':\n\t\t\t\tcase 'credit_card_fees':\n\t\t\t\tcase 'manual_ach':\n\t\t\t\t\t$status->posted_service_charge_count++;\n\t\t\t\t\t$status->attempted_service_charge_count++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'payment_service_chg':\n\t\t\t\tcase 'card_payment_service_chg':\n\t\t\t\t\tif ($e->status === 'complete')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->posted_service_charge_count++;\n\t\t\t\t\t\t$status->attempted_service_charge_count++;\n\t\t\t\t\t\t$status->posted_service_charge_total = bcadd($status->posted_service_charge_total,$e->service_charge,2);\n\n\t\t\t\t\t\t$status->Completed_SC_Debits = bcadd($status->Completed_SC_Debits,$e->service_charge,2);\n\t\t\t\t\t}\n\t\t\t\t\t$el = array_shift($outstanding['sc']);\n\t\t\t\t\t$el->associated_event = $e;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'assess_fee_ach_fail':\n\t\t\t\tcase 'assess_fee_card_fail':\n\t\t\t\t\t$status->ach_fee_count++;\n\t\t\t\t\t$outstanding['ach'][] = $e;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'payment_fee_ach_fail':\n\t\t\t\tcase 'payment_fee_card_fail':\n\t\t\t\t\t$el = array_shift($outstanding['ach']);\n\t\t\t\t\t$el->associated_event = $e;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'writeoff_fee_ach_fail':\n\t\t\t\tcase 'writeoff_fee_card_fail':\n\t\t\t\t\t$el = array_shift($outstanding['ach']);\n\t\t\t\t\t$el->associated_event = $e;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'chargeback':\n\t\t\t\t\t$status->can_reverse_chargeback = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'assess_fee_lien':\n\t\t\t\t\t$status->has_lien_fee = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'assess_fee_delivery':\n\t\t\t\t\t$status->has_delivery_fee = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'assess_fee_transfer':\n\t\t\t\t\t$status->has_transfer_fee = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'credit_card':\n\t\t\t\tcase 'credit_card_princ':\n\t\t\t\tcase 'credit_card_fees':\n\t\t\t\t\tif($e->status === 'complete' )\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_Reatts = bcadd($status->Completed_Reatts,$e->principal_amount,2);\n\t\t\t\t\t\t$status->Completed_SC_Debits = bcadd($status->Completed_SC_Debits,$e->service_charge,2);\n\n\t\t\t\t\t}\n\t\t\t\t\t$status->can_chargeback = TRUE;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'payout':\n\t\t\t\tcase 'card_payout':\n\t\t\t\t\t$status->has_payout = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'repayment_principal':\n\t\t\t\tcase 'card_repayment_principal':\n\t\t\t\t\tif($e->status === 'complete' && !empty($e->origin_id) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_Reatts = bcadd($status->Completed_Reatts,$e->principal_amount,2);\n\n\t\t\t\t\t}\n\t\t\t\t\telseif ($e->status === 'failed' && empty($e->origin_id))\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Failed_Princ_non_reatts = bcadd($status->Failed_Princ_non_reatts,$e->principal_amount,2);\n\n\t\t\t\t\t}\n\n\t\t\t\tcase 'payment_arranged':\n\t\t\t\tcase 'payment_arranged_princ':\n\t\t\t\tcase 'card_payment_arranged':\n\t\t\t\tcase 'card_payment_arranged_princ':\n\t\t\t\t\tif($e->status === 'complete' && !empty($e->origin_id))\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_Reatts = bcadd($status->Completed_Reatts,$e->principal_amount,2);\n\n\t\t\t\t\t}\n\t\t\t\t\telseif ($e->status === 'failed' && empty($e->origin_id) && $e->context == 'manual')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Failed_Princ_non_reatts = bcadd($status->Failed_Princ_non_reatts,$e->principal_amount,2);\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'payment_arranged_fees':\n\t\t\t\tcase 'card_payment_arranged_fees':\n\t\t\t\tcase 'payment_debt':\n\t\t\t\tcase 'paydown':\n\t\t\t\tcase 'card_paydown':\n\t\t\t\tcase 'payout_principal':\n\t\t\t\tcase 'payout_fees':\n\t\t\t\tcase 'cancel_principal':\n\t\t\t\tcase 'card_payout_principal':\n\t\t\t\tcase 'card_payout_fees':\n\t\t\t\tcase 'card_cancel_principal':\n\t\t\t\tcase 'adjustment_internal':\n\t\t\t\tcase 'adjustment_internal_princ':\n\t\t\t\tcase 'adjustment_internal_fees':\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'payment_manual':\n\t\t\t\tcase 'payment_manual_princ':\n\t\t\t\tcase 'card_payment_manual':\n\t\t\t\tcase 'card_payment_manual_princ':\n\t\t\t\t\tif($e->status === 'complete')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_Reatts = bcadd($status->Completed_Reatts,$e->principal_amount,2);\n\t\t\t\t\t\t$status->Completed_SC_Debits = bcadd($status->Completed_SC_Debits,$e->service_charge,2);\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'payment_manual_fees':\n\t\t\t\tcase 'card_payment_manual_fees':\n\t\t\t\tcase 'full_balance':\n\t\t\t\tcase 'card_full_balance':\n\t\t\t\tcase 'quickcheck':\n\t\t\t\tcase 'debt_writeoff':\n\t\t\t\tcase 'debt_writeoff_princ':\n\t\t\t\tcase 'debt_writeoff_fees':\n\t\t\t\tcase 'ext_recovery':\n\t\t\t\tcase 'ext_recovery_princ':\n\t\t\t\tcase 'ext_recovery_fees':\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'money_order':\n\t\t\t\tcase 'money_order_fees':\n\t\t\t\tcase 'money_order_princ':\n\t\t\t\tcase 'moneygram':\n\t\t\t\tcase 'moneygram_fees':\n\t\t\t\tcase 'moneygram_princ':\n\t\t\t\tcase 'western_union':\n\t\t\t\tcase 'western_union_fees':\n\t\t\t\tcase 'western_union_princ':\n\t\t\t\t\tif($e->status === 'complete' )\n\t\t\t\t\t{\n\t\t\t\t\t\t$status->Completed_Reatts = bcadd($status->Completed_Reatts,$e->principal_amount,2);\n\t\t\t\t\t\t$status->Completed_SC_Debits = bcadd($status->Completed_SC_Debits,$e->service_charge,2);\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'refund':\n\t\t\t\tcase 'card_refund':\n\t\t\t\tcase 'refund_3rd_party':\n\t\t\t\tcase 'cancel':\n\t\t\t\tcase 'card_cancel':\n\n\n\t\t\t\t\tbreak; // Nothing to do for these yet\n\t\t\t}\n\t\t}\n\t\t$status->stopping_location++;\n\t\t$posted_schedule[] = $e;\n\t}\n\n\t//echo \"<pre>\".print_r($posted_schedule,true).\"</pre>SC_credit:$status->Completed_SC_Credits + SC_debits:$status->Completed_SC_Debits - Failed_princ:$status->Failed_Princ_non_reatts - completed_reatt:$status->Completed_Reatts<br>\";\n\t//$status->past_due_balance = ($status->Completed_SC_Credits + $status->Completed_SC_Debits) - ($status->Failed_Princ_non_reatts - $status->Completed_Reatts);\n\t$status->past_due_balance = bcsub(bcadd($status->Completed_SC_Credits, $status->Completed_SC_Debits), bcsub($status->Failed_Princ_non_reatts, $status->Completed_Reatts));\n\n\t$status->outstanding = $outstanding;\n\n\t// if we have only cancel type transactions, we can't cancel. If this flag is not set, they were all cancel transactions. It is not cancellable.\n\tif (!$non_cancel_trans) $status->cancellable = false;\n\n\n\tif (!$verify)\n\t{\n\t\t// We need to filter the fail set - the initial run-through\n\t\t// put in ALL the failures, but we only really want the\n\t\t// newest ones. This is determined by the fact that if\n\t\t// the transaction_register_id of any failures equals the\n\t\t// origin_id of any other transaction, the former failure is\n\t\t// old, and therefore should be removed.\n\t\t$new_fail_set = array();\n\t\tforeach ($fail_set as $f)\n\t\t{\n\t\t\tif(! in_array($f->transaction_register_id, $oids))\n\t\t\t{\n\t\t\t\t$new_fail_set[] = $f;\n\t\t\t}\n\t\t}\n\n\t\t$status->fail_set = $new_fail_set;\n\t}\n\n\t//$status->max_reattempt_count = Count_Max_Reattempts($schedule);\n\n\t$status->debits = $debits;\n\t$status->posted_schedule = $posted_schedule;\n\t$schedule_status = $status;\n\n\t$status->pending_total = $status->pending_principal + $status->pending_fees + $status->pending_interest;\n\t$status->posted_total = $status->posted_principal + $status->posted_fees + $status->posted_interest;\n\t$status->running_total = $status->running_principal + $status->running_fees + $status->running_interest;\n\n\t$status->posted_principal = round($status->posted_principal, 2); \t//mantis:4560\n\t$status->posted_fees = round($status->posted_fees, 2);\t\t\t//mantis:4560\n\t$status->posted_interest = round($status->posted_interest, 2);\t\t\t//mantis:9701\n\n\t// Check to see if we allow manual loan renewals and we're within the renewal period\n\tif(($status->next_principal_due_date !== 'N/A') && (ECash::getConfig()->LOAN_RENEWAL_PENDING_PERIOD))\n\t{\n\t\tif(\tDate_Util_1::dateDiff(date('Y-m-d'), $status->next_principal_due_date) <= ECash::getConfig()->LOAN_RENEWAL_PENDING_PERIOD)\n\t\t{\n\t\t\t$status->can_renew_loan = TRUE;\n\t\t}\n\t}\n\treturn $status;\n}", "function ReadDateSchedules($date)\n {\n $where=$this->UnitEventWhere(array(\"Date\" => $date[ \"ID\" ]));\n\n $rschedules=array();\n foreach ($this->Sql_Select_Hashes($where) as $schedule)\n {\n $schedule=$this->PostProcess($schedule);\n \n $timeid=$schedule[ \"Time\" ];\n $roomid=$schedule[ \"Room\" ];\n \n if (empty($rschedules[ $timeid ])) $rschedules[ $timeid ]=array();\n $rschedules[ $timeid ][ $roomid ]=$schedule;\n\n if (!empty($schedule[ \"Submission\" ]))\n {\n $submissionid=$schedule[ \"Submission\" ];\n }\n }\n \n \n return $rschedules;\n }", "function check_sched_enabled() {\n\t\t$t = time();\n\t\tif (\n\t\t\t$this->get_sched()\n\t\t\t&& $t >= $this->get_sched_t_s()\n\t\t\t&& $t <= $this->get_sched_t_e()\n\t\t) {\n\t\t\t// Scheduling active -> enable.\n\t\t\t$this->set_enabled(TRUE);\n\t\t\t$this->write();\n\t\t} else if ($this->get_sched()){\n\t\t\t// Scheduling inactive -> disable.\n\t\t\t$this->set_enabled(FALSE);\n\t\t\t$this->write();\n\t\t}\n\t}", "function bpsPro_schedule_PFWAP_check() {\n$options = get_option('bulletproof_security_options_pfw_autopilot');\n$bpsPFWAPCronCheck = wp_get_schedule('bpsPro_PFWAP_check');\n$killit = '';\n\t\n\tif ( ! get_option('bulletproof_security_options_pfw_autopilot' ) || ! $options['bps_pfw_autopilot_cron'] || $options['bps_pfw_autopilot_cron'] == '' ) {\n\t\treturn $killit;\n\t}\n\t\n\tif ( $options['bps_pfw_autopilot_cron'] == 'On' ) {\n\t\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '1' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_5' || $bpsPFWAPCronCheck == 'minutes_10' || $bpsPFWAPCronCheck == 'minutes_15' || $bpsPFWAPCronCheck == 'minutes_30' || $bpsPFWAPCronCheck == 'minutes_60' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled( 'bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_1', 'bpsPro_PFWAP_check');\n\t}\n\t}\n\t\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '5' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_1' || $bpsPFWAPCronCheck == 'minutes_10' || $bpsPFWAPCronCheck == 'minutes_15' || $bpsPFWAPCronCheck == 'minutes_30' || $bpsPFWAPCronCheck == 'minutes_60' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled('bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_5', 'bpsPro_PFWAP_check' );\n\t}\n\t}\n\t\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '10' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_1' || $bpsPFWAPCronCheck == 'minutes_5' || $bpsPFWAPCronCheck == 'minutes_15' || $bpsPFWAPCronCheck == 'minutes_30' || $bpsPFWAPCronCheck == 'minutes_60' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled('bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_10', 'bpsPro_PFWAP_check' );\n\t}\n\t}\n\t\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '15' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_1' || $bpsPFWAPCronCheck == 'minutes_5' || $bpsPFWAPCronCheck == 'minutes_10' || $bpsPFWAPCronCheck == 'minutes_30' || $bpsPFWAPCronCheck == 'minutes_60' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled('bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_15', 'bpsPro_PFWAP_check' );\n\t}\n\t}\n\t\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '30' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_1' || $bpsPFWAPCronCheck == 'minutes_5' || $bpsPFWAPCronCheck == 'minutes_10' || $bpsPFWAPCronCheck == 'minutes_15' || $bpsPFWAPCronCheck == 'minutes_60' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled('bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_30', 'bpsPro_PFWAP_check' );\n\t}\n\t}\n\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '60' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_1' || $bpsPFWAPCronCheck == 'minutes_5' || $bpsPFWAPCronCheck == 'minutes_10' || $bpsPFWAPCronCheck == 'minutes_15' || $bpsPFWAPCronCheck == 'minutes_30' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled('bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_60', 'bpsPro_PFWAP_check' );\n\t}\n\t}\n\n\t}\n\telseif ( $options['bps_pfw_autopilot_cron'] == 'Off' ) { \n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n}", "public function schedules()\n {\n $inVacation = config('schedules')['vacation'];\n $weekdays = config('schedules')['tabData']['days'];\n\n if ($inVacation) {\n $schedules = [\n 'sun' => null,\n 'mon' => null,\n 'tue' => null,\n 'wed' => null,\n 'thu' => null,\n 'fri' => null,\n 'sat' => null\n ];\n\n $scheduleMessage = config('schedules')['vacationMessage'] . '<br>...';\n } else {\n $schedules = $this->schedules->getByDay();\n $scheduleMessage = 'Sem horários<br>...';\n }\n\n return [\n 'weekDays' => $weekdays,\n 'currentDay' => \\strtolower(\\date('D')),\n 'schedules' => $schedules,\n 'scheduleEmptyMessage' => $scheduleMessage\n ];\n }", "function eo_get_schedule_summary($id=''){\n\tglobal $post,$wp_locale;\n\n\t$ical2day = array(\n\t\t'SU'=>\t$wp_locale->weekday[0],\n\t\t'MO'=>$wp_locale->weekday[1],\n\t\t'TU'=>\t$wp_locale->weekday[2],\n\t\t'WE'=>$wp_locale->weekday[3],\n\t\t'TH'=>$wp_locale->weekday[4],\n\t\t'FR'=>$wp_locale->weekday[5],\n\t\t'SA'=>$wp_locale->weekday[6]\n\t);\n\n\t$nth= array(\n\t\t__('last','eventorganiser'),'',__('first','eventorganiser'),__('second','eventorganiser'),__('third','eventorganiser'),__('fourth','eventorganiser')\n\t);\n\n\t$reoccur = eo_get_reoccurence($id);\n\tif(empty($reoccur))\n\t\treturn false;\n\n\t$return='';\n\n\tif($reoccur['reoccurrence']=='once'){\n\t\t$return = __('one time only','eventorganiser');\n\n\t}else{\n\t\tswitch($reoccur['reoccurrence']):\n\n\t\t\tcase 'daily':\n\t\t\t\tif($reoccur['frequency']==1):\n\t\t\t\t\t$return .=__('every day','eventorganiser');\n\t\t\t\telse:\n\t\t\t\t\t$return .=sprintf(__('every %d days','eventorganiser'),$reoccur['frequency']);\n\t\t\t\tendif;\n\t\t\t\tbreak;\n\n\t\t\tcase 'weekly':\n\t\t\t\tif($reoccur['frequency']==1):\n\t\t\t\t\t$return .=__('every week on','eventorganiser');\n\t\t\t\telse:\n\t\t\t\t\t$return .=sprintf(__('every %d weeks on','eventorganiser'),$reoccur['frequency']);\n\t\t\t\tendif;\n\n\t\t\t\t$weekdays = $reoccur['meta'];\n\t\t\t\tforeach($weekdays as $ical_day){\n\t\t\t\t\t$days[] = $ical2day[$ical_day];\n\t\t\t\t\t}\n\t\t\t\t$return .=' '.implode(', ',$days);\n\t\t\t\tbreak;\n\n\t\t\tcase 'monthly':\n\t\t\t\tif($reoccur['frequency']==1):\n\t\t\t\t\t$return .=__('every month on the','eventorganiser');\n\t\t\t\telse:\n\t\t\t\t\t$return .=sprintf(__('every %d months on the','eventorganiser'),$reoccur['frequency']);\n\t\t\t\tendif;\n\t\t\t\t$return .= ' ';\n\t\t\t\t$bymonthday =preg_match('/^BYMONTHDAY=(\\d{1,2})/' ,$reoccur['meta'],$matches);\n\n\t\t\t\tif($bymonthday ){\n\t\t\t\t\t$d = intval($matches[1]);\n\t\t\t\t\t$m =intval($reoccur['start']->format('n'));\n\t\t\t\t\t$y =intval($reoccur['start']->format('Y'));\n\t\t\t\t\t$reoccur['start']->setDate($y,$m,$d);\n\t\t\t\t\t$return .= $reoccur['start']->format('jS');\n\n\t\t\t\t}elseif($reoccur['meta']=='date'){\n\t\t\t\t\t$return .= $reoccur['start']->format('jS');\n\n\t\t\t\t}else{\n\t\t\t\t\t$byday = preg_match('/^BYDAY=(-?\\d{1,2})([a-zA-Z]{2})/' ,$reoccur['meta'],$matches);\n\t\t\t\t\tif($byday):\n\t\t\t\t\t\t$n=intval($matches[1])+1;\n\t\t\t\t\t\t$return .=$nth[$n].' '.$ical2day[$matches[2]];\n\t\t\t\t\telse:\n\t\t\t\t\t\t$bydayOLD = preg_match('/^(-?\\d{1,2})([a-zA-Z]{2})/' ,$reoccur['meta'],$matchesOLD);\n\t\t\t\t\t\t$n=intval($matchesOLD[1])+1;\n\t\t\t\t\t\t$return .=$nth[$n].' '.$ical2day[$matchesOLD[2]];\n\t\t\t\t\tendif;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'yearly':\n\t\t\t\tif($reoccur['frequency']==1):\n\t\t\t\t\t$return .=__('every year','eventorganiser');\n\t\t\t\telse:\n\t\t\t\t\t$return .=sprintf(__('every %d years','eventorganiser'),$reoccur['frequency']);\n\t\t\t\tendif;\n\t\t\t\tbreak;\n\n\t\tendswitch;\n\t\t\t\t\n\t\t$return .= ' '.__('until','eventorganiser').' '. eo_format_datetime($reoccur['end'],'M, jS Y');\n\t}\n\t\n\treturn $return; \n}", "static function schedule_cron() {\n\t\t$is_multisite = is_multisite();\n\t\tif ( $is_multisite ) {\n\t\t\t$primary_blog = get_current_site();\n\t\t\t$current_blog = get_current_blog_id();\n\t\t} else {\n\t\t\t$primary_blog = 1;\n\t\t\t$current_blog = 1;\n\t\t}\n\n\t\t/**\n\t\t * If we're on a multisite, only schedule the cron if we're on the primary blog\n\t\t */\n\t\tif (\n\t\t( ! $is_multisite || ( $is_multisite && $primary_blog->id === $current_blog ) )\n\t\t) {\n\t\t\t$cronsScheduled = false;\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), '5_minutes', 'wp_rest_cache_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_expired_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), 'hourly', 'wp_rest_cache_expired_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( $cronsScheduled ) {\n\t\t\t\tdo_action( 'wrc_after_schedule_cron', $primary_blog, $current_blog );\n\t\t\t}\n\t\t}\n\t}", "public function get_recurrence_rule();", "function wpcron_intervals( $schedules ) {\n\n\t// one minute\n\n\t$one_minute = array(\n\t\t\t\t\t'interval' => 60,\n\t\t\t\t\t'display' => 'One Minute'\n\t\t\t\t);\n\n\t$schedules[ 'one_minute' ] = $one_minute;\n\n\t// five minutes\n\n\t$five_minutes = array(\n\t\t\t\t\t'interval' => 300,\n\t\t\t\t\t'display' => 'Five Minutes'\n\t\t\t\t);\n\n\t$schedules[ 'five_minutes' ] = $five_minutes;\n\n\t// return data\n\n\treturn $schedules;\n\n}", "function create_schedule(){\n\t\tfor ($i=0 ; $i< 6; $i++){\n\t\t\tfor ($j = $this->times[$i] ; $j < $this->times[$i+1] ; $j++){\n\t \t\t\t$this->bedroom[$j] = $this->temps[$this->bedroom_setting[$i]];\n\t\t\t\t$this->bathroom[$j] = $this->temps[$this->bathroom_setting[$i]];\n\t\t\t\t$this->kitchen[$j] = $this->temps[$this->kitchen_setting[$i]];\n\t\t\t\t$this->livingroom[$j] = $this->temps[$this->livingroom_setting[$i]];\n\t\t\t}\n\t\t}\n\t\t$result = [$this->bedroom,$this->bathroom,$this->kitchen, $this->livingroom];\n\t\treturn $result;\n\t}", "public function rules()\n {\n return $this->initRules(new Calendar());\n }", "private function Get_Business_Rules() \n\t{\n\t\tif (empty(self::$business_rules)) \n\t\t{\n\n\t\t\t$business_rules = new ECash_Business_Rules(ECash::getMasterDb());\n\t\t\t$loan_type_id = $this->Get_Company_Loan_Type($business_rules);\n\t\t\t$rule_sets = $business_rules->Get_Rule_Sets();\n\t\t\t$rule_set_id = 0;\n\t\t\tforeach ($rule_sets as $rule_set) \n\t\t\t{\n\t\t\t\tif ($rule_set->loan_type_id == $loan_type_id && (strpos($rule_set->name, 'Nightly Task Schedule') !== FALSE)) \n\t\t\t\t{\n\t\t\t\t\t$rule_set_id = $rule_set->rule_set_id;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tif ($rule_set_id) \n\t\t\t{\n\t\t\t\tself::$business_rules = $business_rules->Get_Rule_Set_Tree($rule_set_id);\n\t\t\t}\n\t\t}\n\n\t\treturn self::$business_rules;\n\t}", "public function rrule()\n {\n if (null === $this->occurrenceCache) {\n if ($this->repeats) {\n $config = [\n 'FREQ' => strtoupper(static::$RRULEMAP[$this->repeatType]),\n 'INTERVAL' => 1,\n 'DTSTART' => $this->startDate,\n 'UNTIL' => $this->endRepeat !== 'never' ? $this->endRepeatDate ?? $this->startDate : null\n ];\n\n if ($this->endRepeat === 'never') {\n $today = DateTimeHelper::toDateTime(new DateTime('now', new DateTimeZone(Craft::$app->getTimeZone())));\n\n if ($this->repeatType === 'yearly') {\n $config['UNTIL'] = DateTimeHelper::toDateTime($today->modify('+5 years'));\n } else {\n $config['UNTIL'] = DateTimeHelper::toDateTime($today->modify('+1 year'));\n }\n }\n } else {\n $config = [\n 'FREQ' => \"DAILY\",\n 'INTERVAL' => 1,\n 'DTSTART' => $this->startDate,\n 'UNTIL' => $this->startDate\n ];\n $this->repeatType = 'daily';\n }\n\n switch ($this->repeatType) {\n case 'daily':\n case 'yearly':\n break;\n case 'weekly':\n $config['BYDAY'] = array_map(function ($day) {\n return static::$RRULEDAYMAP[$day];\n }, array_keys($this->days ?? []));\n break;\n case 'biweekly':\n $config['BYDAY'] = array_map(function ($day) {\n return static::$RRULEDAYMAP[$day];\n }, array_keys($this->days ?? []));\n $config['INTERVAL'] = 2;\n break;\n case 'monthly':\n if ($this->months === 'onMonthDay') {\n $config['BYDAY'] = Calendarize::$plugin->calendar->weekOfMonth($this->startDate) . static::$RRULEDAYMAP[$this->startDate->format('w')];\n }\n break;\n }\n\n $rset = new RSet();\n $rset->addRRule($config);\n\n if ($this->exceptions) {\n foreach ($this->exceptions as $exception) {\n $date = DateTimeHelper::toDateTime($exception);\n $date->setTime($this->startDate->format('H'), $this->startDate->format('i'));\n $rset->addExDate($date);\n }\n }\n\n // cache rset\n $this->occurrenceCache = $rset;\n }\n\n return $this->occurrenceCache;\n }", "function _get_cron_lock()\n {\n }", "public function offEmployeeSchedule() {\n \n $employeeLists = $this->EmployeesSchedules->find()\n ->contain('Employees')\n ->where([\n 'Employees.status' => 1, \n 'OR'=> [\n \"Employees.availability_status\" => 1,\n \"Employees.consult_availability_status\" => 1\n ]\n ])\n ->toArray();\n \n if(!empty($employeeLists)) {\n foreach ($employeeLists as $key => $val) {\n \n $timezone = !empty($val->timezone) ? $val->timezone : date_default_timezone_get();\n \n $schedule = json_decode($val->schedule, true);\n $consult_schedule = json_decode($val->consult_schedule, true);\n \n $date = date(\"Y-m-d\");\n $previousDate = date('Y-m-d', strtotime('-1 day'));\n \n if(!empty($schedule)) {\n \n date_default_timezone_set($timezone);\n \n $result = array_filter($schedule, function ($val) use ($date, $previousDate) {\n $compareDate = \\DateTime::createFromFormat('m-d-Y', $val);\n $utime = strtotime($compareDate->format('Y-m-d'));\n return $utime >= strtotime($previousDate) && $utime <= strtotime($date);\n }, ARRAY_FILTER_USE_KEY);\n \n if (! empty($result)) {\n $flag = 0;\n foreach ($result as $r_key => $r_val) {\n $compareDate = \\DateTime::createFromFormat('m-d-Y', $r_key);\n \n if($previousDate == $compareDate->format('Y-m-d')) {\n foreach ($r_val as $previous_key => $previous_val) {\n //pr($previous_val); die;\n $previousTime = explode('-', $previous_val['time']);\n \n $previousStartTime = date('H:i', strtotime(substr($previousTime[0], 0, -1) . ':00 ' . substr($previousTime[0], -1) . 'm'));\n $previousEndTime = date('H:i', strtotime(substr($previousTime[1], 0, -1) . ':00 ' . substr($previousTime[1], -1) . 'm'));\n \n if($previousStartTime > $previousEndTime) {\n // This means schedule is next day shift\n $r_val[0] = [\n 'service_team' => $previous_val['service_team'],\n //'time' => '0a-'.$previousTime[1]\n 'time' => $previous_val['time']\n ];\n } else {\n $flag = 1;\n }\n }\n if($flag) {\n continue;\n }\n }\n \n foreach ($r_val as $v_key => $v_val) {\n if (! empty($v_val['time'])) {\n $time = explode('-', $v_val['time']);\n \n $startTime = date('H:i', strtotime(substr($time[0], 0, -1) . ':00 ' . substr($time[0], -1) . 'm'));\n $endTime = date('H:i', strtotime(substr($time[1], 0, -1) . ':00 ' . substr($time[1], -1) . 'm'));\n \n $currentTime = date('H:i');\n \n $employee = $val->employee;\n \n if(strtotime($endTime) >= strtotime(date(\"H:i\")) && strtotime($endTime) <= strtotime(date(\"H:i\", strtotime('+10 minutes')))) {\n if(!empty($employee)) {\n $employee->availability_status = 0;\n $employee->working_time = '';\n $employee->dirty('modified', true);\n $this->Employees->save($employee);\n \n /* $this->HospitalsEmployees->deleteAll([\n 'employee_id' => $val->employee_id,\n 'hospital_id' => $val->hospital_id\n ]); */\n }\n }\n }\n }\n }\n }\n }\n \n if(!empty($consult_schedule)) {\n date_default_timezone_set($timezone);\n $consultResult = array_filter($consult_schedule, function ($val) use ($date, $previousDate) {\n $compareDate = \\DateTime::createFromFormat('m-d-Y', $val);\n $utime = strtotime($compareDate->format('Y-m-d'));\n return $utime >= strtotime($previousDate) && $utime <= strtotime($date);\n }, ARRAY_FILTER_USE_KEY);\n \n if (! empty($consultResult)) {\n $cFlag = 0;\n $departments = TableRegistry::get('Departments');\n \n foreach ($consultResult as $c_key => $c_val) {\n unset($c_val['service_team']);\n \n $compareDate = \\DateTime::createFromFormat('m-d-Y', $c_key);\n \n if($previousDate == $compareDate->format('Y-m-d')) {\n $i =0;\n foreach ($c_val as $previous_key => $previous_val) {\n $previousTime = explode('-', $previous_val['time']);\n \n $previousStartTime = date('H:i', strtotime(substr($previousTime[0], 0, -1) . ':00 ' . substr($previousTime[0], -1) . 'm'));\n $previousEndTime = date('H:i', strtotime(substr($previousTime[1], 0, -1) . ':00 ' . substr($previousTime[1], -1) . 'm'));\n \n if($previousStartTime > $previousEndTime) {\n // This means schedule is next day shift\n //pr($previous_val);\n $cFlag = 0;\n $c_val[$i] = [\n 'department' => $previous_val['department'],\n 'subdepartment' => $previous_val['subdepartment'],\n 'time' => $previous_val['time'],\n 'is_first_call' => $previous_val['is_first_call'],\n 'is_attending' => $previous_val['is_attending'],\n ];\n } else {\n $cFlag = 1;\n }\n $i++;\n }\n \n if($cFlag) {\n continue;\n }\n }\n \n foreach ($c_val as $v_key => $v_val) {\n // change status of employee\n \n if (! empty($v_val['time'])) {\n $time = explode('-', $v_val['time']);\n \n $startTime = date('H:i', strtotime(substr($time[0], 0, -1) . ':00 ' . substr($time[0], -1) . 'm'));\n $endTime = date('H:i', strtotime(substr($time[1], 0, -1) . ':00 ' . substr($time[1], -1) . 'm'));\n \n $currentTime = date('H:i');\n \n $employee = $val->employee;\n \n if(strtotime($endTime) >= strtotime(date(\"H:i\")) && strtotime($endTime) <= strtotime(date(\"H:i\", strtotime('+10 minutes')))) {\n if(!empty($employee)) {\n $employee->is_consult = 0;\n $employee->working_time = '';\n $employee->is_first_call = 0;\n $employee->is_attending = 0;\n $employee->consult_availability_status = 0;\n $employee->dirty('modified', true);\n $this->Employees->save($employee);\n \n /* $this->HospitalsEmployees->deleteAll([\n 'employee_id' => $val->employee_id,\n 'hospital_id' => $val->hospital_id\n ]); */\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }", "function ScheduleDates()\n {\n $dateids=$this->CGI2Dates();\n\n $dates=array();\n foreach ($this->Dates() as $did => $date)\n {\n if (preg_grep('/^'.$date[ \"ID\" ].'$/',$dateids))\n {\n array_push($dates,$date);\n }\n }\n\n return $dates;\n }", "function recurringdowntime_get_servicegroup_cfg($servicegroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"servicegroup\") {\n continue;\n }\n }\n if ($servicegroup && !(strtolower($schedule[\"servicegroup_name\"]) == strtolower($servicegroup))) {\n continue;\n }\n if (array_key_exists('servicegroup_name', $schedule)) {\n if (is_authorized_for_servicegroup(0, $schedule[\"servicegroup_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "private function initNextCronRunInfo() {\n $offsetInSeconds = $this->getGMTOffset();\n\n // Next CRON event dates\n $nextCollectUrls = wp_next_scheduled(Factory::schedulingService()->eventCollectUrls);\n $nextCrawlPost = wp_next_scheduled(Factory::schedulingService()->eventCrawlPost);\n $nextRecrawlPost = wp_next_scheduled(Factory::schedulingService()->eventRecrawlPost);\n $nextDeletePosts = wp_next_scheduled(Factory::schedulingService()->eventDeletePosts);\n\n if($nextCollectUrls) $this->nextURLCollectionDate = date($this->dateFormat, $nextCollectUrls + $offsetInSeconds);\n if($nextCrawlPost) $this->nextPostCrawlDate = date($this->dateFormat, $nextCrawlPost + $offsetInSeconds);\n if($nextRecrawlPost) $this->nextPostRecrawlDate = date($this->dateFormat, $nextRecrawlPost + $offsetInSeconds);\n if($nextDeletePosts) $this->nextPostDeleteDate = date($this->dateFormat, $nextDeletePosts + $offsetInSeconds);\n\n /*\n * Next sites\n */\n\n // Get last site IDs\n $keySiteIdLastUrlCollection = Factory::urlSaver()->optionLastCheckedSiteId;\n $keySiteIdLastPostCrawl = Factory::postSaver()->optionLastCrawledSiteId;\n $keySiteIdLastPostRecrawl = Factory::postSaver()->optionLastRecrawledSiteId;\n $keySiteIdLastPostDelete = Factory::schedulingService()->optionKeyLastPostDeletedSiteId;\n\n // Get next site IDs using the last site IDs\n $nextSiteIdUrlCollection = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastUrlCollection);\n $nextSiteIdPostCrawl = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastPostCrawl);\n $nextSiteIdPostRecrawl = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastPostRecrawl);\n $nextSiteIdPostDelete = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastPostDelete);\n\n // Get the sites as WP_Post\n $sites = $this->getPosts([$nextSiteIdUrlCollection, $nextSiteIdPostCrawl, $nextSiteIdPostRecrawl, $nextSiteIdPostDelete], Environment::postType());\n\n // Assign the related class variables\n foreach($sites as $site) {\n if($site->ID == $nextSiteIdUrlCollection) $this->nextUrlCollectionSite = $site;\n if($site->ID == $nextSiteIdPostCrawl) $this->nextPostCrawlSite = $site;\n if($site->ID == $nextSiteIdPostRecrawl) $this->nextPostRecrawlSite = $site;\n if($site->ID == $nextSiteIdPostDelete) $this->nextPostDeleteSite = $site;\n }\n }", "public function checkScheduledTasks() {\n if (count($this->defaultTasks)) {\n $now = DBDatetime::now()->Format(DBDatetime::ISO_DATETIME);\n\n foreach ($this->defaultTasks as $task => $method) {\n $state = SqsQueueState::get()->filter('Title', $task)->first();\n\n $new = false;\n if (!$state) {\n $state = SqsQueueState::create(array(\n 'Title' => $task\n ));\n $new = true;\n $state->write();\n }\n\n // let's see if the dates are okay.\n $lastQueueRun = strtotime($state->WorkerRun);\n $lastScheduleRun = strtotime($state->LastScheduledStart);\n $lastAdded = strtotime($state->LastAddedScheduleJob);\n\n $a = $state->WorkerRun;\n $b = $state->LastScheduledStart;\n\n // if the last time it was added is more than 10 minutes ago, AND\n // the last run is more than 10 minutes since it was last started OR it's new OR it was last run more than 15 minutes ago\n if ((time() - $lastAdded > 600) && ((($lastQueueRun - $lastScheduleRun) > 600) || $new || (time() - $lastQueueRun > 900))) {\n $state->LastAddedScheduleJob = $now;\n $state->write();\n $this->sendSqsMessage($task, $method);\n }\n }\n }\n }", "function ciniki_musicfestivals_scheduleTimeslotHistory($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'scheduletimeslot_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Schedule Time Slot'),\n 'field'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'field'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'musicfestivals', 'private', 'checkAccess');\n $rc = ciniki_musicfestivals_checkAccess($ciniki, $args['tnid'], 'ciniki.musicfestivals.scheduleTimeslotHistory');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n if( preg_match(\"/(comments|grade|score)_([0-9]+)_([0-9]+)/\", $args['field'], $m) ) {\n $strsql = \"SELECT id \"\n . \"FROM ciniki_musicfestival_comments \"\n . \"WHERE registration_id = '\" . ciniki_core_dbQuote($ciniki, $m[2]) . \"' \"\n . \"AND adjudicator_id = '\" . ciniki_core_dbQuote($ciniki, $m[3]) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.musicfestivals', 'comment');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.musicfestivals.169', 'msg'=>'Unable to load comment', 'err'=>$rc['err']));\n }\n if( !isset($rc['comment']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.musicfestivals.170', 'msg'=>'Unable to find requested comment'));\n }\n $comment = $rc['comment'];\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbGetModuleHistory');\n return ciniki_core_dbGetModuleHistory($ciniki, 'ciniki.musicfestivals', 'ciniki_musicfestivals_history', $args['tnid'], 'ciniki_musicfestival_comments', $comment['id'], $m[1]);\n \n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbGetModuleHistory');\n return ciniki_core_dbGetModuleHistory($ciniki, 'ciniki.musicfestivals', 'ciniki_musicfestivals_history', $args['tnid'], 'ciniki_musicfestival_schedule_timeslots', $args['scheduletimeslot_id'], $args['field']);\n}", "protected function getProcSchedule($last_run_type)\n {\n $now = $this->processorModel->readNow();\n\n if($this->getApiThrottleProvider()->hasReachedLimit()){\n // we are out of api calls, so next time get the latest\n $run_type = 'NEW';\n $run_time = $this->getNextRunTime('NEW');\n } else {\n $run_time = $this->processorData['NEXT_RUN']['NEW'];\n $run_type = 'NEW';\n $priority_arr = [];\n arsort($this->processorData['NEXT_RUN']);\n foreach ($this->processorData['NEXT_RUN'] as $key => $value) {\n //disable rescheduling OLD\n if ($key == 'OLD') {\n continue;\n }\n\n $run_type = $key;\n if (!in_array($run_type, array('NEW', 'MED', 'OLD'))) {\n $run_type = 'COMMENTS';\n $run_type .= '&id=' . $key;\n }\n if ($value < $this->invoke_time + self::NEXT_RUN_CONTINUE) {\n $arr = explode('&', $run_type);\n switch ($arr[0]) {\n case 'NEW':\n $priority = 0;\n break;\n case 'COMMENTS':\n $priority = 1;\n break;\n case 'MED':\n $priority = 2;\n break;\n case 'OLD':\n $priority = 3;\n break;\n }\n $priority_arr[$priority] = array('run_type' => $run_type, 'run_time' => $value, 'run_time_s' => date('Y-m-d H:i:s', $value));\n } else {\n if ($value < $run_time) {\n $run_time = $value;\n }\n }\n }\n //if there are elements that have expired run time (< time())\n if (count($priority_arr) > 0) {\n ksort($priority_arr);\n\n $next = array_shift($priority_arr);\n $run_time = $next['run_time'];\n $run_type = $next['run_type'];\n }\n // Ensure runTime is a little bit in the future\n // $initial_run_time = $run_time;\n $run_time = ($run_time < ($now + self::NEXT_RUN_CONTINUE)) ? ($now + self::NEXT_RUN_CONTINUE) : $run_time;\n }\n\n $resArray = ['RUN_TIME' => $run_time, 'RUN_TYPE' => $run_type];\n return $resArray;\n }", "public function getManualDateStop() {}", "function submitted_events_calendar($submission) {\n\tif (submitted_events_starts_with ( $submission->brunelgroup, 'Joint' )) {\n\t\treturn array (\n\t\t\t\t23,\n\t\t\t\t24 \n\t\t);\n\t} elseif (submitted_events_starts_with ( $submission->brunelgroup, '20' )) {\n\t\treturn array (\n\t\t\t\t23 \n\t\t);\n\t} elseif (submitted_events_starts_with ( $submission->brunelgroup, '40' )) {\n\t\treturn array (\n\t\t\t\t24 \n\t\t);\n\t} else {\n\t\treturn array ();\n\t}\n}", "public function get_payout_schedule() {\n $crons = _get_cron_array();\n\n $schedule = array();\n\n foreach ( $crons as $timestamp => $cron ) {\n if ( isset( $cron[ 'edd_commissions_payout' ] ) ) {\n $schedule[] = $timestamp;\n }\n }\n\n sort( $schedule, SORT_NUMERIC );\n\n return $schedule;\n }", "private function computeOpenSchedules($list) {\n\n // print_array($list, 'input');\n // echo '<br>';\n\n $st = array();\n $et = array();\n $final = array();\n $start = 7;\n $end = 21;\n $temp = $start;\n\n while($temp < $end) {\n array_push( $st, number_format((float)$temp, 2, ':', '') );\n $temp++;\n }\n\n $temp = $start++;\n while( $start <= $end ) {\n array_push( $et, number_format((float)$start, 2, ':', '') );\n $start++;\n }\n\n // print_array($st, 'start_time');\n // print_array($et, 'end_time');\n // echo '<br>';\n\n foreach( $list as $val ) {\n $times = explode(\"-\", $val);\n $start_time = trim($times[0]);\n $end_time = trim($times[1]);\n\n $range = $this->find_range($start_time, $end_time);\n \n if (($key = array_search($start_time, $st)) !== false) {\n unset($st[$key]);\n }\n\n if (($key = array_search($end_time, $et)) !== false) {\n unset($et[$key]);\n }\n\n foreach($range as $time) {\n if (($key = array_search($time, $st)) !== false) {\n unset($st[$key]);\n }\n\n if (($key = array_search($time, $et)) !== false) {\n unset($et[$key]);\n }\n }\n }\n\n $st = array_values($st);\n $et = array_values($et);\n\n $this->print_array($st, 'start_time');\n $this->print_array($et, 'end_time');\n echo '<br>';\n\n if(count($st) >= count($et)) {\n for($idx = 0; $idx < count($st); $idx++){\n array_push($final, new Time($st[$idx], $et[$idx]));\n }\n } \n return $final;\n }", "function adrotate_manage_schedules() {\n\tglobal $wpdb, $adrotate_config, $adrotate_debug;\n\n\t$status = $view = $schedule_edit_id = '';\n\tif(isset($_GET['status'])) $status = esc_attr($_GET['status']);\n\tif(isset($_GET['view'])) $view = esc_attr($_GET['view']);\n\tif(isset($_GET['schedule'])) $schedule_edit_id = esc_attr($_GET['schedule']);\n\n\t$now \t\t\t= adrotate_now();\n\t$today \t\t\t= adrotate_date_start('day');\n\t$in2days \t\t= $now + 172800;\n\t$in7days \t\t= $now + 604800;\n\t$in84days \t\t= $now + 7257600;\n\t?>\n\t<div class=\"wrap\">\n\t\t<h1><?php _e('Schedules', 'adrotate-pro'); ?></h1>\n\n\t\t<?php if($status > 0) adrotate_status($status); ?>\n\n\t\t<div class=\"tablenav\">\n\t\t\t<div class=\"alignleft actions\">\n\t\t\t\t<a class=\"row-title\" href=\"<?php echo admin_url('/admin.php?page=adrotate-schedules');?>\"><?php _e('Manage', 'adrotate-pro'); ?></a> | \n\t\t\t\t<a class=\"row-title\" href=\"<?php echo admin_url('/admin.php?page=adrotate-schedules&view=addnew');?>\"><?php _e('Add New', 'adrotate-pro'); ?></a>\n\t\t\t</div>\n\t\t</div>\n\n \t<?php \n\t if ($view == \"\") {\n\t\t\tinclude(\"dashboard/publisher/schedules-main.php\");\n\t\t} else if($view == \"addnew\" OR $view == \"edit\") {\n\t\t\tinclude(\"dashboard/publisher/schedules-edit.php\");\n\t\t}\n\t\t?>\n\n\t\t<br class=\"clear\" />\n\n\t\t<?php echo adrotate_trademark(); ?>\n\n\t</div>\n<?php\n}", "function local_campusconnect_cron() {\n $ecslist = ecssettings::list_ecs();\n foreach ($ecslist as $ecsid => $name) {\n $ecssettings = new ecssettings($ecsid);\n\n if ($ecssettings->time_for_cron()) {\n mtrace(\"Checking for updates on ECS server '\".$ecssettings->get_name().\"'\");\n $connect = new connect($ecssettings);\n $queue = new receivequeue();\n\n try {\n $queue->update_from_ecs($connect);\n $queue->process_queue($ecssettings);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n mtrace(\"Sending updates to ECS server '\".$ecssettings->get_name().\"'\");\n try {\n export::update_ecs($connect);\n course_url::update_ecs($connect);\n enrolment::update_ecs($connect);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n $cms = participantsettings::get_cms_participant();\n if ($cms && $cms->get_ecs_id() == $ecssettings->get_id()) {\n // If we are updating from the ECS with the CMS attached, then check the directory mappings (and sort order).\n directorytree::check_all_mappings();\n }\n\n mtrace(\"Emailing any necessary notifications for '\".$ecssettings->get_name().\"'\");\n notification::send_notifications($ecssettings);\n\n $ecssettings->update_last_cron();\n }\n }\n}", "function recurringdowntime_get_hostgroup_cfg($hostgroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"hostgroup\") {\n continue;\n }\n }\n if ($hostgroup && !(strtolower($schedule[\"hostgroup_name\"]) == strtolower($hostgroup))) {\n continue;\n }\n if (array_key_exists('hostgroup_name', $schedule)) {\n if (is_authorized_for_hostgroup(0, $schedule[\"hostgroup_name\"])) {\n $ret[$sid] = $schedule;\n }\n }\n }\n return $ret;\n}", "function cron()\n\t{\n\t\tglobal $wpdb,\n\t\t\t\t\t $wgobd_importer_helper,\n\t\t\t\t\t $wgobd_events_helper,\n\t\t\t\t\t $wgobd_settings_controller;\n\n\t\t// ====================\n\t\t// = Select all feeds =\n\t\t// ====================\n\t\t$table_name = $wpdb->prefix . 'wgobd_event_feeds';\n\t\t$sql = \"SELECT * FROM {$table_name}\";\n\t\t$feeds = $wpdb->get_results( $sql );\n\n\t\t// ===============================\n\t\t// = go over each iCalendar feed =\n\t\t// ===============================\n\t\tforeach( $feeds as $feed ) {\n\t\t // flush the feed\n\t\t $wgobd_settings_controller->flush_ics_feed( false, $feed->feed_url );\n\t\t // import the feed\n\t\t\t$wgobd_importer_helper->parse_ics_feed( $feed );\n\t\t}\n\t}", "public function updateSchedule()\n\t{\n\t\t// Removing old days if we have any days\n\t\tif (count(self::$schedule) > 0) {\n\t\t\t$currDate = date('Y/m/d');\n\n\t\t\twhile (isset(self::$schedule[0]) && self::$schedule[0]->date != $currDate) {\n\t\t\t\tarray_shift(self::$schedule);\n\t\t\t}\n\t\t}\n\n\t\t// Building out the schedule if we're missing days\n\t\tif (count(self::$schedule) < 7) $this->build();\n\t}", "public function getWFScheduleTime() {\n\t\tif (isset($this->multipleschtime)) {\n\t\t\t$multipleschtime = explode(',', $this->multipleschtime);\n\t\t\tusort($multipleschtime, function ($time1, $time2) {\n\t\t\t\t$t1 = strtotime($time1);\n\t\t\t\t$t2 = strtotime($time2);\n\t\t\t\treturn $t1 - $t2;\n\t\t\t});\n\t\t\t$currentTrigger = array_search(date('g:i a', strtotime($this->schtime)), $multipleschtime);\n\t\t\tif (!$currentTrigger && $currentTrigger !== 0) {\n\t\t\t\t$nextTiggerTime = date('H:i', strtotime($multipleschtime[0]));\n\t\t\t\t$this->updateSchtime($multipleschtime[0]);\n\t\t\t} elseif (!isset($multipleschtime[$currentTrigger + 1])) {\n\t\t\t\t$nextTiggerTime = date('H:i', strtotime($multipleschtime[count($multipleschtime)-1]));\n\t\t\t\t$this->updateSchtime($nextTiggerTime);\n\t\t\t} else {\n\t\t\t\t$nextTiggerTime = date('H:i', strtotime($multipleschtime[$currentTrigger + 1]));\n\t\t\t\t$this->updateSchtime($nextTiggerTime);\n\t\t\t}\n\t\t\treturn $nextTiggerTime;\n\t\t}\n\t\treturn $this->schtime;\n\t}", "function recurrence($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_type, $parameters) {\n global $DB,$CFG;\n\n //Take parameters and convert to array\n $parameters = urldecode($parameters);\n $params = explode(';', $parameters);\n //print_r($params);\n //echo 'TYPE: ' . $recurrence_type;\n\n if($recurrence_type == 'none'){\n $recurrence_id = 0;\n }\n else{\n $recurrences = $DB->get_records_select('roomscheduler_reservations', 'location=\\''.$room.'\\' GROUP BY {roomscheduler_reservations}.recurrence_id',array(),\"\",'{roomscheduler_reservations}.recurrence_id');\n $recurrence_id = sizeof($recurrences);\n }\n\n //No recursion\n if ($recurrence_type == 'none') {\n return new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n }\n\n //Daily: Every x days\n else if ($recurrence_type == 'everyxdays') {\n $endtype = $params[0];\n $endtype_param = $params[1];\n $xdays = $params[2];\n if ($xdays <= 0 || $endtype_param<0) {}\n \n\n //Condition 1: End by \n else if ($endtype == 'endby') {\n\n while ($fromTime < $endtype_param && $toTime < $endtype_param) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $fromTime += $xdays * (24 * 60 * 60);\n $toTime += $xdays * (24 * 60 * 60);\n }\n }\n //Condition 2: End after\n else if ($endtype == 'endafter') {\n for ($occurences = 1; $occurences <= $endtype_param; $occurences++) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $fromTime += $xdays * (24 * 60 * 60);\n $toTime += $xdays * (24 * 60 * 60);\n }\n }\n }\n //Daily: Every week day\n else if ($recurrence_type == 'everyweekday') {\n $endtype = $params[0];\n $endtype_param = $params[1];\n\n //Condition 1: End by\n if ($endtype == 'endby') {\n\n while ($fromTime < $endtype_param && $toTime < $endtype_param) {\n\n $dayofweek = strftime_dayofweek_compatible($fromTime);\n if ($dayofweek == 6 || $dayofweek == 7) {\n \n } else {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n }\n $fromTime += 1 * (24 * 60 * 60);\n $toTime += 1 * (24 * 60 * 60);\n }\n }\n //Condition 2: End after\n else if ($endtype == 'endafter') {\n\n $occurences = 0;\n while ($occurences < $endtype_param) {\n $dayofweek = strftime_dayofweek_compatible($fromTime);\n if ($dayofweek == 6 || $dayofweek == 7) {\n \n } else {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $occurences++;\n }\n\n $fromTime += 1 * (24 * 60 * 60);\n $toTime += 1 * (24 * 60 * 60);\n }\n }\n }\n\n\n //Weekly: Every x weeks\n else if ($recurrence_type == 'everyxweeks') {\n $endtype = $params[0];\n $endtype_param = $params[1];\n $xweeks = $params[2];\n $dayofweek = explode('?', $params[3]);\n\n if ($xweeks <= 0 || $xweeks > 48 || $endtype_param <0) {\n \n }\n\n //Condition 1: End by\n else if ($endtype == 'endby') {\n $counter = 0;\n while ($fromTime < $endtype_param && $toTime < $endtype_param) {\n if ($counter == 0) {\n for ($day = 1; $day <= 7; $day++) {\n\n $dayofweek_temp = strftime_dayofweek_compatible($fromTime);\n if (in_array($dayofweek_temp, $dayofweek)) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n }\n $fromTime += 1 * (24 * 60 * 60);\n $toTime += 1 * (24 * 60 * 60);\n }\n $counter++;\n } else if ($counter == $xweeks) {\n $counter = 0;\n } else if ($counter != 0) {\n\n for ($day = 1; $day <= 7; $day++) {\n $fromTime += 1 * (24 * 60 * 60);\n $toTime += 1 * (24 * 60 * 60);\n }\n $counter++;\n }\n }\n }\n\n\n //Condition 2: End after\n else if ($endtype == 'endafter') {\n $occurences = 0;\n $counter = 0;\n while ($occurences < $endtype_param) {\n if ($counter == 0) {\n for ($day = 1; $day <= 7; $day++) {\n\n $dayofweek_temp = strftime_dayofweek_compatible($fromTime);\n if (in_array($dayofweek_temp, $dayofweek)) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n }\n $fromTime += 1 * (24 * 60 * 60);\n $toTime += 1 * (24 * 60 * 60);\n }\n $counter++;\n $occurences++;\n } else if ($counter == $xweeks) {\n $counter = 0;\n } else if ($counter != 0) {\n\n for ($day = 1; $day <= 7; $day++) {\n $fromTime += 1 * (24 * 60 * 60);\n $toTime += 1 * (24 * 60 * 60);\n }\n $counter++;\n }\n }\n }\n }\n\n //Monthly: Day x of every x month(s)\n else if ($recurrence_type == 'everyxmonthxday') {\n $endtype = $params[0];\n $endtype_param = $params[1];\n $xmonths_param = $params[3];\n $dayofmonth_param = $params[2];\n if ($dayofmonth_param <= 0 || $dayofmonth_param > 31 || $xmonths_param <= 0 || $endtype_param < 0) {\n \n }\n\n //Condition 1: End by\n if ($endtype == 'endby') {\n $counter = 0;\n while ($fromTime < $endtype_param && $toTime < $endtype_param) {\n\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n\n while ($firstmatch == 0) {\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n if ($dayofmonth == $dayofmonth_param) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $firstmatch = 1;\n }\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n }\n\n if ($dayofmonth == $dayofmonth_param && $counter == 0) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n } else {\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n }\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n if ($dayofmonth == 01) {\n $counter++;\n }\n if ($dayofmonth_param == 29) {\n if ($dayofmonth == 28) {\n $fromTime += 24 * 60 * 60;\n $toTime += 24 * 60 * 60;\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n if ($dayofmonth == 01) {\n $counter--;\n }\n $fromTime -= 24 * 60 * 60;\n $toTime -= 24 * 60 * 60;\n }\n }\n if ($dayofmonth_param == 30) {\n if ($dayofmonth == 29) {\n $fromTime += 24 * 60 * 60;\n $toTime += 24 * 60 * 60;\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n if ($dayofmonth == 01) {\n $counter--;\n }\n $fromTime -= 24 * 60 * 60;\n $toTime -= 24 * 60 * 60;\n }\n }\n if ($dayofmonth_param == 31) {\n if ($dayofmonth == 30) {\n $fromTime += 24 * 60 * 60;\n $toTime += 24 * 60 * 60;\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n if ($dayofmonth == 01) {\n $counter--;\n }\n $fromTime -= 24 * 60 * 60;\n $toTime -= 24 * 60 * 60;\n }\n }\n\n\n if ($counter == $xmonths_param) {\n $counter = 0;\n $occurences++;\n }\n }\n }\n //Condition 2: End after\n else if ($endtype == 'endafter') {\n $counter = 0;\n $occurences = 0;\n $firstmatch = 0;\n\n while ($occurences < $endtype_param) {\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n\n while ($firstmatch == 0) {\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n if ($dayofmonth == $dayofmonth_param) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $firstmatch = 1;\n $occurences++;\n }\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n }\n\n if ($dayofmonth == $dayofmonth_param && $counter == 0) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n } else {\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n }\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n if ($dayofmonth == 01) {\n $counter++;\n }\n if ($dayofmonth_param == 29) {\n if ($dayofmonth == 28) {\n $fromTime += 24 * 60 * 60;\n $toTime += 24 * 60 * 60;\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n if ($dayofmonth == 01) {\n $counter--;\n }\n $fromTime -= 24 * 60 * 60;\n $toTime -= 24 * 60 * 60;\n }\n }\n if ($dayofmonth_param == 30) {\n if ($dayofmonth == 29) {\n $fromTime += 24 * 60 * 60;\n $toTime += 24 * 60 * 60;\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n if ($dayofmonth == 01) {\n $counter--;\n }\n $fromTime -= 24 * 60 * 60;\n $toTime -= 24 * 60 * 60;\n }\n }\n if ($dayofmonth_param == 31) {\n if ($dayofmonth == 30) {\n $fromTime += 24 * 60 * 60;\n $toTime += 24 * 60 * 60;\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n if ($dayofmonth == 01) {\n $counter--;\n }\n $fromTime -= 24 * 60 * 60;\n $toTime -= 24 * 60 * 60;\n }\n }\n\n\n if ($counter == $xmonths_param) {\n $counter = 0;\n $occurences++;\n }\n }\n }\n }\n\n //Monthly: The x(first/second/third/fourth) y(m,t,w,t,f,s,s) of every z(1-12) month(s)\n else if ($recurrence_type == 'thexyofeveryzmonths') {\n $endtype = $params[0];\n $endtype_param = $params[1];\n $numberdate_param = $params[2];\n $dayofweek_param = $params[3];\n $xmonths_param = $params[4];\n if ($xmonths_param <= 0 || $endtype_param <0) {\n \n }\n //Condition 1: End by\n if ($endtype == 'endby') {\n $numberdatecounter = 0;\n $xmonthscounter = 0;\n $firstmatch = 0;\n\n while ($fromTime < $endtype_param && $toTime < $endtype_param) {\n $dayofweek = strftime_dayofweek_compatible($fromTime);\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n while ($firstmatch == 0) {\n if ($dayofweek == $dayofweek_param) {\n $numberdatecounter++;\n if ($numberdatecounter == $numberdate_param && $xmonthscounter == 0) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n //$xmonthscounter++;\n $firstmatch = 1;\n }\n }\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n $dayofweek = strftime_dayofweek_compatible($fromTime);\n\n if ($dayofmonth == 01) {\n $numberdatecounter = 0;\n }\n }\n if ($dayofweek == $dayofweek_param) {\n $numberdatecounter++;\n if ($numberdatecounter == $numberdate_param) {\n $xmonthscounter++;\n if ($xmonthscounter == $xmonths_param) {\n $xmonthscounter = 0;\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n }\n }\n }\n\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n $dayofweek = strftime_dayofweek_compatible($fromTime);\n\n if ($dayofmonth == 01) {\n $numberdatecounter = 0;\n }\n }\n }\n //Condition 2: End after\n if ($endtype == 'endafter') {\n $numberdatecounter = 0;\n $xmonthscounter = 0;\n $occurences = 0;\n $firstmatch = 0;\n\n while ($occurences < $endtype_param) {\n $dayofweek = strftime_dayofweek_compatible($fromTime);\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n while ($firstmatch == 0) {\n if ($dayofweek == $dayofweek_param) {\n $numberdatecounter++;\n if ($numberdatecounter == $numberdate_param && $xmonthscounter == 0) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n //$xmonthscounter++;\n $occurences++;\n $firstmatch = 1;\n }\n }\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n $dayofweek = strftime_dayofweek_compatible($fromTime);\n\n if ($dayofmonth == 01) {\n $numberdatecounter = 0;\n }\n }\n if ($dayofweek == $dayofweek_param) {\n $numberdatecounter++;\n if ($numberdatecounter == $numberdate_param) {\n $xmonthscounter++;\n if ($xmonthscounter == $xmonths_param) {\n $xmonthscounter = 0;\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $occurences++;\n }\n }\n }\n\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n $dayofmonth = strftime_dayofmonth_compatible($fromTime);\n $dayofweek = strftime_dayofweek_compatible($fromTime);\n\n if ($dayofmonth == 01) {\n $numberdatecounter = 0;\n }\n }\n }\n }\n //Yearly: Every xmonth xday\n else if ($recurrence_type == 'everyxmonthxdayyear') {\n $endtype = $params[0];\n $endtype_param = $params[1];\n $xmonth_param = $params[2];\n $xday_param = $params[3];\n if ($xday_param <= 0 || $xday_param > 31 || $endtype_param <0) {\n\n }\n //Condition1: End by\n if ($endtype == 'endby') {\n while ($fromTime < $endtype_param && $toTime < $endtype_param) {\n $xmonth = strftime('%m', $fromTime);\n $xday = strftime_dayofmonth_compatible($fromTime);\n if ($xmonth == $xmonth_param && $xday == $xday_param) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $fromTime += ( 150 * 24 * 60 * 60);\n $toTime += ( 150 * 24 * 60 * 60);\n } else {\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n }\n }\n }\n //Condition2: End After\n else if ($endtype == 'endafter') {\n $occurences = 0;\n while ($occurences < $endtype_param) {\n $xmonth = strftime('%m', $fromTime);\n $xday = strftime_dayofmonth_compatible($fromTime);\n if ($xmonth == $xmonth_param && $xday == $xday_param) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $occurences++;\n $fromTime += ( 150 * 24 * 60 * 60);\n $toTime += ( 150 * 24 * 60 * 60);\n } else {\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n }\n }\n }\n }\n //Yearly: The x(first/second/third/fourth) y(1-7) of (1-12)\n else if ($recurrence_type == 'thexyofz') {\n $endtype = $params[0];\n $endtype_param = $params[1];\n $numberdate_param = $params[2];\n $dayofweek_param = $params[4];\n $xmonth_param = $params[3];\n\n //Condition 1: Endby\n if ($endtype == 'endby') {\n $numberdatecounter = 0;\n while ($fromTime < $endtype_param && $toTime < $endtype_param) {\n $dayofweek = strftime_dayofweek_compatible($fromTime);\n $xmonth = strftime('%m', $fromTime);\n if ($dayofweek == $dayofweek_param) {\n $numberdatecounter++;\n if ($numberdatecounter == $numberdate_param && $xmonth_param == $xmonth) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $fromTime += (150*24*60*60);\n $toTime += (150*24*60*60);\n\n }\n }\n\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n\n $dayofthemonth = strftime_dayofmonth_compatible($fromTime);\n\n if ($dayofthemonth == 1) {\n $numberdatecounter = 0;\n }\n }\n }\n //Condition 2: End after\n if ($endtype == 'endafter') {\n $occurences = 0;\n $numberdatecounter = 0;\n while ($occurences < $endtype_param) {\n $dayofweek = strftime_dayofweek_compatible($fromTime);\n $xmonth = strftime('%m', $fromTime);\n $xmonthday = strftime('%d', $fromTime);\n $year = strftime('%Y', $fromTime);\n if ($dayofweek == $dayofweek_param) {\n $numberdatecounter++;\n if ($numberdatecounter == $numberdate_param && $xmonth_param == $xmonth) {\n new_reservation($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_id);\n $occurences++;\n $fromTime += (150*24*60*60);\n $toTime += (150*24*60*60);\n\n }\n }\n\n $fromTime += ( 24 * 60 * 60);\n $toTime += ( 24 * 60 * 60);\n\n $dayofthemonth = strftime_dayofmonth_compatible($fromTime);\n\n if ($dayofthemonth == 1) {\n $numberdatecounter = 0;\n }\n }\n }\n }\n}", "protected function getRegisteredEvents() {\n// $events = [];\n// foreach ($this->loadMultiple() as $rules_config) {\n// $event = $rules_config->getEvent();\n// if ($event && !isset($events[$event])) {\n// $events[$event] = $event;\n// }\n// }\n// return $events;\n }", "abstract protected function getScheduledObjectUpdates($uow);", "function registry()\n\t{\n\t\tif ( !wp_next_scheduled( 'admin_action_delibera_cron_action' ) ) // if already been scheduled, will return a time \n\t\t{\n\t\t\twp_schedule_event(time(), 'hourly', 'admin_action_delibera_cron_action');\n\t\t}\n\t}", "function ds_add_email_cron_schedules( $param ) {\n\n $param['fifteen_minute'] = array(\n 'interval' => 900, // seconds* 900/60 = 15 mins\n 'display' => __( 'Every Fifteen Minutes' )\n );\n\n return $param;\n\n }", "function Retrieve_Scheduled_Debits($schedule_array)\n{\n\t$scheduled_payments = array();\n\tforeach ($schedule_array as $event)\n\t{\n\t\tif (($event->status == 'scheduled') &&\n\t\t(($event->principal_amount + $event->fee_amount) < 0.0))\n\t\t{\n\t\t\t$scheduled_payments[] = $event;\n\t\t}\n\t}\n\n\treturn $scheduled_payments;\n}", "public function getScheduleTime(){return $this->time_of_day;}", "function card_schedule_get(){\n\t\tif ($this->get('idspbu') == NULL){\n\t\t\t$this->response(array( 'status' => \"ID SPBU not found\" ), 408);\n\t\t} else {\n\t\t\t$param['id_spbu'] = $this->get('idspbu');\n\t\t\t$param['id_pelanggan'] = $this->get('idpelanggan');\n\t\t\t$param['id_card'] = $this->get('idcard');\n\t\t\t$param['nik'] = $this->get('nik');\n\t\t\t\n\t\t\t$response = $this->rest_model->getCard($this->get('idspbu'), $param);\n\t\t\tif(!empty($response)){\n\t\t\t\t$this->response($response, 200);\n\t\t\t} else {\n\t\t\t\t$this->response(array( 'status' => \"NULL\" ), 406);\n\t\t\t}\n\t\t}\n\t}", "public function get_test_scheduled_events()\n {\n }", "public function getSchedules()\n {\n return $this->hasMany(Schedule::className(), ['lesson_plan_id' => 'lesson_plan_id']);\n }", "abstract protected function getRules();", "function timeconditions_timegroups_configprocess() {\n\t$action= isset($_REQUEST['action'])?$_REQUEST['action']:null;\n\t$timegroup= isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null;\n\t$description= isset($_REQUEST['description'])?$_REQUEST['description']:null;\n\t$times = isset($_REQUEST['times'])?$_REQUEST['times']:null;\n\n\tswitch ($action) {\n\t\tcase 'add':\n\t\t\ttimeconditions_timegroups_add_group($description,$times);\n\t\t\tbreak;\n\t\tcase 'edit':\n\t\t\ttimeconditions_timegroups_edit_group($timegroup,$description);\n\t\t\ttimeconditions_timegroups_edit_times($timegroup,$times);\n\t\t\tbreak;\n\t\tcase 'del':\n\t\t\ttimeconditions_timegroups_del_group($timegroup);\n\t\t\tbreak;\n\t}\n}", "function is_schedule( $schedule_identifier = null ) {\r\n global $bp;\r\n $courseware_uri = bp_get_group_permalink( $bp->groups->current_group ) . 'courseware/' ;\r\n \r\n if( is_object( $schedule_identifier ) && $schedule_identifier->post_type == \"assignment\" )\r\n if( $schedule_identifier->group[0]->name == $bp->groups->current_group->id )\r\n return $schedule_identifier;\r\n else\r\n return null;\r\n \r\n if( !$schedule_identifier && get_class( (object)$this->current_schedule ) == __CLASS__ )\r\n return $this->current_schedule;\r\n \r\n $schedule_query = array(\r\n 'post_type' => 'schedule',\r\n 'group_id' => $bp->groups->current_group->id,\r\n );\r\n \r\n if ( $schedule_identifier != null ) {\r\n if( is_numeric( $schedule_identifier ) )\r\n $schedule_query['p'] = $schedule_identifier;\r\n else\r\n $schedule_query['name'] = $schedule_identifier;\r\n }\r\n $schedule = get_posts( $schedule_query );\r\n \r\n if( !empty( $schedule[0] ) )\r\n $schedule = $schedule[0];\r\n else\r\n return null;\r\n \r\n $schedule->start_date = get_post_meta( $schedule->ID, 'start_date', true );\r\n $schedule->end_date = get_post_meta( $schedule->ID, 'end_date', true );\r\n $schedule->location = get_post_meta( $schedule->ID, 'location', true );\r\n $schedule_lecture = get_post_meta( $schedule->ID, 'lecture_id', true );\r\n $schedule->lecture = $schedule_lecture ? BPSP_Lectures::is_lecture( $schedule_lecture ) : null;\r\n $schedule->permalink = $courseware_uri . 'schedule/' . $schedule->post_name;\r\n $course_id = wp_get_object_terms( $schedule->ID, 'course_id' );\r\n if( !empty( $course_id ) )\r\n $schedule->course = BPSP_Courses::is_course( $course_id[0]->name );\r\n \r\n return $schedule;\r\n }", "public function getScheduleStatus(){return $this->status;}", "public function rules()\n {\n return [\n 'title' => 'required|max:100',\n 'schedule_date' => 'required|date_format:\"Y-m-d\"',\n 'start_time' => 'required|date_format:H:i',\n 'end_time' => 'required|date_format:H:i|after:start_time',\n 'place' => 'required',\n ];\n }", "function get_scheduled_days() {\n\t\treturn Clean::ids( $this->get_option( 'scheduled_day' ) );\n\t}", "public function rules()\n {\n $postData = $this->all();\n return [\n 'start-date' => empty($postData['start-date'])? '' : 'before:now',\n 'end-date' => empty($postData['end-date'])? '' : 'before:now',\n ];\n }", "function postSchedule(){\r\n\t\t// and update the scheduler on the RelayQuery\r\n\t return $this-> scheduler-> request_complete($this->channel->responseHeaders() ) ; \r\n\t}", "public function getAllowCustomAssignmentSchedule()\n {\n if (array_key_exists(\"allowCustomAssignmentSchedule\", $this->_propDict)) {\n return $this->_propDict[\"allowCustomAssignmentSchedule\"];\n } else {\n return null;\n }\n }", "public function rules() {\n $in = \\Input::get();\n// var_dump($in);\n $rules = [];\n foreach ($in['entered_on'] as $i => $day) {\n $rules[\"entered_on.{$i}\"] = 'required|date';\n if (!empty($in['work_type'][$day]) && $in['work_type'][$day] != 0)\n {\n $rules[\"work_type.{$day}\"] = 'required|exists:mysql_roster.work_types,work_type_id';\n }\n if (!empty($in['rest'][$day]) && $in['rest'][$day] != 0)\n {\n $rules[\"rest.{$day}\"] = 'required|exists:mysql_roster.rest_reasons,rest_reason_id';\n }\n }\n// var_dump($rules);\n return $rules;\n }", "function get_avaliable_rooms($fromTime, $toTime){\n global $DB, $USER, $CFG;\n\n //reservation starts: Start = S, End = E\n //Location: Above Given Start Time : A, Between given start/end: M, After End Time: E\n\n //Cases:\n //SA EA, --(start above, end above) non useful\n //SA EM, --(start above, end mid)\n //SA EE, -- (Start above, end after)\n //SM EA -- (start mid, end above) -- no useful\n //SM EM -- start mid, end mid\n //SM EE -- start mid, end after\n //SE EA -- non useful\n //SE EM -- non useful\n //SE EE -- non useful\n\n\n $sql = \"SELECT DISTINCT * FROM {roomscheduler_rooms} room \".\n\"WHERE room.active = 1 AND room.id not in ( \". //check which rooms are not avaliable\n\"SELECT DISTINCT rom.id FROM {roomscheduler_reservations} res, {roomscheduler_rooms} rom \".\n\"WHERE rom.id = res.location AND res.active=1 AND ( \".\n\"(res.startdate <= $fromTime AND res.enddate <= $toTime and res.enddate > $fromTime ) OR \". //--(start above, end mid)\n\"(res.startdate <= $fromTime AND res.enddate > $toTime ) OR \". //-- (Start above, end after)\n\"(res.startdate >= $fromTime AND res.startdate < $toTime and res.enddate > $fromTime AND res.enddate <= $toTime ) OR \". //-- start mid, end mid\n\"(res.startdate >= $fromTime AND res.startdate < $toTime AND res.enddate > $toTime )) \".//-- start mid, end after\n\");\";\n\n$rooms = $DB->get_records_sql($sql, array(), $limitfrom=0, $limitnum=0);\n\n\nprint '<center><table id=\"open_rooms_table\">';\nprint '<tr><th>'.get_string('room','block_roomscheduler');\nprint '</th><th>'.get_string('resources','block_roomscheduler');\nprint '</th><th>'.get_string('bookroom','block_roomscheduler').'</th></tr>';\nif($rooms){\n$index = 1;\nforeach($rooms as $room){\n\nprint '<tr onclick=\"\"><td>';\n\nprint \"$index. \".$room->name;\n\nprint '</td><td>';\nprint $room->resources;\nprint '</td><td>';\n\nprint '<form><center>';\nif($room->reservable){\nprint '<input type=\"image\" src=\"img/success.gif\" value=\"Book Room\" onclick=\"book_room('.$room->id.');return false;\" />';\n} else {\n$email = $CFG->roomscheduler_manage_email;\n$subject = get_string('book_room_email_subject','block_roomscheduler');\n\n$information = get_string('email_room','block_roomscheduler').\" \".$room->name . \"%0A\";\n$information .= get_string('email_start','block_roomscheduler').\" \".date( 'F n, Y @ G:i' , $fromTime ). \"%0A\";\n$information .= get_string('email_end','block_roomscheduler').\" \".date( 'F n, Y @ G:i' , $toTime ). \"%0A\";\n$information .= get_string('email_reason','block_roomscheduler').\" _______________________________%0A%0A\";\n\n$body = get_string('book_room_email_body','block_roomscheduler') . $information;\n$body .= get_string('book_room_email_close','block_roomscheduler') . $USER->firstname .\" \".$USER->lastname ;\n\n\nprint '<a href=\"mailto:'.$email.'?subject='.$subject.'&body='.$body.'\" border=\"0\">\n <img src=\"img/email.png\"></a>';\n\n}\nprint '</form></center>';\nprint '</td></tr>';\n\n\n\n\n $index++;\n}\n}\nprint '</table></center>';\n\n}", "public function getSchedule() {\n// from schedule\n// ORDER BY gameDate\";\n $sql = \"Select id, opponent, location, stadiumName, homeoraway, byuScore, oppScore,\n gameDate, closeDate, showUntilDate, sysdate() as now\n from schedule\n ORDER BY gameDate\";\n\n try {\n return $this->getFullList($sql);\n } catch (PDOException $e) {\n echo '{\"error\":{\"text\":\"' . $e->getMessage() . '\"\"}}';\n }\n }", "static function fetchJobSchedule( $jobId ) {\n global $wpdb;\n $resultset = $wpdb->get_results($wpdb->prepare(\n \"SELECT job_id, classname, repeat_time_minutes, repeat_daily_at, active_yn, last_run_date \n FROM job_scheduler\n WHERE job_id = %d\", $jobId));\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n foreach( $resultset as $record ) {\n return $record;\n }\n return null;\n }", "public function getNextTriggerTime() {\n\t\tglobal $default_timezone;\n\t\t$admin = Users::getActiveAdminUser();\n\t\t$adminTimeZone = $admin->time_zone;\n\t\t@date_default_timezone_set($adminTimeZone);\n\n\t\t$scheduleType = $this->getWFScheduleType();\n\t\t$scheduleMinute= $this->getScheduleMinute();\n\t\t$nextTime = date('Y-m-d H:i:s');\n\t\tif ($scheduleType==Workflow::$SCHEDULED_BY_MINUTE) {\n\t\t\t$nextTime=date('Y-m-d H:i:s', strtotime(\"+ $scheduleMinute minutes\"));\n\t\t}\n\n\t\tif ($scheduleType == Workflow::$SCHEDULED_HOURLY) {\n\t\t\t$nextTime = date('Y-m-d H:i:s', strtotime('+1 hour'));\n\t\t}\n\n\t\tif ($scheduleType == Workflow::$SCHEDULED_DAILY) {\n\t\t\t$nextTime = $this->getNextTriggerTimeForDaily($this->getWFScheduleTime());\n\t\t}\n\n\t\tif ($scheduleType == Workflow::$SCHEDULED_WEEKLY) {\n\t\t\t$nextTime = $this->getNextTriggerTimeForWeekly($this->getWFScheduleWeek(), $this->getWFScheduleTime());\n\t\t}\n\n\t\tif ($scheduleType == Workflow::$SCHEDULED_MONTHLY_BY_DATE) {\n\t\t\t$nextTime = $this->getNextTriggerTimeForMonthlyByDate($this->getWFScheduleDay(), $this->getWFScheduleTime());\n\t\t}\n\n\t\tif ($scheduleType == Workflow::$SCHEDULED_MONTHLY_BY_WEEKDAY) {\n\t\t\t$nextTime = $this->getNextTriggerTimeForMonthlyByWeekDay($this->getWFScheduleDay(), $this->getWFScheduleTime());\n\t\t}\n\n\t\tif ($scheduleType == Workflow::$SCHEDULED_ON_SPECIFIC_DATE || $scheduleType == Workflow::$SCHEDULED_ANNUALLY) {\n\t\t\t$nextTime = $this->getNextTriggerTimeForAnnualDates($this->getWFScheduleAnnualDates(), $this->getWFScheduleTime());\n\t\t}\n\t\t@date_default_timezone_set($default_timezone);\n\t\treturn $nextTime;\n\t}", "public function getRules() {}", "function showschedule($id){\r\n\tglobal $conn;\r\n\t$time=getdate();\r\n\t\r\n\t$query = \"SELECT * FROM schedules WHERE id='\".$id.\"' ORDER BY fin_date ASC\";\r\n\t$res = mysql_query($query,$conn);\r\n\twhile ($rows = mysql_fetch_array($res)){\r\n\r\n\t\r\n\r\n\t\tif($rows['onoff'] == 1){\r\n\r\n\t\t\t$lock=0;\r\n\t\t\t$firsthourpassed=0;\r\n\t\t\t$de = 0;\r\n\t\t\t$min = \"00\";\r\n\t\t\t$tim = \"00\";\r\n\t\t\t$stopschdl=0;\r\n\r\n\r\n\t\t\tif($rows['fin_date'] == $today){\r\n\t\t\t\tif((($time['hours'] > $rows['start_hour']) || ($time['hours'] == $rows['start_hour'] && $time['minutes'] >= $rows['start_minute'])) && (($time['hours'] < $rows['fin_hour']) || ($time['hours'] == $rows['fin_hour'] && $time['minute'] <= $rows['fin_minute']))){\r\n\t\t\t\t\t$lock=1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\r\n\t\t\tfor ($j = $rows['start_hour']; $j <= $rows['fin_hour']; $j++) {\r\n\t\t\t\tfor ($i = 0; $i < 60; $i= $i+$rows['minutes']) {\r\n\t\t\t\t\tif( ($j == $rows['fin_hour']) && ($rows['fin_minute'] <= $i) ){\r\n\t\t\t\t\t\t\t$stopschdl=1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($stopschdl==0){\r\n\t\t\t\t\t\tif($i >0){\r\n\t\t\t\t\t\t\t$finalleftover= 60 - $i;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif($firsthourpassed==1 && $i==0 && $finalleftover>0){\r\n\t\t\t\t\t\t\tif($finalleftover < $rows['minutes']){\r\n\t\t\t\t\t\t\t\t$i = $rows['minutes']-$finalleftover;\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\tif($firsthourpassed==0){\r\n\t\t\t\t\t\t\t$i=$rows['start_minute'];\r\n\t\t\t\t\t\t\t$firsthourpassed=1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($i < 10){\r\n\t\t\t\t\t\t\t$min= \"0\".$i;\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t$min= $i;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif($rows['seconds'] == '30'){\r\n\t\t\t\t\t\t\tif($de == 1){\r\n\t\t\t\t\t\t\t\t$tim = \"30\";\r\n\t\t\t\t\t\t\t\t$de=0;\r\n\t\t\t\t\t\t\t\t$i++;\r\n\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\t$tim = \"00\";\r\n\t\t\t\t\t\t\t\t$de=1;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$q = \"SELECT * FROM studentslots WHERE sch_date_id ='\".$rows['id'].$j.$min.$tim.\"'\";\r\n\t\t\t\t\t\t$result = mysql_query($q,$conn);\r\n\t\t\t\t\t\t$row=mysql_fetch_array($result);\r\n\t\t\t\t\t\t$date_id=$rows['id'].$j.$min.$tim ;\r\n\r\n\t\t\t\t\t\tif(isset($row['user_id'])){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$q = \"SELECT * FROM users WHERE id ='\".$row['user_id'].\"'\";\r\n\t\t\t\t\t\t\t$result = mysql_query($q,$conn);\r\n\t\t\t\t\t\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\t\t\t\t\t\techo \"<li data-corners='false' data-shadow='false' data-iconshadow='true' data-wrapperels='div' data-theme='c' class='ui-li ui-li-static ui-btn-up-c'><div class='ui-btn-inner ui-li'><div class='ui-btn-text'>\";\r\n\t\t\t\t\t\t\techo \"<p class='ui-li-aside ui-li-desc'><strong>\".$j.\":\".$min.\":\".$tim.\"</strong></p> <h3 class='ui-li-heading'>Name : \" . $row['first_name'] . \" \" . $row['last_name'] . \"</h3> <p class='ui-li-desc'><strong>AEM : \" . $row['aem'] . \" </strong></p>\" ;\r\n\t\t\t\t\t\t\techo \"</div></div></li>\";\r\n\r\n\t\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\t\techo \"<li data-corners='false' data-shadow='false' data-iconshadow='true' data-wrapperels='div' data-icon='arrow-r' data-iconpos='right' data-theme='c' class='ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-btn-up-c'><div class='ui-btn-inner ui-li'><div class='ui-btn-text'>\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(isset($_SESSION['username'])){\r\n\t\t\t\t\t\t\t\techo \"<a href='mobilefunctions.php?id=\".$rows['id'].\"&date_id=\".$date_id.\"&user_id=\".$_SESSION['id'].\"&gid=\".$rows['gid'].\"' class='ui-link-inherit'>\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\techo \"<a href='login.php' data-rel='dialog' class='ui-link-inherit'>\";\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\techo \"<tr> <td id='timetd'>\".$j.\":\".$min.\":\".$tim.\" </td> <td id='nametd'> </td><td id='aemtd'> </td>\" ;\r\n\t\t\t\t\t\t\techo \"</a></div><span class='ui-icon ui-icon-arrow-r ui-icon-shadow'>&nbsp;</span></div></li>\";\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\techo \"</li>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$tempmin = $rows['minutes'] + $i; \r\n\r\n\t\t\t\t\t\tif($tempmin >= 60){\r\n\t\t\t\t\t\t\t$tempmin = $tempmin - 60 ;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif( ($j == $rows['fin_hour']) && ($tempmin >= $rows['fin_minute']) ) {\r\n\t\t\t\t\t\t\t$i=61;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function nhymxu_weekly_cron_job_recurrence( $schedules ) {\n\t$schedules['weekly'] = array(\n\t\t'display' => 'weekly',\n\t\t'interval' => 604800,\n\t);\n\treturn $schedules;\n}", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n // Da ka Event\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/PunchEvent';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('9:13');\n // Check sprint progress.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/amChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('10:00');\n // Verify completed tasks\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/doneIssueChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('17:30');\n // volunteer for unassigned task.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/todoChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n })->weekdays()\n ->everyFiveMinutes()\n ->timezone('Asia/Shanghai')\n ->between('9:50', '22:00');\n }", "protected function schedule(Schedule $schedule)\n {\n //\n /*$schedule->call(function () {\n $banco = App\\Bank::create(['name' => 'NAN']);\n $banco->save();\n })->everyMinute();*/\n\n $schedule->call(function () {\n $credits = App\\approvedcredit::where('extends', null)->get();\n $npl_ratio = collect();\n $total_money_loaned= collect();\n $income_net_interest = collect();\n $financial_margin = 0;\n foreach ($credits as $credit) {\n switch($credit->startDate){\n\n }\n try{\n if ($credit->type == 2) {\n $lastMove = App\\controlcredit::where('credit', $credit->id)->orderBy('id', 'DESC')->firstOrFail();\n }if($credit->type == 1){\n $lastCredit = App\\approvedcredit::where('extends',$credit->id)->orderBy('id','DESC')->firstOrFail();\n if($lastCredit){\n $lastMove = App\\controlcredit::where('credit', $lastCredit->id)->orderBy('id', 'DESC')->firstOrFail();\n }else{\n $lastMove = App\\controlcredit::where('credit', $credit->id)->orderBy('id', 'DESC')->firstOrFail();\n }\n }\n }catch (\\Exception $ex){\n $lastMove = null;\n }\n Log::warning($lastMove);\n if ($lastMove!= null) {\n $lastMoveDate = Carbon::parse($lastMove->period);\n $finalDate = Carbon::parse($credit->start_date)->addMonth(intval($credit->term));\n $graceDate = Carbon::parse($credit->start_date)->addMonth(intval($credit->term))->addDays(\n intval($credit->grace_days));\n $newDate = Carbon::now();\n $dateDif = $lastMoveDate->diffInDays($newDate);\n $dateDifGrace = $dateDif;//$newDate->diffInDays($graceDate);\n //$dateDif = $lastMoveDate->diffInDays($newDate);\n //$dateDifGrace = $newDate->diffInDays($graceDate);\n $move = new App\\controlcredit();\n $move->credit = $credit->id;\n $move->period = $newDate;\n $move->capital_balance = floatval($lastMove->capital_balance);\n if($dateDif == 0){//Si no ha pasado ningun dia, el balance interes nuevo es igual al anterior\n $move->interest_balance = floatval($lastMove->interest_balance);\n }else{\n $move->interest_balance = floatval($lastMove->interest_balance) +\n (floatval($move->capital_balance) * $credit->interest)/(36500/ $dateDif);\n }\n\n //restar intereses moratorios a margen financiero\n $financial_margin+=ceil($move->interest_balance);\n $move->iva_balance = ($move->interest_balance * ($credit->iva / 100));\n $move->interest = $move->interest_balance;\n $move->iva = $move->iva_balance;\n $application = App\\Application::where('id',$credit->application)->first();\n if(!isset($total_money_loaned[$application->idclient])){\n $total_money_loaned[$application->idclient] = $move->capital_balance;\n }else{\n $total_money_loaned[$application->idclient] += $move->capital_balance;\n }\n //Inicializando variables para indice de morosidad\n if(!isset($npl_ratio[$application->idclient])){\n $npl_ratio[$application->idclient] = collect();\n $npl_ratio[$application->idclient]->expired_money = 0;\n $npl_ratio[$application->idclient]->grace_money = 0;\n $npl_ratio[$application->idclient]->active_money = 0;\n }\n //Calculando indice de morosidad en el siguiente orden:\n //--Cantidad activa\n //--cantidad en dias de gracia\n //--Cantidad expirada\n if($newDate->lt($finalDate)){\n $npl_ratio[$application->idclient]->active_money+=$move->capital_balance;\n }\n if($newDate->gt($finalDate)&& $newDate->lt($graceDate)){\n $npl_ratio[$application->idclient]->grace_money+=$move->capital_balance;\n }\n if($newDate->gt($graceDate)){\n $npl_ratio[$application->idclient]->expired_money+=$move->capital_balance;\n }\n //Inicializando intereses por cliente en interes balance, si no lo tiene\n\n\n if ($newDate->timestamp > $graceDate->timestamp) {\n $move->interest_arrear_balance = $lastMove->interest_arrear_balance + ((($credit->interest_arrear / 100 / 365) * $dateDifGrace) * ($move->capital_balance + $move->interest_balance));\n //restar intereses moratorios a margen financiero\n $financial_margin+=ceil($move->interest_arrear_balance);\n $move->interest_arrear_iva_balance = $move->interest_arrear_balance * ($credit->iva / 100);\n } else {\n $move->interest_arrear_balance = 0;\n $move->interest_arrear_iva_balance = 0;\n }\n if(!isset($income_net_interest[$application->idclient])){\n $income_net_interest[$application->idclient]=$move->capital_balance+$move->interest_balance\n +$move->interest_arrear_balance+$move->interest_arrear_iva_balance+$move->iva_balance;\n }else{//Si lo tiene, lo agregamos a una sumatoria\n $income_net_interest[$application->idclient]+=$move->capital_balance+$move->interest_balance\n +$move->interest_arrear_balance+$move->interest_arrear_iva_balance+$move->iva_balance;\n }\n $move->currency = $credit->currency;\n $move->save();\n } else {\n if($credit->type == 1){\n $move = new App\\controlcredit();\n $move->credit = $credit->id;\n $move->period = $credit->start_date;\n $move->capital_balance = $credit->amount;\n $move->interest_balance = 0;\n $move->iva_balance = 0;\n $move->interest_arrear_balance = 0;\n $move->interest_arrear_iva_balance = 0;\n $move->currency = $credit->currency;\n $move->save();\n }\n }\n unset($lastMove);\n unset($credit);\n\n }\n //Calculando valores para la tabla \"Cartera promedio\"\n try{\n $idsample = App\\Average_Money_Loaned::all();\n if($idsample->isEmpty()) $idsample = 1;\n else $idsample = $idsample->max('idsample')+1;\n //Iteramos cada cliente, y su cantidad que tiene prestada, para meterlo a la tabla\n foreach ($total_money_loaned as $client => $money_loaned){\n $newEntry = new App\\Average_Money_Loaned();\n $newEntry->idsample = $idsample;\n $newEntry->idclient = $client;\n $newEntry->money_loaned = $money_loaned;\n $newEntry->save();\n }\n }catch (\\Exception $ex){\n Log::error(\"No se pudo calcular la grafica 'Cartera promedio'\");\n Log::error($ex);\n }\n\n //Calculando valores para la tabla \"Ingreso de intereses neto\"\n try{\n //Calculamos el ID de muestra\n $idsample = App\\Interest_Net_Income::all();\n if($idsample->isEmpty()) $idsample = 1; //1, si es la primera muestra que se calcula\n else $idsample = $idsample->max('idsample')+1; //ultimaMuestra + 1, si ya hay muestras\n //Iteramos cada cliente, y la sumatoria de sus intereses, para meterlos a la tabla\n\n foreach ($total_money_loaned as $client => $interest_net_income){\n $newEntry = new App\\Interest_Net_Income();\n $newEntry->idsample = $idsample;\n $newEntry->idclient = $client;\n $newEntry->interest_net_income = $interest_net_income;\n $newEntry->save();\n }\n }catch (\\Exception $ex){\n Log::error(\"No se pudo calcular la grafica 'Ingreso de intereses neto'\");\n Log::error($ex);\n }\n\n //Calculando valores para la tabla \"Indice de morosidad\"\n try{\n $idsample = App\\NPL_Ratio::all();\n if($idsample->isEmpty()) $idsample = 1;\n else $idsample = $idsample->max('idsample')+1;\n //Iteramos cada cliente, y sus tres cantidades de dinero que deben, para meterlos a la tabla\n foreach ($npl_ratio as $client => $total_money){\n $newEntry = new App\\NPL_Ratio();\n $newEntry->idsample = $idsample;\n $newEntry->idclient = $client;\n $newEntry->active_money = $total_money->active_money;\n $newEntry->grace_money = $total_money->grace_money;\n $newEntry->expired_money = $total_money->expired_money;\n $newEntry->save();\n }\n }catch (\\Exception $ex){\n Log::error(\"No se pudo calcular la grafica 'Indice de Morosidad'\");\n Log::error($ex);\n }\n //Fondeadores\n //Fondeadores\n //Fondeadores\n $funds = App\\fund::where('extends', null)->get();\n $total_money_borrowed= collect();\n foreach ($funds as $fund) {\n try{\n $lastMove = App\\Control_Fund::where('credit', $fund->id)->orderBy('id', 'DESC')->firstOrFail();\n\n }catch (\\Exception $ex){\n $lastMove = null;\n }\n if ($lastMove!= null) {\n $lastMovePeriod = Carbon::parse($lastMove->period);\n $graceDate = Carbon::parse($lastMove->period)->addMonth(intval($fund->term))->addDays(intval($fund->grace_days));\n $newDate = Carbon::now();\n $dateDif = $lastMovePeriod->diffInDays($newDate);\n $dateDifGrace = $dateDif;//$newDate->diffInDays($graceDate);\n $move = new App\\Control_Fund();\n $move->credit = $fund->id;\n $move->period = $newDate;\n Log::warning($dateDif);\n $move->capital_balance = floatval($lastMove->capital_balance);\n if($dateDif == 0){\n $move->interest_balance = floatval($lastMove->interest_balance);\n }else{\n $move->interest_balance = floatval($lastMove->interest_balance) +\n (floatval($move->capital_balance) * $fund->interest)/(36500/ $dateDif);\n }\n\n //restar intereses moratorios a margen financiero\n $financial_margin-=ceil($move->interest_balance);\n $move->iva_balance = ($move->interest_balance * ($fund->iva / 100));\n $move->interest = $move->interest_balance;\n $move->iva = $move->iva_balance;\n\n\n if ($newDate->timestamp > $graceDate->timestamp) {\n $move->interest_arrear_balance = $lastMove->interest_arrear_balance + ((($fund->interest_arrear / 100 / 365) * $dateDifGrace) * ($move->capital_balance + $move->interest_balance));\n //restar intereses moratorios a margen financiero\n $financial_margin-=ceil($move->interest_arrear_balance);\n $move->interest_arrear_iva_balance = $move->interest_arrear_balance * ($fund->iva / 100);\n } else {\n $move->interest_arrear_balance = 0;\n $move->interest_arrear_iva_balance = 0;\n }\n $move->currency = $fund->currency;\n if(!isset($total_money_borrowed[$fund->idstock])){\n $total_money_borrowed[$fund->idstock] = $move->capital_balance+$move->interest_balance\n +$move->interest_arrear_balance+$move->interest_arrear_iva_balance+$move->iva_balance;\n }else{\n $total_money_borrowed[$fund->idstock] += $move->capital_balance+$move->interest_balance\n +$move->interest_arrear_balance+$move->interest_arrear_iva_balance+$move->iva_balance;\n }\n $move->save();\n }\n unset($lastMove);\n unset($fund);\n\n }\n //Try-catch que calcula el registro de deuda promedio\n try{\n $idsample = App\\Average_Money_Borrowed::all();\n if($idsample->isEmpty()) $idsample = 1;\n else $idsample = $idsample->max('idsample')+1;\n foreach ($total_money_borrowed as $stockholder => $money_borrowed){\n $newEntry = new App\\Average_Money_Borrowed();\n $newEntry->idsample = $idsample;\n $newEntry->idstockholder = $stockholder;\n $newEntry->money_borrowed = $money_borrowed;\n $newEntry->save();\n }\n }catch (\\Exception $ex){\n Log::error(\"No se pudo calcular la grafica 'Deuda Promedio'\");\n Log::error($ex);\n }\n\n //Post a la tabla de margen financiero\n $newFinancialMargin = new App\\Financial_Margin();\n $newFinancialMargin->financial_margin = $financial_margin;\n $newFinancialMargin->save();\n\n })->everyMinute();//->monthlyOn(1, '05:00');\n }", "public static function initiate_schedules() {\n\t\t/** Clearing scheduled hook */\n\t\tif ( wp_next_scheduled( 'xl_maybe_track_usage_scheduled' ) ) {\n\t\t\twp_clear_scheduled_hook( 'xl_maybe_track_usage_scheduled' );\n\t\t}\n\n\t\tif ( ! wp_next_scheduled( 'xl_new_maybe_track_usage_scheduled' ) ) {\n\t\t\twp_schedule_event( current_time( 'timestamp' ), 'weekly_xl', 'xl_new_maybe_track_usage_scheduled' );\n\t\t}\n\t}", "function view_check_cron() {\n\t}", "public function getForCron() {\n $request_time = \\Drupal::time()->getCurrentTime();\n $plugins = [];\n foreach ($this->getActiveDefinitions() as $definition) {\n if (empty($definition['cron'])) {\n continue;\n }\n $cron_time = $this->getNextCronTime($definition);\n // Cron time returns the next available time, which may be tomorrow. We\n // only want to run times that are on the same day.\n if ($cron_time <= $request_time && date('ymd', $cron_time) == date('ymd', $request_time)) {\n $plugins[$definition['id']] = $this->createInstance($definition['id']);\n }\n }\n return $plugins;\n }", "function add_shedule(){\n\t\t\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\n\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$act_mode \t= mysqli_real_escape_string($con,$_POST['act_mode']);\n\t\t$cmbtype \t\t= mysqli_real_escape_string($con,$_POST['cmbtype']);\n\t\t$cmbexamtype = mysqli_real_escape_string($con,$_POST['cmbexamtype']);\n\t\t$cmbbatch = mysqli_real_escape_string($con,$_POST['cmbbatch']);\n\t\t$cmbclroom \t= mysqli_real_escape_string($con,$_POST['cmbclroom']);\n\t\t$cmblecturer \t= mysqli_real_escape_string($con,$_POST['cmblecturer']);\n\t\t$txtdosch = mysqli_real_escape_string($con,$_POST['txtdosch']);\n\t\t$txtstime \t= mysqli_real_escape_string($con,$_POST['txtstime']);\n\t\t$txtetime \t= mysqli_real_escape_string($con,$_POST['txtetime']);\t\n\t\t\n\t\t$sqlget1 =\"SELECT * FROM shedule WHERE schtype='$cmbtype' AND examtype='$cmbexamtype' AND batchID='$cmbbatch' AND lecID ='$cmblecturer' AND clroomID ='$cmbclroom' AND date='$txtdosch' AND (starttime >='$txtstime' AND endtime <='$txtetime');\";\n\t\t\n\t\t\n\t\t$resultget1 = mysqli_query($con,$sqlget1) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget1= mysqli_fetch_assoc($resultget1);\n\t\t\n\t\t\n\t\t$sqlget2 =\"SELECT * FROM shedule WHERE lecID ='$cmblecturer' AND date='$txtdosch' AND (starttime >='$txtstime' OR endtime <='$txtetime');\";\n\t\t\n\t\t$resultget2 = mysqli_query($con,$sqlget2) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget2= mysqli_fetch_assoc($resultget2);\n\t\t\n\t\t$sqlget3 =\"SELECT * FROM shedule WHERE clroomID ='$cmbclroom' AND date='$txtdosch' AND (starttime >='$txtstime' OR endtime <='$txtetime');\";\n\t\t\n\t\t$resultget3 = mysqli_query($con,$sqlget3) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget3= mysqli_fetch_assoc($resultget3);\n\t\n\t\t\t\n\t\tif(count($recget1)>0){\n\t\t\t$recget1 =\"sch1\";\n\t\t\techo json_encode($recget1);\n\t\t}\n\t\telse if(count($recget2)>0){\n\t\t\t$recget2 =\"sch2\";\n\t\t\techo json_encode($recget2);\n\t\t}\n\t\telse if(count($recget3)>0){\n\t\t\t$recget3 =\"sch3\";\n\t\t\techo json_encode($recget3);\n\t\t}\n\n\t\telse{\n\t\t\n\t\t$sth = $dbh->prepare('INSERT INTO shedule (schtype,examtype,date,starttime,endtime,batchID,clroomID,lecID,schstatus) VALUES(?,?,?,?,?,?,?,?,?);');\n\t\t$sth->execute(Array($cmbtype,$cmbexamtype,$txtdosch,$txtstime,$txtetime,$cmbbatch,$cmbclroom,$cmblecturer,1));\n\n\t\t\t\tif(count($sth)<0){\n\t\t\t\t\t \n\t\t\t\t\t $status =\"false\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\n\t\t\t\t\t$status =\"true\";\n\t\t\t\t}\n\t\n\t\t\t\techo json_encode($status);\n\n\t\t} \n\n\t}", "function rlip_schedulding_init() {\n global $CFG, $DB;\n\n // Check whether the scheduled tasks table exists\n $dbman = $DB->get_manager();\n $table = new xmldb_table('elis_scheduled_tasks');\n if (!$dbman->table_exists($table)) {\n return;\n }\n\n // If we haven't setup a scheduled task for the block yet, do so now\n if (!$DB->record_exists('elis_scheduled_tasks', array('plugin' => 'block_rlip'))) {\n require_once($CFG->dirroot.'/elis/core/lib/tasklib.php');\n\n // Add a cron task for the RLIP block\n elis_tasks_update_definition('block_rlip');\n }\n}", "function GetAllSchedules() {\n\tglobal $server;\n\tglobal $user;\n\t$url = \"http://\".$server.\"/api/\".$user.\"/schedules\";\n\t$array = LaunchCurl($url);\n\treturn $array;\n}", "public function rules()\n {\n return [\n 'page' => 'integer',\n 'pagesize' => 'integer',\n 'title' => 'string',\n 'status' => ['string', Rule::in(array_keys(Task::$status))],\n 'beginTime' => 'string',\n 'endTIme' => 'string',\n 'sortField' => 'string',\n 'sortord' => 'in:desc,asc'\n ];\n }", "public function rules()\n {\n $attrs = $this->all();\n $start = $attrs['time_start'];\n $end = $attrs['time_end'];\n return [\n 'program_id' => 'required',\n 'time_start' => ['required', \"lt:$end\", new BetweenTimes($start, $end, $attrs['day'])],\n 'time_end' => ['required', \"gt:$start\", new BetweenTimes($start, $end, $attrs['day'])],\n 'day' => Rule::in($this->validDays)\n ];\n }", "function BPSP_Schedules() {\r\n add_action( 'courseware_new_teacher_added', array( &$this, 'add_schedule_caps' ) );\r\n add_action( 'courseware_new_teacher_removed', array( &$this, 'remove_schedule_caps' ) );\r\n add_action( 'courseware_group_screen_handler', array( &$this, 'screen_handler' ) );\r\n add_filter( 'courseware_group_nav_options', array( &$this, 'add_nav_options' ) );\r\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->call(function(){\n cache()->forever('cached.phrases', getRandomPhrases(5) );\n\n cache()->forever('cached.featuredEvents', getFeatureEvents() );\n\n cache()->forever('cached.pastEvents', getPastEvents() );\n\n cache()->forever('cached.ratings', \\App\\Post::ratings()->onlyEnabled()->take(3)->orderBy('id', 'desc')->get() );\n\n cache()->forever('cached.news',\n \\App\\Post::news()\n ->select(['title', 'image','slug','excerpt','created_at','post_type_id', 'views'])\n ->onlyEnabled()\n ->with(['postType.page'])\n\n ->orderBy('id', 'desc')\n ->take(4)\n ->get());\n\n cache()->forever('cached.slides',\n \\App\\Post::slides()->onlyEnabled()->orderBy('created_at', 'desc')->get());\n })->everyMinute();\n\n\t $schedule->call(function(){\n\n\t \t$serializedJobs = DB::table('jobs')->select()->get();\n\n\t \tforeach ($serializedJobs as $serializedJob){\n\n\t \t\t$jsonJob = json_decode($serializedJob->payload);\n\n\t\t\t $job = unserialize( $jsonJob->data->command);\n\n\t\t\t $job->handle();\n\n\t\t\t DB::table('jobs')->where('id', '=', $serializedJob->id)->delete();\n\t\t }\n\n\t })->everyMinute()\n\t\t ->name('jobs_dispatch')\n\t ->withoutOverlapping();\n\n }", "public function run()\n\t{\n\t\t//\\DB::table('mailing_schedule')->delete();\n \n\t\t\\DB::table('mailing_schedule')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => 1,\n\t\t\t\t'status' => 'nothing',\n\t\t\t\t'time_elapsed' => 24,\n\t\t\t\t'template' => '1.0',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'id' => 2,\n\t\t\t\t'status' => 'some',\n\t\t\t\t'time_elapsed' => 24,\n\t\t\t\t'template' => '1.1',\n\t\t\t),\n\t\t\t2 => \n\t\t\tarray (\n\t\t\t\t'id' => 3,\n\t\t\t\t'status' => 'all',\n\t\t\t\t'time_elapsed' => 24,\n\t\t\t\t'template' => '1.2',\n\t\t\t),\n\t\t\t3 => \n\t\t\tarray (\n\t\t\t\t'id' => 4,\n\t\t\t\t'status' => 'nothing',\n\t\t\t\t'time_elapsed' => 168,\n\t\t\t\t'template' => '3.0',\n\t\t\t),\n\t\t\t4 => \n\t\t\tarray (\n\t\t\t\t'id' => 6,\n\t\t\t\t'status' => 'all',\n\t\t\t\t'time_elapsed' => 168,\n\t\t\t\t'template' => '3.2',\n\t\t\t),\n\t\t\t5 => \n\t\t\tarray (\n\t\t\t\t'id' => 7,\n\t\t\t\t'status' => 'nothing',\n\t\t\t\t'time_elapsed' => 336,\n\t\t\t\t'template' => '4.0',\n\t\t\t),\n\t\t\t6 => \n\t\t\tarray (\n\t\t\t\t'id' => 8,\n\t\t\t\t'status' => 'some',\n\t\t\t\t'time_elapsed' => 336,\n\t\t\t\t'template' => '4.1',\n\t\t\t),\n\t\t\t7 => \n\t\t\tarray (\n\t\t\t\t'id' => 9,\n\t\t\t\t'status' => 'all',\n\t\t\t\t'time_elapsed' => 336,\n\t\t\t\t'template' => '4.1',\n\t\t\t),\n\t\t\t8 => \n\t\t\tarray (\n\t\t\t\t'id' => 11,\n\t\t\t\t'status' => 'some',\n\t\t\t\t'time_elapsed' => 600,\n\t\t\t\t'template' => '6.1',\n\t\t\t),\n\t\t\t9 => \n\t\t\tarray (\n\t\t\t\t'id' => 12,\n\t\t\t\t'status' => 'all',\n\t\t\t\t'time_elapsed' => 600,\n\t\t\t\t'template' => '6.1',\n\t\t\t),\n\t\t\t10 => \n\t\t\tarray (\n\t\t\t\t'id' => 13,\n\t\t\t\t'status' => 'nothing',\n\t\t\t\t'time_elapsed' => 24,\n\t\t\t\t'template' => '0.5',\n\t\t\t),\n\t\t));\n\t}", "function timeconditions_get_time( $hour_start, $minute_start, $hour_finish, $minute_finish, $wday_start, $wday_finish, $mday_start, $mday_finish, $month_start, $month_finish) {\n\n\t//----- Time Hour Interval proccess ----\n\t//\n\tif ($minute_start == '-') {\n\t\t$time_minute_start = \"*\";\n\t} else {\n\t\t$time_minute_start = sprintf(\"%02d\",$minute_start);\n\t}\n\tif ($minute_finish == '-') {\n\t\t$time_minute_finish = \"*\";\n\t} else {\n \t\t$time_minute_finish = sprintf(\"%02d\",$minute_finish);\n\t}\n\tif ($hour_start == '-') {\n\t\t$time_hour_start = '*';\n\t} else {\n\t\t$time_hour_start = sprintf(\"%02d\",$hour_start) . ':' . $time_minute_start;\n\t}\n\tif ($hour_finish == '-') {\n\t\t$time_hour_finish = '*';\n\t} else {\n\t\t$time_hour_finish = sprintf(\"%02d\",$hour_finish) . ':' . $time_minute_finish;\n\t}\n\tif ($time_hour_start == $time_hour_finish) {\n\t\t$time_hour = $time_hour_start;\n\t} else {\n\t\t$time_hour = $time_hour_start . '-' . $time_hour_finish;\n\t}\n\n\t//----- Time Week Day Interval proccess -----\n\t//\n\tif ($wday_start == '-') {\n\t\t$time_wday_start = '*';\n\t} else {\n\t\t$time_wday_start = $wday_start;\n\t}\n\tif ($wday_finish == '-') {\n\t\t$time_wday_finish = '*';\n\t} else {\n\t\t$time_wday_finish = $wday_finish;\n\t}\n\tif ($time_wday_start == $time_wday_finish) {\n\t\t$time_wday = $time_wday_start;\n\t} else {\n\t\t$time_wday = $time_wday_start . '-' . $time_wday_finish;\n\t}\n\n\t//----- Time Month Day Interval proccess -----\n\t//\n\tif ($mday_start == '-') {\n\t\t$time_mday_start = '*';\n\t} else {\n\t\t$time_mday_start = $mday_start;\n\t}\n\tif ($mday_finish == '-') {\n\t\t$time_mday_finish = '*';\n\t} else {\n\t\t$time_mday_finish = $mday_finish;\n\t}\n\tif ($time_mday_start == $time_mday_finish) {\n\t\t$time_mday = $time_mday_start;\n\t} else {\n\t\t$time_mday = $time_mday_start . '-' . $time_mday_finish;\n\t}\n\n\t//----- Time Month Interval proccess -----\n\t//\n\tif ($month_start == '-') {\n\t\t$time_month_start = '*';\n\t} else {\n\t\t$time_month_start = $month_start;\n\t}\n\tif ($month_finish == '-') {\n\t\t$time_month_finish = '*';\n\t} else {\n\t\t$time_month_finish = $month_finish;\n\t}\n\tif ($time_month_start == $time_month_finish) {\n\t\t$time_month = $time_month_start;\n\t} else {\n\t\t$time_month = $time_month_start . '-' . $time_month_finish;\n\t}\n\t$time = $time_hour . '|' . $time_wday . '|' . $time_mday . '|' . $time_month;\n\treturn $time;\n}", "private function get_sla_data() {\n\t\t// OK, we have start and end but we will have to split\n\t\t// this time into parts according to sla_periods (months)\n\t\t$time_arr = $this->_split_month_data($this->options['start_time'], $this->options['end_time']);\n\t\t// only use month entered by the user regardless of start- or endtime\n\t\t$sla_data = array();\n\t\t$opts = new Avail_options($this->options);\n\t\t$opts['report_period'] = 'custom';\n\t\tforeach ($time_arr as $mnr => $dates) {\n\t\t\t$opts['start_time'] = $dates['start'];\n\t\t\t$opts['end_time'] = $dates['end'];\n\t\t\t$report_class = new Status_Reports_Model($opts);\n\t\t\t$data_tmp = $report_class->get_uptime();\n\t\t\t# So, all this does is to remove the summary for all reports?\n\t\t\t# That's anti-clever!\n\t\t\tforeach ($data_tmp as $group => $val) {\n\t\t\t\tif (!is_array($val) || !isset($val['states']))\n\t\t\t\t\tcontinue;\n\t\t\t\t$sla_data[$group][$mnr] = $val;\n\t\t\t}\n\t\t}\n\t\tif (empty($sla_data))\n\t\t\treturn $sla_data;\n\t\t$report_data = array();\n\t\tforeach ($sla_data as $period_data) {\n\t\t\t$table_data = array();\n\t\t\t$data = array();\n\t\t\t$name = false;\n\t\t\t// loop over whole period for current group\n\t\t\tforeach ($period_data as $period_start => $tmp_data) {\n\t\t\t\tif (!is_array($tmp_data) || !isset($tmp_data['states']))\n\t\t\t\t\tcontinue;\n\t\t\t\t$month_idx = date('n', $period_start);\n\t\t\t\tif (array_key_exists($month_idx, $this->options['months'])) {\n\t\t\t\t\tif (arr::search($tmp_data, 'states')) {\n\n\t\t\t\t\t\t# $tmp_data['states']['PERCENT_TOTAL_TIME_{UP,OK}']\n\t\t\t\t\t\t$real_val = $tmp_data['states'][self::$sla_field_names[$this->options['report_type']]];\n\n\t\t\t\t\t\t# control colour of bar depending on value\n\t\t\t\t\t\t# true = green, false = red\n\t\t\t\t\t\t$sla_ok = $this->options['months'][$month_idx] > $real_val ? true : false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// create empty 'real' values\n\t\t\t\t\t\t$sla_ok = false;\n\t\t\t\t\t\t$real_val = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t$data[date('M', $period_start)] = array($real_val, $this->options['months'][$month_idx], $sla_ok);\n\t\t\t\t\tif ($this->options['scheduleddowntimeasuptime'] == 2)\n\t\t\t\t\t\t$table_data[$period_start] = array($real_val, $this->options['months'][$month_idx], $tmp_data['states']['PERCENT_TIME_DOWN_COUNTED_AS_UP']);\n\t\t\t\t\telse\n\t\t\t\t\t\t$table_data[$period_start] = array($real_val, $this->options['months'][$month_idx]);\n\t\t\t\t}\n\t\t\t\t$source = false;\n\t\t\t\tforeach ($tmp_data as $subobj) {\n\t\t\t\t\tif (!is_array($subobj) || !isset($subobj['states']))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t$source[] = $subobj['source'];\n\t\t\t\t}\n\t\t\t\t$name = isset($tmp_data['groupname']) ? $tmp_data['groupname'] : false;\n\t\t\t}\n\n\t\t\tif (!$name && count($source) == 1)\n\t\t\t\t$name = $source;\n\n\t\t\t$report_data[] = array(\n\t\t\t\t'name' => $name,\n\t\t\t\t'table_data' => $table_data,\n\t\t\t\t'data_str' => http_build_query($data),\n\t\t\t\t'source' => $source,\n\t\t\t\t'avail_link' => $this->_generate_avail_member_link(),\n\t\t\t);\n\t\t}\n\t\treturn $report_data;\n\t}", "function initMonthlyRecurPattern($taskArray){\r\r\n $taskStartOccurenceDate=\"0000-00-00\";\r\r\n $taskLastOccurenceDate=\"0000-00-00\";\r\r\n $taskLastExecutionDate=\"0000-00-00\";\r\r\n $taskTotalOccurenceCount=0;\r\r\n $taskNextOccurenceDate=\"0000-00-00\";\r\r\n $task_is_done=0;\r\r\n $today=date('Y-m-d');\r\r\n // STEP : TASK START AND EDN PARAMATERS \r\r\n $taskStartDate=$taskArray['starttime'];\r\r\n $taskEndBy=$taskArray['task_end'];\r\r\n if($taskEndBy==\"after_accurrences\"){\r\r\n $taskTaskEndAfterOccurrences=$taskArray['task_end_after_occurrences']; \r\r\n $taskTaskEndByDate=\"0000-00-00\";\r\r\n }else if($taskEndBy==\"by_date\"){\r\r\n $taskTaskEndAfterOccurrences=0; \r\r\n $taskTaskEndByDate=$taskArray['task_end_by_date']; \r\r\n }else{\r\r\n $taskTaskEndAfterOccurrences=0; \r\r\n $taskTaskEndByDate=\"0000-00-00\"; \r\r\n }\r\r\n \r\r\n // STEP: TASK RECUR PATTERN\r\r\n \r\r\n $taskMonthlyPattern=$taskArray['monthly_pattern']; \r\r\n $taskMonthDate=$taskArray['monthly_onof_day'];\r\r\n $taskMonthEveryNumofMonth=$taskArray['monthly_every_noof_months'];\r\r\n $taskMonthWeekNumber=strtolower($taskArray['monthly_weeknumber']);\r\r\n $taskMonthWeekDayName=$taskArray['monthly_weekday'];\r\r\n $taskMonthWeekEveryNumofMonth=$taskArray['monthly_weekof_noof_months']; \r\r\n $pastArray=array();\r\r\n \r\r\n if($taskStartDate < $today){\r\r\n $today=date(\"Y-m-d\");\r\r\n \r\r\n if($taskMonthlyPattern==\"dayofeverymonth\") {\r\r\n $nthDayOfMonthPattern=$taskMonthDate; \r\r\n $taskEveryNumOfMonth=$taskMonthEveryNumofMonth; \r\r\n }else if($taskMonthlyPattern==\"weekdayofeverymonth\"){\r\r\n //$nthDayOfMonthPattern=$taskMonthWeekNumber.\" \".$taskMonthWeekDayName; \r\r\n if($taskMonthWeekNumber==\"first\"){$wknm=\"0\";}else if($taskMonthWeekNumber==\"second\"){$wknm=\"1\";}else if($taskMonthWeekNumber==\"third\"){$wknm=\"2\";}else if($taskMonthWeekNumber==\"fourth\"){$wknm=\"3\";}else{ $wknm=\"5\"; }\r\r\n $nthDayOfMonthPattern= \"+\".$wknm.\" week \".$taskMonthWeekDayName; \r\r\n \r\r\n $taskEveryNumOfMonth=$taskMonthWeekEveryNumofMonth; \r\r\n }\r\r\n //echo \"<br/> Every \".$nthDayOfMonthPattern; \r\r\n $taskNextExeChkDate=$taskStartDate;\r\r\n $taskNxtDateYear= date(\"Y\", strtotime($taskNextExeChkDate));\r\r\n $taskNxtDateMon= date(\"F\", strtotime($taskNextExeChkDate));\r\r\n $month =$taskNxtDateMon;\r\r\n $year=$taskNxtDateYear;\r\r\n if($taskMonthWeekNumber==\"last\" && $taskMonthlyPattern==\"weekdayofeverymonth\"){\r\r\n if(strtolower($month)==\"december\" ){\r\r\n $year=$year+1;\r\r\n $month=\"january\";\r\r\n }else{\r\r\n $result = strtotime(\"01 \".$month.\" \".$year); \r\r\n $month = date('F', strtotime('+1 month', $result)); \r\r\n }\r\r\n // $nthDayOfMonthPattern=$taskMonthWeekNumber.\" \".$taskMonthWeekDayName;\r\r\n $nthDayOfMonthPattern=\"-1 week \".$taskMonthWeekDayName; \r\r\n }else if($taskMonthlyPattern==\"dayofeverymonth\"){\r\r\n // selected date will not come in some month then it will take last date of month \r\r\n $nthDayOfMonthPattern=$taskMonthDate; \r\r\n $lastDayofMonth = date('t',strtotime(\"1 \".$month.\" \".$year)); \r\r\n if($lastDayofMonth < $taskMonthDate) {\r\r\n $nthDayOfMonthPattern=$lastDayofMonth; \r\r\n }\r\r\n }\r\r\n $utNthDateOfMonth = strtotime( $nthDayOfMonthPattern.\" \".$month.\" \".$year); \r\r\n $taskExeDate=date(\"Y-m-d\", $utNthDateOfMonth); \r\r\n \r\r\n \r\r\n if($taskExeDate < $today){\r\r\n while($taskExeDate < $today){\r\r\n if($taskExeDate < $taskStartDate ){\r\r\n $taskExeDate=date(\"Y-m-d\", strtotime(date(\"Y-m-d\", strtotime($taskExeDate)).\" +1 month\" )); \r\r\n }\r\r\n $taskNxtDateYear= date(\"Y\", strtotime($taskExeDate));\r\r\n $taskNxtDateMon= date(\"F\", strtotime($taskExeDate));\r\r\n $month =$taskNxtDateMon;\r\r\n $year=$taskNxtDateYear;\r\r\n if($taskMonthWeekNumber==\"last\" && $taskMonthlyPattern==\"weekdayofeverymonth\"){\r\r\n if(strtolower($month)==\"december\"){\r\r\n $year=$year+1;\r\r\n $month=\"january\";\r\r\n }else{\r\r\n $result = strtotime(\"01 \".$month.\" \".$year); \r\r\n $month = date('F', strtotime('+1 month', $result)); \r\r\n }\r\r\n // $nthDayOfMonthPattern=$taskMonthWeekNumber.\" \".$taskMonthWeekDayName; \r\r\n $nthDayOfMonthPattern=\"-1 week \".$taskMonthWeekDayName; \r\r\n }else if($taskMonthlyPattern==\"dayofeverymonth\"){\r\r\n // selected date will not come in some month then it will take last date of month \r\r\n $nthDayOfMonthPattern=$taskMonthDate; \r\r\n $lastDayofMonth = date('t',strtotime(\"1 \".$month.\" \".$year)); \r\r\n if($lastDayofMonth < $taskMonthDate) {\r\r\n $nthDayOfMonthPattern=$lastDayofMonth; \r\r\n }\r\r\n }\r\r\n \r\r\n $utNthDateOfMonth = strtotime( $nthDayOfMonthPattern.\" \".$month.\" \".$year); \r\r\n $taskExeDate=date(\"Y-m-d\", $utNthDateOfMonth); \r\r\n if($taskExeDate < $today){ \r\r\n $taskTotalOccurenceCount++;\r\r\n $taskLastOccurenceDate= $taskExeDate; //echo \"<br/> Last \".$taskTotalOccurenceCount.\" Occurence : \".$taskLastOccurenceDate; \r\r\n\r\r\n $newArray=$taskArray;\r\r\n //$taskTotalOccurenceCount++;\r\r\n $newArray['task_last_execution_date']=$taskLastOccurenceDate; \r\r\n $newArray['task_execution_count']=$taskTotalOccurenceCount; \r\r\n $newArray['task_is_done']=$task_is_done;\r\r\n array_push($pastArray, $newArray); \r\r\n\r\r\n $lastYear= date(\"Y\", strtotime($taskExeDate));\r\r\n $lastMon= date(\"F\", strtotime($taskExeDate));\r\r\n $lastStrTime=strtotime(\"01 \".$lastMon.\" \".$lastYear); \r\r\n $taskExeDate=date(\"Y-m-d\", strtotime(date(\"Y-m-d\", $lastStrTime).\" +\".$taskEveryNumOfMonth.\" month\" )); \r\r\n }else{\r\r\n break;\r\r\n }\r\r\n }\r\r\n }else{\r\r\n $taskTotalOccurenceCount=0;\r\r\n $taskLastOccurenceDate=\"0000-00-00\";\r\r\n // echo \"<br/> Last \".$taskTotalOccurenceCount.\" Occurence : \".$taskLastOccurenceDate; \r\r\n }\r\r\n }\r\r\n \r\r\n /*\r\r\n if($task_is_done==0){\r\r\n // STEP: CALCULATE NEXT OCCURENCE DATE FOR TASK\r\r\n $taskNextOccurenceDate= $this->calculateMonthlyNextExecutionDate($taskLastOccurenceDate,$taskTotalOccurenceCount,$taskStartDate, $taskMonthlyPattern, $taskMonthDate,$taskMonthEveryNumofMonth,$taskMonthWeekNumber,$taskMonthWeekDayName, $taskMonthWeekEveryNumofMonth, $taskTaskEndAfterOccurrences, $taskTaskEndByDate);\r\r\n if($taskNextOccurenceDate==\"0000-00-00\"){\r\r\n $task_is_done=1;\r\r\n }\r\r\n }else{\r\r\n // STEP : TASK IS COMPLETED , SO NEXT EXECUTION DATE IS NOT AVAILABLE\r\r\n $taskNextOccurenceDate=\"0000-00-00\";\r\r\n } \r\r\n \r\r\n $taskArray['task_last_execution_date']=$taskLastExecutionDate; \r\r\n $taskArray['task_execution_count']=0;\r\r\n $taskArray['task_start_occurrence_date']=$taskStartOccurenceDate;\r\r\n $taskArray['task_last_occurrence_date']=$taskLastOccurenceDate;\r\r\n $taskArray['task_occurrences_count']=$taskTotalOccurenceCount;\r\r\n $taskArray['task_next_execution_date']=$taskNextOccurenceDate;\r\r\n $taskArray['task_is_done']=$task_is_done;\r\r\n */\r\r\n return $pastArray;\r\r\n \r\r\n }", "public static function isScheduleField(FieldConfigInterface $field) {\n $storageSettings = $field->getFieldStorageDefinition()->getSettings();\n return isset($storageSettings['target_type']) && 'scheduled_update' === $storageSettings['target_type'];\n }", "function list_schedules_screen( $vars ) {\r\n $vars['schedules'] = $this->has_schedules();\r\n $vars['assignments'] = BPSP_Assignments::has_assignments();\r\n \r\n if( empty( $vars['schedules'] ) && empty( $vars['assignments'] ) )\r\n $vars['message'] = __( 'No schedules exist.', 'bpsp' );\r\n \r\n $vars['name'] = 'list_schedules';\r\n $vars['trail'] = array(\r\n __( 'Available Schedules', 'bpsp' ) => ''\r\n );\r\n return $vars;\r\n }" ]
[ "0.6068186", "0.5885367", "0.58424807", "0.5800601", "0.5774397", "0.57198364", "0.5665717", "0.54888994", "0.54523945", "0.54225147", "0.54192555", "0.5415502", "0.541171", "0.5374265", "0.53595895", "0.5355944", "0.53357667", "0.529372", "0.52759415", "0.5265253", "0.52312154", "0.5231155", "0.522728", "0.51891625", "0.51713824", "0.5168199", "0.51672494", "0.5139004", "0.51354784", "0.51126176", "0.5110525", "0.51015437", "0.5097345", "0.50928247", "0.50859123", "0.50817055", "0.50720775", "0.5069717", "0.50674325", "0.50606906", "0.50447404", "0.5044718", "0.5043271", "0.5042711", "0.50290376", "0.5028204", "0.50227225", "0.5021552", "0.5016154", "0.50144565", "0.5010876", "0.5009999", "0.5007582", "0.49993438", "0.49956658", "0.4994873", "0.49928442", "0.4991373", "0.498929", "0.49835512", "0.49821734", "0.49810255", "0.4980843", "0.49787065", "0.49711177", "0.4963458", "0.4960703", "0.49587893", "0.49474576", "0.4930564", "0.49288216", "0.49281985", "0.49277294", "0.492316", "0.4919745", "0.49117136", "0.49040416", "0.49024683", "0.49007797", "0.48973614", "0.48962462", "0.4893616", "0.48923507", "0.48911735", "0.48878103", "0.4884867", "0.48845896", "0.48843563", "0.48838586", "0.48818314", "0.4881219", "0.48788783", "0.487361", "0.4861772", "0.48542604", "0.48513967", "0.48496267", "0.48483375", "0.4846244", "0.48449102", "0.48426884" ]
0.0
-1
==================================================================================================== END FIND SCHEDULES ==================================================================================================== ==================================================================================================== NEW SCHEDULE ====================================================================================================
public function newSchedule($parameter, $connection){ $new = $connection->newPerformScriptCommand(self::$layout, self::$api_new, $parameter); $result = $new->execute(); if (Filemaker::isError($result)) { echo $result->getMessage(); } $records = $result->getRecords(); $result = Events::getAsObject($records, self::$fields); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function initiate_schedules() {\n\t\t/** Clearing scheduled hook */\n\t\tif ( wp_next_scheduled( 'xl_maybe_track_usage_scheduled' ) ) {\n\t\t\twp_clear_scheduled_hook( 'xl_maybe_track_usage_scheduled' );\n\t\t}\n\n\t\tif ( ! wp_next_scheduled( 'xl_new_maybe_track_usage_scheduled' ) ) {\n\t\t\twp_schedule_event( current_time( 'timestamp' ), 'weekly_xl', 'xl_new_maybe_track_usage_scheduled' );\n\t\t}\n\t}", "function goodrds_schedule_cron() {\n\t if ( !wp_next_scheduled( 'goodrds_cronjob' ) )\n\t wp_schedule_event(time(), 'daily', 'goodrds_cronjob');\n\t}", "public function schedule_cron() {\n\t\twp_schedule_event( time(), 'daily', 'download_iracing_members_files' );\n\t\twp_schedule_event( time(), 'daily', 'convert_iracing_members_file_to_json' );\n\t}", "function update_interval_schedule($int) {\n\t//check schedule exists, remove it, add new one\t\n\twp_clear_scheduled_hook('standards_resource_check');\t\n\tif ($int > 0)\n\t\twp_schedule_single_event( time() + 3600 * $int, 'standards_resource_check' );\n}", "public function updateSchedule()\n\t{\n\t\t// Removing old days if we have any days\n\t\tif (count(self::$schedule) > 0) {\n\t\t\t$currDate = date('Y/m/d');\n\n\t\t\twhile (isset(self::$schedule[0]) && self::$schedule[0]->date != $currDate) {\n\t\t\t\tarray_shift(self::$schedule);\n\t\t\t}\n\t\t}\n\n\t\t// Building out the schedule if we're missing days\n\t\tif (count(self::$schedule) < 7) $this->build();\n\t}", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('inspire')\n ->hourly();\n $schedule->call(function() {\n\t\t\tSendMail::sendmails();\n\t\t})->name('sendmails')->everyFiveMinutes()->withoutOverlapping();\n $schedule->command('owish:update')->daily();\n\t\t$schedule->call(function () {\n $ows = DB::table('owarehouse')->where('status','active')->get();\n\t\t\tforeach($ows as $ow){\n\t\t\t\t$date = $ow->created_at;\n\t\t\t\t$date = strtotime($date);\n\t\t\t\t$current_date = strtotime(date('Y-m-d H:i:s'));\n\t\t\t\t$date1 = new DateTime('now');\n\t\t\t\t$date2 = new DateTime(date('Y-m-d H:i:s', strtotime(\"+ $ow->duration day\", $date)));\n\t\t\t\t$dDiff = $date1->diff($date2);\t\n\t\t\t\t$status=1;\n\t\t\t\tif ($dDiff->format(\"%r\") == '-') {\n\t\t\t\t\t$status=0;\n\t\t\t\t}\n\t\t\t\t$product = DB::table('product')->where('id',$ow->product_id)->first();\n\t\t\t\t$available = 0;\n\t\t\t\tif(!is_null($product)){\n\t\t\t\t\t$available = $product->available;\n\t\t\t\t}\n\t\t\t\tif($available == 0){\n\t\t\t\t\t$status=0;\n\t\t\t\t}\n\t\t\t\tif($status == 0){\n\t\t\t\t\tDB::table('owarehouse')->where('id',$ow->id)->\n\t\t\t\t\t\toupdate(['status','expired']);\n\t\t\t\t\t$pledges = DB::table('owarehousepledge')->\n\t\t\t\t\t\twhere('owarehouse_id',$ow->id)->count();\n\n\t\t\t\t\tif($pledges < $ow->moq){\n\t\t\t\t\t\t/************* OPEN CREDIT**************/\n\t\t\t\t\t\t$pledges = DB::table('owarehousepledge')->\n\t\t\t\t\t\t\twhere('owarehouse_id',$ow->id)->get();\n\n\t\t\t\t\t\t/*foreach($pledges as $pledge){\n\t\t\t\t\t\t}*/\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/************* PROCESS PLEDGES **************/\n\t\t\t\t\t\tDB::table('owarehouse')->\n\t\t\t\t\t\t\twhere('id',$ow->id)->update(['status','excecuted']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$ows = DB::table('owarehouse')->\n\t\t\t\twhere('status','active')->get();\n })->daily();\n }", "function registry()\n\t{\n\t\tif ( !wp_next_scheduled( 'admin_action_delibera_cron_action' ) ) // if already been scheduled, will return a time \n\t\t{\n\t\t\twp_schedule_event(time(), 'hourly', 'admin_action_delibera_cron_action');\n\t\t}\n\t}", "public function checkScheduledTasks() {\n if (count($this->defaultTasks)) {\n $now = DBDatetime::now()->Format(DBDatetime::ISO_DATETIME);\n\n foreach ($this->defaultTasks as $task => $method) {\n $state = SqsQueueState::get()->filter('Title', $task)->first();\n\n $new = false;\n if (!$state) {\n $state = SqsQueueState::create(array(\n 'Title' => $task\n ));\n $new = true;\n $state->write();\n }\n\n // let's see if the dates are okay.\n $lastQueueRun = strtotime($state->WorkerRun);\n $lastScheduleRun = strtotime($state->LastScheduledStart);\n $lastAdded = strtotime($state->LastAddedScheduleJob);\n\n $a = $state->WorkerRun;\n $b = $state->LastScheduledStart;\n\n // if the last time it was added is more than 10 minutes ago, AND\n // the last run is more than 10 minutes since it was last started OR it's new OR it was last run more than 15 minutes ago\n if ((time() - $lastAdded > 600) && ((($lastQueueRun - $lastScheduleRun) > 600) || $new || (time() - $lastQueueRun > 900))) {\n $state->LastAddedScheduleJob = $now;\n $state->write();\n $this->sendSqsMessage($task, $method);\n }\n }\n }\n }", "static function schedule_cron() {\n\t\t$is_multisite = is_multisite();\n\t\tif ( $is_multisite ) {\n\t\t\t$primary_blog = get_current_site();\n\t\t\t$current_blog = get_current_blog_id();\n\t\t} else {\n\t\t\t$primary_blog = 1;\n\t\t\t$current_blog = 1;\n\t\t}\n\n\t\t/**\n\t\t * If we're on a multisite, only schedule the cron if we're on the primary blog\n\t\t */\n\t\tif (\n\t\t( ! $is_multisite || ( $is_multisite && $primary_blog->id === $current_blog ) )\n\t\t) {\n\t\t\t$cronsScheduled = false;\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), '5_minutes', 'wp_rest_cache_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_expired_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), 'hourly', 'wp_rest_cache_expired_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( $cronsScheduled ) {\n\t\t\t\tdo_action( 'wrc_after_schedule_cron', $primary_blog, $current_blog );\n\t\t\t}\n\t\t}\n\t}", "private function initNextCronRunInfo() {\n $offsetInSeconds = $this->getGMTOffset();\n\n // Next CRON event dates\n $nextCollectUrls = wp_next_scheduled(Factory::schedulingService()->eventCollectUrls);\n $nextCrawlPost = wp_next_scheduled(Factory::schedulingService()->eventCrawlPost);\n $nextRecrawlPost = wp_next_scheduled(Factory::schedulingService()->eventRecrawlPost);\n $nextDeletePosts = wp_next_scheduled(Factory::schedulingService()->eventDeletePosts);\n\n if($nextCollectUrls) $this->nextURLCollectionDate = date($this->dateFormat, $nextCollectUrls + $offsetInSeconds);\n if($nextCrawlPost) $this->nextPostCrawlDate = date($this->dateFormat, $nextCrawlPost + $offsetInSeconds);\n if($nextRecrawlPost) $this->nextPostRecrawlDate = date($this->dateFormat, $nextRecrawlPost + $offsetInSeconds);\n if($nextDeletePosts) $this->nextPostDeleteDate = date($this->dateFormat, $nextDeletePosts + $offsetInSeconds);\n\n /*\n * Next sites\n */\n\n // Get last site IDs\n $keySiteIdLastUrlCollection = Factory::urlSaver()->optionLastCheckedSiteId;\n $keySiteIdLastPostCrawl = Factory::postSaver()->optionLastCrawledSiteId;\n $keySiteIdLastPostRecrawl = Factory::postSaver()->optionLastRecrawledSiteId;\n $keySiteIdLastPostDelete = Factory::schedulingService()->optionKeyLastPostDeletedSiteId;\n\n // Get next site IDs using the last site IDs\n $nextSiteIdUrlCollection = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastUrlCollection);\n $nextSiteIdPostCrawl = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastPostCrawl);\n $nextSiteIdPostRecrawl = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastPostRecrawl);\n $nextSiteIdPostDelete = Factory::schedulingService()->getSiteIdForEvent($keySiteIdLastPostDelete);\n\n // Get the sites as WP_Post\n $sites = $this->getPosts([$nextSiteIdUrlCollection, $nextSiteIdPostCrawl, $nextSiteIdPostRecrawl, $nextSiteIdPostDelete], Environment::postType());\n\n // Assign the related class variables\n foreach($sites as $site) {\n if($site->ID == $nextSiteIdUrlCollection) $this->nextUrlCollectionSite = $site;\n if($site->ID == $nextSiteIdPostCrawl) $this->nextPostCrawlSite = $site;\n if($site->ID == $nextSiteIdPostRecrawl) $this->nextPostRecrawlSite = $site;\n if($site->ID == $nextSiteIdPostDelete) $this->nextPostDeleteSite = $site;\n }\n }", "public function cron()\n\t{\n\t\t$objNews = $this->Database->prepare(\"SELECT * FROM tl_news WHERE newsalert=? AND na_sent=? AND date<=?\")\n\t\t\t\t\t\t\t\t ->execute(1, '', time());\n\t\t\t\t\t\t\t\t \n\t\tif ($objNews->numRows)\n\t\t{\n\t\t\twhile( $objNews->next() )\n\t\t\t{\n\t\t\t\t$this->send($objNews->id, true);\n\t\t\t}\n\t\t}\n\t}", "function local_campusconnect_cron() {\n $ecslist = ecssettings::list_ecs();\n foreach ($ecslist as $ecsid => $name) {\n $ecssettings = new ecssettings($ecsid);\n\n if ($ecssettings->time_for_cron()) {\n mtrace(\"Checking for updates on ECS server '\".$ecssettings->get_name().\"'\");\n $connect = new connect($ecssettings);\n $queue = new receivequeue();\n\n try {\n $queue->update_from_ecs($connect);\n $queue->process_queue($ecssettings);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n mtrace(\"Sending updates to ECS server '\".$ecssettings->get_name().\"'\");\n try {\n export::update_ecs($connect);\n course_url::update_ecs($connect);\n enrolment::update_ecs($connect);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n $cms = participantsettings::get_cms_participant();\n if ($cms && $cms->get_ecs_id() == $ecssettings->get_id()) {\n // If we are updating from the ECS with the CMS attached, then check the directory mappings (and sort order).\n directorytree::check_all_mappings();\n }\n\n mtrace(\"Emailing any necessary notifications for '\".$ecssettings->get_name().\"'\");\n notification::send_notifications($ecssettings);\n\n $ecssettings->update_last_cron();\n }\n }\n}", "public function wp_cron_scheduled_check()\n {\n }", "function schedule()\n {\n $this->currentTcb = $this->list;\n while ($this->currentTcb != null) {\n if ($this->currentTcb->isHeldOrSuspended()) {\n $this->currentTcb = $this->currentTcb->link;\n } else {\n $this->currentId = $this->currentTcb->id;\n $this->currentTcb = $this->currentTcb->run();\n }\n }\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n // Da ka Event\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/PunchEvent';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('9:13');\n // Check sprint progress.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/amChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('10:00');\n // Verify completed tasks\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/doneIssueChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('17:30');\n // volunteer for unassigned task.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/todoChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n })->weekdays()\n ->everyFiveMinutes()\n ->timezone('Asia/Shanghai')\n ->between('9:50', '22:00');\n }", "private function cronMinute()\n {\n $timedRecords = $this->app['storage.event_processor.timed'];\n if ($timedRecords->isDuePublish()) {\n $this->notify('Publishing timed records');\n $timedRecords->publishTimedRecords();\n }\n if ($timedRecords->isDueHold()) {\n $this->notify('De-publishing timed records');\n $timedRecords->holdExpiredRecords();\n }\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('make:rss')->hourly();\n\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->call(function(){\n cache()->forever('cached.phrases', getRandomPhrases(5) );\n\n cache()->forever('cached.featuredEvents', getFeatureEvents() );\n\n cache()->forever('cached.pastEvents', getPastEvents() );\n\n cache()->forever('cached.ratings', \\App\\Post::ratings()->onlyEnabled()->take(3)->orderBy('id', 'desc')->get() );\n\n cache()->forever('cached.news',\n \\App\\Post::news()\n ->select(['title', 'image','slug','excerpt','created_at','post_type_id', 'views'])\n ->onlyEnabled()\n ->with(['postType.page'])\n\n ->orderBy('id', 'desc')\n ->take(4)\n ->get());\n\n cache()->forever('cached.slides',\n \\App\\Post::slides()->onlyEnabled()->orderBy('created_at', 'desc')->get());\n })->everyMinute();\n\n\t $schedule->call(function(){\n\n\t \t$serializedJobs = DB::table('jobs')->select()->get();\n\n\t \tforeach ($serializedJobs as $serializedJob){\n\n\t \t\t$jsonJob = json_decode($serializedJob->payload);\n\n\t\t\t $job = unserialize( $jsonJob->data->command);\n\n\t\t\t $job->handle();\n\n\t\t\t DB::table('jobs')->where('id', '=', $serializedJob->id)->delete();\n\t\t }\n\n\t })->everyMinute()\n\t\t ->name('jobs_dispatch')\n\t ->withoutOverlapping();\n\n }", "protected function schedule(Schedule $schedule)\n\t{\n\t\t//Runs daily, every 5 minutes from 03:00\n\t\t$schedule->command(TranslationsBackup::class)->dailyAt('03:00'); // Dispatching a Job that will create a CSV File with the translations\n\t\t$schedule->command(RemoveCsvFiles::class, ['1', '--queue'])->dailyAt('03:05'); // Remove CSV Files older than x months (default 1) from /var/www/public/admin/reports/csv\n\t\t$schedule->command(DeleteOldTokens::class, ['1'])->dailyAt('03:10'); // Deletes the tokens that are older than x (default 1) days\n\t\t$schedule->command(DeleteUselessTransactions::class, ['3', '1000'])->dailyAt('03:15'); //Delete a number of created transactions older than 3 months\n\t\t//$schedule->command(DeleteExpiredClients::class, ['1000'])->dailyAt('03:20'); // TODO: This comes from V1, why do we do it? Clear expired maestro clients\n\n\t\t//Runs every hour\n\t\t$schedule->command(ActivateVouchers::class)->hourly(); // Activate vouchers that are inactive and startDate < now()\n\t\t$schedule->command(DeactivateVouchers::class)->hourly(); // Deactivate vouchers that are active and stopDate < now()\n\t\t//$schedule->command(ClearPasswordAttempts::class, ['3'])->hourly(); // Update reminder table where there are more than 2 attempts and updated < last x (default 3) hours\n\t\t//$schedule->command(ClearHheClients::class)->hourly(); // TODO: This comes from V1, why do we do it? Clear expired hhe clients\n\n\t\t//Runs every 10 minutes\n\t\t//$schedule->command(MerakiCheck::class)->everyTenMinutes(); // Update airhealth.hardware based on a xml taken from a URL from site_attribute having \"meraki_network\"\n\t\t//$schedule->command(DestroyGhostSessions::class, ['10'])->everyTenMinutes(); // 1. Cleaning up NULL Connectinfo_Start records; 2. Cleaning up NULL Connectinfo_Stop records and acctstoptime; 3. Removing records stale for x (default 10) minutes\n\t\t//$schedule->command(ShutdownIdle::class, ['20'])->everyTenMinutes(); // Shuts down sessions older than x (default 20) minutes where IP is 192.168.1.2 by adding a acctstoptime | Might be CC only\n\t\t//$schedule->command(UpdateGender::class)->everyTenMinutes(); // Checks the name with the names that we have in our DB to return the gender\n\t\t$schedule->command(UpdatePmsDynamicIp::class)->everyTenMinutes(); // Updates the IP of site attributes that have dynamic_ip enabled (for UPMS and Captive PMS)\n\n\t\t//Runs every minute\n\t\t$schedule->command(DeleteTransactionReceipts::class, ['2', '10000'])->everyMinute(); // Delete a number of transaction receipts older than x (default 2) months\n\n\t\t// These are the SSID scheduling and was never implemented (unless it was)\n//\t\t$schedule->command(RevertScheduledSsids::class, ['2'])->everyMinute(); //THIS MUST BE CHECKED AS I THINK IT'S NOT CORRECT\n//\t\t$schedule->command(ChangeScheduledSsids::class, ['2'])->everyMinute(); //THIS MUST BE CHECKED AS I THINK IT'S NOT CORRECT\n\t}", "function addCronTask()\n{\n require_once __DIR__.\"/models/SchedulesModel.php\";\n require_once __DIR__.\"/models/LogModel.php\";\n\n // Emojione client\n $Emojione = new \\Emojione\\Client(new \\Emojione\\Ruleset());\n\n\n // Get auto repost schedules\n $Schedules = new SchedulesModel;\n $Schedules->where(\"is_active\", \"=\", 1)\n ->where(\"schedule_date\", \"<=\", date(\"Y-m-d H:i:s\"))\n ->where(\"end_date\", \">=\", date(\"Y-m-d H:i:s\"))\n ->orderBy(\"last_action_date\", \"ASC\")\n ->setPageSize(5) // required to prevent server overload\n ->setPage(1)\n ->fetchData();\n\n if ($Schedules->getTotalCount() < 1) {\n // There is not any active schedule\n return false;\n }\n\n // Settings\n $settings = namespace\\settings();\n\n // Random delays between actions\n $random_delay = 0;\n if ($settings->get(\"data.random_delay\")) {\n $random_delay = rand(0, 3600); // up to an hour\n }\n\n // Speeds (action count per day)\n $default_speeds = [\n \"very_slow\" => 1,\n \"slow\" => 2,\n \"medium\" => 3,\n \"fast\" => 4,\n \"very_fast\" => 5,\n ];\n $speeds = $settings->get(\"data.speeds\");\n if (empty($speeds)) {\n $speeds = [];\n } else {\n $speeds = json_decode(json_encode($speeds), true);\n }\n $speeds = array_merge($default_speeds, $speeds);\n\n\n $as = [__DIR__.\"/models/ScheduleModel.php\", __NAMESPACE__.\"\\ScheduleModel\"];\n foreach ($Schedules->getDataAs($as) as $sc) {\n $Log = new LogModel;\n $Account = \\Controller::model(\"Account\", $sc->get(\"account_id\"));\n $User = \\Controller::model(\"User\", $sc->get(\"user_id\"));\n\n // Set default values for the log (not save yet)...\n $Log->set(\"user_id\", $User->get(\"id\"))\n ->set(\"account_id\", $Account->get(\"id\"))\n ->set(\"status\", \"error\");\n\n // Check the account\n if (!$Account->isAvailable() || $Account->get(\"login_required\")) {\n // Account is either removed (unexected, external factors)\n // Or login reqiured for this account\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Re-login is required for the account.\")\n ->save();\n continue;\n }\n\n // Check the user\n if (!$User->isAvailable() || !$User->get(\"is_active\") || $User->isExpired()) {\n // User is not valid\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"User account is either disabled or expired.\")\n ->save();\n continue;\n }\n\n if ($User->get(\"id\") != $Account->get(\"user_id\")) {\n // Unexpected, data modified by external factors\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n // Check user access to the module\n $user_modules = $User->get(\"settings.modules\");\n if (!is_array($user_modules) || !in_array(IDNAME, $user_modules)) {\n // Module is not accessible to this user\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Module is not accessible to your account.\")\n ->save();\n continue;\n }\n\n // Calculate next schedule datetime...\n if (isset($speeds[$sc->get(\"speed\")]) && (int)$speeds[$sc->get(\"speed\")] > 0) {\n $speed = (int)$speeds[$sc->get(\"speed\")];\n $delta = round(86400/$speed) + $random_delay;\n } else {\n $delta = rand(1200, 21600); // 20 min - 6 hours\n }\n\n $next_schedule = date(\"Y-m-d H:i:s\", time() + $delta);\n if ($sc->get(\"daily_pause\")) {\n $pause_from = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_from\");\n $pause_to = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_to\");\n if ($pause_to <= $pause_from) {\n // next day\n $pause_to = date(\"Y-m-d\", time() + 86400).\" \".$sc->get(\"daily_pause_to\");\n }\n\n if ($next_schedule > $pause_to) {\n // Today's pause interval is over\n $pause_from = date(\"Y-m-d H:i:s\", strtotime($pause_from) + 86400);\n $pause_to = date(\"Y-m-d H:i:s\", strtotime($pause_to) + 86400);\n }\n\n if ($next_schedule >= $pause_from && $next_schedule <= $pause_to) {\n $next_schedule = $pause_to;\n }\n }\n $sc->set(\"schedule_date\", $next_schedule)\n ->set(\"last_action_date\", date(\"Y-m-d H:i:s\"))\n ->save();\n\n\n // Parse targets\n $targets = @json_decode($sc->get(\"target\"));\n if (is_null($targets)) {\n // Unexpected, data modified by external factors or empty targets\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n if (count($targets) < 1) {\n // Couldn't find any target for the feed\n // Log data\n $Log->set(\"data.error.msg\", \"Couldn't find any target to search for the feed.\")\n ->save();\n return false;\n }\n\n // Select random target from the defined target collection\n $i = rand(0, count($targets) - 1);\n $target = $targets[$i];\n\n if (empty($target->type) || empty($target->id) ||\n !in_array($target->type, [\"hashtag\", \"location\", \"people\"])) \n {\n // Unexpected invalid target, \n // data modified by external factors\n $sc->set(\"is_active\", 0)->save();\n continue; \n }\n\n $Log->set(\"data.trigger\", $target);\n\n\n // Login into the account\n try {\n $Instagram = \\InstagramController::login($Account);\n } catch (\\Exception $e) {\n // Couldn't login into the account\n $Account->refresh();\n\n // Log data\n if ($Account->get(\"login_required\")) {\n $sc->set(\"is_active\", 0)->save();\n $Log->set(\"data.error.msg\", \"Activity has been stopped\");\n } else {\n $Log->set(\"data.error.msg\", \"Action re-scheduled\");\n }\n $Log->set(\"data.error.details\", $e->getMessage())\n ->save();\n\n continue;\n }\n\n\n // Logged in successfully\n $permissions = $User->get(\"settings.post_types\");\n $video_processing = isVideoExtenstionsLoaded() ? true : false;\n\n $acceptable_media_types = [];\n if (!empty($permissions->timeline_photo)) {\n $acceptable_media_types[] = \"1\"; // Photo\n }\n\n if (!empty($permissions->timeline_video)) {\n $acceptable_media_types[] = \"2\"; // Video\n }\n\n if (!empty($permissions->album_photo) || !empty($permissions->album_video)) {\n $acceptable_media_types[] = \"8\"; // Album\n }\n\n\n // Generate a random rank token.\n $rank_token = \\InstagramAPI\\Signatures::generateUUID();\n\n if ($target->type == \"hashtag\") {\n $hashtag = str_replace(\"#\", \"\", trim($target->id));\n if (!$hashtag) {\n continue;\n }\n\n try {\n $feed = $Instagram->hashtag->getFeed(\n $hashtag,\n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the hashtag\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = array_merge($feed->getRankedItems(), $feed->getItems());\n } else if ($target->type == \"location\") {\n try {\n $feed = $Instagram->location->getFeed(\n $target->id, \n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the location id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n } else if ($target->type == \"people\") {\n try {\n $feed = $Instagram->timeline->getUserFeed($target->id);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the user id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n }\n\n\n // Found feed item to repost\n $feed_item = null;\n\n // Shuffe items\n shuffle($items);\n\n // Iterate through the items to find a proper item to repost\n foreach ($items as $item) {\n if (!$item->getId()) {\n // Item is not valid\n continue;\n }\n\n if (!in_array($item->getMediaType(), $acceptable_media_types)) {\n // User has not got a permission to post this kind of the item\n continue;\n }\n\n if ($item->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n continue;\n }\n\n if ($item->getMediaType() == 8) {\n $medias = $item->getCarouselMedia();\n $is_valid = true;\n foreach ($medias as $media) {\n if ($media->getMediaType() == 1 && empty($permissions->album_photo)) {\n // User has not got a permission for photo albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && empty($permissions->album_video)) {\n // User has not got a permission for video albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n $is_valid = false;\n break; \n }\n }\n\n if (!$is_valid) {\n // User can not re-post this album post because of the permission \n // (or absence of the ffmpeg video processing)\n continue;\n }\n }\n\n\n $_log = new LogModel([\n \"user_id\" => $User->get(\"id\"),\n \"account_id\" => $Account->get(\"id\"),\n \"original_media_code\" => $item->getCode(),\n \"status\" => \"success\"\n ]);\n\n if ($_log->isAvailable()) {\n // Already reposted this feed\n continue;\n }\n\n // Found the feed item to repost\n $feed_item = $item;\n break;\n }\n\n\n if (empty($feed_item)) {\n $Log->set(\"data.error.msg\", \"Couldn't find the new feed item to repost\")\n ->save();\n continue;\n }\n\n\n // Download the media\n $media = [];\n if ($feed_item->getMediaType() == 1 && $feed_item->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 2 && $feed_item->getVideoVersions()[0]->getUrl()) {\n $media[] = $feed_item->getVideoVersions()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 8) {\n foreach ($feed_item->getCarouselMedia() as $m) {\n if ($m->getMediaType() == 1 && $m->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $m->getImageVersions2()->getCandidates()[0]->getUrl();\n\n } else if ($m->getMediaType() == 2 && $m->getVideoVersions()[0]->getUrl()) {\n $media[] = $m->getVideoVersions()[0]->getUrl();\n }\n }\n }\n\n\n $downloaded_media = [];\n foreach ($media as $m) {\n $url_parts = parse_url($m);\n if (empty($url_parts['path'])) {\n continue;\n }\n\n $ext = strtolower(pathinfo($url_parts['path'], PATHINFO_EXTENSION));\n $filename = uniqid(readableRandomString(8).\"-\").\".\".$ext;\n $downres = file_put_contents(TEMP_PATH . \"/\". $filename, file_get_contents($m));\n if ($downres) {\n $downloaded_media[] = $filename;\n }\n }\n\n if (empty($downloaded_media)) {\n $Log->set(\"data.error.msg\", \"Couldn't download the media of the selected post\")\n ->save();\n continue;\n }\n\n $original_caption = \"\";\n if ($feed_item->getCaption()->getText()) {\n $original_caption = $feed_item->getCaption()->getText();\n }\n\n $caption = $sc->get(\"caption\");\n $variables = [\n \"{{caption}}\" => $original_caption,\n \"{{username}}\" => \"@\".$feed_item->getUser()->getUsername(),\n \"{{full_name}}\" => $feed_item->getUser()->getFullName() ?\n $feed_item->getUser()->getFullName() :\n \"@\".$feed_item->getUser()->getUsername()\n ];\n $caption = str_replace(\n array_keys($variables), \n array_values($variables), \n $caption);\n\n $caption = $Emojione->shortnameToUnicode($caption);\n if ($User->get(\"settings.spintax\")) {\n $caption = \\Spintax::process($caption);\n }\n\n $caption = mb_substr($caption, 0, 2200);\n\n\n\n // Try to repost\n try {\n if (count($downloaded_media) > 1) {\n $album_media = [];\n\n foreach ($downloaded_media as $m) {\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n\n $album_media[] = [\n \"type\" => in_array($ext, [\"mp4\"]) ? \"video\" : \"photo\",\n \"file\" => TEMP_PATH.\"/\".$m\n ];\n }\n\n $res = $Instagram->timeline->uploadAlbum($album_media, ['caption' => $caption]);\n } else {\n $m = $downloaded_media[0];\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n if (in_array($ext, [\"mp4\"])) {\n $res = $Instagram->timeline->uploadVideo(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n } else {\n $res = $Instagram->timeline->uploadPhoto(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n }\n }\n } catch (\\Exception $e) {\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n if (!$res->isOk()) {\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", __(\"Instagram didn't return the expected result.\"))\n ->save();\n continue;\n }\n\n\n // Reposted media succesfully\n // Save log\n $thumb = null;\n if (null !== $feed_item->getImageVersions2()) {\n $thumb = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if (null !== $feed_item->getCarouselMedia()) {\n $thumb = $feed_item->getCarouselMedia()[0]->getImageVersions2()->getCandidates()[0]->getUrl();\n }\n\n\n $Log->set(\"data.grabbed\", [\n \"media_id\" => $feed_item->getId(),\n \"media_code\" => $feed_item->getCode(),\n \"media_type\" => $feed_item->getMediaType(),\n \"media_thumb\" => $thumb,\n \"user\" => [\n \"pk\" => $feed_item->getUser()->getPk(),\n \"username\" => $feed_item->getUser()->getUsername(),\n \"full_name\" => $feed_item->getUser()->getFullName()\n ]\n ]);\n\n $Log->set(\"data.reposted\", [\n \"upload_id\" => $res->getUploadId(),\n \"media_pk\" => $res->getMedia()->getPk(),\n \"media_id\" => $res->getMedia()->getId(),\n \"media_code\" => $res->getMedia()->getCode()\n ]);\n \n $Log->set(\"status\", \"success\")\n ->set(\"original_media_code\", $feed_item->getCode());\n \n\n if ($sc->get(\"remove_delay\") > 0) {\n $Log->set(\"is_removable\", 1)\n ->set(\"remove_scheduled\", date(\"Y-m-d H:i:s\", time() + $sc->get(\"remove_delay\")));\n }\n\n $Log->save();\n\n // Remove downloaded media files\n foreach ($downloaded_media as $m) {\n @unlink(TEMP_PATH.\"/\".$m);\n }\n }\n}", "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')\n// ->hourly();\n// $schedule->call(function(){\n// $time=date('H');\n $date=date('Y-m-d');\n// $data=[];\n// if($time>0){\n// $reserves=Reserve::where('date',$date)->whereIn('progress',[1,3])->get();\n// foreach($reserves as $k=>$v){\n// $v->progress=2;\n// $v->save();\n// $number=Number::where('reserve_id',$v->id)->where('number_class',1)->first();\n// if($number){\n// $number->number_push=1;\n// $number->number_status=0;\n// $number->save();\n// }\n// }\n// DB::table('reserves')->where('date',$date)->whereIn('progress',[1,3])->where('halt',0)->update('progress',2);\n//// }\n// })->everyMinute();\n\n }", "function cron()\n\t{\n\t\tglobal $wpdb,\n\t\t\t\t\t $wgobd_importer_helper,\n\t\t\t\t\t $wgobd_events_helper,\n\t\t\t\t\t $wgobd_settings_controller;\n\n\t\t// ====================\n\t\t// = Select all feeds =\n\t\t// ====================\n\t\t$table_name = $wpdb->prefix . 'wgobd_event_feeds';\n\t\t$sql = \"SELECT * FROM {$table_name}\";\n\t\t$feeds = $wpdb->get_results( $sql );\n\n\t\t// ===============================\n\t\t// = go over each iCalendar feed =\n\t\t// ===============================\n\t\tforeach( $feeds as $feed ) {\n\t\t // flush the feed\n\t\t $wgobd_settings_controller->flush_ics_feed( false, $feed->feed_url );\n\t\t // import the feed\n\t\t\t$wgobd_importer_helper->parse_ics_feed( $feed );\n\t\t}\n\t}", "protected function schedule(Schedule $schedule)\n {\n\n $schedule->call(function () {\n ContestBusinessLogic::insertContests();\n })->hourly()->onSuccess(\n function () {\n FiltersLogic::applyFilter2();\n }\n );\n\n $schedule->call(function () {\n FiltersLogic::sendNotifications2();\n })->twiceDaily(7 , 13);\n\n\n\n $schedule->command('subscription:send_warning_email')->dailyAt(0);\n //corre o InsertContests a cada minuto\n /*$schedule->call(function(){\n ContestBusinessLogic::insertContests();\n })->everyFiveMinutes()->onSuccess(function () {\n FiltersLogic::applyFilter();\n })->onSuccess(function () {\n FiltersLogic::sendNotifications();\n });*/\n\n $schedule->call(function (){\n $entities = Entity::where('status', 1)->get();\n foreach ($entities as $entity) {\n if( !Entity::isEntitySubscribed($entity)){\n $entity->update(['status' => 0]);\n }\n }\n })->daily();\n\n/*\n $schedule->call(function (){\n FiltersLogic::applyFilter();\n })->twiceDaily(9, 15);\n $schedule->call(function (){\n FiltersLogic::sendNotifications();\n })->twiceDaily(9, 14);\n */\n }", "static function process_scheduler(){\n\t\treturn self::process_offline_leads();\n\t}", "static function cron() {\n\t\tself::starter();\n\t\tself::ender();\n\t}", "protected function schedule(Schedule $schedule)\n {\n $schedule->call(function () {\n\n $unassigned_orders = Order::where('status','New')->get();\n foreach($unassigned_orders as $order){\n $pharmacies = Pharmacy::where('area_id',$order->address->area_id)->get();\n if( empty($pharmacies->first()) ){continue;}\n $pharmacy = $pharmacies->sortBy('priority')->first();\n\n $order->update([\n 'pharmacy_id' => $pharmacy->id,\n 'status' => 'Processing',\n ]);\n }\n })->everyminute();\n }", "private function createSchedule()\n {\n $days = DisplayScheduleDay::singleton()->dbObject('Day')->enumValues();\n foreach ($days as $day) {\n $scheduleDay = DisplayScheduleDay::create();\n $scheduleDay->Day = $day;\n $this->Schedule()->add($scheduleDay);\n }\n }", "protected function schedule(Schedule $schedule)\n {\n //\n /*$schedule->call(function () {\n $banco = App\\Bank::create(['name' => 'NAN']);\n $banco->save();\n })->everyMinute();*/\n\n $schedule->call(function () {\n $credits = App\\approvedcredit::where('extends', null)->get();\n $npl_ratio = collect();\n $total_money_loaned= collect();\n $income_net_interest = collect();\n $financial_margin = 0;\n foreach ($credits as $credit) {\n switch($credit->startDate){\n\n }\n try{\n if ($credit->type == 2) {\n $lastMove = App\\controlcredit::where('credit', $credit->id)->orderBy('id', 'DESC')->firstOrFail();\n }if($credit->type == 1){\n $lastCredit = App\\approvedcredit::where('extends',$credit->id)->orderBy('id','DESC')->firstOrFail();\n if($lastCredit){\n $lastMove = App\\controlcredit::where('credit', $lastCredit->id)->orderBy('id', 'DESC')->firstOrFail();\n }else{\n $lastMove = App\\controlcredit::where('credit', $credit->id)->orderBy('id', 'DESC')->firstOrFail();\n }\n }\n }catch (\\Exception $ex){\n $lastMove = null;\n }\n Log::warning($lastMove);\n if ($lastMove!= null) {\n $lastMoveDate = Carbon::parse($lastMove->period);\n $finalDate = Carbon::parse($credit->start_date)->addMonth(intval($credit->term));\n $graceDate = Carbon::parse($credit->start_date)->addMonth(intval($credit->term))->addDays(\n intval($credit->grace_days));\n $newDate = Carbon::now();\n $dateDif = $lastMoveDate->diffInDays($newDate);\n $dateDifGrace = $dateDif;//$newDate->diffInDays($graceDate);\n //$dateDif = $lastMoveDate->diffInDays($newDate);\n //$dateDifGrace = $newDate->diffInDays($graceDate);\n $move = new App\\controlcredit();\n $move->credit = $credit->id;\n $move->period = $newDate;\n $move->capital_balance = floatval($lastMove->capital_balance);\n if($dateDif == 0){//Si no ha pasado ningun dia, el balance interes nuevo es igual al anterior\n $move->interest_balance = floatval($lastMove->interest_balance);\n }else{\n $move->interest_balance = floatval($lastMove->interest_balance) +\n (floatval($move->capital_balance) * $credit->interest)/(36500/ $dateDif);\n }\n\n //restar intereses moratorios a margen financiero\n $financial_margin+=ceil($move->interest_balance);\n $move->iva_balance = ($move->interest_balance * ($credit->iva / 100));\n $move->interest = $move->interest_balance;\n $move->iva = $move->iva_balance;\n $application = App\\Application::where('id',$credit->application)->first();\n if(!isset($total_money_loaned[$application->idclient])){\n $total_money_loaned[$application->idclient] = $move->capital_balance;\n }else{\n $total_money_loaned[$application->idclient] += $move->capital_balance;\n }\n //Inicializando variables para indice de morosidad\n if(!isset($npl_ratio[$application->idclient])){\n $npl_ratio[$application->idclient] = collect();\n $npl_ratio[$application->idclient]->expired_money = 0;\n $npl_ratio[$application->idclient]->grace_money = 0;\n $npl_ratio[$application->idclient]->active_money = 0;\n }\n //Calculando indice de morosidad en el siguiente orden:\n //--Cantidad activa\n //--cantidad en dias de gracia\n //--Cantidad expirada\n if($newDate->lt($finalDate)){\n $npl_ratio[$application->idclient]->active_money+=$move->capital_balance;\n }\n if($newDate->gt($finalDate)&& $newDate->lt($graceDate)){\n $npl_ratio[$application->idclient]->grace_money+=$move->capital_balance;\n }\n if($newDate->gt($graceDate)){\n $npl_ratio[$application->idclient]->expired_money+=$move->capital_balance;\n }\n //Inicializando intereses por cliente en interes balance, si no lo tiene\n\n\n if ($newDate->timestamp > $graceDate->timestamp) {\n $move->interest_arrear_balance = $lastMove->interest_arrear_balance + ((($credit->interest_arrear / 100 / 365) * $dateDifGrace) * ($move->capital_balance + $move->interest_balance));\n //restar intereses moratorios a margen financiero\n $financial_margin+=ceil($move->interest_arrear_balance);\n $move->interest_arrear_iva_balance = $move->interest_arrear_balance * ($credit->iva / 100);\n } else {\n $move->interest_arrear_balance = 0;\n $move->interest_arrear_iva_balance = 0;\n }\n if(!isset($income_net_interest[$application->idclient])){\n $income_net_interest[$application->idclient]=$move->capital_balance+$move->interest_balance\n +$move->interest_arrear_balance+$move->interest_arrear_iva_balance+$move->iva_balance;\n }else{//Si lo tiene, lo agregamos a una sumatoria\n $income_net_interest[$application->idclient]+=$move->capital_balance+$move->interest_balance\n +$move->interest_arrear_balance+$move->interest_arrear_iva_balance+$move->iva_balance;\n }\n $move->currency = $credit->currency;\n $move->save();\n } else {\n if($credit->type == 1){\n $move = new App\\controlcredit();\n $move->credit = $credit->id;\n $move->period = $credit->start_date;\n $move->capital_balance = $credit->amount;\n $move->interest_balance = 0;\n $move->iva_balance = 0;\n $move->interest_arrear_balance = 0;\n $move->interest_arrear_iva_balance = 0;\n $move->currency = $credit->currency;\n $move->save();\n }\n }\n unset($lastMove);\n unset($credit);\n\n }\n //Calculando valores para la tabla \"Cartera promedio\"\n try{\n $idsample = App\\Average_Money_Loaned::all();\n if($idsample->isEmpty()) $idsample = 1;\n else $idsample = $idsample->max('idsample')+1;\n //Iteramos cada cliente, y su cantidad que tiene prestada, para meterlo a la tabla\n foreach ($total_money_loaned as $client => $money_loaned){\n $newEntry = new App\\Average_Money_Loaned();\n $newEntry->idsample = $idsample;\n $newEntry->idclient = $client;\n $newEntry->money_loaned = $money_loaned;\n $newEntry->save();\n }\n }catch (\\Exception $ex){\n Log::error(\"No se pudo calcular la grafica 'Cartera promedio'\");\n Log::error($ex);\n }\n\n //Calculando valores para la tabla \"Ingreso de intereses neto\"\n try{\n //Calculamos el ID de muestra\n $idsample = App\\Interest_Net_Income::all();\n if($idsample->isEmpty()) $idsample = 1; //1, si es la primera muestra que se calcula\n else $idsample = $idsample->max('idsample')+1; //ultimaMuestra + 1, si ya hay muestras\n //Iteramos cada cliente, y la sumatoria de sus intereses, para meterlos a la tabla\n\n foreach ($total_money_loaned as $client => $interest_net_income){\n $newEntry = new App\\Interest_Net_Income();\n $newEntry->idsample = $idsample;\n $newEntry->idclient = $client;\n $newEntry->interest_net_income = $interest_net_income;\n $newEntry->save();\n }\n }catch (\\Exception $ex){\n Log::error(\"No se pudo calcular la grafica 'Ingreso de intereses neto'\");\n Log::error($ex);\n }\n\n //Calculando valores para la tabla \"Indice de morosidad\"\n try{\n $idsample = App\\NPL_Ratio::all();\n if($idsample->isEmpty()) $idsample = 1;\n else $idsample = $idsample->max('idsample')+1;\n //Iteramos cada cliente, y sus tres cantidades de dinero que deben, para meterlos a la tabla\n foreach ($npl_ratio as $client => $total_money){\n $newEntry = new App\\NPL_Ratio();\n $newEntry->idsample = $idsample;\n $newEntry->idclient = $client;\n $newEntry->active_money = $total_money->active_money;\n $newEntry->grace_money = $total_money->grace_money;\n $newEntry->expired_money = $total_money->expired_money;\n $newEntry->save();\n }\n }catch (\\Exception $ex){\n Log::error(\"No se pudo calcular la grafica 'Indice de Morosidad'\");\n Log::error($ex);\n }\n //Fondeadores\n //Fondeadores\n //Fondeadores\n $funds = App\\fund::where('extends', null)->get();\n $total_money_borrowed= collect();\n foreach ($funds as $fund) {\n try{\n $lastMove = App\\Control_Fund::where('credit', $fund->id)->orderBy('id', 'DESC')->firstOrFail();\n\n }catch (\\Exception $ex){\n $lastMove = null;\n }\n if ($lastMove!= null) {\n $lastMovePeriod = Carbon::parse($lastMove->period);\n $graceDate = Carbon::parse($lastMove->period)->addMonth(intval($fund->term))->addDays(intval($fund->grace_days));\n $newDate = Carbon::now();\n $dateDif = $lastMovePeriod->diffInDays($newDate);\n $dateDifGrace = $dateDif;//$newDate->diffInDays($graceDate);\n $move = new App\\Control_Fund();\n $move->credit = $fund->id;\n $move->period = $newDate;\n Log::warning($dateDif);\n $move->capital_balance = floatval($lastMove->capital_balance);\n if($dateDif == 0){\n $move->interest_balance = floatval($lastMove->interest_balance);\n }else{\n $move->interest_balance = floatval($lastMove->interest_balance) +\n (floatval($move->capital_balance) * $fund->interest)/(36500/ $dateDif);\n }\n\n //restar intereses moratorios a margen financiero\n $financial_margin-=ceil($move->interest_balance);\n $move->iva_balance = ($move->interest_balance * ($fund->iva / 100));\n $move->interest = $move->interest_balance;\n $move->iva = $move->iva_balance;\n\n\n if ($newDate->timestamp > $graceDate->timestamp) {\n $move->interest_arrear_balance = $lastMove->interest_arrear_balance + ((($fund->interest_arrear / 100 / 365) * $dateDifGrace) * ($move->capital_balance + $move->interest_balance));\n //restar intereses moratorios a margen financiero\n $financial_margin-=ceil($move->interest_arrear_balance);\n $move->interest_arrear_iva_balance = $move->interest_arrear_balance * ($fund->iva / 100);\n } else {\n $move->interest_arrear_balance = 0;\n $move->interest_arrear_iva_balance = 0;\n }\n $move->currency = $fund->currency;\n if(!isset($total_money_borrowed[$fund->idstock])){\n $total_money_borrowed[$fund->idstock] = $move->capital_balance+$move->interest_balance\n +$move->interest_arrear_balance+$move->interest_arrear_iva_balance+$move->iva_balance;\n }else{\n $total_money_borrowed[$fund->idstock] += $move->capital_balance+$move->interest_balance\n +$move->interest_arrear_balance+$move->interest_arrear_iva_balance+$move->iva_balance;\n }\n $move->save();\n }\n unset($lastMove);\n unset($fund);\n\n }\n //Try-catch que calcula el registro de deuda promedio\n try{\n $idsample = App\\Average_Money_Borrowed::all();\n if($idsample->isEmpty()) $idsample = 1;\n else $idsample = $idsample->max('idsample')+1;\n foreach ($total_money_borrowed as $stockholder => $money_borrowed){\n $newEntry = new App\\Average_Money_Borrowed();\n $newEntry->idsample = $idsample;\n $newEntry->idstockholder = $stockholder;\n $newEntry->money_borrowed = $money_borrowed;\n $newEntry->save();\n }\n }catch (\\Exception $ex){\n Log::error(\"No se pudo calcular la grafica 'Deuda Promedio'\");\n Log::error($ex);\n }\n\n //Post a la tabla de margen financiero\n $newFinancialMargin = new App\\Financial_Margin();\n $newFinancialMargin->financial_margin = $financial_margin;\n $newFinancialMargin->save();\n\n })->everyMinute();//->monthlyOn(1, '05:00');\n }", "public static function wpapp_schedule_events() {\n\t\t// setup temporary script deletion.\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_file_watcher' );\n\t\twp_schedule_event( time(), 'every_minute', 'wpcd_wordpress_file_watcher' );\n\n\t\t// setup deferred instance actions schedule.\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_deferred_actions_for_server' );\n\t\twp_schedule_event( time(), 'every_minute', 'wpcd_wordpress_deferred_actions_for_server' );\n\n\t\t// setup repeated actions schedule.\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_deferred_actions_for_apps' );\n\t\twp_schedule_event( time(), 'every_minute', 'wpcd_wordpress_deferred_actions_for_apps' );\n\n\t\t// @TODO does not work because the cron schedule is not registered.\n\t\t// wp_schedule_event( time(), 'every-10-seconds', \"wpcd_wordpress_repeated_actions_for_apps\" );\n\t}", "function cron() {\n\t\t//look at the clock.\n\t\t$now = strtotime('now');\n\t\t\n\t\t//check for the hack\n\t\tif(Configure::read('debug') != 0 && isset($this->params['named']['time_machine'])){\n\t\t\t$now = strtotime($this->params['named']['time_machine']);\n\t\t}\n\t\t\n\t\t$this->Project->upgradeProjects($now);\n\t}", "public function schedule(){\n $this->executeAllTransferts();\n }", "protected function schedule(Schedule $schedule)\n {\n //https://laravel.com/docs/5.4/scheduling\n \\Log::info(\"SCHEDULING for day \".DatesHelper::getCurrentDay().' DATE : '.DatesHelper::getCurrentDate());\n //->timezone('America/New_York');\n // $schedule->command('update:info')\n // ->everyMinute();\n\n\n $schedule->call(function() {\\Log::info('Update exchange ...');CoinbaseHelper::updateExchangeRate();})->everyTenMinutes();\n $schedule->call(function() {\\Log::info('Check invoices ...');UpdateInfo::checkInvoices();})->everyMinute();\n $schedule->call(function() {\\Log::info('Check digital check ...');UpdateInfo::checkCheckbook();})->everyMinute();\n\n\n $schedule->command('update:ranking')->dailyAt('10:00')->timezone('America/New_York')->when(function(){\n \\Log::info('Checking conditions for update::ranking weekly');\n if (DatesHelper::getCurrentDay() === 'Tuesday') {\n \\Log::info('Condition is true for update:ranking weekly');\n return true;\n }\n \\Log::info('Condition is false for update:ranking weekly');\n return false;\n });\n\n $schedule->command('update:info')->hourlyAt(11)->timezone('America/New_York')->when(function(){\n \\Log::info('Checking conditions for update::info hourly');\n if (DatesHelper::getCurrentDay() === 'Tuesday' || DatesHelper::getCurrentDay() === 'Wednesday' ||\n DatesHelper::getCurrentDay() === 'Friday' ) {\n \\Log::info('Condition is true for update:info hourly');\n return true;\n }\n \\Log::info('Condition is false for update:info hourly');\n return false;\n });\n\n $schedule->command('update:info')->everyFiveMinutes()->timezone('America/New_York')->when(function(){\n \\Log::info('Checking conditions for update::info everyFiveMinutes');\n if (DatesHelper::getCurrentDay() === 'Tuesday' || DatesHelper::getCurrentDay() === 'Wednesday' ||\n DatesHelper::getCurrentDay() === 'Friday' ) {\n return false;\n Log::info('Condition is false for update:info everyFiveMinutes');\n }\n \\Log::info('Condition is true for update:info everyFiveMinutes');\n return true;\n });\n\n $schedule->command('timeframe:update')->hourly()->timezone('America/New_York')->when(function(){\n \\Log::info(\"Checking condition for timeframe:update hourly ...\");\n if (DatesHelper::getCurrentDay() === 'Thursday' || DatesHelper::getCurrentDay() === 'Friday' ||\n DatesHelper::getCurrentDay() === 'Saturday' || DatesHelper::getCurrentDay() === 'Sunday'){\n \\Log::info(\"Condition for timeframe:update hourly for day condition is false\");\n return false;\n }\n\n $current = TimeFrame::getCurrentTimeFrame();\n\n if (!$current){\n \\Log::info('Condition for timeframe:update hourly for non-existing current timeframe is true');\n return true;\n }\n\n \\Log::info('Retrieving games which are not in HISTORY state for timeframe:update hourly');\n //\n $games = Game::where('status', '!=', 'HISTORY')->get();\n $fps = FantasyPlayer::where('updated', '=', false)->get();\n\n \\Log::info('Retrieved games which are not in HISTORY state for timeframe:update hourly');\n if ($games->count() === 0 && $fps->count() === 0){\n \\Log::info('Condition for timeframe:update hourly for !HISTORY games is true');\n return true;\n }\n\n \\Log::info('Condition for timeframe:update hourly false');\n return false;\n });\n\n $schedule->command('games:update')->withoutOverlapping()->twiceDaily(6, 18)->timezone('America/New_York')->when(function() {\n \\Log::info('Condition for games:update twiceDaily is met');\n return true;\n });\n\n $schedule->command('games:update')->withoutOverlapping()->everyFiveMinutes()->timezone('America/New_York')->when(function(){\n \\Log::info('Checking conditions for games:update everyFiveMinutes');\n //if (DatesHelper::getCurrentDay() === 'Tuesday' || DatesHelper::getCurrentDay() === 'Monday' ||\n if( DatesHelper::getCurrentDay() === 'Wednesday') {\n \\Log::info('Condition for games:update everyFiveMinuets for day condition is false '.DatesHelper::getCurrentDay());\n return false;\n }\n\n \\Log::info('Retrieving games in progress for games:update command everyFiveMinutes');\n $gamesInProgress = Game::where('status', '=', 'LIVE')->get();\n \\Log::info('Retrieved games in progress for games:update command everyFiveMinutes'.$gamesInProgress);\n if ($gamesInProgress->count() > 0){\n \\Log::info('Condition for games:update everyFiveMinutes for games in progress is true ');\n return true;\n }\n \\Log::info('Condition for games:update everyFiveMinutes is false');\n });\n\n $schedule->command('playerInfo:update')->withoutOverlapping()->twiceDaily(6, 18)->timezone('America/New_York')->when(function(){\n \\Log::info('Checking conditions for playerInfo:update twiceDaily');\n if (DatesHelper::getCurrentDay() === 'Tuesday' || DatesHelper::getCurrentDay() === 'Monday' ||\n DatesHelper::getCurrentDay() === 'Wednesday' || DatesHelper::getCurrentDay() === 'Friday' ) {\n \\Log::info('Condition for playerInfo:update twiceDaily for day is true '.DatesHelper::getCurrentDay());\n return true;\n }\n\n \\Log::info('Condition for playerInfo:update twiceDaily is false');\n return false;\n });\n\n $schedule->command('playerInfo:update')->withoutOverlapping()->hourly()->timezone('America/New_York')->when(function(){\n \\Log::info('Checking condition for playerInfo:update hourly ');\n if (DatesHelper::getCurrentDay() === 'Thursday' || DatesHelper::getCurrentDay() === 'Sunday' ||\n DatesHelper::getCurrentDay() === 'Saturday') {\n \\Log::info('Condition for playerInfo:update hourly for day condition is true');\n return true;\n }\n\n \\Log::info('Condition for playerInfo:update hourly is false');\n return false;\n });\n\n $schedule->command('playerStats:update')->twiceDaily(16, 22)->timezone('America/New_York');\n\n $schedule->command('playerStats:update')->hourly()->timezone('America/New_York')->when(function(){\n \\Log::info('Checking condition for playerStats:update hourly');\n\n if (DatesHelper::getCurrentDay() === 'Tuesday') {\n \\Log::info('Checking condition palyerStats:update hourly for Tuesday');\n $timeframe = TimeFrame::getPreviousTimeFrame();\n if (!$timeframe){\n \\Log::info('Condition for playerStats:update hourly for previous timeframe is false');\n return false;\n }\n\n $key = $timeframe->retrieveKey();\n \\Log::info('Condition playerStats:update hourly checking players with key '.$key);\n $fps = FantasyPlayer::where('id', 'like', '%'.$key.'%')->where('updated', '=', false)->get();\n \\Log::info('Condition playerStats:update hourly successfully retrieved players with key '.$key);\n if ($fps && $fps->count() > 0){\n \\Log::info('Condition playerStats:update hourly there are players which are not updated, so condition is true');\n return true;\n }\n\n \\Log::info('Condition playerStats:update hourly condition is false');\n return false;\n }\n });\n\n /*$schedule->command('fantasyData:pull')->everyMinute()->timezone('America/New_York')->when(function(){\n \\Log::info('Checking condition for fantasyData:pull everyThirtyMinutes');\n if (DatesHelper::getCurrentDay() !== 'Tuesday') {\n \\Log::info('Condition for fantasyData:pull everyThirtyMinutes day condition is Tuesday');\n $timeframe = TimeFrame::getCurrentTimeFrame();\n if ($timeframe->count() === 0){\n \\Log::info('Condition for fantasyData:pull hourly for current timeframe is false');\n return false;\n }\n\n \\Log::info('Condition fantasyData:pull everyFiveMinutes retrieving games in progress');\n $gamesInProgress = Game::where('status', '=', 'LIVE')->get();\n \\Log::info('Condition fantasyData:pull everyFiveMinutes received games in progress');\n if ($gamesInProgress->count() > 0){\n \\Log::info('Condition fantasyData:pull everyFiveMinutes there are games in progress');\n return true;\n }\n\n return false;\n }\n });*/\n\n $schedule->command('liveStats:update')->everyThirtyMinutes()->timezone('America/New_York')->when(function(){\n \\Log::info('Checking condition for liveStats:update everyThirtyMinutes');\n if (DatesHelper::getCurrentDay() !== 'Tuesday' && DatesHelper::getCurrentDay() !== 'Wednesday' &&\n DatesHelper::getCurrentDay() !== 'Friday') {\n \\Log::info('Condition for liveStats:update everyThirtyMinutes day condition is Tuesday');\n $timeframe = TimeFrame::getCurrentTimeFrame();\n if (!$timeframe){\n \\Log::info('Condition for liveStats:update hourly for current timeframe is false');\n return false;\n }\n\n \\Log::info('Condition liveStats:update everyFiveMinutes retrieving games in progress');\n $gamesInProgress = Game::where('status', '=', 'LIVE')->get();\n \\Log::info('Condition liveStats:update everyFiveMinutes received games in progress');\n if ($gamesInProgress && $gamesInProgress->count() > 0){\n \\Log::info('Condition liveStats:update everyFiveMinutes there are games in progress');\n return true;\n }\n\n return false;\n }\n });\n\n\n\n // $schedule->command('playerStats:update')->timezone('America/New_York')->hourly()->when(function(){\n\n //$schedule->command('update:info')->everyMinute();\n\n\n\n//->withoutOverlapping();\n\n\n\n }", "public function change()\n {\n\n $time = new Time('+4 hours'); \n\n $usersTable = TableRegistry::get('Users');\n $schedulerTable = TableRegistry::get('Scheduler');\n $usersData = $usersTable->find()->where('active',1)->toArray();\n foreach($usersData as $user){\n\n $schedule = $schedulerTable->newEntity();\n $schedule->user_id = $user['id'];\n $schedule->marketplace_id = 1;\n $schedule->job_interval = 4;\n $schedule->next_occurrence = $time;\n $schedule->type = 'Crawler';\n $schedule->meta_data = serialize([]);\n $schedule->created = Time::now();;\n $schedule->updated = Time::now();;\n $scheduleData = $schedulerTable->save($schedule);\n\n $schedule1 = $schedulerTable->newEntity();\n $schedule1->user_id = $user['id'];\n $schedule1->marketplace_id = 2;\n $schedule1->job_interval = 4;\n $schedule1->next_occurrence = $time;\n $schedule1->meta_data = serialize([]);\n $schedule1->type = 'Crawler';\n $schedule1->created = Time::now();;\n $schedule1->updated = Time::now();;\n $scheduleData = $schedulerTable->save($schedule1);\n\n }\n }", "protected function schedule(Schedule $schedule)\n {\n //* * * * * /usr/bin/php /your/projectPath/artisan schedule:run >> /dev/null 2>&1\n\n //买格子后的日志,记录到数据库\n $schedule->command('Grid:TradeInfo')->everyMinute()->withoutOverlapping();\n\n //延时统计用户成就\n $schedule->command('Grid:Achievement')->everyFiveMinutes()->withoutOverlapping();\n\n //延时更新用户头像\n $schedule->command('Grid:ChangeAvatar')->everyMinute()->withoutOverlapping();\n\n //排行榜统计\n $schedule->command('Grid:RankList')->everyFiveMinutes()->withoutOverlapping();\n\n //n天不交易的格子自动降价m%\n $schedule->command('Grid:ReducePrice')->cron('30 2 * * *')->withoutOverlapping();\n\n\n\n\n //后台发的系统通知\n $schedule->command('Admin:SystemMessage')->everyMinute()->withoutOverlapping();\n\n //后台admin的控制面板,计算cpu,内存,硬盘占用\n $schedule->command('Admin:ServerInfoNew')->everyMinute()->withoutOverlapping();\n\n //后台admin的控制面板,统计用户分布情况\n $schedule->command('Admin:UserDistribution')->daily()->withoutOverlapping();\n\n //后台的数据统计\n $schedule->command('Admin:userData1')->everyThirtyMinutes()->withoutOverlapping();\n $schedule->command('Admin:gridData1')->everyThirtyMinutes()->withoutOverlapping();\n\n\n\n //处理探索世界迷雾\n $schedule->command('Tssj:FogUpload0')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload1')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload2')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload3')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload4')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload5')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload6')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload7')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload8')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload9')->everyMinute()->withoutOverlapping();\n\n //处理我的路迷雾\n $schedule->command('Wodelu:FogUpload0')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload1')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload2')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload3')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload4')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload5')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload6')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload7')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload8')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload9')->everyMinute()->withoutOverlapping();\n\n //处理我的路足迹\n $schedule->command('Wodelu:TrackFogUploadForZUJI0')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI1')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI2')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI3')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI4')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI5')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI6')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI7')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI8')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI9')->everyMinute()->withoutOverlapping();\n\n //计算昨日繁荣度 联盟的\n $schedule->command('Aliance:Flourish')->cron('1 0 * * *')->withoutOverlapping();\n //计算昨日繁荣度 用户的\n $schedule->command('Aliance:FlourishForUser')->cron('1 0 * * *')->withoutOverlapping();\n\n //每月第一天计算联盟战绩\n $schedule->command('Aliance:PKinfo')->cron('30 0 1 */1 *')->withoutOverlapping();\n\n\n\n //每分钟刷拍卖行物品,过期的返回给用户\n $schedule->command('FoodMap:AuctionHouse')->everyMinute()->withoutOverlapping();\n\n\n\n\n $schedule->command('Tssj:OneJoke')->everyFifteenMinutes()->withoutOverlapping();\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('autoBanSubscribeJob')->everyThirtyMinutes();\n $schedule->command('autoBanUserJob')->everyTenMinutes();\n $schedule->command('autoCheckNodeStatusJob')->everyMinute();\n $schedule->command('autoClearLogJob')->everyThirtyMinutes();\n $schedule->command('autoCloseOrderJob')->everyMinute();\n $schedule->command('autoDecGoodsTrafficJob')->everyTenMinutes();\n $schedule->command('autoDisableExpireUserJob')->everyMinute();\n $schedule->command('autoDisableUserJob')->everyMinute();\n $schedule->command('autoExpireCouponJob')->everyThirtyMinutes();\n $schedule->command('autoExpireInviteJob')->everyThirtyMinutes();\n $schedule->command('autoReleasePortJob')->everyMinute();\n $schedule->command('autoReopenUserJob')->everyMinute();\n $schedule->command('autoResetUserTrafficJob')->everyFiveMinutes();\n $schedule->command('autoStatisticsNodeDailyTrafficJob')->dailyAt('04:30');\n $schedule->command('autoStatisticsNodeHourlyTrafficJob')->hourly();\n $schedule->command('autoStatisticsUserDailyTrafficJob')->dailyAt('03:00');\n $schedule->command('autoStatisticsUserHourlyTrafficJob')->hourly();\n $schedule->command('userExpireWarningJob')->daily();\n $schedule->command('userTrafficWarningJob')->daily();\n $schedule->command('autoStatisticsNodeHourlyTestJob')->hourlyAt(10);\n// $schedule->command('autoStatisticsNodeHourlyTestJob')->everyMinute();//测试用\n $schedule->command('autoMysqlBackUpJob')->dailyAt('00:00');\n// $schedule->command('autoMysqlBackUpJob')->everyMinute();//测试用\n $schedule->command('autoMysqlBackUpRemoteJob')->dailyAt('00:30');\n $schedule->command('cPJob')->everyMinute();\n $schedule->command('deleteAuthJob')->everyMinute();\n $schedule->command('pushJob')->dailyAt('13:37');\n $schedule->command('telegramJob')->everyMinute();\n $schedule->command('autoCountNodeFlow')->everyMinute();\n\n\n\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n\n //It will excute the class SocialWorkerController at midnight and retrieve the user tags from facebook\n $schedule->call(\"SmartCity\\Http\\Controllers\\SocialWorkerController@index\")\n ->daily();\n // ->name(\"facebooktags\")\n // ->withoutOverlapping();\n\n //It will excute the class FacebookPagesController every saturday and cities' Facebook pages posts\n $schedule->call(\"SmartCity\\Http\\Controllers\\FacebookPagesController@index\")\n ->saturdays();\n\n }", "function activateSchedules()\n{\n\tforeach( glob( __DIR__ . '/actions/*.php') as $hook ) {\n\n\t\t$hook = explode('-', pathinfo( $hook )['filename']);\n\t\t$name = $hook[0];\n\t\t$schedule = $hook[1];\n\t\t$timestamp = wp_next_scheduled( $name );\n\n\t\tif ( ! $timestamp || $timestamp < time() ) {\n\t\t\twp_schedule_event( time(), 'schedule' . $schedule, $name );\n\t\t}\n\t}\n}", "function dcs_dropship_cron_definer($schedules)\r\n{ \r\n\t$schedules['monthly'] = array( \r\n\t\t'interval'=> 2592000, \r\n\t\t'display'=> __('Once Every 30 Days') \r\n\t\t); \r\n\treturn $schedules;\r\n}", "function check(){\n\techo \"Looking for jobs and adding to queue\\n\";\n\t\n\t$times = date('d-M-Y');\n\tif(DEBUG) $qlog = new snowytech\\stphplogger\\logWriter('../logs/check-queue-' . $times . '.txt');\n\t$check = new snowytech\\stphpschedule\\schedule();\n\t//Goes through whole Jobs table and checks interval!\t\n\t$db = db::getInstance();\n\t$sql = \"SELECT * FROM JOBS\";\n\t$stmt = $db->getData($sql);\n\n\t//Count the rows and send console message there are no jobs configured.\n\tif ( count($stmt) > 0) {\n\t\tforeach($stmt as $row){\n\t\t\t$id = $row['id'];\n\t\t\t$job_name = $row['name'];\n\t\t\t$path = $row['path'];\n\t\t\t$in_queue = $row['status_int'];\n\t\t\t$lastrun = $row['last_run'];\n\t\t\t$interval = $row['interval'];\n\t\t\t$global_hold = $row['global_hold'];\n\t\t\t\n\t\t\t$r = $check->interval($lastrun, $interval);\n\t\t\t\n\t\t\t//Dont run if global hold is set to 1\n\t\t\tif($global_hold !=1){\n\t\t\t\t//Dont run if $in_queue = 0 ( already in queue )\n\t\t\t\tif($in_queue != 0){\n\t\t\t\t\tif( $r ) {\n\t\t\t\t\t\techo \"Job hit the queue: \" . $job_name . \"\\n\";\n\t\t\t\t\t\t$count = time();\n\t\t\t\t\t\techo $count . \"\\n\";\n\t\t\t\t\t\tif(DEBUG) $qlog->info('Job hit the queue: ' . $job_name . \" : time: \" . $count);\n\t\t\t\t\t\t \n\t\t\t\t\t\t//Now last update is updating in table. Need to add an entry to the QUE and update last run from there.\t\t\t\t\n\t\t\t\t\t\t$data = array(':jid' => $id, ':path' => $path, ':hold' => '1', ':time' => $count);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add into QUEUE\n\t\t\t\t\t\t$sql= 'INSERT INTO QUEUE (job_id, path, hold, in_que_time) VALUES (:jid,:path,:hold,:time)';\n\t\t\t\t\t\t$db->execQuery($sql, $data);\n\n\t\t\t\t\t\t//update status_int, prevents multiple entries into queue\n\t\t\t\t\t\t$sql= \"UPDATE JOBS SET status_int = 0 WHERE id = '$id'\";\n\t\t\t\t\t\t$db->updateData($sql);\n\t\t\t\t\t}else{ \n\t\t\t\t\t\techo \"NOT ready to run - \" . $job_name . \"\\n\"; \n\t\t\t\t\t\t//Log that its intervnal is not ready\n\t\t\t\t\t\tif(DEBUG) $qlog->info('NOT RUN - interval is ' . $interval . \" minutes on JOB: \" . $job_name . \"\\n\");\n\t\t\t\t\t}\n\t\t\t\t} else { \n\t\t\t\t\techo \"JOB \" . $job_name . \" - already in QUEUE!\\n\"; \n\t\t\t\t\tif(DEBUG) $qlog->info('JOB ' . $job_name . \" - already in QUEUE!\");\n\t\t\t\t}\n\t\t\t} else { \n\t\t\t\techo \"JOB \" . $job_name . \" is HELD globally!\\n\";\n\t\t\t\tif(DEBUG) $qlog->info(\"JOB \" . $job_name . \" is HELD globally!\\n\");\n\t\t\t}\n\t\t}\n\t} else { echo \"There are no JOBS configured!\"; }\n\t$db->closeDB();\n}", "static function jobs() {\n\t\tif(self::doCron()):\n\t\t\n\t\twhile(!Db::lock());\n\n\t\tReminder::cron();\n\t\t\n\t\t$ctrl = new Cronjob();\n\t\t$ctrl->checkBookings();\n\t\t$ctrl->cancelPending();\n\t\t$ctrl->unattended();\n\t\t\n\t\twhile(!Db::unlock());\n\t\t\n\t\tPreferences::set('lastCron', date(\"H:i:s\"));\n\t\t_debug(\"CRON JOBS DONE!\");\n\t\tendif;\n\t}", "public function run()\n {\n /*$requiredModels = 60;\n $currentModelsCount = \\App\\Schedule::all()->count();\n if($currentModelsCount < $requiredModels){\n for($i=0;$i<$requiredModels;$i++){\n $schedule = factory(\\App\\Schedule::class)->create();\n }\n }\n */\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->call(function(){\n $orders = order::where('approved', 'pending')->get();\n foreach ($orders as $order) {\n $order->approved = 'cancelled';\n $order->save();\n }\n })->daily();\n\n $schedule->call(function(){\n $orders = Order::whereNotNull('until')->get();\n foreach ($orders as $order) {\n $service = Service::where('cost', $order->amount)->first();\n $username = $order->username;\n if (Carbon::parse(now())->diffInDays($order->until, false) <= 0) {\n \tif (is_null($order->until)) {\n\t\t\t\t\t\t$until = \"NULL\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$until = $order->until;\n\t\t\t\t\t\t$order->until = null;\n\t\t\t\t\t\t$order->save();\n\t\t\t\t\t\tLog::debug('Neteko Paslaugos: ' . $username . '---'. $service->name);\n\t\t\t\t\t}\n\n\t\t\t\t\t$host = env('Server_IP');\n\t $port = env('Server_PORT');\n\t $password = env('Server_PASS');\n\t $timeout = 3;\n\t $rcon = new Rcon($host, $port, $password, $timeout);\n\n\t if ($rcon->connect()){\n\n \t$rcon->sendCommand('pex user '.$username. 'group set lavonas'); \n \t$rcon->sendCommand('broadcast '.$username. ' Neteko paslaugos, nes jos galiojimas pasibaigė');\n \t\n \t}\n\t\t\t\t}\n\t\t\t}})->daily();\n\n $schedule->call(function(){\n $orders = Order::where('approved', 'done')->whereNull('until')->where('service_name', '!=', 'atleiskit')->delete();\n $orders2 = Order::where('approved', 'cancelled')->delete();\n })->weeklyOn(1, '7:00');;\n\n }", "function cron_job_for_closed_event_check() {\n $this->event_model->cron_job_for_closed_event_check();\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('notify:endrbtcontent')->daily();\n $schedule->command('notify:endcontractrenew')->daily();\n $schedule->command('notify:roadmapstartdate')->daily();\n $schedule->command('contract:auto_renew')->daily();\n\n\n $schedule->command('notify:endcontract')->weeklyOn(1, '8:00'); //weekly each monday at 10:00\n $schedule->command('notify:attachments')->weeklyOn(1, '08:15'); //weekly each monday at 10:15\n\n // $schedule->command(\"queue:work --tries=3 --daemon\");\n\n }", "public function processQueue ()\n {\n $lastRestartTime = $this->getLastRestartTime();\n $app = Application::getInstance();\n\n while ( true ) {\n //check if the code is updated in between the run time\n $this->needsRestart($lastRestartTime);\n\n //check if the system is down for maintenance\n if ( $app->isDownForMaintenance() ) continue;\n\n //get all pending events for the period\n $events = $this->getPendingEvents();\n\n foreach ( $events as $event ) {\n $event->start_time = DateUtil::getDateTime();\n\n //no event is registered for the given record\n $handler = $event->event_detail;\n if ( !$handler ) {\n $this->saveEvent($event);\n continue;\n }\n\n //set event to broadcast of its event\n event(new EventQueueRaised($event));\n\n //process the job mentioned with the event\n $this->dispatchEventJob($event);\n\n //dispatch notification if any attached to the event\n $this->dispatchNotificationJob($event);\n\n //save the given event with necessary datetime params\n $this->saveEvent($event);\n }\n\n //check if the program has to sleep or not\n if ( !sizeof($events) ) $this->rest();\n\n Cache::forever($this->identifier, false);\n }\n }", "protected function schedule(Schedule $schedule)\n\t{\n\t}", "public function run()\n {\n Schedule::create(['name'=>'7:00-9:00']);\n Schedule::create(['name'=>'9:00-11:00']);\n Schedule::create(['name'=>'11:00-13:00']);\n Schedule::create(['name'=>'13:00-15:00']);\n Schedule::create(['name'=>'15:00-17:00']);\n Schedule::create(['name'=>'17:00-19:00']);\n Schedule::create(['name'=>'19:00-21:00']);\n }", "protected function schedule(Schedule $schedule)\n {\n\n $schedule->call(function () {\n $appointment = Appointment::get();\n for ($i = 0; $i < sizeof($appointment); $i++) {\n $appointObject = $appointment[$i]; // 약속 객체 한개\n $cur_time = new \\DateTime(); // 현재 시간\n $appoint_date = new \\DateTime($appointObject->date . ' ' . $appointObject->date_time); // 약속 날짜\n $date_gap = date_diff($cur_time, $appoint_date); // 현재 시간과 약속 시간의 차이\n if ($date_gap->invert == 1) { // 현재 시간이 약속 시간을 지난 경우 -> 약속 종료 상태로 변경\n if ($appointObject->status == 1) {\n $member = Member::where('Member.appointment_id', $appointObject->id)->get();\n //약속 멤버 모두에게 약속 종료 알림 보내기\n foreach ($member as $object) {\n $user = User::find($object->user_id);\n $user->latitude = 0;\n $user->longitude = 0;\n if ($object->success == 0) {\n $object->Fine_final = $object->Fine_current;\n }\n $user->save();\n\n $object->save();\n }\n\n// NotificationController::SendGameNotification($appointObject->id,$date_gap->h * 60 + $date_gap->i,0,100,$pageTime,array()); //push 알람 보내기\n }\n $appointObject->status = 2; //status가 0이든 1이든 종료상태로\n } else { // 약속 시작 전 또는 진행 중\n\n // 초 단위 차이\n $time_gap = $date_gap->h * 60 * 60 + $date_gap->i * 60 + $date_gap->s;\n // 설정된 타이머(초)\n $timer = 120 * 60; //2시간\n\n\n // 총 게임 진행 시간(초)\n $totalGameTime = $timer;\n // **약속 실행전**\n if ($appointObject->status == 0) {\n if ($date_gap->days == 0) { // 현재 날짜와 같음\n\n if ($time_gap <= $totalGameTime) {\n // 시작 상태로 변경하기\n $appointObject->status = 1;\n $appointObject->radius = 20000;\n\n }\n }\n } // **약속 실행중**\n else {\n\n\n $appointObject->radius = $appointObject->radius - ((20000 / $timer) * 60);\n if ($appointObject->radius < 100)\n $appointObject->radius = 100; //100미터까지\n\n $member = Member::join('users', 'Member.user_id', '=', 'users.id')->where('Member.appointment_id', $appointObject->id)->get();\n if($appointObject->Fine_current==1) {\n\n $appointObject->Fine_current = $appointObject->Fine_time;\n\n\n foreach ($member as $object) {\n $circle_in = true;\n $distance = GpsService::geoDistance($object->latitude, $object->longitude, $appointObject->latitude, $appointObject->longitude) * 1000;\n $member_user = Member::where('appointment_id', $appointObject->id)->where('user_id', $object->user_id)->first();\n if ($appointObject->radius < $distance) { //원 밖에 있다.\n//\n $circle_in = false;\n if($member_user!=null)\n $member_user->update(['Fine_current' => (int)$member_user->Fine_current + $appointObject->Fine_money]);\n\n } else if ($distance < 100) //도착\n {\n if($member_user!=null)\n $member_user->update(['success' => 1, 'Fine_current' => 0]);\n }\n\n $appointObject->results()->create([\n 'user_id' => $object->user_id,\n 'Fine_current' => $member_user->Fine_current,\n 'appointment_radius' => $appointObject->radius,\n 'latitude' => $object->latitude,\n 'longitude'=> $object->longitude,\n 'time'=>date(\"h:i\"),\n 'circle_in'=>$circle_in,\n ]);\n }\n\n }else{\n $appointObject->Fine_current = $appointObject->Fine_current -1;\n }\n NotificationController::SendGameNotification($appointObject->id,$appointObject,$member);\n }\n\n }\n $appointObject->save(); //반지름 변경\n }\n })->everyMinute(); //매 분마다\n }", "function nhymxu_weekly_cron_job() {\n\tif ( ! wp_next_scheduled( '' ) ) {\n\t\twp_schedule_event( time(), 'weekly', '' );\n\t}\n}", "public function run()\n {\n DB::table('cron_master_lists')->insert([\n \t\t 'description' => 'Advertising Performance',\n \t\t 'route' => 'UpdateCampaignAdvertising',\n \t\t 'sequence' => 10\n \t\t]);\n }", "function rlip_schedulding_init() {\n global $CFG, $DB;\n\n // Check whether the scheduled tasks table exists\n $dbman = $DB->get_manager();\n $table = new xmldb_table('elis_scheduled_tasks');\n if (!$dbman->table_exists($table)) {\n return;\n }\n\n // If we haven't setup a scheduled task for the block yet, do so now\n if (!$DB->record_exists('elis_scheduled_tasks', array('plugin' => 'block_rlip'))) {\n require_once($CFG->dirroot.'/elis/core/lib/tasklib.php');\n\n // Add a cron task for the RLIP block\n elis_tasks_update_definition('block_rlip');\n }\n}", "public static function scheduleUpdate()\n {\n $next_refresh = wp_next_scheduled('amwscpf_update_feeds_hook');\n if (!$next_refresh)\n wp_schedule_event(time(), 'refresh_interval', 'amwscpf_update_feeds_hook');\n }", "function rlip_schedule_add_job($data) {\n global $DB, $USER;\n\n //calculate the next run time, for use in both records\n $nextruntime = (int)(time() + rlip_schedule_period_minutes($data['period']) * 60);\n\n $userid = isset($data['userid']) ? $data['userid'] : $USER->id;\n $data['timemodified'] = time();\n if (isset($data['submitbutton'])) { // formslib!\n unset($data['submitbutton']);\n }\n $ipjob = new stdClass;\n $ipjob->userid = $userid;\n $ipjob->plugin = $data['plugin'];\n $ipjob->config = serialize($data);\n\n //store as a redundant copy in order to prevent elis task strangeness\n $ipjob->nextruntime = $nextruntime;\n\n if (!empty($data['id'])) {\n $ipjob->id = $data['id'];\n $DB->update_record(RLIP_SCHEDULE_TABLE, $ipjob);\n // Must delete any existing task records for the old schedule\n $taskname = 'ipjob_'. $ipjob->id;\n $DB->delete_records('elis_scheduled_tasks', array('taskname' => $taskname));\n } else {\n $ipjob->id = $DB->insert_record(RLIP_SCHEDULE_TABLE, $ipjob);\n }\n\n $task = new stdClass;\n $task->plugin = 'block_rlip';\n $task->taskname = 'ipjob_'. $ipjob->id;\n $task->callfile = '/blocks/rlip/lib.php';\n $task->callfunction = serialize('run_ipjob'); // TBD\n $task->lastruntime = 0;\n $task->blocking = 0;\n $task->minute = 0;\n $task->hour = 0;\n $task->day = '*';\n $task->month = '*';\n $task->dayofweek = '*';\n $task->timezone = 0;\n $task->enddate = null;\n $task->runsremaining = null;\n $task->nextruntime = $nextruntime;\n return $DB->insert_record('elis_scheduled_tasks', $task);\n}", "public function maybe_create_scheduled_event()\n {\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n // $filePath = \"C:\\Users\\Shukin_A_V\\Desktop\\testSheduleNekit.txt\";\n $schedule->call(function() {\n $waterMetersIds = DB::table('meters')\n ->select('id')\n ->where('type_id', '=', 2)\n ->where('worked', '=', 1)\n ->where('active', '=', 1)\n ->whereNotNull('server_ip')\n ->get();\n\n for ($i=0; $i < count($waterMetersIds); $i++) {\n $this->writeSingleMeterFreshData($waterMetersIds[$i]->id);\n }\n })->everyMinute();\n }", "function schedule_expiry() {\n\t\tif ( ! wp_next_scheduled( 'github_embed_cron' ) ) {\n\t\t\t$frequency = apply_filters( 'github_embed_cache_frequency', 'daily' );\n\t\t\twp_schedule_event( time(), $frequency, 'github_embed_cron' );\n\t\t}\n\t}", "public function nextCron() {\n\t\t$jour=array('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi');\n\t\t$x = self::getCron();\n\t\t$t = [];\n\t\tforeach ($x['cron'] as $cron) {\n\t\t\tif ($cron['active']) $t[] = self::getNextCron($cron['raw']);\n\t\t}\n\t\tif (count($t) >=1) {\n\t\t\t$n = min($t);\n\t\t\tFlight::json(array('Status' => 'OK','Time' => $jour[date('w', $n)].date(' d/m/Y H:i', $n)));\n\t\t}\n\t\telse Flight::json(array('Status' => 'KO','Time' => 'Not Found'));\n\t}", "function add_custom_cron() {\n\tif ( ! wp_next_scheduled( 'custom_cron_action' ) ) {\n\t\twp_schedule_event( current_time( 'timestamp' ), 'hourly', 'custom_cron_action' );\n\t}\n}", "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')->everyMinute();\n// $schedule->command('process:timers')->everyMinute();\n// $schedule->command('travel_sender')->everyFiveMinutes();\n// $schedule->command('travel_cleaner')->everyFiveMinutes();\n// $schedule->command('auction:purchases')->everyFiveMinutes();\n//\n }", "static function activate_the_scheduler(){\n\t\tif(!wp_next_scheduled(self::hook)) {\n\t\t\twp_schedule_event( current_time( 'timestamp' ), self::interval, self::hook);\n\t\t}\n\t}", "protected function schedule(Schedule $schedule)\n {\n \n //$schedule->command('add:winners')->everyMinute();\n \n //$schedule->command('add:winners')->cron('00 18 31 10 * *');\n \n /*$schedule->command('test:test')\n ->everyMinute()\n ->sendOutputTo(base_path() . '/public/output_files/test.txt');\n */\n \n //$schedule->command('add:winners')->cron('52 13 02 11 * *');\n \n $periods = Period::all();\n \n foreach($periods as $period) {\n \n $enddate_month = explode('-', $period->enddate)[1];\n $enddate_day = explode(' ', explode('-', $period->enddate)[2])[0];\n //echo(\"maand: \" . $enddate_month . \" en dag \" . $enddate_day . \"<br>\");\n $schedule->command('add:winners')->cron('40 22 ' . $enddate_day . ' ' . $enddate_month . ' * *');\n }\n \n \n }", "public function scheduleIndex()\n {\n // Only one job should be running.\n $scheduledJob = Mage::getModel('cron/schedule')->getCollection()\n ->addFieldToFilter('job_code', 'hackathon_asyncindex_cron')\n ->addFieldToFilter('status', 'running')\n ->getFirstItem();\n\n $message = json_decode($scheduledJob->getMessages(), true);\n if (isset($message['indexerCode'])) {\n $indexer = $message['indexerCode'];\n /** @var Hackathon_AsyncIndex_Model_Manager $indexManager */\n $indexManager = Mage::getModel('hackathon_asyncindex/manager');\n\n $indexProcess = Mage::getSingleton('index/indexer')->getProcessByCode($indexer);\n\n if ($indexProcess) {\n if ($message['fullReindex'] === true) {\n $indexProcess->reindexEverything();\n } else {\n $indexManager->executePartialIndex($indexProcess);\n }\n }\n }\n }", "function postSchedule(){\r\n\t\t// and update the scheduler on the RelayQuery\r\n\t return $this-> scheduler-> request_complete($this->channel->responseHeaders() ) ; \r\n\t}", "public function run()\n\t{\n\t\t//\\DB::table('mailing_schedule')->delete();\n \n\t\t\\DB::table('mailing_schedule')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => 1,\n\t\t\t\t'status' => 'nothing',\n\t\t\t\t'time_elapsed' => 24,\n\t\t\t\t'template' => '1.0',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'id' => 2,\n\t\t\t\t'status' => 'some',\n\t\t\t\t'time_elapsed' => 24,\n\t\t\t\t'template' => '1.1',\n\t\t\t),\n\t\t\t2 => \n\t\t\tarray (\n\t\t\t\t'id' => 3,\n\t\t\t\t'status' => 'all',\n\t\t\t\t'time_elapsed' => 24,\n\t\t\t\t'template' => '1.2',\n\t\t\t),\n\t\t\t3 => \n\t\t\tarray (\n\t\t\t\t'id' => 4,\n\t\t\t\t'status' => 'nothing',\n\t\t\t\t'time_elapsed' => 168,\n\t\t\t\t'template' => '3.0',\n\t\t\t),\n\t\t\t4 => \n\t\t\tarray (\n\t\t\t\t'id' => 6,\n\t\t\t\t'status' => 'all',\n\t\t\t\t'time_elapsed' => 168,\n\t\t\t\t'template' => '3.2',\n\t\t\t),\n\t\t\t5 => \n\t\t\tarray (\n\t\t\t\t'id' => 7,\n\t\t\t\t'status' => 'nothing',\n\t\t\t\t'time_elapsed' => 336,\n\t\t\t\t'template' => '4.0',\n\t\t\t),\n\t\t\t6 => \n\t\t\tarray (\n\t\t\t\t'id' => 8,\n\t\t\t\t'status' => 'some',\n\t\t\t\t'time_elapsed' => 336,\n\t\t\t\t'template' => '4.1',\n\t\t\t),\n\t\t\t7 => \n\t\t\tarray (\n\t\t\t\t'id' => 9,\n\t\t\t\t'status' => 'all',\n\t\t\t\t'time_elapsed' => 336,\n\t\t\t\t'template' => '4.1',\n\t\t\t),\n\t\t\t8 => \n\t\t\tarray (\n\t\t\t\t'id' => 11,\n\t\t\t\t'status' => 'some',\n\t\t\t\t'time_elapsed' => 600,\n\t\t\t\t'template' => '6.1',\n\t\t\t),\n\t\t\t9 => \n\t\t\tarray (\n\t\t\t\t'id' => 12,\n\t\t\t\t'status' => 'all',\n\t\t\t\t'time_elapsed' => 600,\n\t\t\t\t'template' => '6.1',\n\t\t\t),\n\t\t\t10 => \n\t\t\tarray (\n\t\t\t\t'id' => 13,\n\t\t\t\t'status' => 'nothing',\n\t\t\t\t'time_elapsed' => 24,\n\t\t\t\t'template' => '0.5',\n\t\t\t),\n\t\t));\n\t}", "function system_handle_on_daily() {\n ProjectObjectViews::cleanUp();\n\n\t$priorities_images = array(\n\t\tPRIORITY_URGENT \t=> 'assets/images/icons/priority/urgent.png',\n\t\tPRIORITY_HIGHEST \t=> 'assets/images/icons/priority/highest.gif',\n\t\tPRIORITY_HIGH \t=> 'assets/images/icons/priority/high.gif',\n\t\tPRIORITY_NORMAL \t=> 'assets/images/icons/priority/normal.gif',\n\t\tPRIORITY_LOW \t=> 'assets/images/icons/priority/low.gif',\n\t\tPRIORITY_LOWEST \t=> 'assets/images/icons/priority/lowest.gif',\n\t\tPRIORITY_HOLD \t\t=> 'assets/images/icons/priority/hold.png',\n\t\t'-99' \t\t\t\t=> 'assets/images/icons/priority/unknown.png',);\n\n\t$pages = array();\n\t$link = mysql_connect(DB_HOST, DB_USER, DB_PASS);\n\tmysql_select_db(DB_NAME);\n\t$sql = \"select id, name from healingcrystals_project_objects where project_id='\" . TASK_LIST_PROJECT_ID . \"' and type='Page'\";\n\t$result = mysql_query($sql, $link);\n\twhile ($entry = mysql_fetch_assoc($result)){\n\t\tlist($name, ) = explode('-', $entry['name']);\n\t\t$name = trim($name);\n\t\t$pages[$name] = $entry['id'];\n\t}\n\t\n\t$current_time = time();\n\n\t$users = Users::findAll();\n\tforeach($users as $user){\n\t\t$flag = 1;\n\t\t$message = '';\n\t\t$name = $user->getName();\n\t\tif (array_key_exists($name, $pages)){\n\t\t\t$page = new Page($pages[$name]);\n\t\t\tif ($page){\n\t\t\t\t$sql = \"select id from healingcrystals_project_objects where parent_id='\" . $pages[$name] . \"' and parent_type='Page' and type='Task' and completed_on is null and priority is null and created_on>='\" . date('Y-m-d H:i:s', $current_time - (1*24*60*60) ) . \"' order by created_on\";\n\t\t\t\t$result = mysql_query($sql, $link);\n\t\t\t\tif (mysql_num_rows($result)){\n\t\t\t\t\t$show_task_list = true;\n\t\t\t\t} else {\n\t\t\t\t\t$show_task_list = false;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (date('N')=='1' || $show_task_list){\n\t\t\t\t\t$message .= \n\t'<style>\n\t\t.odd {background-color:#ffffff;}\n\t\t.even{background-color:#eeeeee;}\n\t</style>\n\t<table>\n\t\t<tr>\n\t\t\t<td colspan=\"3\">Task List: ' . $name . '</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align=\"center\">Priority</td>\n\t\t\t<td>Task</td>\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>';\n\t\t\t\t\t$tasks = Tasks::findOpenByObject($page);\n\t\t\t\t\tforeach($tasks as $task){\n\t\t\t\t\t\t$message .= '\n\t\t<tr class=\"' . ($flag%2===1 ? 'odd' : 'even' ) . '\">\n\t\t\t<td valign=\"top\" align=\"center\"><img src=\"http://projects.ffbh.org/public/' . $priorities_images[$task->getPriority()] . '\"/></td>\n\t\t\t<td valign=\"top\">' . $task->getName() . '</td>\n\t\t\t<td valign=\"top\"><a href=\"' . $task->getViewUrl() . '\">View</a></td>\n\t\t</tr>';\n\t\t\t\t\t\t$flag++;\n\t\t\t\t\t}\n\t\t\t\t\t$message .= '\n\t</table>';\n\t\t\t\t\t$subject = 'projects: healingcrystals.com Task list';\n\t\t\t\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t\t\t\t$headers .= 'Content-type: text/html; charset=UTF-8' . \"\\r\\n\";\n\t\t\t\t\t$headers .= 'From: FFBH Reminder <[email protected]>' . \"\\r\\n\";\n\t\t\t\t\tmail($user->getEmail(), $subject, $message, $headers);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\n\t$sql = \"select po.id, cast(if( pom.recurring_period_type='D', DATE_ADD(po.due_on, interval pom.recurring_period day), if(pom.recurring_period_type='W', DATE_ADD(po.due_on, interval pom.recurring_period week), if(pom.recurring_period_type='M', DATE_ADD(po.due_on, interval pom.recurring_period month), null ) ) ) as Date) as next_due_date, cast(DATE_ADD(now(), interval 0 day) as Date) as cur_date, cast(if(isnull(pom.email_reminder_unit), null, if( pom.email_reminder_unit='D', DATE_ADD(po.due_on, interval pom.email_reminder_period day), if(pom.email_reminder_unit='W', DATE_ADD(po.due_on, interval pom.email_reminder_period week), if(pom.email_reminder_unit='M', DATE_ADD(po.due_on, interval pom.email_reminder_period month), null ) ) )\t) as Date) as reminder_date from healingcrystals_project_objects po inner join healingcrystals_project_object_misc pom on po.id=pom.object_id where po.type='Task' and po.due_on is not null and po.due_on<=now() and po.completed_on is null and pom.recurring_period_condition='after_due_date' and if(pom.recurring_end_date is not null and pom.recurring_end_date!='0000-00-00', if(pom.recurring_end_date>=now(), 1, 0), 1)=1 having next_due_date=cur_date\"; \n\t$result = mysql_query($sql);\n\twhile ($entry = mysql_fetch_assoc($result)){\n\t\t$task = new Task($entry['id']);\n\t\t$action = $task->complete(new AnonymousUser('auto', '[email protected]'));\n\t\tif (!empty($entry['reminder_date']) && $entry['cur_date']==$entry['reminder_date']){\n\t\t\t$sql02 = \"select id from \" . TABLE_PREFIX . \"project_objects where type='Task' and project_id='\" . $task->getProjectId() . \"' and milestone_id='\" . $task->getMilestoneId() . \"' and parent_id='\" . $task->getParentId() . \"' order by id desc limit 0, 1\";\n\t\t\t$result02 = mysql_query($sql02);\n\t\t\tif (mysql_num_rows($result02)){\n\t\t\t\t$info = mysql_fetch_assoc($result02);\n\t\t\t\t$recurring_task = new Task($info['id']);\n\t\t\t\t$parent = $recurring_task->getParent();\n\t\t\t\t$project = $recurring_task->getProject();\n\t\t\t\t$assignees = $recurring_task->getAssignees();\n\t\t\t\t\n\t\t\t\t$priorities = array(\n\t\t\t\t\tPRIORITY_HIGHEST \t=> lang('Highest'),\n\t\t\t\t\tPRIORITY_HIGH \t=> lang('High'),\n\t\t\t\t\tPRIORITY_NORMAL \t=> lang('Normal'),\n\t\t\t\t\tPRIORITY_LOW \t=> lang('Low'),\n\t\t\t\t\tPRIORITY_LOWEST \t=> lang('Lowest'),\n\t\t\t\t\tPRIORITY_ONGOING \t=> lang('Ongoing'),\n\t\t\t\t\tPRIORITY_HOLD \t\t=> lang('Hold'),\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$due_date = $task->getDueOn();\n\t\t\t\t$due_date = date('m/d/Y', strtotime($due_date));\n\t\t\t\t$reminder_date = date('m/d/Y', strtotime($entry['reminder_date']));\n\t\t\t\tforeach($assignees as $assignee) {\n\t\t\t\t\t$assignees_string .= $assignee->getDisplayName() . ', ';\n\t\t\t\t}\n\t\t\t\tif (!empty($assignees_string))\n\t\t\t\t\t$assignees_string = substr($assignees_string, 0, -2);\n\t\t\t\telse\n\t\t\t\t\t$assignees_string = '--';\n\t\t\t\t\t\n\t\t\t\t$reminders_sent = array();\n\t\t\t\tforeach($assignees as $user) {\n\t\t\t\t\t//if ($user->getEmail()=='[email protected]'){\n\t\t\t\t\t\t$reminder = new Reminder();\n\n\t\t\t\t\t\t$reminder->setAttributes(array(\n\t\t\t\t\t\t\t'user_id' => $user->getId(),\n\t\t\t\t\t\t\t'object_id' => $recurring_task->getId(),\n\t\t\t\t\t\t\t'comment' => $comment,\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\t$save = $reminder->save();\n\t\t\t\t\t\tif($save && !is_error($save)) {\n\t\t\t\t\t\t\t$reminders_sent[] = $user->getDisplayName();\n\t\t\t\t\t\t\tApplicationMailer::send($user, 'system/reminder', array(\n\t\t\t\t\t\t\t\t'reminded_by_name' \t\t\t\t=> 'AutoReminder',\n\t\t\t\t\t\t\t\t'reminded_by_url' \t\t\t\t=> '',\n\t\t\t\t\t\t\t\t'object_name' \t\t\t\t=> $recurring_task->getName(),\n\t\t\t\t\t\t\t\t'object_url' \t\t\t\t=> $recurring_task->getViewUrl(),\n\t\t\t\t\t\t\t\t'object_type' \t\t\t\t=> strtolower($recurring_task->getType()),\n\t\t\t\t\t\t\t\t'comment_body' \t\t\t\t=> $comment,\n\t\t\t\t\t\t\t\t'project_name' \t\t\t\t=> $project->getName(),\n\t\t\t\t\t\t\t\t'project_url' \t\t\t\t=> $project->getOverviewUrl(),\n\t\t\t\t\t\t\t\t'ticket_name' \t\t\t\t=> $parent->getName(),\n\t\t\t\t\t\t\t\t'ticket_url' \t\t\t\t\t=> $parent->getViewUrl(),\n\t\t\t\t\t\t\t\t'object_priority' \t\t\t\t\t=> $priorities[(string)$recurring_task->getPriority()], \n\t\t\t\t\t\t\t\t'object_due_date' \t\t\t\t\t=> $due_date, \n\t\t\t\t\t\t\t\t'object_reminder_date_n_time' \t\t=> $reminder_date, \n\t\t\t\t\t\t\t\t'object_assignees' \t\t\t\t\t=> $assignees_string, \n\t\t\t\t\t\t\t\t'task_mark_complete_url' \t\t\t=> $recurring_task->getCompleteUrl() . '&auto=1', \n\t\t\t\t\t\t\t\t'display_status_for_complete_url'\t=> ($recurring_task->is_action_request_task() ? '' : 'none'), \n\t\t\t\t\t\t\t), $recurring_task);\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\tmysql_close($link);\n }", "protected function schedule ( Schedule $schedule )\n {\n\n /** BEGIN: FETCH APPWORKS API DATA ****************************************/\n\n $schedule->command( 'ot-appworks:fetch-events' )\n ->hourlyAt(0)\n ->withoutOverlapping();\n\n $schedule->command( 'ot-appworks:fetch-event-data' )\n ->hourlyAt(5)\n ->withoutOverlapping();\n\n $schedule->command( 'ot-scoreboard:fetch-new-points' )\n ->everyFiveMinutes()\n ->withoutOverlapping();\n\n $schedule->command( 'ot-socialcards:fetch-new-posts' )\n ->everyFiveMinutes()\n ->withoutOverlapping();\n\n /** END: FETCH APPWORKS API DATA ******************************************/\n\n /** BEGIN: FETCH TWITTER API DATA *****************************************/\n\n $schedule->command( 'ot-socialcards:fetch-new-tweets' )\n ->everyMinute()\n ->withoutOverlapping();\n\n /** END: FETCH TWITTER API DATA *******************************************/\n\n }", "private function respawn()\n {\n // create new event at the end of the queue\n Mage::getModel('marketingsoftware/queue')\n ->setObject($this->currentStatus)\n ->setAction('file_sync')\n ->save();\n }", "protected function schedule(Schedule $schedule) {\n //$schedule->command('inspire')->hourly();\n //Processamento do pagamento do Professor\n $schedule->call(function() {\n\n $teacherStatementController = new TeacherStatementController(\n new EloquentTeacherStatementRepository(), new EloquentOrderRepository(), new EloquentOrderCourseRepository(), new EloquentOrderModuleRepository(), new EloquentOrderLessonRepository(), new EloquentCourseTeacherRepository(), new EloquentConfigurationRepository(), new EloquentOrderPackageRepository(), new EloquentPackageTeacherRepository(), new EloquentPartnerorderPaymentRepository()\n );\n $teacherStatementController->processToday();\n })->dailyAt('00:00')\n ->name('process_teacher_payment')\n ->withoutOverlapping();\n\n //Processo para limpar notificações da área do aluno\n $schedule->call(function() {\n $notification = new EloquentNotificationRepository();\n $notification->remove_by_time(30, '0');\n $notification->remove_by_time(7, 1);\n })->everyFiveMinutes()\n ->name('process_notification_clean')\n ->withoutOverlapping();\n\n //Processo para enviar por e-mail as notificações de calendário de curso para os alunos\n $schedule->call(function(EloquentCourseCalendarRepository $courseCalendar){\n //Enviando e-mail para os alunos todo dia ás 00:00:00(meia noite)\n $courseCalendar->getAndSendNotificationsCalendarCourse();\n })->dailyAt('00:00');\n\n //Processo para deletar os pedidos de usuários feito pelo brasil jurídico\n $schedule->call(function(EloquentOrderRepository $order){\n $order->deleteOrdersBrasilJuridico();\n })->dailyAt('00:00');\n\n /* $schedule->call(\n function(EloquentUserStudentRepository $user){\n $user->sendEmail($user->birthday());\n })->everyMinute(); */\n }", "public function ReloadTasks()\n\t{\n\t\t$this->_tasks = array();\n\t\n\t\t$sql = \"SELECT `ps`.*, ISNULL(`a`.`id_task`) AS `active`\n\t\t\t\tFROM `{poker_scheduler}` AS `ps`\n\t\t\t\tLEFT JOIN (SELECT `id_task` FROM `{poker_scheduler}` WHERE `uid`= %d AND `moment` > NOW()) AS `a` USING(`id_task`)\n\t\t\t\tWHERE `uid`= %d AND (`moment` <= NOW() OR `visible` = 1) ORDER BY `moment` DESC\";\n\t\t\n\t\t$res = db_query($sql, $this->_user->uid, $this->_user->uid);\n\t\t\n\t\tif ($res)\n\t\t{\n\t\t\twhile (($task = db_fetch_object($res)))\n\t\t\t{\n\t\t\t\t$triggers = json_decode($task->trigger);\n\t\t\t\t\n\t\t\t\tif (is_array($triggers))\n\t\t\t\t{\n\t\t\t\t\t$task->trigger = $triggers;\n\t\t\t\t\t\n\t\t\t\t\tforeach($triggers as $trigger)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_tasks[$trigger][$task->id_task] = $task;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->ClearNewTask();\n\t\t}\n\t}", "public function cron(){\n\t\t$schedule_list = $this->db->select('analytics.*, account.username, account.password, account.proxy, account.default_proxy, account.id as account_id')\n\t\t->from($this->tb_analytics.\" as analytics\")\n\t\t->join($this->tb_accounts.\" as account\", \"analytics.account = account.id\")\n\t\t->where(\"account.status = 1 AND analytics.next_action <= '\".NOW.\"'\")->limit(10,0)->get()->result();\n\t\t\n\t\tif(!empty($schedule_list)){\n\t\t\tforeach ($schedule_list as $key => $schedule) {\n\t\t\t\tif(!permission(\"instagram/post\", $schedule->uid)){\n\t\t\t\t\t$this->db->delete($this->tb_posts, array(\"uid\" => $schedule->uid, \"time_post >=\" => NOW));\n\t\t\t\t}\n\n\t\t\t\t$proxy_data = get_proxy($this->tb_accounts, $schedule->proxy, $schedule);\n\t\t\t\ttry {\n\t\t\t\t\t$ig = new InstagramAPI($schedule->username, $schedule->password, $proxy_data->use);\n\t\t\t\t\t$result = $ig->analytics->process();\n\t\t\t\t\t\n\t\t\t\t\t$user_timezone = get_timezone_user(NOW, false, $schedule->uid);\n\t\t\t\t\t$user_day = date(\"Y-m-d\", strtotime($user_timezone));\n\n\t\t\t\t\t$check_stats_exist = $this->model->get(\"id\", $this->tb_analytics_stats, \" account = '\".$schedule->account_id.\"' AND uid = '\".$schedule->uid.\"' AND date = '\".$user_day.\"'\");\n\t\t\t\t\tif(empty($check_stats_exist)){\n\n\t\t\t\t\t\t//Save data\n\t\t\t\t\t\t$user_data = array(\n\t\t\t\t\t\t\t\"media_count\" => $result->userinfo->media_count,\n\t\t\t\t\t\t\t\"follower_count\" => $result->userinfo->follower_count,\n\t\t\t\t\t\t\t\"following_count\" => $result->userinfo->following_count,\n\t\t\t\t\t\t\t\"engagement\" => $result->engagement\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\"ids\" => ids(),\n\t\t\t\t\t\t\t\"uid\" => $schedule->uid,\n\t\t\t\t\t\t\t\"account\" => $schedule->account_id,\n\t\t\t\t\t\t\t\"data\" => json_encode($user_data),\n\t\t\t\t\t\t\t\"date\" => date(\"Y-m-d\", strtotime($user_timezone))\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->db->insert($this->tb_analytics_stats, $data);\n\n\t\t\t\t\t\t$save_info = array(\n\t\t\t\t\t\t\t\"engagement\" => $result->engagement,\n\t\t\t\t\t\t\t\"average_likes\" => $result->average_likes,\n\t\t\t\t\t\t\t\"average_comments\" => $result->average_comments,\n\t\t\t\t\t\t\t\"top_hashtags\" => $result->top_hashtags,\n\t\t\t\t\t\t\t\"top_mentions\" => $result->top_mentions,\n\t\t\t\t\t\t\t\"feeds\" => $result->feeds,\n\t\t\t\t\t\t\t\"userinfo\" => $result->userinfo,\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Next Action\n\t\t\t\t\t\t$now = date('Y-m-d 00:00:00', strtotime($user_timezone));\n\t\t\t\t\t\t$next_day = date('Y-m-d 00:00:00', strtotime($now) + 86400);\n\t\t\t\t\t\t$data_next_action = array(\n\t\t\t\t\t\t\t\"data\" => json_encode($save_info),\n\t\t\t\t\t\t\t\"next_action\" => get_timezone_system($next_day, false, $schedule->uid)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->db->update($this->tb_analytics, $data_next_action, \"account = '\".$schedule->account_id.\"'\");\n\t\t\t\t\t}\n\n\t\t\t\t\techo lang(\"successfully\");\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\techo $e->getMessage();\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\techo lang(\"no_activity\");\n\t\t}\n\t}", "protected function schedule(Schedule $schedule)\n {\n \n if(File::isDirectory(storage_path('app\\uploads'))){\n\n $scheduler_dir = __DIR__ . '/../..\\storage\\logs\\scheduler';\n\n if (!file_exists($scheduler_dir)) {\n mkdir($scheduler_dir, 0777, true);\n }\n\n $file=storage_path('logs\\scheduler\\Scheduerlogdefault.log');\n\n // $ab=storage_path('logs\\scheduler\\Scheduerlog1.log');\n $view_log = new Logger('schedulerlogs');\n $view_log->pushHandler(new StreamHandler(storage_path('logs\\Scheduerlog.log'), Logger::INFO));\n // $ab=File::get($file);\n // $view_log->addInfo('hello');\n //$view_log->addInfo(\"User $user clicked\");\n \n $schedule->command('queue:work --queue=database-high,database-low')\n //->hourlyAT('09')\n ->dailyAT('01:00')\n ->appendOutputTo($file)\n ->after( function () {\n Storage::deletedirectory('uploads'); \n DB::Table('map_tables')->truncate(); \n });\n\n \n if(file::exists($file))\n { \n $temp = '';\n $handle = fopen($file, \"r\");\n \t if ($handle) {\n while (! feof($handle)) {\n \n $line = stripslashes(fgets($handle)); \n \n\t\t\t\t\t$line = substr_replace($line,'',((strpos($line, '[32m'))-1),5);\n\t\t\t\t\t$line = substr_replace($line,'',((strpos($line, '[39m'))-1),5);\n\t\t\t\t\t$line = substr_replace($line,'',((strpos($line, '[37;41m'))-1),8);\n\t\t\t\t\t$line = substr_replace($line,'',((strpos($line, '[39;49m'))-1),8);\n\t\t\t\t\t$temp = $temp.$line;\n\n }\n \n fclose($handle);\n }\n \n $view_log->addINFO($temp);\n }\n \n }\n }", "protected function schedule(Schedule $schedule)\n\t{\n\t\t//$schedule->command('inspire')->hourly();\n $schedule->command('jamyl:allchecks')->everyFiveMinutes();\n $schedule->command('jamyl:firekillbot')->everyFiveMinutes();\n $schedule->command('jamyl:manage')->everyFiveMinutes();\n $schedule->command('jamyl:getchannels')->Hourly();\n $schedule->command('jamyl:punk')->dailyAt('10:05');\n $schedule->command('api:getalliances')->dailyAt('00:01');\n $schedule->command('api:getcontactlists')->twiceDaily();\n $schedule->command('api:getcorporations')->everyFiveMinutes();\n $schedule->command('jamyl:refreshgrouppermissions')->everyFiveMinutes();\n $schedule->command('ts3:checknickames')->everyFiveMinutes();\n $schedule->command('ts3:updateaccess')->everyFiveMinutes();\n $schedule->command('ts3:checknicknames')->everyFiveMinutes();\n //$schedule->command('ts3:getgroups')->twiceDaily();\n\t}", "protected function schedule(Schedule $schedule){\n\n $schedule->call(function(Cardinity $cardinity){\n\n /*\n $pdo = DB::getPdo();\n $res = $pdo->query('SELECT * FROM payments GROUP BY user_id DESC HAVING end_access_date <= CURDATE() ORDER BY end_access_date');\n\n $payments = $res->fetchAll(\\PDO::FETCH_CLASS, Payment::class);\n\n foreach($payments as $paymentDb){\n $user = User::where('id', $paymentDb->user_id)->first();\n\n if((bool)$user->is_subscription_renewable){\n $payment = $cardinity->renewSubscribe($paymentDb);\n SubscriptionController::successPayment($paymentDb->plan(), $payment, $user);\n }\n }\n */\n\n $users = User::where('is_email_valid', false)\n ->where('role', 'client')\n ->where('created_at', '<', Carbon::create()->addDay(-7)->format('Y-m-d H:i:s'))\n ->whereNull('start_subscribe_date')\n ->get();\n\n\n if(count($users) > 0) foreach($users as $user){\n $user->forceDelete();\n }\n\n// })->everyMinute();\n })->twiceDaily(1, 11);\n\n\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n\n $schedule->call('App\\Http\\Controllers\\RequestKPController@rejectExpiredRequests')\n ->daily();\n $schedule->call('App\\Http\\Controllers\\RequestSkripsiController@rejectExpiredRequests')\n ->daily();\n\n // steven add new\n // kp\n // schedule to notify prodi admin for reschedule and update for prodi admin able to reschedule\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangKPController@notifyProdiAdminToRescheduleIfNeed')\n ->daily();\n // ->everyMinute();\n // set schedule end by the expired date\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangKPController@updateNoRevisionOnH2Request')\n ->daily();\n // ->everyMinute();\n // set the penjadwalan already past and it was old data\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangKPController@updatePenjadwalanIntoOldData')\n ->daily();\n // ->everyMinute();\n // set form to be available on participant list table to enter the form each row\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangKPController@scheduleBeritaAcaraForm')\n ->daily();\n // ->everyMinute();\n // set form cannot be open while expired date or if already submitted status completed dont need to show to the participant again\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangKPController@expiredDateForSubmitForm')\n ->daily();\n // ->everyMinute();\n\n // skripsi\n // schedule to notify prodi admin for reschedule and update for prodi admin able to reschedule\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangSkripsiController@notifyProdiAdminToRescheduleIfNeed')\n ->daily();\n // ->everyMinute();\n // set schedule end by the expired date\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangSkripsiController@updateNoRevisionOnH2Request')\n ->daily();\n // ->everyMinute();\n // set the penjadwalan already past and it was old data\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangSkripsiController@updatePenjadwalanIntoOldData')\n ->daily();\n // ->everyMinute();\n // set form to be available on participant list table to enter the form each row\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangSkripsiController@scheduleBeritaAcaraForm')\n ->daily();\n // ->everyMinute();\n // set form cannot be open while expired date or if already submitted status completed dont need to show to the participant again\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangSkripsiController@expiredDateForSubmitForm')\n ->daily();\n // ->everyMinute();\n\n // tesis\n // schedule to notify prodi admin for reschedule and update for prodi admin able to reschedule\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangTesisController@notifyProdiAdminToRescheduleIfNeed')\n ->daily();\n // ->everyMinute();\n // set schedule end by the expired date\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangTesisController@updateNoRevisionOnH2Request')\n ->daily();\n // ->everyMinute();\n // set the penjadwalan already past and it was old data\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangTesisController@updatePenjadwalanIntoOldData')\n ->daily();\n // ->everyMinute();\n // set form to be available on participant list table to enter the form each row\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangTesisController@scheduleBeritaAcaraForm')\n ->daily();\n // ->everyMinute();\n // set form cannot be open while expired date or if already submitted status completed dont need to show to the participant again\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangTesisController@expiredDateForSubmitForm')\n ->daily();\n // ->everyMinute();\n\n // hard cover kp, skripsi, tesis api to store db every daily\n // on going status\n // validated status\n // first ongoing \n $schedule->call('App\\Http\\Controllers\\AdminHardcoverKPController@storeOngoingHardcoverKPByAPI')\n // ->daily();\n ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverSkripsiController@storeOngoingHardcoverSkripsiByAPI')\n // ->daily();\n ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverTesisController@storeOngoingHardcoverTesisByAPI')\n ->daily();\n // ->everyMinute();\n // second validated\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverKPController@storeValidateHardcoverKPByAPI')\n ->daily();\n // ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverSkripsiController@storeValidateHardcoverSkripsiByAPI')\n ->daily();\n // ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverTesisController@storeValidateHardcoverTesisByAPI')\n ->daily();\n // ->everyMinute(); \n }", "protected function schedule(Schedule $schedule)\n {\n\n /* Funciona */ \n $schedule->command('usuarios:cumples')->timezone('America/Lima')->at('08:00');\n\n $schedule->command('estado:cumples')->timezone('America/Lima')->at('08:00');\n \n $schedule->command('active:cumples')->timezone('America/Lima')->monthly(); \n $schedule->command('deleted:comcumple')->timezone('America/Lima')->monthly(); \n $schedule->command('deleted:tarjeta')->timezone('America/Lima')->monthly(); \n\n\n $schedule->command('estado:conferencias')->timezone('America/Lima')->hourly();\n\n \n }", "public function fullAction(){\n \t$logger = new Frogg_Log('/home2/bleachse/public_html/seriando/log/calendar_US.log');\n \t$xml = new XMLReader();\n \tif(!$xml->open('http://services.tvrage.com/feeds/fullschedule.php?country=US')){\n \t\t$logger->err('Failed to open input file');\n \t\t$logger->close();\n \t\tdie;\n \t}\n \t$logger->info('Starting to index full schedule');\n \t$series = new Application_Model_Series();\n \twhile ($xml->read()){\n \t\twhile($xml->read() && $xml->name != 'DAY');//Goes to next <DAY>\n \t\t$timestamp = new Frogg_Time_Time($xml->getAttribute('attr'));\n \t\t$timestamp = $timestamp->getUnixTstamp();\n \t\twhile($xml->read()){ //Daily shows reading\n \t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'show'){ //Found new show\n \t\t\t\t$episode_name = $xml->getAttribute('name');\n \t\t\t\t$show_id = '';\n \t\t\t\twhile($xml->read() && $xml->name != 'sid'); //Found show id\n \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'sid'){\n \t\t\t\t\t$show_id = $xml->readString();\n \t\t\t\t}\n \t\t\t\twhile($xml->read() && $xml->name != 'ep'); //Found episode air order\n \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'ep'){\n \t\t\t\t\t$episode_num = $xml->readString();\n \t\t\t\t\t$scheduled = new Application_Model_Scheduled($show_id,'http://services.tvrage.com/tools/quickinfo.php?show='.urlencode($episode_name).'&ep='.$episode_num,Application_Model_Scheduled::UNREAD,$timestamp);\n \t\t\t\t\t$scheduled->save();\n \t\t\t\t\t$logger->ok('Saved : '.$scheduled->link);\n \t\t\t\t}\n \t\t\t$xml->next('show');\n \t\t\t} else if($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'DAY'){ //Found </DAY>\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}//END - Daily shows reading\n \t}\n \t$logger->close();\n \tdie;\n }", "public function __construct() {\n\t\t\t$this->schedules = wp_get_schedules();\n\t\t}", "function asu_isearch_cron() {\n\n // Cache data from configuration\n _asu_isearch_cache_dept_feed();\n\n // Cache dept tree and employee types data\n _asu_isearch_cache_dept_tree_data();\n\n // Begin profile migrations\n _asu_isearch_begin_migrate(FALSE);\n\n // Cleanup the profiles which are no longer associated with\n // unit depts in iSearch. Only run once per day.\n $last_clean = variable_get('last_profile_cleanup', NULL);\n\n if ($last_clean != date('ymd', time())) {\n _asu_isearch_cleanup();\n variable_set('last_profile_cleanup', date('ymd', time()));\n }\n}", "public static function reschedule_if_needed() {\n\t\n\t\tglobal $updraftplus;\n\t\n\t\t// If nothing is scheduled, then no re-scheduling is needed, so return\n\t\tif (empty($updraftplus->newresumption_scheduled)) return;\n\t\t\n\t\t$time_away = $updraftplus->newresumption_scheduled - time();\n\t\t\n\t\t// 45 is chosen because it is 15 seconds more than what is used to detect recent activity on files (file mod times). (If we use exactly the same, then it's more possible to slightly miss each other)\n\t\tif ($time_away > 1 && $time_away <= 45) {\n\t\t\t$updraftplus->log('The scheduled resumption is within 45 seconds - will reschedule');\n\t\t\t// Increase interval generally by 45 seconds, on the assumption that our prior estimates were innaccurate (i.e. not just 45 seconds *this* time)\n\t\t\tself::increase_resume_and_reschedule(45);\n\t\t}\n\t}", "public function run()\n {\n factory(App\\Models\\Schedule::class, 1000)->create()->each(function ($s) {\n if (UserStallNumber::where('user_id', $s->user_id)->get()->isEmpty())\n UserStallNumber::create([\n 'user_id' => $s->user_id,\n 'verified' => 1\n ]);\n });\n }", "protected function checkScheduledJobs() {\n global $database;\n // first get all active cronjobs\n $SQL = sprintf(\"SELECT * FROM %smod_kit_cj_cronjob WHERE `cronjob_status`='ACTIVE'\", TABLE_PREFIX);\n if (null ===($result = $database->query($SQL))) {\n $this->setError(sprintf('[%s _ %s] %s', __METHOD__, __LINE__, $database->get_error()));\n exit($this->getError());\n }\n $cronjobs = array();\n while (false !== ($job = $result->fetchRow(MYSQL_ASSOC))) {\n $cronjobs[$job['cronjob_id']] = $job;\n }\n foreach ($cronjobs as $cronjob) {\n $this->log[self::CRONJOB_ID] = $cronjob['cronjob_id'];\n $this->log[self::CRONJOB_NAME] = $cronjob['cronjob_name'];\n if ($cronjob['cronjob_next_run'] == '0000-00-00 00:00:00') {\n // this cronjob was never executed...\n $cronjob['cronjob_next_run'] = $this->calculateNextRun($cronjob);\n $cronjob['cronjob_last_status'] = 'First call, calculate the next regular run of this cronjob.';\n $cronjob['cronjob_last_run'] = date('Y-m-d H:i:s');\n $this->updateCronjob($cronjob);\n $this->log[self::LOG_MESSAGE] = 'First call, calculate the next regular run of this cronjob.';\n $this->log[self::LOG_STATUS] = self::STATUS_OK;\n $this->log[self::CRONJOB_RUN] = $cronjob['cronjob_last_run'];\n $this->log[self::CRONJOB_STATUS] = 'OK';\n $this->writeLog();\n }\n if (strtotime($cronjob['cronjob_next_run']) < time()) {\n // execute this cronjob\n if (false !== strpos($cronjob['cronjob_command'], LEPTON_URL)) {\n $cronjob['cronjob_command'] = substr($cronjob['cronjob_command'], strlen(LEPTON_URL));\n }\n if (false !== strpos($cronjob['cronjob_command'], LEPTON_PATH)) {\n $cronjob['cronjob_command'] = substr($cronjob['cronjob_command'], strlen(LEPTON_PATH));\n }\n if (strpos($cronjob['cronjob_command'], DIRECTORY_SEPARATOR) == 0) {\n $cronjob['cronjob_command'] = substr($cronjob['cronjob_command'], 1);\n }\n $execute = LEPTON_PATH.DIRECTORY_SEPARATOR.$cronjob['cronjob_command'];\n if (!file_exists($execute)) {\n // write the error to the log but continue with the next cronjob.\n $this->setError(sprintf('The relative path %s does not exists, please check the settings for this cronjob!', $cronjob['cronjob_command']));\n continue;\n }\n if (false === ($result = exec(sprintf(\"%s %s\", $this->php_exec, $execute)))) {\n // error executing - write log and continue\n $this->setError(sprintf('Error executing %s - no more informations available.', $cronjob['cronjob_command']));\n continue;\n }\n $this->log[self::LOG_MESSAGE] = $result;\n $this->log[self::LOG_STATUS] = self::STATUS_OK;\n $this->log[self::CRONJOB_RUN] = date('Y-m-d H:i:s');\n $this->log[self::CRONJOB_STATUS] = 'OK';\n $this->writeLog();\n $cronjob['cronjob_last_run'] = $this->log[self::CRONJOB_RUN];\n $cronjob['cronjob_last_status'] = $result;\n $cronjob['cronjob_next_run'] = $this->calculateNextRun($cronjob);\n $this->updateCronjob($cronjob);\n $this->cronjob_executed = true;\n }\n }\n }", "protected function schedule(Schedule $schedule)\n { \n //Cambiar el estado de las pasantias a \"Cerrado\" cuando llegue la fecha de fin\n $schedule->call(function(){\n $pasantias = PropuestaPasantia::whereHas('estado', function($q){\n $q->where('nombre', 'Disponible');\n })->get();\n\n foreach($pasantias as $pasantia){\n $estado = Estado::where('nombre', 'Cerrado')->first();\n $today = date('d/m/Y', strtotime(Carbon::now()->toDateString()));\n if($pasantia->fecha_fin == $today){\n $pasantia->estado()->associate($estado);\n $pasantia->save();\n }\n }\n })->timezone('America/Argentina/Salta')->dailyAt('23:59');\n\n // Cambiar estado a 'No regular' de las presentaciones que no fueron regularizadas luego de 6 meses\n $schedule->call(new VerificarRegularidad)->timezone('America/Argentina/Salta')->dailyAt('00:00');\n }", "function jetpack_sync_full_sync_interval( $schedule_name ) {\n\treturn 'twicedaily';\n}", "protected function schedule(Schedule $schedule)\n {\n /* $schedule->command('inspire')\n ->hourly();\n */ \n $schedule->command('sync:sfa')\n \t\t\t->dailyAt('3:00')\n \t\t\t//->withoutOverlapping()\n \t\t\t->appendOutputTo(storage_path('logs/cron').'/sync1.log');\n \n// \t\t$schedule->command('sync:sfa')\n// \t\t\t->dailyAt('12:00')\n// \t\t\t//->withoutOverlapping()\n// \t\t\t->appendOutputTo(storage_path('logs/cron').'/sync2.log');\n \n $schedule->command('reset:admin_password')\n\t\t\t ->weekly()\n\t\t\t ->mondays()\n\t\t\t ->at('2:30')\n\t\t\t ->withoutOverlapping()\n\t\t\t ->appendOutputTo(storage_path('logs/cron').'/password.log');\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('youtube:check')\n ->daily()\n ->withoutOverlapping();\n\n $schedule->command('youtube:duration')\n ->everyMinute()\n ->withoutOverlapping();\n\n $schedule->command('vidme:check')\n ->daily()\n ->withoutOverlapping();\n\n $schedule->command('delete:synced')\n ->daily()\n ->withoutOverlapping();\n\n $schedule->command('clean:user_watched_table')\n ->weekly()\n ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate www')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate en')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate il')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate ar')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate ro')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate ru')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n $schedule->command('videocache:generate')\n ->everyTenMinutes()\n ->withoutOverlapping();\n\n // $schedule->command('download:livefeedxml')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson en')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson il')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson ar')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson ro')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson ru')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson www')\n // ->everyMinute()\n // ->withoutOverlapping();\n }", "function nhymxu_weekly_cron_job_recurrence( $schedules ) {\n\t$schedules['weekly'] = array(\n\t\t'display' => 'weekly',\n\t\t'interval' => 604800,\n\t);\n\treturn $schedules;\n}", "function emp_cron_schedules($schedules){\n\t$schedules['em_minute'] = array(\n\t\t'interval' => 60,\n\t\t'display' => 'Every Minute'\n\t);\n\treturn $schedules;\n}", "public function init_archive(){\n add_action('save_post', array($this, 'update_is_upcoming'));\n add_action('check_upcoming_is_post_upcoming', array($this, 'check_upcoming_is_post_upcoming'));\n if ( wp_next_scheduled( 'check_upcoming_is_post_upcoming' ) === false ) {\n wp_schedule_event( time(), 'daily', 'check_upcoming_is_post_upcoming' );\n }\n }", "static function fetchJobSchedules() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \" SELECT job_id, classname, repeat_time_minutes, repeat_daily_at, active_yn, last_run_date \n FROM job_scheduler\n ORDER BY job_id\");\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n $schedule = array();\n foreach( $resultset as $record ) {\n if( false === empty( $record->repeat_time_minutes ) ) {\n $schedule[] = new ScheduledJobRepeat(\n $record->job_id, \n $record->classname, \n $record->repeat_time_minutes, \n $record->active_yn == 'Y',\n $record->last_run_date,\n self::fetchJobScheduleParameters( $record->job_id ));\n }\n else if( false === empty( $record->repeat_daily_at ) ) {\n $schedule[] = new ScheduledJobDaily(\n $record->job_id, \n $record->classname, \n $record->repeat_daily_at,\n $record->active_yn == 'Y',\n $record->last_run_date,\n self::fetchJobScheduleParameters( $record->job_id ));\n }\n }\n return $schedule;\n }", "public function run()\n {\n $schedule = new Schedule();\n $schedule->schedule_year = '2019';\n $schedule->schedule_month = '01';\n $schedule->save();\n\n $schedule = new Schedule();\n $schedule->schedule_year = '2019';\n $schedule->schedule_month = '02';\n $schedule->save();\n\n $schedule = new Schedule();\n $schedule->schedule_year = '2019';\n $schedule->schedule_month = '03';\n $schedule->save();\n\n $schedule = new Schedule();\n $schedule->schedule_year = '2019';\n $schedule->schedule_month = '04';\n $schedule->save();\n }", "function create_daily_hook() {\n //wp_clear_scheduled_hook( 'efpsenddailyhook' );\n if (!wp_next_scheduled('efpsenddailyhook')) {\n wp_schedule_event(time(), 'daily', 'efpsenddailyhook');\n //wp_schedule_event(time(), 'minutes_5', 'efpsenddailyhook');\n }\n}", "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')->hourly();\n }", "protected function schedule(Schedule $schedule)\n {\n\t\t$schedule->call(function () {\n\t\t\t\n\t\t\t/*\n\t\t\t\tcreate jobs to send current newsletter\n\t\t\t*/\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\t\tcreate newsletters for next week\n\t\t\t*/\n\t\t\t$mail = new Email;\n\t\t\t$mail->status = 'disabled';\n\t\t\t$mail->sent = 0;\n\t\t\t$mail->send_date = Carbon::parse( new Carbon('next '.rtrim(env('APP_EMAIL_SEND_DAY'),\"s \")) )->toDateString();\n\t\t\t$mail->list = env('MAD_MIMI_MALES');\n\t\t\t$mail->save();\n\t\t\t\n\t\t\t$mail = new Email;\n\t\t\t$mail->status = 'disabled';\n\t\t\t$mail->sent = 0;\n\t\t\t$mail->send_date = Carbon::parse( new Carbon('next '.rtrim(env('APP_EMAIL_SEND_DAY'),\"s \")) )->toDateString();\n\t\t\t$mail->list = env('MAD_MIMI_FEMALES');\n\t\t\t$mail->save();\n\t\t\t\n\t\t\t$mail = new Email;\n\t\t\t$mail->status = 'disabled';\n\t\t\t$mail->sent = 0;\n\t\t\t$mail->send_date = Carbon::parse( new Carbon('next '.rtrim(env('APP_EMAIL_SEND_DAY'),\"s \")) )->toDateString();\n\t\t\t$mail->list = env('MAD_MIMI_FAMILIES');\n\t\t\t$mail->save();\n\t\t\t\n\t\t})->weekly()->{env('APP_EMAIL_SEND_DAY')}()->at(env('APP_EMAIL_SEND_TIME'));\n }", "public function fullCaAction(){\n \t$logger = new Frogg_Log('/home2/bleachse/public_html/seriando/log/calendar_CA.log');\n \t$xml = new XMLReader();\n \tif(!$xml->open('http://services.tvrage.com/feeds/fullschedule.php?country=CA')){\n \t\t$logger->err('Failed to open input file');\n \t\t$logger->close();\n \t\tdie;\n \t}\n \t$logger->info('Starting to index full schedule');\n \t$series = new Application_Model_Series();\n \twhile ($xml->read()){\n \t\twhile($xml->read() && $xml->name != 'DAY');//Goes to next <DAY>\n \t\t$timestamp = new Frogg_Time_Time($xml->getAttribute('attr'));\n \t\t$timestamp = $timestamp->getUnixTstamp();\n \t\twhile($xml->read()){ //Daily shows reading\n \t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'show'){ //Found new show\n \t\t\t\t$episode_name = $xml->getAttribute('name');\n \t\t\t\t$show_id = '';\n \t\t\t\twhile($xml->read() && $xml->name != 'sid'); //Found show id\n \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'sid'){\n \t\t\t\t\t$show_id = $xml->readString();\n \t\t\t\t}\n \t\t\t\twhile($xml->read() && $xml->name != 'ep'); //Found episode air order\n \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'ep'){\n \t\t\t\t\t$episode_num = $xml->readString();\n \t\t\t\t\t$scheduled = new Application_Model_Scheduled($show_id,'http://services.tvrage.com/tools/quickinfo.php?show='.urlencode($episode_name).'&ep='.$episode_num,Application_Model_Scheduled::UNREAD,$timestamp);\n \t\t\t\t\t$scheduled->save();\n \t\t\t\t\t$logger->ok('Saved : '.$scheduled->link);\n \t\t\t\t}\n \t\t\t$xml->next('show');\n \t\t\t} else if($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'DAY'){ //Found </DAY>\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}//END - Daily shows reading\n \t}\n \t$logger->close();\n \tdie;\n }", "public function initialteRedmineCronJob()\r\n { \r\n \r\n //GET All projects \r\n $allProjects = $this->client->api('project')->all(array('limit' => 100,'offset' => 0));\r\n foreach ($allProjects['projects'] as $project)\r\n { \r\n \t$this->addProject($project);\r\n }\r\n //GET All issues \r\n $allIssue=$this->client->api('issue')->all();\r\n if($allIssue['total_count'] >= 0)\r\n {\r\n for ($offset=0; $offset <=$allIssue['total_count'] ; $offset+=$allIssue['limit']) \r\n { \r\n \r\n $issueList=$this->client->api('issue')->all(array(\r\n 'limit' => $allIssue['limit'],\r\n 'offset' =>$offset)); \r\n foreach ($issueList['issues'] as $singleIssue)\r\n {\r\n $this->addIssue($singleIssue);\r\n }\r\n }\r\n }\r\n \r\n \r\n // //Get All Timelog Entries \r\n $allTimeEntry=$this->client->api('time_entry')->all();\r\n if($allTimeEntry['total_count'] >= 0)\r\n {\r\n for ($offset=0; $offset <=$allTimeEntry['total_count'] ; $offset+=$allTimeEntry['limit']) \r\n { \r\n \r\n $timeEntryList=$this->client->api('time_entry')->all(array('limit' => $allTimeEntry['limit'],'offset' =>$offset)); \r\n foreach ($timeEntryList['time_entries'] as $singleTimeLog)\r\n {\r\n $this->addTimeEntry($singleTimeLog);\r\n }\r\n }\r\n }\r\n\r\n \r\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('sitemap:generate')\n // ->everyMinute();\n }", "public static function action_wp() {\n $enable_reminders = self::send_domain_reminders();\n $schedule = wp_get_schedule( self::$scheduled_event_hook );\n $next_occurence = wp_next_scheduled( self::$scheduled_event_hook );\n if( !$schedule && !$next_occurence && $enable_reminders ) {\n wp_schedule_event( time(), 'weekly', self::$scheduled_event_hook );\n return;\n \t}\n \tif( $schedule !== false && !$enable_reminders ) {\n \twp_unschedule_event( $next_occurence, self::$scheduled_event_hook );\n \treturn;\n \t}\n }", "function ds_add_email_cron_schedules( $param ) {\n\n $param['fifteen_minute'] = array(\n 'interval' => 900, // seconds* 900/60 = 15 mins\n 'display' => __( 'Every Fifteen Minutes' )\n );\n\n return $param;\n\n }", "function cron_add_weekly( $schedules ) {\n $schedules['weekly'] = array(\n 'interval' => 604800,\n 'display' => __( 'Once Weekly' )\n );\n return $schedules;\n}", "protected function schedule(Schedule $schedule)\n {\n $schedule->call(function () {\n $users=User::all();\n foreach ($users as $user){\n $articles=$user->articles()->wherePivot('type','like','achat');\n\n }\n\n DB::table('deal_user')->where('expired_at', '<',Carbon::now())->update(['status' => 'expired']);\n })->everyMinute();\n }", "public function cron_action()\n\t{\n\n\t\t// process any recently updated inventory\n\t\t$this->inventory_batch();\n\t\t\n\t\t// process any recently shipped orders\n\t\t$this->shipping_batch();\n\n\t\t// process any recently processing orders\n\t\t$this->processing_batch();\n\n\t\t// process any product updates\n\t\t$this->product_batch(); \n\n\t\t// clean up any old records from the queues\n\t\t$this->cleanup();\n\t\texit('done');\n\n\t}" ]
[ "0.63838834", "0.6287593", "0.6282198", "0.62096685", "0.6191843", "0.6180062", "0.6178438", "0.61579955", "0.6131383", "0.6116661", "0.6094027", "0.608667", "0.6084408", "0.6083873", "0.6057832", "0.6049932", "0.60333", "0.6027221", "0.60265994", "0.60206985", "0.6009187", "0.59835356", "0.5979275", "0.5964662", "0.5963903", "0.5962678", "0.5950703", "0.5945861", "0.59360635", "0.59242034", "0.59148407", "0.5913153", "0.59095824", "0.5909436", "0.58967274", "0.5891091", "0.5890779", "0.58903605", "0.58711183", "0.585272", "0.5851144", "0.58059394", "0.5798069", "0.5780151", "0.5761617", "0.5753403", "0.57494533", "0.5743434", "0.57425076", "0.57422227", "0.57420033", "0.5741672", "0.5739895", "0.5734026", "0.57219493", "0.5721599", "0.5721486", "0.57206887", "0.57179385", "0.5711238", "0.5699293", "0.5688874", "0.56882244", "0.5685418", "0.56753546", "0.5661797", "0.56571126", "0.5656154", "0.5653508", "0.56513655", "0.5650292", "0.56499404", "0.56490916", "0.56470656", "0.5646853", "0.56419307", "0.56418335", "0.5636322", "0.56314856", "0.5630861", "0.56291586", "0.562775", "0.56171066", "0.5615305", "0.5615143", "0.56050116", "0.56048304", "0.5604751", "0.5603152", "0.5602163", "0.5594943", "0.5591834", "0.55874777", "0.55863243", "0.55851066", "0.5585015", "0.5582739", "0.5580722", "0.5579513", "0.5576073", "0.55759615" ]
0.0
-1
Display a calendar view to logged in user
public function index() { if (!Sentry::check()) { // User is not logged in, or is not activated return Redirect::route('landing'); } else { return View::make('calendar.index'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $this->view('calendar');\n }", "public function getindex()\n\t{\n\t\t$id = Sentry::getUser()->id;\n\t\tif(!$id)\n\t\t{\n\t\t\techo \"please login first\";\n\n\t\t}\n\t\telse\n\t\t{\n\t\t$events = Calender::all(); \n\t\t\n\t\treturn View::make('event.index')->with('events',$events);\n\t}\n\t}", "public function index() {\n \tif(!$this->user)\n \t\n \t{\n \t\t\n \t\t echo \"Members only. <a href='/users/login'>Login</a>\";\n \n \t\t # Return will force this method to exit here so the rest of the code won't be executed and the profile view won't be displayed.\n \t\t return false;\n\t\n\t }\n\t \t\t\n\t\t# Any method that loads a view will commonly start with this\n\t\t# First, set the content of the template with a view file\n\t\t\t$this->template->content = View::instance('v_calendar');\n\t\t# Now set the <title> tag\n\t\t\t$this->template->title = \"Event Calendar of \".$this->user->first_name;\t\t\n\t\n\t\t# If this view needs any JS or CSS files, \n\t\t# add their paths to this array so they will get loaded in the head\n\t\t\t$client_files = Array(\n\t\t\t\t\t\t\"\"\n\t );\n\t \n\t \t$this->template->client_files = Utils::load_client_files($client_files); \n\t \t\t\n\t\t# Render the view\n\t\t\techo $this->template;\n\n\t}", "public function calendar()\n {\n return view('pages.calendar');\n }", "public function calendario() {\n $datos['titulo'] = 'Calendario';\n $this->load->view('calendar/calendar_view',$datos);\n }", "public function calendar()\n {\n return view('calendar');\n }", "public function calendarIndex()\n {\n return view('calendar');\n }", "public function actionCalendar()\n {\n // Get current ID of logined user\n $userId = Yii::$app->user->getId() ?: '1000';\n $profile = (new UsersProfile())->getProfile();\n\n // Fill array keyes with [1, .., date(\"t\")].\n // date(\"t\") - count of days in current month\n $calendar = array_fill_keys(range(1, date(\"t\")), []);\n $model = new TaskQuery(Task::class);\n\n foreach ($model->getByCurrentMonth($userId)->all() as $task) {\n // Get current $task->date and create new DateTime object\n // $date->format(\"j\") -- Day of the month: 1, 2, .., 31\n // Fill array $calender with $task objects\n $date = \\DateTime::createFromFormat(\"Y-m-d H:i:s\", $task->deadline);\n $calendar[$date->format(\"j\")][] = $task;\n }\n\n return $this->render('calendar', \\compact('calendar', 'profile'));\n }", "public function calendar()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'calendar');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | Calendar')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/calendar');\n }", "public function index()\n {\n $title = translate('📆');\n return view('backend.'.Auth::user()->role.'.event_calendar.index', compact('title'));\n }", "public function index()\n {\n //$calendar_events = CalendarEvent::all(); //Too Many?\n $calendar_events = CalendarEvent::where('user_id', '!=', '1')->whereBetween(\n 'start', [Carbon::today(), Carbon::today()->addMonths(3)])->get();\n $today = Carbon::today()->toDateString();\n $calendar_events_sorted = CalendarEvent::whereDate('start', '=', $today)\n ->get()->sortby('start');\n\n $calendar = $this->prepCalendar($calendar_events);\n\n $admins = Admin::all()->pluck('name', 'id');\n\n \\JavaScript::put(['admin' => Auth::guard('admin')->check()]);\n\n return view('calendar_events.index', compact('calendar_events', 'calendar_events_sorted', 'calendar', 'admins'));\n }", "public function index()\n {\n return view('calendar.calendar');\n }", "function academic_calendar(){\n $data['content_page']='admin/academic_calendar';\n $this->load->view('common/base_template',$data);\n }", "public function index()\n {\n $id = Auth::user()->id;\n $events = [];\n $data = Event::where(['user_id'=>$id])->get();\n if($data->count()) {\n foreach ($data as $key => $value) {\n $events[] = Calendar::event(\n $value->title,\n true,\n new \\DateTime($value->start_date),\n new \\DateTime($value->end_date.' +1 day'),\n null,\n // Add color and link on event\n [\n 'color' => '#3490dc',\n 'url' => '/update/' . $value->id,\n ]\n );\n }\n }\n $calendar = Calendar::addEvents($events);\n return view('home', compact('calendar'));\n }", "public function index()\n {\n $events = [];\n $data = Event::all();\n if($data->count()) {\n foreach ($data as $key => $value) {\n $events[] = Calendar::event(\n $value->title,\n true,\n new \\DateTime($value->start_date),\n new \\DateTime($value->end_date.' +1 day'),\n null,\n // Add color and link on event\n [\n 'color' => '#0fc',\n 'url' => 'pass here url and any route',\n ]\n );\n }\n }\n $calendar = Calendar::addEvents($events);\n return view('calender.calender', compact('calendar')); \n }", "public function index()\n {\n\n return view('webapp-layouts.calendar.agenda');\n }", "public function ownerCombinedCal()\n {\n // Restricted access\n if ( ! $this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n\n require_once('views/OwnerCombinedCalView.class.php');\n $site = new SiteContainer($this->db);\n $page = new OwnerCombinedCalView();\n \n $site->printHeader();\n $site->printNav(\"owner\");\n $site->printCombinedCalFooter();\n $page->printHtml();\n $page->printCalendar(); \n\n }", "public function getCalendarPage();", "public function calendario()\n {\n $alerts = Alerts::with('user')->get();\n return view('alertas.calendario', compact('alerts'));\n }", "function DisplayCalendarOfEvents()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\techo \"<div id='calendar'></div>\";\t\r\n\t}", "public function index()\n\t{\n\t\t// Fetch calendars\n\t\t$calendars = $this->calendars->getAllCalendars();\n\n\t\t// Output\n\t\t$this->display($this->load->view('calendar/list', ['calendars' => $calendars], TRUE));\n\t}", "public function index()\n {\n return view('Shift::calendar.index');\n }", "function index()\n\t{\n\n\t\t// Load Library Calendar\n\t\t$this->load->library('calendar');\n\n\t\t$data[\"varkal\"] = $this->calendar->generate();\n\t\t$data[\"judul\"] = \"Kalender Dengan Library Calendar\";\n\n\t\t$this->load->view(\"kalender/calendar_view\", $data);\n\t}", "public function index()\n {\n $today = Carbon::now()->format('Y-m-d').'%';\n $auth_man=1;\n $list=CalendarModel::with('patient')->where('start', 'like', $today)->where('user_id',auth()->id())\n ->where('status','active')->orderBy('id','desc')->get();\n $all = CalendarModel::all();\n return view('calendar.index',compact('list','auth_man','all'));\n }", "public function index()\n {\n (new Calendar())->getOutDays();\n $user = Auth::user();\n $year = $_GET['year'] ?? Carbon::now()->year;\n $data = array(\n \"hours\" => array(1, 2, 3, 4, 5, 6),\n \"date\" => Carbon::now('Europe/Paris'),\n \"categories\" => Category::all(),\n \"calendar\" => (new Calendar())->show(),\n \"navi\" => (new Calendar())->navigation(),\n \"counts\" => array(\n 'f' => Helpers::getCounter('f', $year, $user),\n 'cp' => Helpers::getCounter('cp', $year, $user),\n 'r' => Helpers::getCounter('r', $year, $user),\n 'am' => Helpers::getCounter('am', $year, $user),\n 'cs' => Helpers::getCounter('cs', $year, $user),\n 'a' => Helpers::getCounter('a', $year, $user),\n ),\n \"days\" => Helpers::getNumberRange(1, 31),\n \"months\" => Helpers::getNumberRange(1, 12),\n \"years\" => Helpers::getNumberRange(2015, 2030),\n );\n\n return view('pages.wcalendar.index', compact('data'));\n }", "public function index()\n {\n $users = User::count();\n\n $widget = [\n 'users' => $users\n ];\n\n $schedules = $this->CalendarController->fetchSchedules();\n \n return view('home', compact('widget','schedules'));\n }", "public function viewCreateFromCalendar(){\r\n\r\n\r\n\t\tif(isset($_POST['startDate']) && isset($_POST['startTime']) && isset($_POST['endDate']) && isset($_POST['endTime']) ){\r\n\t\t\t$data['start_date'] = $_POST['startDate'];\r\n\t\t\t$data['start_time'] = $_POST['startTime'];\r\n\t\t\t$data['end_date'] = $_POST['endDate'];\r\n\t\t\t$data['end_time'] = $_POST['endTime'];\r\n\t\t\t$result = $this->load->view('vEventForCalendar',$data,TRUE);\r\n\t\t\t//$this->viewCreateEvent();\r\n\t\t\techo $result;\r\n\t\t}\r\n\r\n\r\n\r\n\t}", "public function index()\n {\n return view('calendario_main');\n }", "function displayCalendar(){\r\n $conn= databaseConnection();\r\n\r\n $dia = date (\"d\"); $mes = date (\"n\"); $ano = date (\"Y\");\r\n if($dia[0]=='0') $dia=substr($dia, -1);\r\n\r\n if (isset($_POST[\"userid\"])){\r\n $userid= ($_POST[\"userid\"]);\r\n } \r\n\r\n //(YYYY-MM-DD)\r\n if (isset($_POST[\"date\"])){\r\n //$dia = substr(($_GET[\"date\"]),8,2);\r\n $dia = \"01\";\r\n $mes = substr(($_POST[\"date\"]),5,2);\r\n $ano = substr(($_POST[\"date\"]),0,4);\r\n } \r\n\r\n //include the WeeklyCalClass and create the object !!\r\n include (\"StaffCalendar.php\");\r\n $calendar = new StaffCalendarClass ($userid, $dia, $mes, $ano);\r\n echo $calendar->showCalendar ();\r\n\r\n mysqli_close($conn);\r\n }", "public function index() {\n\t\t$employees = Employee::all();\n\t\t$descriptionSigns = DescriptionSign::all();\n\t\t$month = date('m');\n\t\t$year = date('Y');\n\t\tforeach ($employees as $key => $value) {\n\t\t\t$calendar = Calendar::where('employee_id', '=', $value->id)->where('month',$month)->where('year',$year)->first();\n\t\t\tif($calendar == null)\n\t\t\t{\n\t\t\t\t$calendar = $this->bornCalendarEmpty($value->id,$month,$year);\n\t\t\t}\n\t\t\t$this->generatePresenteWhenInitNewDate($calendar, $month, $year);\n\t\t\t$employees[$key]->calendar = $calendar;\n\t\t}\n\n\t\t$func = function($emp) {\n\t\t return $emp->year;\n\t\t};\n\t\t// Year is stored in database calendar.\n\t\t$years = collect(Calendar::all())->map($func);\n\t\t$years = array_unique($years->toArray());\n\n\t\treturn view('calendar.calendar', compact('employees','month','year','years','descriptionSigns'));\n\t}", "public function getIndex()\n\t{\n\t\t\n\t\t//Get the user id of the currently logged in user\n $userId = Sentry::getUser()->id;\n //Current Date\n\t\t$day = date(\"Y-m-d\");\n //Get tasks list for the user\n\t\t$tasks = $this->timesheet->getIndex($userId);\n //Get the entries\n\t\t$entries = $this->timesheet->getEntries($day,$userId);\n //Current Week\n\t\t$week = $this->timesheet->getWeek($day);\n\t\treturn \\View::make('dashboard.timesheet.view')\n\t\t\t\t\t\t->with('week',$week)\n\t\t\t\t\t\t->with('selectedDate',$day)\n\t\t\t\t\t\t->with('entries', $entries)\n\t\t\t\t\t\t->with('tasks',$tasks);\n\t}", "public function index()\n {\n $calendar_events = CalendarEvent::all();\n\n return view('calendar::calendar_events.index', compact('calendar_events'));\n }", "public function index()\n {\n //add a really old appointment\n $temp[] = \\Calendar::event(\n \"work\",\n false,\n \"1886-01-01T00:00:00\",\n \"1886-01-01T00:00:00\"\n );\n $calendar = \\Calendar::addEvents($temp)->setOptions(['firstDay' => 1])->setCallbacks([]);\n\n\n if(session(\"accountType\") == \"patient\"){\n return redirect(\"/patients/\".session('accountID'));\n }\n else if(session(\"accountType\") == \"doctor\"){\n $appointments = Appointment::where('doctor_id',session('accountID'))->get();\n // return $as;\n foreach($appointments as $appointment){\n $temp[] = \\Calendar::event(\n $appointment->event,\n false,\n $appointment->startTime,\n $appointment->endTime\n );\n $calendar = \\Calendar::addEvents($temp)->setOptions(['firstDay' => 1])->setCallbacks([]);\n }\n \n \n //$calendar = \\Calendar::addEvents($events2)->setOptions(['firstDay' => 1])->setCallbacks([]);\n return view('home', array('calendar'=>$calendar));\n }\n else if(session(\"accountType\") == \"nurse\"){ \n return redirect(\"/patients\");\n }\n // return redirect(\"/hospitals\");\n return view('home', array('calendar'=>$calendar));\n // return session('accountType');\n }", "public function index()\n {\n $user = auth()->user();\n\n return view('appointments', compact('user'));\n }", "public function create()\n {\n return view('backend.'.Auth::user()->role.'.event_calendar.create');\n }", "public function index()\n {\n $calendar = Calendar::all();\n\n return view('/welcome', compact('calendar'));\n }", "public function index(){\n \n\n return view('medicalappointments', [\n 'userId' => Auth::id(),\n 'username' => DB::table('users')->where('id', Auth::id() )->value('name'),\n ]\n );\n }", "protected function getCalendarView()\n {\n return !empty($_GET['calview']) ? $_GET['calview'] : 'fullcalendar';\n }", "public function show(Calendar $calendar)\n {\n //\n }", "public function show(Calendar $calendar)\n {\n //\n }", "public function index(Request $request, User $user)\n {\n // The authenticated user can view their calendar only\n $this->authorize('access', $user);\n\n //Teacher events to be displayed in the calendar\n if ($request->ajax())\n {\n return $user->teacher->events->load('subject', 'classroom');\n }\n\n return view('events.index')->with([\n 'user' => $user->load('teacher'),\n ]);\n }", "function events(){\n if(!$this->session->userdata('logged_in') || $this->session->userdata('role') != 'student'):\n redirect('/');\n endif;\n\n $data = array(\n 'events' => $this->admin_model->browse(array('module' => 'events'))\n );\n //load content\n $this->template->content->view('/students/content/events', $data);\n\n //add js file\n $this->template->publish('layouts/app');\n }", "function view_ical()\n\t{\n\t\t\n\t\tif (!JRequest::getVar('format') == 'raw') {\n\t\t\t$this->setRedirect(JURI::root(false).'administrator/index.php?option=com_pbbooking&controller=manage&task=view_ical&id='.JRequest::getInt('id').'&format=raw');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$view=$this->getView('manage','raw');\n\t\t$view->setLayout('ics_view');\n\t\t\n\t\t$db = JFactory::getDbo();\n\n\t\t$db->setQuery('select * from #__pbbooking_events where id='.$db->escape((int)JRequest::getInt('id')));\t\t\n\t\t$view->event = $db->loadObject();\n\t\t\n\t\t$view->display();\n\t}", "function view()\n {\n $data['title'] = 'Cadet Events';\n $this->load->model('cadetevent_model');\n $data['events'] = $this->cadetevent_model->get_all_cadetevents();\n \n // Loads the home page \n $this->load->view('templates/header', $data);\n $this->load->view('pages/attendance.php');\n $this->load->view('templates/footer'); \n }", "public function actionIndex()\n {\n $searchModel = new CalendarSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n return view('mystudio.calendar.index', [\n 'calendars' => Calendar::all(),\n ]);\n }", "function cal_content()\n{\n $a = get_app();\n $o = \"\";\n if ($a->argc == 1) {\n $o .= \"<h3>\".t('Event Export').\"</h3><p>\".t('You can download public events from: ').$a->get_baseurl().\"/cal/username/export/ical</p>\";\n } elseif ($a->argc==4) {\n\t// get the parameters from the request we just received\n\t$username = $a->argv[1];\n\t$do = $a->argv[2];\n\t$format = $a->argv[3];\n\t// check that there is a user matching the requested profile\n\t$r = q(\"SELECT uid FROM user WHERE nickname='\".$username.\"' LIMIT 1;\");\n\tif (count($r)) \n\t{\n\t $uid = $r[0]['uid'];\n\t} else {\n\t killme();\n\t}\n\t// if we shall do anything other then export, end here\n\tif (! $do == 'export' )\n\t killme();\n\t// check if the user allows us to share the profile\n\t$enable = get_pconfig( $uid, 'cal', 'enable');\n\tif (! $enable == 1) {\n\t info(t('The user does not export the calendar.'));\n\t return;\n\t}\n\t// we are allowed to show events\n\t// get the timezone the user is in\n\t$r = q(\"SELECT timezone FROM user WHERE uid=\".$uid.\" LIMIT 1;\");\n\tif (count($r))\n\t $timezone = $r[0]['timezone'];\n\t// does the user who requests happen to be the owner of the events \n\t// requested? then show all of your events, otherwise only those that \n\t// don't have limitations set in allow_cid and allow_gid\n\tif (local_user() == $uid) {\n\t $r = q(\"SELECT `start`, `finish`, `adjust`, `summary`, `desc`, `location` FROM `event` WHERE `uid`=\".$uid.\" and `cid`=0;\");\n\t} else {\n\t $r = q(\"SELECT `start`, `finish`, `adjust`, `summary`, `desc`, `location` FROM `event` WHERE `allow_cid`='' and `allow_gid`='' and `uid`='\".$uid.\"' and `cid`='0';\");\n\t}\n\t// we have the events that are available for the requestor\n\t// now format the output according to the requested format\n\t$res = cal_format_output($r, $format, $timezone);\n\tif (! $res=='')\n\t info($res);\n } else {\n\t// wrong number of parameters\n\tkillme();\n }\n return $o;\n}", "public function cal_indexAction()\n {\n $startDate = date(\"Y-m-d\") ;\n $endDate = date(\"Y-m-d\", mktime(0,0,0,date(\"m\"),date(\"d\"),date(\"Y\")+1));\n $em = $this->getDoctrine()->getManager();\n $dql1 = \"SELECT c.title,c.date,c.time,c.description FROM EnglishCalendarBundle:Calendar c WHERE c.date >= ?1 and c.date < ?2 ORDER BY c.date ASC\";\n $calendar = $em->createQuery($dql1)->setParameter('1',$startDate)->setParameter('2',$endDate)->getResult();\n return $this->render('EnglishHomeBundle:Default:cal_index.html.twig', array('calendar' => $calendar,));\n\n }", "public function viewAction()\n {\n \t$idEmployee = EmployeeCatalog::getInstance()->getIdEmployeeByIdUser($this->getUser()->getBean()->getIdUser());\n \t$projects = ProjectCatalog::getInstance()->getIdProjectByIdEmployee($idEmployee); \t\n \tforeach ($projects as $project)\n \t{\n \t\t$tmp[]=$project['id_project'];\n\t\t}\n\t\t$stringProjects = implode(\",\",$tmp);\n\t\t$strProjects='\"';\t\n\t\t$strProjects.= implode(\",\",$tmp);\n\t\t$strProjects.='\"';\t\n\t\t$dates = TimetableHourCatalog::getInstance()->getDisctinctDateByIdProjects($stringProjects);\n \tforeach ($dates as $date)\n \t{\n \t\t$date = $date['date'];\n \t\t$statusTask= TimetableHourCatalog::getInstance()->getStatusByDate($date);\n \t\tif ($statusTask == 2)\n \t\t\t$dateArray2[] = $date;\n \t\tif ($statusTask == 3)\n \t\t\t$dateArray3[] = $date;\n \t\tif ($statusTask == 4)\n \t\t\t$dateArray4[] = $date;\n \t\tif ($statusTask == 1)\n \t\t\t$dateArray1[] = $date;\n\t\t}\t\t\n\t\t$datesStatus2=CalendarDayManager::getInstance()->getCalendarDays($dateArray2);\n\t\t$datesStatus3=CalendarDayManager::getInstance()->getCalendarDays($dateArray3);\n\t\t$datesStatus4=CalendarDayManager::getInstance()->getCalendarDays($dateArray4);\n\t\t$datesStatus1=CalendarDayManager::getInstance()->getCalendarDays($dateArray1);\n\t\t$this->view->daysStaus2= json_encode($datesStatus2);\n\t\t$this->view->daysStaus3= json_encode($datesStatus3);\n\t\t$this->view->daysStaus4= json_encode($datesStatus4);\n\t\t$this->view->daysStaus1= json_encode($datesStatus1); \n\t\t$this->view->projects = $strProjects; \t\t\n $this->setTitle('Calendario de Tareas');\n }", "public function show() {\n $year = null;\n \n $month = null;\n \n if(null==$year&&isset($_GET['year'])){\n \n $year = $_GET['year'];\n \n }else if(null==$year){\n \n $year = date(\"Y\",time()); \n \n } \n \n if(null==$month&&isset($_GET['month'])){\n \n $month = $_GET['month'];\n \n }else if(null==$month){\n \n $month = date(\"m\",time());\n \n } \n \n $this->thisYear=$year;\n \n $this->thisMonth=$month;\n \n $this->daysInMonth=$this->_daysInMonth($month,$year); \n \n $content='<div id=\"calendar\">'.\n\t\t\t\t\t\"<img src = 'img/manadensbabe/$month.jpg'>\".\n\t\t\t\t\t\n '<div class=\"box\">'.\n $this->_createNavi().\n '</div>'.\n '<div class=\"box-content\">'.\n '<ul class=\"label\">'.$this->_createCalender().'</ul>'; \n $content.='<div class=\"clear\"></div>'; \n $content.='<ul class=\"dates\">'; \n \n $weeksInMonth = $this->_weeksInMonth($month,$year);\n \n for( $i=0; $i<$weeksInMonth; $i++ ){\n \n for($j=1;$j<=7;$j++){\n $content.=$this->_showDay($i*7+$j);\n }\n }\n \n $content.='</ul>';\n \n $content.='<div class=\"clear\"></div>'; \n \n $content.='</div>';\n \n $content.='</div>';\n return $content; \n }", "public function index() {\n //\n $currentDate = \\Helpers\\DateHelper::getLocalUserDate(date('Y-m-d H:i:s')); \n $day = \\Helpers\\DateHelper::getDay($currentDate);\n $weekDays = \\Helpers\\DateHelper::getWeekDays($currentDate, $day); \n $workouts = \\App\\Schedule::getScheduledWorkouts($weekDays);\n \n return view('user/schedule', ['number_of_day' => $day, 'current_date' => $currentDate, 'weekDays' => $weekDays])\n ->with('target_areas', json_decode($this->target_areas, true))\n ->with('movements', json_decode($this->movements, true))\n ->with('workouts', $workouts);\n }", "public function show($user_id)\n {\n\n $auth_man=0;\n if ($user_id==auth()->id()){\n $auth_man=1;\n }\n\n $today = Carbon::now()->format('Y-m-d').'%';\n\n $list=CalendarModel::with('patient')->where('start', 'like', $today)->where('user_id',$user_id)\n ->where('status','active')->orderBy('id','desc')->get();\n\n $all = CalendarModel::with('patient')->where('user_id',$user_id)\n ->where('status','active')->orderBy('id','desc')->get();\n\n return view('calendar.index',compact('all','list','user_id','auth_man'));\n }", "public function events()\n {\n if (!Sentry::check()) {\n // User is not logged in, or is not activated\n return Redirect::route('landing');\n } else {\n // Gets all appointments from the school\n $user = Sentry::getUser();\n\n // Check if user is superAdmin\n if ($user->hasAccess('school')) {\n $appointments = Appointment::get()->load('group.school')->toArray();\n // Returns JSON response of the user\n return Response::json($appointments)->setCallback(\n Input::get('callback')\n ); //return View::make('calendar.events');\n\n } else {\n // If user is not superAdmin, show groups based on the school of the logged in user\n $user->load('school.groups.appointments.group.school');\n $appointments = [];\n\n // Loop through groups to get all appointments\n foreach ($user->school->groups as $group) {\n foreach ($group->appointments as $appointment) {\n array_push($appointments, $appointment);\n }\n }\n // Returns JSON response of the user\n return Response::json($appointments)->setCallback(Input::get('callback'));\n }\n }\n }", "public function index()\n {\n $reservations = Reservation::all();\n return view('calendarreservation', compact('reservations'));\n }", "function view($calendar=null,$tag=null,$date=null) {\n\t\t$data = $this->parseUrl($calendar,$tag,$date);\n\t\t$prev = $this->findPrev($this->params['pass']);\n\t\t$next = $this->findNext($this->params['pass']);\n\t\t$events = $this->Event->findEvents($data);\n\t\t$data['calendar_name'] = $this->requestAction('/calendars/findNameByShortname/'.$calendar);\n\t\t$data['tag_name'] = $this->requestAction('/tags/findNameByShortname/'.$tag);\n\t\t$this->set(compact('events','prev','next','data'));\n\t}", "public function calendar(){\n\n /**\n * Hago una consulta a la tabla eventos para que me traiga los eventos\n * que esten activos y le pido que me lo convierta a array\n */\n $events = Event::query()->where('state','Activo')->get()->toArray();\n\n /**\n * Creo un array vacio\n */\n $eventos = array();\n\n /**\n * Recorro cada uno de los elementos de la consulta que hice antes con un foreach\n * y los guardo en un array, en la posicion title guardo el titulo y la descripcion\n * y la fecha la guardo en la posicion start, ya que asi me la pide el fullcalendar\n */\n foreach($events as $event){\n $evento = [\n 'title' => $event['title'].\" | \".$event['description'],\n 'start' => $event['date'],\n ];\n /**\n * Guardo el array anterior en el array vacio que cree antes\n */\n array_push($eventos,$evento);\n }\n return view('calendar' , compact('eventos'));\n }", "public function index()\n { \n \t//Se a pessoa for admin ou alguma perfil de organizador ela pode ver os eventos dela gerenciável\n \t/*if(Auth::user()->hasRole('admin')){\n \t\treturn view('event.index'); \n \t}\n \telse{\n \t\treturn view('feed.index'); \n \t}*/\n\n return view('event.index');\n\n }", "public function indexAction() {\n\t\t$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\n\t\tif (!Engine_Api::_()->core()->hasSubject()) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t// Get subject and check auth\n\t\t$subject = Engine_Api::_()->core()->getSubject('event');\n\t\tif (!$subject->authorization()->isAllowed($viewer, 'view')) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\n\t\t// Prepare data\n\t\t$this->view->event = $event = $subject;\n\t\t$limit =$this->_getParam('max',5);\n\t\t$currentDay = date('Y') . '-' . date('m') . '-' . date('d');\n\t\t\n\t\t$table = Engine_Api::_()->getItemTable('event');\n\t\t$select = $table->select()\n ->where('category_id = ?', $event->category_id)\n ->where('event_id != ?', $event->getIdentity())\n ->order(\"DATEDIFF('{$currentDay}', starttime) DESC\")\n ->limit($limit);\n\n\t\t$showedEvents = $table->fetchAll($select);\n\t\t$this->view->showedEvents = $showedEvents;\n\t\t// Hide if nothing to show\n\t\tif( count($showedEvents) <= 0 ) {\n\t return $this->setNoRender();\n\t }\n }", "public function eventsAction()\n {\n $events = $this->manager->getRepository('Event\\Doctrine\\Orm\\Event')->findBy(array(), array('date' => 'ASC'));\n\n return $this->renderView('events', array(\n 'title' => 'Zusammenfassung der Grillveranstaltungen',\n 'events' => $events,\n 'meals' => $this->createMealsList($events),\n ));\n }", "public function showEvents(){\n return view('event.usereventlist', ['user' => auth()->user()]);\n }", "public function goToCalendarDate($date)\n {\n $unixTime = strtotime($date);\n $this->getSession()->visit($this->locatePath(\"index.php?page=calendar&date=\" . $unixTime));\n }", "function index()\n\t\t{\n\t\t\t// get every event record\n\t\t\t$all_events = $this->calendar->get_calendar_data();\n\t\t\t\n\t\t\t$veiw_data['all_events'] = $all_events;\n\t\t\t\n\t\t\t// load the view and send the data\n\t\t\t$this->load->view('index', $veiw_data);\n\t\t}", "public function index()\n {\n $calendarios = $this->repository->latest('data')->get();\n\n return view('admin.pages.calendarios.index',\n [\n 'calendarios'=>$calendarios,\n 'convenios'=>Convenio::all()\n ]\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $events = $em->getRepository('MALrmBundle:CalendarEvent')->findAll();\n\n\n return $this->render('MALrmBundle:event:index.html.twig', array(\n 'events' => $events,\n ));\n }", "public function index()\n\t{\n\t\tif(isset($_SESSION['userid']))\n\t\t{\n\t\t\tredirect('schedule');\n\t\t}\n\n\t\t// for testing purposes, use backdoor_login\n\t\t$this->backdoor_login();\n\n\t}", "public function index()\n {\n $user = auth()->user();\n\n $userUpcomingEvents = $user->interestedEvents()->current()->orderBy('start_datetime')->get();\n\n return view('auth.residents.events.index', compact('events', 'userUpcomingEvents'));\n }", "public function index()\n {\n $this->calendar->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n $calendar = $this->calendar->paginate(1);\n $horario = $this->horario->all();\n $pessoa = $this->pessoa->all();\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'data' => $calendar,\n 'horarios' => $horario,\n 'pessoas' => $pessoa\n ]);\n }\n\n return view('app.pages.calendars.index', compact('calendar','horario', 'pessoa'));\n }", "function getHomeCalendar()\n {\n $intYear = (isset($_GET['yearID'])) ? intval($_GET['yearID']) : date('Y', time());\n $intMonth = (isset($_GET['monthID'])) ? intval($_GET['monthID']) : date('m', time());\n $intDay = (isset($_GET['dayID'])) ? intval($_GET['dayID']) : 0;\n return $this->getCalendar($intYear,$intMonth,$intDay);\n }", "public function acad_calendar(Request $request)\n { \n $post = Page::with('sections', 'sliders')->where('code', 'acad_calendar')->first();\n\n return view('acad_calendar', compact('post'));\n }", "public function index()\n {\n $user = auth()->user();\n\n $dailySchedules = $user\n ->todaySchedules;\n\n $dailyReminders = $user\n ->todayReminders;\n\n return view('home.index', [\n 'schedules' => $dailySchedules ?? [],\n 'reminders' => $dailyReminders ?? [],\n ]);\n }", "public function index() {\n $events[] = \\Calendar::event(\n 'Event One', //event title\n false, //full day event?\n '2016-04-01T0800', //start time (you can also use Carbon instead of DateTime)\n '2016-04-01T1200', //end time (you can also use Carbon instead of DateTime)\n 0 //optionally, you can specify an event ID\n );\n \n //$eloquentEvent = EventModel::first(); //EventModel implements MaddHatter\\LaravelFullcalendar\\Event \n\n \n $calendar = \\Calendar::addEvents($events) //add an array with addEvents\n ->setOptions([ //set fullcalendar options\n 'firstDay' => 1\n ])->setCallbacks([ //set fullcalendar callback options (will not be JSON encoded)\n 'viewRender' => 'function() {alert(\"Callbacks!\");}'\n ]); \n \n \n return view('calendar', compact('calendar'));\n }", "function show()\n\t{\n\n\t\t$prefs = array(\n\t\t\t\t'show_next_prev'\t=> TRUE,\n\t\t\t\t'next_prev_url'\t\t=> site_url(\"Calendar/show/\")\n\t\t\t);\n\n\t\t// Load Library Calendar dengan parameter tambahan.\n\t\t$this->load->library(\"calendar\", $prefs);\n\n\t\t$data[\"varkal\"] = $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));\n\n\t\t/*\n\t\t*\tsegment(3)\t=> tahun\n\t\t*\tsegment(4)\t=> bulan\n\t\t*/\n\n\t\t$data[\"judul\"] = \"Navigasi Kalender\";\n\n\t\t$this->load->view(\"kalender/calendar_view\", $data);\n\t}", "public function scheduleAction() {\n $em = $this->_doctrineContainer->getEntityManager();\n \n // find corresponding doctors.\n $doctor = $em->getRepository('App\\Entity\\User')\n ->find(Zend_Auth::getInstance()->getIdentity()->id)\n ->doctor;\n\n $this->view->doctor = $doctor;\n }", "public function calendario(){\n return view('layouts.calendario')->with('encabezado','layouts.encabezadojefe');\n }", "public function index()\n\t{\n\t\treturn view('evento')->with('paginaAtual','evento');\n\t}", "public function index()\n {\n if (Auth::guest()) {\n $title = 'Welcome to Sentral Education!!';\n } else {\n $title = 'Welcome '.auth()->user()->name ;\n }\n \n return view('events.index')->with('title', $title);\n }", "function get_calendars() {\n\n\t\t// Get the attached calendars\n\t\t$calendars = wp_get_post_terms( $this->post_id , 'calendar' );\n\t\t$this->calendars = $calendars;\n\t\t\n\t\t// Loop through calendars, checking permissions\n\t\tforeach ( $calendars as $calendar ) {\n\t\t\t\n\t\t\t// Is it a group calendar?\n\t\t\tif ( is_group_calendar( $calendar->term_id ) ) :\n\t\t\t\t$group_id\t= groups_get_id( $calendar->slug );\n\t\t\t\t$can_view \t= groups_is_user_member( get_current_user_id() , $group_id ) ? true : false;\n\t\t\telse :\n\t\t\t\t$can_view = true;\n\t\t\tendif;\n\t\t\t\n\t\t\t// If we find a calendar for which the user is authorized, go ahead and display it\n\t\t\tif( $can_view ) :\n\t\t\t\t$this->calendar = $calendar;\n\t\t\t\t$this->can_view = true;\n\t\t\t\tbreak;\n\t\t\tendif;\n\t\t}\n\n\t\t// If the user is not allowed to view any calendar, redirect them to the group\n\t\tif ( !$can_view ) {\n\t\t\t$redirect = SITEURL . '/groups/' . $this->calendar->slug;\n\t\t\tbp_core_add_message( 'You cannot access events on this calendar.' , 'error' );\n\t\t\tbp_core_redirect( $redirect );\n\t\t}\n\t}", "public function create()\n {\n\n return view('webapp-layouts.calendar.create');\n }", "public function render()\r\n\t{\r\n\t\t$days = 1;\r\n\t\t$this->redirect = isset($this->redirect) ? $this->redirect: $this->getURL() ;\r\n\t\t$this->set_date();\r\n\t\t$total_days = cal_days_in_month(CAL_GREGORIAN, $this->month, $this->year);\r\n\t\t$first_spaces = date(\"w\", mktime(0, 0, 0, $this->month, 1, $this->year));\r\n\t\t$currentday = $this->UID('day');\r\n\r\n\t\tif (isset($this->inForm))\r\n\t\t{\r\n\t\t\t$CObjID = $this->UID('calendar');\r\n\t\t\t$DateString = ($this->Value()) ? '\",\"'.$this->Value() : '';\r\n\t\t\t$this->output = '<script language=\"javascript\">'.\"\\n\".'var '.$CObjID.' = new Calendar(\"'.$this->ID.$DateString.'\");'.\"\\n\"\r\n\t\t\t.$CObjID.'.currentDateStyle = \"'.$this->currentDateStyle.'\";'.\"\\n\"\r\n\t\t\t.$CObjID.'.selectedDateStyle = \"'.$this->selectedDateStyle.'\";'.\"\\n\"\r\n\t\t\t.$CObjID.'.normalDateStyle = \"'.$this->normalDateStyle.'\";'.\"\\n\"\r\n\t\t\t.$CObjID.'.setStyles();'.\"\\n\"\r\n\t\t\t.'</script>'.\"\\n\"\r\n\t\t\t.'<input type=\"hidden\" id=\"'.$CObjID.'\" name=\"'.$CObjID.'\" value=\"'.$this->Value().'\"/>'.\"\\n\";\r\n\t\t}\r\n\t\telse $this->output = '';\r\n\r\n\t\t$NavUrls = $this->url_params($this->UID('year'),$this->UID('month'),$this->UID('day'),array_keys($this->add_params_sel));\r\n\r\n\t\t$this->output.= '<table class=\"calendar\"><tr><td class=\"'.$this->navigateStyle.'\"><a id=\"'.$this->UID('navigateback').'\" class=\"'.$this->navigateStyle.'\" href=\"'.$this->getURL().\r\n\t\t\t'?'.$this->add_params_sel().'&'.$this->UID('month').'='.($this->month-1).'&'.$this->UID('year').'='.$this->year.$NavUrls.'\"><</a>\r\n\t\t </td><td id=\"'.$this->UID('Month').'\" colspan=\"5\" class=\"'.$this->monthStyle.'\">'.$this->RUS_MONTHS[date(\"n\", mktime(0, 0, 0, $this->month, 1, $this->year))-1].'&nbsp;'.$this->year.'\r\n\t\t </td><td class=\"'.$this->navigateStyle.'\"><a id=\"'.$this->UID('navigatenext').'\" class=\"'.$this->navigateStyle.'\" href=\"'.$this->getURL().'?'.$this->add_params_sel().'&'.$this->UID('month').'='.($this->month+1).'&'.$this->UID('year').'='.$this->year.$NavUrls.'\">></a>\r\n\t\t </td></tr><tr class=\"'.$this->daysOfTheWeekStyle.'\"><td>Ïí</td><td>Âò</td><td>Ñð</td><td>×ò</td><td>Ïò</td><td>Ñá</td><td>Âñ</td></tr>';\r\n\r\n \tfor ($Week=0;$Week<6;$Week++)\r\n \t{\r\n \t$this->output.= '<tr>';\r\n\r\n\t\t\t\tfor ($Day=0;$Day<7;$Day++)\r\n \t{\r\n\r\n\t\t\t\t\t$days++;\r\n\t\t\t\t\t$dDay = $days - $first_spaces;\r\n\t\t\t\t\t$norm_style = ($this->isDayAvailable($dDay))?$this->availDateStyle:$this->normalDateStyle;\r\n\t\t\t\t\t\r\n//\t\t\t\t\techo('dDay='.$dDay.'<br/>avail dates:');\r\n//\t\t\t\t\tforeach($this->availDates as $date)\r\n//\t\t\t\t\t\techo(date('d/m/Y',$date).'<br/>');\r\n\r\n\t\t\t\t\t$CellID = $this->UID('item['.$days.']');\r\n\r\n\t\t\t\t\tif ($days > $first_spaces && ($dDay) < $total_days + 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$LinkID = $this->UID('hlink['.$days.']');\r\n\t\t\t\t\t\t$currentSelectedDay = '<td id=\"'.$CellID.'\" class=\"'.$this->selectedDateStyle.'\"><a id=\"'.$LinkID.'\" class=\"'.$this->selectedDateStyle.'\"';\r\n\t\t\t\t\t\t$CurrentDate = isset($_REQUEST[$currentday]) ? $_REQUEST[$currentday]: '';\r\n\r\n\t\t\t\t\t\tif ($CurrentDate == $dDay)\t$this->output.= $currentSelectedDay;\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$this->output.='<td id=\"'.$CellID.'\" class=';\r\n\t\t\t\t\t\t\t$this->output.= ($dDay==date(\"j\") && $this->year==date(\"Y\") && $this->month==date(\"n\")) ?\r\n\t\t\t\t\t\t\t\t'\"'.$this->currentDateStyle.'\"><a id=\"'.$LinkID.'\" class=\"'.$this->currentDateStyle.'\"' :\r\n\t\t\t\t\t\t\t\t'\"'.$norm_style.'\"><a id=\"'.$LinkID.'\" class=\"'.$this->normalDateStyle.'\"';\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif($this->isDayAvailable($dDay))\r\n\t\t\t\t\t\t\t$this->output.= 'href=\"'.$this->redirect.'?'.$this->add_params_day().'&'.$currentday.'='.$dDay.$this->url_params($currentday,array_keys($this->add_params_day)).'\">'.$dDay.'</a></td>';\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$this->output.= '>'.$dDay.'</a></td>';\r\n\r\n\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$this->output.='<td id=\"'.$CellID.'\" class=\"'.$this->normalDateStyle.'\"></td>'.\"\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->output.=\"</tr>\";\r\n \t}\r\n\r\n\t\t$this->output.= '</table>';\r\n\r\n\t\treturn $this->output;\r\n\t}", "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 show(EventCalendar $eventCalendar)\n {\n //\n }", "public function actionAuth(){\n$client = $this->getClient();;\n$service = new Google_Service_Calendar($client);\n\n// Print the next 10 events on the user's calendar.\n$calendarId = 'primary';\n$optParams = array(\n 'maxResults' => 10,\n 'orderBy' => 'startTime',\n 'singleEvents' => true,\n 'timeMin' => date('c'),\n);\n$results = $service->events->listEvents($calendarId, $optParams);\n$events = $results->getItems();\n\nif (empty($events)) {\n print \"No upcoming events found.\\n\";\n} else {\n print \"Upcoming events:\\n\";\n foreach ($events as $event) {\n $start = $event->start->dateTime;\n if (empty($start)) {\n $start = $event->start->date;\n }\n printf(\"%s (%s)\\n\", $event->getSummary(), $start);\n }\n }\n}", "public function index()\n {\n // $this->authorize('index', Contact::class);\n\n $labels = Auth::user()->account->customLabels;\n\n return view('pages.schedule', compact('labels'));\n }", "public function viewAction() {\n if (!Engine_Api::_()->core()->hasSubject('siteevent_organizer'))\n $this->respondWithError('unauthorized');\n\n $showEvents = $this->_getParam('showEvents', 1);\n $profileTabs = $this->_getParam('profileTabs', 1);\n $getInfo = $this->_getParam('getInfo', null);\n\n\n $viewtype = $this->_getParam('viewType', 'upcoming');\n\n //GET EVENT SUBJECT\n $organizer = Engine_Api::_()->core()->getSubject();\n if (empty($organizer)) {\n return $this->respondWithError('no_record');\n }\n $response = $organizer->toArray();\n\n $suffix = '';\n if (strpos($response['web_url'], \"http\") === false)\n $suffix = \"http://\";\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $response['facebook_url'] = 'https://facebook.com/' . $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $response['twitter_url'] = 'https://twitter.com/' . $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $response['web_url'] = $suffix . $response['web_url'];\n\n $contentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($organizer);\n $response = array_merge($response, $contentImages);\n $response['countOrganizedEvent'] = $organizer->countOrganizedEvent();\n $response['addedBy'] = $organizer->getOwner()->displayname;\n\n if (isset($getInfo) && !empty($getInfo)) {\n $getInfoArray['Added By'] = $response['addedBy'];\n $getInfoArray['Events Hosted '] = $organizer->countOrganizedEvent();\n\n $allowedInfo = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.hostinfo', array('body', 'sociallinks'));\n\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description']))\n $getInfoArray['Description'] = strip_tags($response['description']);\n }\n\n if (in_array('sociallinks', $allowedInfo)) {\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $getInfoArray['Facebook URL'] = $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $getInfoArray['Twitter URL'] = $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $getInfoArray['Web URL'] = $response['web_url'];\n }\n\n $ratingEnable = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.reviews', 2);\n if ($ratingEnable) {\n $tempRating = Engine_Api::_()->getDbtable('events', 'siteevent')->avgTotalRating(\n array('host_type' => $organizer->getType(), 'host_id' => $organizer->getIdentity(), 'more_than' => 0));\n\n // Added variable for rating to show rating bar\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['total_rating'] = $tempRating;\n } else {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['Total Rating'] = $tempRating;\n }\n }\n\n // Added variable for description to show full description\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description'])) {\n $getInfoArray['description'] = strip_tags($response['description']);\n if (isset($getInfoArray['Description']) && !empty($getInfoArray['Description']))\n unset($getInfoArray['Description']);\n }\n }\n }\n\n if (isset($getInfoArray) && !empty($getInfoArray))\n $this->respondWithSuccess($getInfoArray, true);\n }\n\n// //GET EVENTS PAGINATOR\n// $paginator = Engine_Api::_()->getDbTable('events', 'siteevent')->getSiteeventsPaginator($values, $customProfileFields);\n// $paginator->setItemCountPerPage($this->getRequestParam(\"limit\", 20));\n// $paginator->setCurrentPageNumber($this->getRequestParam(\"page\", 1));\n//\n// //SET VIEW\n// Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n// $response['canCreate'] = Engine_Api::_()->authorization()->isAllowed('siteevent_event', $viewer, 'create');\n// $response[\"getTotalItemCount\"] = $getTotalItemCount = $paginator->getTotalItemCount();\n//\n//\n// if (isset($showEvents) && !empty($showEvents) && empty($getInfo)) {\n// try {\n// $values['viewType'] = $viewtype;\n// $values['host_type'] = 'siteevent_organizer';\n// $values['host_id'] = $organizer->getIdentity();\n//\n//\n// if (!empty($getTotalItemCount)) {\n// foreach ($paginator as $eventObj) {\n// $event = $eventObj->toArray();\n//\n// // ADD OWNER IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj, true);\n// $event = array_merge($event, $getContentImages);\n// $event[\"owner_title\"] = $eventObj->getOwner()->getTitle();\n//\n// // ADD EVENT IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj);\n// $event = array_merge($event, $getContentImages);\n// $tempResponse[] = $event;\n// }\n// $response['events'] = $tempResponse;\n// }\n// } catch (Exception $e) {\n// \n// }\n// }\n\n\n if (isset($profileTabs) && !empty($profileTabs) && empty($getInfo)) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_info',\n 'label' => $this->translate('Info'),\n 'url' => 'advancedevents/organizer/' . $organizer->getIdentity(),\n 'urlParams' => array(\n 'getInfo' => 1\n )\n );\n\n if ($organizer->countOrganizedEvent() > 0) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_events',\n 'label' => $this->translate('Events'),\n 'url' => 'advancedevents/',\n 'totalItemCount' => $organizer->countOrganizedEvent(),\n 'urlParams' => array(\n 'host_type' => 'siteevent_organizer',\n 'host_id' => $organizer->getIdentity()\n )\n );\n }\n\n $response['profileTabs'] = $profileTabsArray;\n }\n $this->respondWithSuccess($response, true);\n }", "public function render()\n {\n $this->prepareVars();\n return $this->makePartial('calendar');\n }", "public function index()\n { $events = new Eventos();\n $eventos = $events->giveEvents();\n //return view('userEvents', compact(\"eventos\"));\n return view('userEvents')->with('eventos', $eventos);\n }", "public function display() {\n $actions = array();\n $html = '';\n if ( !$this->get_client_id() || !$this->get_client_secret() ) {\n $html .= $this->get_client_secret_form_view();\n } else {\n $this->oauth_access();\n\n if ( $this->is_connected() ) {\n $html .= $this->get_profile_details_view();\n\n $html .= $this->get_timezone_info_view();\n\n $html .= $this->get_options_form_view();\n\n $actions[] = 'logout';\n } else {\n $html .= $this->get_access_form_view();\n }\n\n $actions[] = 'delete-secret';\n }\n\n if ( !!$actions ) {\n $args = array(\n 'actions' => $actions,\n 'google_calendar' => $this,\n );\n\n $html .= $this->get_view( 'actions.php', $args );\n }\n\n echo $html;\n }", "public function index()\n {\n $events = Event::whereDate('date_end','>',date('Y-m-d H:i:s'))->where('public', '1')->orderBy('date_start')->limit(10)->get();\n return view('dashboard', compact('events'));\n }", "public function get_attendance() {\n\t\t$view_type = ($this->uri->segment(3) === NULL)? 'daily': $this->uri->segment(3);\n\n\t\t$data['view_header'] = $this->get_sched_header($view_type);\n\t\t$data['view_type'] = $view_type;\n\t\t$data['type'] = ($this->type === NULL)? 'active': $this->type;\n\n\t\t$result = $this->Member_Model->get_attendance($view_type);\n\t\t$data['members'] = $result;\n\n\t\t$this->breadcrumbs->set(['Members Attendance' => 'members/attendance']);\n\n\t\t$this->render('attendance', $data);\n\t}", "public function create()\n {\n return view('Backend.Calendar.create');\n }", "public function getEdit(){\t\n\n\t\t$rec = Calendar::find(Session::get('calendar_id'));\n\n\t\tif($rec){\n\t\t\treturn View::make('calendar.edit')\n\t\t\t\t\t\t->with('record', $rec);\n\t\t}\t\n\t\treturn Redirect::to('/');\n\t}", "function event_grid_view() {\n\tsp_calendar_grid();\n}", "public function index()\n {\n $this->data->setDate(date('d-M-y'));\n $this->callView();\n\n }", "public function index()\n {\n // GET ALL USERS INFO FOREACH EVENT\n $eventMeals = DB::table('users')\n ->join('meals', 'user_id', '=', 'users.id')\n ->join('events', 'meal_id', '=', 'meals.id')\n ->select('*')\n ->where('events.event_date', '>=', Carbon::today()->toDateString())\n ->where('users.id', '=', Auth::id())\n ->orderBy('events.event_date', 'desc')\n ->get();\n\n // GET ALL RESERVATIONS\n $reservations = DB::table('reservations')\n ->join('users', 'users.id', '=', 'reservations.user_id')\n ->join('events', 'events.id', '=', 'reservations.event_id')\n ->select('*', 'reservations.id AS reservation_id')\n ->get();\n\n return view('events.mijnevents')\n ->with('eventMeals', $eventMeals)\n ->with('reservations', $reservations)\n ->with('pagetitle', 'Mijn Apptite events');\n }", "function wfCalendarDisplay($paramstring, $params = array(), $parser)\n{\n global $wgRequest;\n global $wgTitle, $wgUser;\n global $wgRestrictCalendarTo, $wgCalendarDisableRedirects;\n global $wgCalendarForceNamespace, $wgCalendarDateFormat;\n\n wfCalendarRefresh();\n\n $parser->disableCache();\n $userMode = 'month';\n\n $calendar = new WikiCalendar();\n\n // set path\n $params['path'] = str_replace(\"\\\\\", \"/\", dirname(__FILE__));\n\n // normal calendar...\n $params['title'] = $wgTitle;\n $calendar->paramstring = $paramstring;\n $calendar->config($params);\n $title = $params['title']->getPrefixedText();\n $name = $params['name'];\n\n // if the calendar isn't in a namespace(s) specificed in $wgCalendarForceNamespace, return a warning\n // this can be a string or an array\n if (isset($wgCalendarForceNamespace))\n {\n $ns = $wgCalendarForceNamespace;\n if (!is_array($ns))\n $ns = array($ns);\n if (!in_array($calendar->namespace, $ns) && !isset($params[\"fullsubscribe\"]))\n return CalendarCommon::translate('invalid_namespace') . '<b>'.implode(', ', $ns).'</b>';\n }\n // finished special conditions\n\n $p = 'cal'.crc32(\"$title $name\");\n $v = $wgRequest->getVal($p);\n if ($v)\n {\n list($year, $month, $day, $mode) = explode('-', $v, 4);\n $calendar->setYear(0+$year);\n $calendar->setMonth(0+$month);\n $calendar->setDay(0+$day);\n if (wfCalendarIsValidMode($mode))\n {\n $userMode = $mode;\n }\n }\n else\n {\n // defaults from the <calendar /> parameters; must restart browser to enable\n if (isset($params['week']))\n $userMode = 'week';\n if (isset($params['year']))\n $userMode = 'year';\n }\n\n if (isset($params['useeventlist']))\n $userMode = 'events';\n if (isset($params['date']) && strtolower($params['date']) != 'off')\n $userMode = 'day';\n if (isset($params['simplemonth']))\n $userMode = 'simplemonth';\n\n if (($ical = $wgRequest->getText('ical')) &&\n ($title = Title::newFromText($ical, NS_FILE)) &&\n ($img = wfLocalFile($title)))\n {\n $calendar->load_iCal($img->getFullPath());\n // refresh the calendar's newly added events\n $calendar->invalidateCache = true;\n }\n\n $render = $calendar->renderCalendar($userMode);\n\n // purge main calendar before displaying the calendar\n if ($calendar->invalidateCache)\n {\n $article = new Article(Title::newFromText($title));\n $article->purge();\n header(\"Location: \" . $wikiRoot . $title);\n }\n\n return $render;\n}", "public function index()\n {\n if (auth()->user()->role_id == 0){\n return redirect()->route('client.my_dashboard');\n }\n $data = [\n 'toDos' => ToDo::where('created_by', Auth::id())->get(),\n 'calendar_events' => $this->calendarEvents(),\n 'appointments' => Appointment::orderBy('id', 'desc')->take(10)->get(),\n 'upcommingdate' => Cases::where(['status' => 'Open'])->where('hearing_date','>=', date('Y-m-d'))->orderBy('hearing_date', 'asc')->take(10)->get()\n ];\n return view('home')->with($data);\n\n }", "public function getAppointments(){\n\t\tif (Auth::user()->type==4) {\n\t\t\t# code...\n\t\t\treturn redirect()->back(); \n\t\t}\n\t\t$todays = $this->getTodayAppointments(); \n\t\treturn view('appointments.nurseAppointments',compact('todays'));\n\t}", "public function actionIndex()\n\t{\n// Service::booking(array());\n $data=Service::mainPage();\n $date=new DateTime();\n $year= $date->format('Y');\n $monthNumber= intval($date->format('m'));\n if(isset($_GET['month'])){\n $monthNumber= intval($_GET['month']);\n if($monthNumber>12) $monthNumber=12;\n if($monthNumber<1) $monthNumber=1;\n }\n $s = null;\n if(isset($_GET['s']))\n {\n $s = $_GET['s'];\n }\n $days=cal_days_in_month(CAL_GREGORIAN, $monthNumber, $year);\n $this->render('index',array('data'=>$data,'year'=>$year,'monthNumber'=>$monthNumber,'days'=>$days,'s'=>$s));\n\t}", "public function index()\n {\n $events = Events::where([\n ['event_date', '>', Carbon::now()->toDateString()],\n ['status', '=', 'PUBLISHED']\n ])\n ->latest()\n ->get();\n $items = menu('guest', '_json');\n $segment = 'Events';\n return view('pages.events', [\n 'events' => $events,\n 'items' => $items,\n 'segment' => $segment,\n ]);\n }", "public function actionIndex()\r\n {\r\n $events = Events::find()->all();\r\n\t\t$tasks = [];\r\n\t\tforeach ($events as $eve) {\r\n\t\t $event = new \\yii2fullcalendar\\models\\Event();\r\n\t\t $event->id = $eve->id;\r\n\t\t $event->title = $eve->title;\r\n\t\t $event->start = $eve->date_created;\r\n\t\t $tasks[] = $event;\t\t\r\n\t\t}\r\n\t\t\r\n return $this->render('index', [\r\n 'events' => $tasks,\r\n ]);\r\n }" ]
[ "0.767319", "0.74256873", "0.7383843", "0.7354142", "0.7311155", "0.72852856", "0.72561646", "0.7242718", "0.71803486", "0.7152835", "0.71456623", "0.7111431", "0.7097638", "0.70280796", "0.70278424", "0.7003563", "0.6972465", "0.69253826", "0.68868345", "0.687292", "0.68528724", "0.68315357", "0.6816005", "0.6775809", "0.6751115", "0.6746521", "0.67342144", "0.67240554", "0.6612591", "0.66068697", "0.65971756", "0.65966994", "0.6587373", "0.65701586", "0.6560698", "0.65480494", "0.65373254", "0.6536371", "0.65138024", "0.65138024", "0.6513592", "0.65076566", "0.65063167", "0.6504295", "0.65021145", "0.64837426", "0.6481536", "0.6480905", "0.6473704", "0.64629906", "0.64624095", "0.64533186", "0.64480895", "0.6437785", "0.6433592", "0.64237744", "0.6412591", "0.6406172", "0.6390398", "0.6352762", "0.6349173", "0.6347861", "0.63447815", "0.6340223", "0.6334429", "0.6329597", "0.6322994", "0.63220686", "0.63189346", "0.6282983", "0.6279264", "0.6277512", "0.62683225", "0.6257385", "0.6252909", "0.6248478", "0.62380385", "0.62335086", "0.6223198", "0.62046057", "0.6196687", "0.61949325", "0.6186388", "0.61807054", "0.6179702", "0.61793363", "0.6170068", "0.61655575", "0.6164094", "0.61636305", "0.6162749", "0.61591876", "0.61529326", "0.6143949", "0.6137586", "0.6134965", "0.6131176", "0.61301476", "0.6126052", "0.6120514" ]
0.74838424
1
Return a listing of the events based on the logged in user.
public function events() { if (!Sentry::check()) { // User is not logged in, or is not activated return Redirect::route('landing'); } else { // Gets all appointments from the school $user = Sentry::getUser(); // Check if user is superAdmin if ($user->hasAccess('school')) { $appointments = Appointment::get()->load('group.school')->toArray(); // Returns JSON response of the user return Response::json($appointments)->setCallback( Input::get('callback') ); //return View::make('calendar.events'); } else { // If user is not superAdmin, show groups based on the school of the logged in user $user->load('school.groups.appointments.group.school'); $appointments = []; // Loop through groups to get all appointments foreach ($user->school->groups as $group) { foreach ($group->appointments as $appointment) { array_push($appointments, $appointment); } } // Returns JSON response of the user return Response::json($appointments)->setCallback(Input::get('callback')); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showEvents(){\n return view('event.usereventlist', ['user' => auth()->user()]);\n }", "public function listEventsAction()\n {\n $events = $this->getDoctrine()->getRepository('AppBundle:Event')->findEventsByManager($this->getUser());\n\n return $this->render('AppBundle:frontend/manager:event_list.html.twig', [\n 'events' => $events,\n ]);\n }", "public function getUserEvents() {\n $user = Auth::user();\n $userEvents = $user->events()->get();\n $userEvents = $userEvents->concat(Event::where('leader_id', $user->id)->get());\n return Response(EventResource::collection($userEvents), 200);\n }", "public function index()\n\t\t {\n\t\t\t\t\t // if (! $user = JWTAuth::parseToken()->authenticate()) {\n\t\t\t\t\t\t// return response()->json(['msg' => 'User not found'], 404);\n\t\t\t\t\t // }\n\t\t\t$events = Event::all();\n\n\t\t\treturn $events;\n\n\t\t\t//return $this->sendResponse($events->toArray(), 'Events extraits avec succes.');\n\t\t}", "public function get_events($args = [])\n {\n global $db, $system;\n /* initialize arguments */\n $user_id = !isset($args['user_id']) ? null : $args['user_id'];\n $offset = !isset($args['offset']) ? 0 : $args['offset'];\n $get_all = !isset($args['get_all']) ? false : true;\n $suggested = !isset($args['suggested']) ? false : true;\n $random = !isset($args['random']) ? false : true;\n $managed = !isset($args['managed']) ? false : true;\n $filter = !isset($args['filter']) ? \"admin\" : $args['filter'];\n $results = !isset($args['results']) ? $system['max_results_even'] : $args['results'];\n /* initialize vars */\n $events = [];\n $offset *= $results;\n /* get suggested events */\n if ($suggested) {\n $where_statement = \"\";\n /* make a list from joined events */\n $events_ids = $this->get_events_ids();\n if ($events_ids) {\n $events_list = implode(',', $events_ids);\n $where_statement .= \"AND event_id NOT IN (\" . $events_list . \") \";\n }\n $sort_statement = ($random) ? \" ORDER BY RAND() \" : \" ORDER BY event_id DESC \";\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n $get_events = $db->query(\"SELECT * FROM `events` WHERE event_privacy != 'secret' \" . $where_statement . $sort_statement . $limit_statement) or _error(\"SQL_ERROR_THROWEN\");\n /* get the \"taget\" all events who admin */\n } elseif ($managed) {\n $get_events = $db->query(sprintf(\"SELECT * FROM `events` WHERE event_admin = %s ORDER BY event_id DESC\", secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n /* get the \"viewer\" events who (going|interested|invited|admin) */\n } elseif ($user_id == null) {\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n switch ($filter) {\n case 'going':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_going = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'interested':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_interested = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'invited':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_invited = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n default:\n $get_events = $db->query(sprintf(\"SELECT * FROM `events` WHERE event_admin = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n }\n /* get the \"target\" events */\n } else {\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_events FROM users WHERE user_id = %s\", secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_events'], $user_id)) {\n return $events;\n }\n /* if the viewer not the target exclude secret groups */\n $where_statement = ($this->_data['user_id'] == $user_id) ? \"\" : \"AND `events`.event_privacy != 'secret'\";\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE (events_members.is_going = '1' OR events_members.is_interested = '1') AND events_members.user_id = %s \" . $where_statement . \" ORDER BY event_id DESC \" . $limit_statement, secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n }\n if ($get_events->num_rows > 0) {\n while ($event = $get_events->fetch_assoc()) {\n $event['event_picture'] = get_picture($event['event_cover'], 'event');\n /* check if the viewer joined the event */\n $event['i_joined'] = $this->check_event_membership($this->_data['user_id'], $event['event_id']);;\n $events[] = $event;\n }\n }\n return $events;\n }", "public function getUserList(){\n\t\t$this->load->database();\n\t\t$eventlist = $this->db->query(\"SELECT * FROM user \");\n\t\treturn $eventlist;\n\t}", "public function indexAction() {\n\t\t$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\n\t\tif (!Engine_Api::_()->core()->hasSubject()) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t// Get subject and check auth\n\t\t$subject = Engine_Api::_()->core()->getSubject('event');\n\t\tif (!$subject->authorization()->isAllowed($viewer, 'view')) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\n\t\t// Prepare data\n\t\t$this->view->event = $event = $subject;\n\t\t$limit =$this->_getParam('max',5);\n\t\t$currentDay = date('Y') . '-' . date('m') . '-' . date('d');\n\t\t\n\t\t$table = Engine_Api::_()->getItemTable('event');\n\t\t$select = $table->select()\n ->where('category_id = ?', $event->category_id)\n ->where('event_id != ?', $event->getIdentity())\n ->order(\"DATEDIFF('{$currentDay}', starttime) DESC\")\n ->limit($limit);\n\n\t\t$showedEvents = $table->fetchAll($select);\n\t\t$this->view->showedEvents = $showedEvents;\n\t\t// Hide if nothing to show\n\t\tif( count($showedEvents) <= 0 ) {\n\t return $this->setNoRender();\n\t }\n }", "public function listAction(Request $request)\n {\n $user = $this->getUser();\n\n $entityManager = $this->getDoctrine()->getManager();\n $eventsQuery = $entityManager\n ->getRepository('AppBundle:Event')\n ->getUserEventsQuery($user, $request->query->all());\n\n $paginator = $this->get('knp_paginator');\n\n $pagination = $paginator->paginate(\n $eventsQuery,\n $request->query->getInt('page', 1)\n );\n\n $view = $this->view([\n 'events' => $pagination->getItems(),\n 'total' => $pagination->getTotalItemCount()\n ]);\n\n return $this->handleView($view);\n }", "public function eventsList()\n {\n $alumniId = session('alumni_id');\n $alumni = AlumniBasicInfo::find($alumniId);\n $events = Event::where('dept_info_id',$alumni->dept_info_id)->latest()->paginate(3);\n return view('frontend.events.events-list',compact('events'));\n }", "public function getEventList() {\n $response = $this->client->get(\n $this->apiUrl . \"events\");\n return $response->json();\n }", "public function getEvents()\n {\n $startDate = new \\DateTime(\"-1 months\");\n $endDate = new \\DateTime(\"+3 months\");\n\n $repo = EntityUtils::getRepository(\"EventLegacy\");\n\n //Use a different function for getting events for a student\n if ($this->user_context->isStudent()) {\n return $this->getStudentEvents($startDate, $endDate);\n }\n\n $eventResults = $repo->getStudentEventsByProgram($this->user_context->program->id, $startDate, $endDate, $this->filters);\n $quickAddResults = $repo->getStudentQuickAddShiftsByProgram($this->user_context->program->id, $startDate, $endDate, $this->filters);\n\n return ['events' => $eventResults, 'quick_add_shifts' => $quickAddResults];\n }", "public function getAllEvents(){\n\t\t//$events = EventPage::get()->sort('Date', 'DESC')->limit(5);\n\t\t$limit = 10;\n\n\t\t$items = DataObject::get(\"EventPage\", \"Date > NOW()\", \"Date\", null, $limit);\n\t\treturn $items;\n\n\t}", "public static function list_events()\n\t{\n\t\treturn cms_orm('CmsDatabaseEvent')->find_all(array('order' => 'module_name, event_name'));\n\t}", "public function index()\n {\n $events = Evenement::orderBy('created_at', 'desc')->paginate(10);\n return view('user.events.index')->with(compact('events' ) );\n }", "public function index()\n {\n\n $sidebar_items = array(\n \"List Events\" => array('url' => URL::route('event.index'), 'icon' => '<i class=\"fa fa-users\"></i>'),\n );\n $FillableDropdown = new FillableDropdown();\n $active = $FillableDropdown->active($default = 2);\n $accessibility = $FillableDropdown->accessibility($default = 2);\n $operations = $FillableDropdown->eventOperations($default = 2);\n\n $authentication = \\App::make('authenticator');\n $user = $authentication->getLoggedUser();\n\n if (isset($user)) {\n\n $user_id = $user->id;\n }\n\n if (isset($user_id)) {\n\n $users = User::findOrFail($user_id);\n }\n $events = Events::orderBy('name', 'asc')->paginate(20);\n\n return view('events.event_listing_page', compact('events', 'users', 'active', 'accessibility', 'operations', 'sidebar_items'));\n\n }", "public function action_index()\r\n\t{\r\n\t\tif ( ! Auth::instance()->logged_in())\r\n\t\t\tNotices::info('event.enroll.login');\r\n\t\t\r\n\t\t$filter = Arr::get($this->request->query(), 'filter', 'current');\r\n\t\t$id = Arr::get($this->request->query(), 'id', FALSE);\r\n\t\t\t\r\n\t\tif ($filter == 'mine' AND ! Auth::instance()->logged_in())\r\n\t\t{\r\n\t\t\tSession::instance()->set('follow_login', $this->request->url());\r\n\t\t\t$this->request->redirect(Route::url('user', array('action' => 'login')));\r\n\t\t}\r\n\t\t\r\n\t\tif (Auth::instance()->logged_in() AND $this->user->characters->where('visibility', '=', 1)->count_all() == 0)\r\n\t\t{\r\n\t\t\tNotices::info('event.enroll.need_character');\r\n\t\t}\r\n\t\t\r\n\t\t// Pass events to the view class\r\n\t\t$this->view->event_data = Model_Event::filtered_list($filter, $this->user, $id);\r\n\t\t$this->view->filter_message = Kohana::message('gw', 'filter.'.$filter);\r\n\t\t$this->view->filter = $filter;\r\n\t}", "public function getEvents(){\n\t\t// prepares the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/event\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\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 reponse of the API\n\t\t$events = json_decode($output, true);\n\n\t\t// format the date\n\t\tforeach ($events as $key => $event) {\n\t\t\t$events[$key]['date'] = explode('T', $event['date'])[0];\n\t\t}\n\n\t\t// if the user is not connected or if he is a student, remove events which are not public\n\t\tif (!isset($_SESSION['status']) || $_SESSION['status'] == 'student'){\n\t\t\t$publicEvents = [];\n\t\t\t$eventNumber = sizeof($events);\n\t\t\tfor($i=0 ; $i < $eventNumber; $i++){\n\t\t\t\t$event = array_shift($events);\n\t\t\t\tif($event['is_public'] == 1){\n\t\t\t\t\tarray_push($publicEvents, $event);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $publicEvents;\n\t\t}\n\n\t\t// return all events\n\t\treturn $events;\n\t}", "public function eventsAction()\n {\n $events = $this->manager->getRepository('Event\\Doctrine\\Orm\\Event')->findBy(array(), array('date' => 'ASC'));\n\n return $this->renderView('events', array(\n 'title' => 'Zusammenfassung der Grillveranstaltungen',\n 'events' => $events,\n 'meals' => $this->createMealsList($events),\n ));\n }", "public function show()\r\n {\r\n $events = DB::table('app_event')\r\n ->orderBy('id', 'desc')\r\n ->paginate(10)->toJson();\r\n\r\n return $events;\r\n }", "public function listar()\n {\n \t//valida se User tem Autorização\n \t$this->authorize('evento_list');\n \t\n \t$title\t\t\t= 'Inscrições de Eventos';\n \t$eventos\t\t= $this->Evento->select('id', 'Nome', 'Inicio', 'Quantidade_Vagas')\n \t\t\t\t\t\t\t\t\t->where('Igrejas_idIgrejas', auth()->user()->Igrejas_idIgrejas)\n\t\t\t\t\t\t\t\t \t->whereDate('Final', '>=', Carbon::now()->format('Y-m-d'))\n\t\t\t\t\t\t\t\t \t->paginate($this->TotalPagina);\n \t\n \treturn view('site.evento.listar', compact('title', 'eventos'));\n }", "public function All() {\n if($user = Utils::GetUser()) {\n $this->Context->Model = $user->Events;\n }\n else {\n Message::SetMessage('Please, login or sign up');\n Utils::Redirect('/Home/Index');\n }\n }", "public static function getUserEventList($event_type,$id)\n\t{\n\t\t// Page My Event is Own Event\n\t\t\n\t\t$limit = 100;\n\t\t$page = 1;\n\t\t\n\t\tif($page==\"\") $page = 1;\n\t\t\n\t\t$date_now = date(\"Y-m-d\");\n\t\t$result = CommonFunction::resultPaging(\n\t\t\t\t\t\t$page, $limit, EventModel::where('userId', '=', $id)->count(),\n\t\t\t\t\t\tEventModel::where(\"status\",\"=\",$event_type)->\n\t\t\t\t\t\twhere(\"endDate\",\">=\",$date_now)->where('userId', '=', $id)->take($limit)->skip(($page-1)*$limit)->get(array('id', 'name','description', 'avenueName','avanueAddress','latitude','longitude','coverImage','facebook','twitter','line','website','host','categoryId','status','private','share','userId','startDate','endDate','time','startTime','endTime'))\n\t\t\t\t\t);\n\n\n\t\treturn $result;\n\n\t}", "public function getindex()\n\t{\n\t\t$id = Sentry::getUser()->id;\n\t\tif(!$id)\n\t\t{\n\t\t\techo \"please login first\";\n\n\t\t}\n\t\telse\n\t\t{\n\t\t$events = Calender::all(); \n\t\t\n\t\treturn View::make('event.index')->with('events',$events);\n\t}\n\t}", "public function viewAllEvents();", "public function index()\n {\n $user = auth()->user();\n\n $userUpcomingEvents = $user->interestedEvents()->current()->orderBy('start_datetime')->get();\n\n return view('auth.residents.events.index', compact('events', 'userUpcomingEvents'));\n }", "public function getEvents(){\n\t\t$events = Event::where('owner', Auth::user()->id)->where('deleted', 0)->get();\n\t\treturn response()->json(['data' => $events]);\n\t}", "public function index()\n {\n return view(\"admin.event\")->with([\n \"events\" => Event::query()->orderBy(\"created_at\", \"desc\")->paginate()\n ]);\n }", "public function user_event() {\n $this->loadModel('Image');\n $id = $this->Auth->user('id');\n $this->layout = 'front_end';\n $allImage = $this->Image->getAllimage($id);\n $this->set('image', $allImage);\n $data = $this->User->userData($id);\n $this->set('user', $data);\n $this->loadModel('Event');\n $event = $this->Event->eventList();\n $this->set('events', $event);\n $this->render('/Users/user_event');\n }", "function geteventlist(){\r\n\t\t\t$res=$this->auth_chk();\r\n\t\t\tif(isset($res[\"trust\"])){\r\n\t\t\t\t$data =$this->model->get_event_list($this->post());\r\n\t\t\t\techo json_encode($data);\r\n\t\t\t}else{\r\n\t\t\t\techo json_encode(array(\"status\" => array(\"code\" => 1,'success'=>false,'msg'=>'User have no permission')));\t\r\n\t\t\t}\t\t\r\n\t\t}", "public function index()\n {\n //$calendar_events = CalendarEvent::all(); //Too Many?\n $calendar_events = CalendarEvent::where('user_id', '!=', '1')->whereBetween(\n 'start', [Carbon::today(), Carbon::today()->addMonths(3)])->get();\n $today = Carbon::today()->toDateString();\n $calendar_events_sorted = CalendarEvent::whereDate('start', '=', $today)\n ->get()->sortby('start');\n\n $calendar = $this->prepCalendar($calendar_events);\n\n $admins = Admin::all()->pluck('name', 'id');\n\n \\JavaScript::put(['admin' => Auth::guard('admin')->check()]);\n\n return view('calendar_events.index', compact('calendar_events', 'calendar_events_sorted', 'calendar', 'admins'));\n }", "public function getUserEvents() {\n\t\tif(!$data = $this->getNikePlusFile('http://nikerunning.nike.com/nikeplus/v2/services/userevent/get_user_events.jsp?_plus=true')) {\n\t\t\tthrow new Exception($this->feedErrorMessage);\n\t\t}\n\t\treturn $data;\n\t}", "public function getEvents()\n {\n $main_actions = [\n 'event' => \\adminer\\lang('Create event'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n \\adminer\\lang('Schedule'),\n \\adminer\\lang('Start'),\n // \\adminer\\lang('End'),\n ];\n\n // From db.inc.php\n $events = \\adminer\\support(\"event\") ? \\adminer\\get_rows(\"SHOW EVENTS\") : [];\n $details = [];\n foreach($events as $event)\n {\n $detail = [\n 'name' => \\adminer\\h($event[\"Name\"]),\n ];\n if(($event[\"Execute at\"]))\n {\n $detail['schedule'] = \\adminer\\lang('At given time');\n $detail['start'] = $event[\"Execute at\"];\n // $detail['end'] = '';\n }\n else\n {\n $detail['schedule'] = \\adminer\\lang('Every') . \" \" .\n $event[\"Interval value\"] . \" \" . $event[\"Interval field\"];\n $detail['start'] = $event[\"Starts\"];\n // $detail['end'] = '';\n }\n $details[] = $detail;\n }\n\n return \\compact('main_actions', 'headers', 'details');\n }", "public function index()\n { $eventuser=[];\n $events=Event::all()->sortBy('startDate');\n foreach($events as $event){\n $eventuser[]= ['user'=> $event->user,'event'=>$event ];\n \n }\n return ['data' => $eventuser];\n }", "public function actionEventAccess()\n\t{\n\t\t//$m = new User; for debugging\n\t\t//$m->searchForAdding(); for debugging\n\t\t$model=new Userevent('search');\n\t\t$model->unsetAttributes(); // clear any default values\n\t\t\n\t\t// Select the users based on the currently selected event\n\t\t$model->eventid=User::getUserSelectedEvent();\n\n\t\t// if there are no events, navigate back to splash screen\t\t\n\t\t$sqlcheck = \"select count(id) from event where id=:eventcheck\";\n\t\t$paramcheck = array(':eventcheck'=>$model->eventid);\n\t\t$checkifexist = Event::model()->countBySql($sqlcheck , $paramcheck );\t\n\n\t\tif($checkifexist==0)\n\t\t{\n\t\t\t$this->redirect('splash');\n\t\t}\n\t\telse\n\t\t$this->render('eventaccess',array('model'=>$model));\n\t}", "public function index()\n {\n $events = Event::latest()->paginate(10);\n return view('event.events', compact('events'));\n }", "public function getEvents();", "public function getEvents();", "public function getUserevents()\n {\n return $this->hasMany(Userevent::className(), ['user_id' => 'id']);\n }", "public function myEventsAction(Request $request)\n {\n $em = $this->getDoctrine()->getManager();\n $user = $em->getRepository('FlowerModelBundle:User\\User')->findOneBy(array('username' => $request->get(\"user_username\")));\n\n $today = new \\DateTime();\n $nextDays = clone($today);\n $nextDays->modify('+6 days');\n\n $events = $em->getRepository('FlowerModelBundle:Planner\\Event')->findByStartDate($user, $today, $nextDays, 50, 0);\n\n return array(\n \"events\" => $events,\n );\n }", "public function index()\n {\n $events = \\App\\Models\\Event::all();\n return view('admins.events', ['events' => $events]);\n }", "public function index() {\n if (Auth::user()->profile != 'admin') {\n abort(403);\n } else {\n return view('setting.event', [\n 'count' => \\App\\Event::count(),\n 'events' => \\App\\Event::simplePaginate(10),\n ]);\n }\n }", "public function index()\n {\n $events = Events::where([\n ['event_date', '>', Carbon::now()->toDateString()],\n ['status', '=', 'PUBLISHED']\n ])\n ->latest()\n ->get();\n $items = menu('guest', '_json');\n $segment = 'Events';\n return view('pages.events', [\n 'events' => $events,\n 'items' => $items,\n 'segment' => $segment,\n ]);\n }", "public function userEvents(Request $request)\n {\n $user = $request->user();\n $events = $this->eventRepo->events($user->id);\n return Response::success(['events' => new UserEventsCollection($events), 'user' => new UserResource($user)]);\n }", "function event_list(){\n\tglobal $DB;\n\t$currenttime = time();\n\t$query = \"SELECT * FROM {event} WHERE eventtype='site' ORDER By id DESC\";\n $result = $DB->get_records_sql($query);\n\treturn $result;\n}", "public function index()\n {\n return Event::all();\n }", "public function events()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC'),\n 'condition' => array('type' => 'Event')\n ));\n \n $this->set('events', $eventdata);\n \n $this->assignUserToView($this->Auth->user('id'));\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Info');\n }", "function loadEvents() {\n $events = Event::orderBy('date', 'desc')->paginate(10);\n \n return view('cms.events', ['events' => $events]);\n }", "public function index()\n\t{\n // set a value in the session\n $query = CalendarEvent::with('user');\n\n // if(Input::has('search')){\n // \t$search = Input::get('search');\n // \t$query->where('title', 'like', '%' . $search . '%');\n // \t$query->orWhere('title', 'like', '%' . $search);\n // \t$query->orWhere('title', 'like', $search . '%');\n \t\n // \t$query->orWhereHas('users', function($q){\n // \t\t$search = Input::get('search');\n // \t\t$q->where('band_name', $search);\n // \t});\n // \t$query->orWhereHas('users', function($q){\n // \t\t$search = Input::get('search');\n // \t\t$q->where('genre', $search);\n // \t});\n // }\n \n\n $events = $query->get();\n\n\n\t\t\n return View::make('events.index')->with(array('events' => $events));\n\t}", "public function actionIndex()\n\t{\n\t\t$selectedEvent=User::getUserSelectedEvent();\n\t\tif ($selectedEvent!=NULL)\n\t\t{\n\t\t\t// If the user has a selected event, retrieve that event\n\t\t\t$model=Event::model()->findByPk($selectedEvent);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// If the user does not have a selected event, choose the first event available\n\t\t\t$model=Event::model()->find();\n\t\t\t$user=User::model()->find('LOWER(username)=?',array(Yii::app()->user->name));\n\t\t\t$user->selectedevent=$model->id;\n\t\t\t$user->save();\n\t\t}\n\n\t\t// if there are no events, navigate back to splash screen\n\t\tif(is_null($model) || !isset($model))\n\t\t{\n\t\t\t$this->redirect('splash');\n\t\t}\n\t\telse\n\t\t$this->render('index',array('model'=>$model));\n\t}", "public function index()\n {\n $listing=Event::all();\n return view('events.list', compact('listing'));\n }", "public function listAction()\r\n\t{\r\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\r\n\t\t$this -> view -> business = $business = Engine_Api::_() -> core() -> getSubject();\r\n\t\t$this -> view -> form = $form = new Ynbusinesspages_Form_Event_Search;\r\n\t\t$val = $this -> _getAllParams();\r\n\t\t// Populate form data\r\n\t\tif (!$form -> isValid($val))\r\n\t\t{\r\n\t\t\t$form -> populate($defaultValues);\r\n\t\t\t$this -> view -> formValues = $values = array();\r\n\t\t\t$this -> view -> message = \"The search value is not valid !\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$values = $form -> getValues();\r\n\t\t$values['business_id'] = $business -> getIdentity();\r\n\t\t// Prepare data\r\n\t\t$this -> view -> formValues = $values = array_merge($values, $_GET);\r\n\t\t\r\n\t\t// Check create event authorization\r\n\t\t$this -> view -> canCreate = $business -> isAllowed('event_create');\r\n\t\t//Get data\r\n\t\t$this -> view -> paginator = $paginator = Engine_Api::_()->getDbTable('mappings', 'ynbusinesspages') -> getEventsPaginator($values);\r\n\t\t$paginator -> setCurrentPageNumber($this -> _getParam('page'));\r\n\t}", "public function index(){\n\t\t$user = self::model('user');;\n\n\t\tif(!$user->isLoggedIn()){\n\t\t\t\n\t\t\tSession::flash('login_redirect', 'Please Login first!');\n \t\t\tRedirect::to('login');\n\t\t}\n\t\t// data related to user\n\t\t$data['userData'] = $user->data()->fetch_array();\n\n\t\t$event = self::model('event');\n\n\t\tif($event->findByUser($data['userData']['user_ID'])){\n\t\t\t$data['eventData'] = $event->data()->fetch_all();\n\t\t}\n\n\n\t\tself::view('dashboard/index', $data);\n\t}", "public function get_all_events()\n {\n // get today date for check past events or not\n $todayData = date(\"m/d/Y\");\n // get option from database\n $past_events_option = get_option('past_events');\n // preparing sql query\n $sql = \"SELECT * FROM $this->tableName \";\n if ($past_events_option != 'yes') {\n $sql .= \"WHERE `date` >= \" . $todayData;\n }\n global $wpdb;\n $allevents = $wpdb->get_results($sql);\n return $allevents;\n }", "public function index()\n { $events = new Eventos();\n $eventos = $events->giveEvents();\n //return view('userEvents', compact(\"eventos\"));\n return view('userEvents')->with('eventos', $eventos);\n }", "public function actionIndex()\r\n\t{\r\n\t\t$account_id = Yii::app()->user->id;\r\n\r\n\t\tif($account_id != null)\r\n\t\t{\r\n\t\t\t$events = Event::model()->findAll(\"status_id = 1\");\r\n\t\t\t\t\r\n\t\t\t$eventsDP = new CArrayDataProvider($events, array(\r\n\t\t\t\t\t'pagination' => array(\r\n\t\t\t\t\t\t'pageSize' => 10,\r\n\t\t\t\t\t)\r\n\t\t\t));\r\n\r\n\t\t\t$this->render('index',array(\r\n\t\t\t\t'eventsDP'=>$eventsDP,\r\n\t\t\t\t'events'=>$events,\r\n\t\t\t));\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->redirect(array('site/login'));\r\n\r\n\t}", "public function index()\n {\n $events = Event::latest()->paginate(5);\n return view('events',compact('events'));\n }", "public function getEvents()\n {\n //\n\n return Event::all();\n }", "public function index()\n {\n $results = Event::with('participants')->orderBy('start_date')->paginate(10);\n return view('adm.events.index')->with(compact('results'));\n }", "public function index()\n {\n $events = Event::with('Teams', 'Teams.Members', 'Teams.Members.User', 'Teams.Members.User.Occupation', 'Teams.Members.Role', 'Teams.Category')->where([\n ['to', '>', Carbon::now()->format('Y-m-d H:m:s')],\n ['visibility', '!=', 'draft'],\n ])->get();\n $pastEvents = Event::with('Teams', 'Teams.Members', 'Teams.Category')->where([\n ['to', '<', Carbon::now()->format('Y-m-d H:m:s')],\n ['visibility', '!=', 'draft'],\n ])->get();\n\n return view('layouts.events', ['events' => $events, 'pastEvents' => $pastEvents]);\n }", "public function getEvents()\n {\n\n $cached = $this->getFromCache('events_cache');\n if ($cached !== null) {\n return $cached;\n }\n\n // Fetch past and future events (only upcoming contains the current event)\n $events = $this->client->getEvents(\n array(\n 'group_urlname' => $this->group,\n 'status' => 'past,upcoming',\n 'desc' => 'desc'\n )\n );\n\n // Filter out events further in the future than a day\n $dayFromNow = (time() + (24 * 60 * 60)) * 1000;\n $events = $events->filter(function($value) use ($dayFromNow) {\n return ($value['time'] < $dayFromNow)? true : false;\n });\n\n $this->saveInCache('events_cache', $events);\n\n return $events;\n }", "public function events()\n {\n //search query\n $query = Input::get('query');\n\n if ($query == 'latest')\n {\n $exhibitions = Exhibition::orderBy('date_event', 'desc')->paginate(5);\n }\n elseif ($query == 'oldest')\n {\n $exhibitions = Exhibition::orderBy('date_event', 'asc')->paginate(5);\n }\n else\n {\n $exhibitions = Exhibition::orderBy('date_event', 'desc')->paginate(5);\n }\n return View::make('/events', ['exhibitions' => $exhibitions]);\n }", "public function index()\n {\n\n $event = Event::all();\n\n return $event;\n }", "public function index()\n { \n \t//Se a pessoa for admin ou alguma perfil de organizador ela pode ver os eventos dela gerenciável\n \t/*if(Auth::user()->hasRole('admin')){\n \t\treturn view('event.index'); \n \t}\n \telse{\n \t\treturn view('feed.index'); \n \t}*/\n\n return view('event.index');\n\n }", "public function index()\n {\n $events = $this->eventRepository->all();\n return view('admin.event.index',compact('events'));\n }", "public function getUserEvents(Request $request)\n {\n $access_token = $request->get('access_token');\n $url = '/me/events?fields=id,name,description,start_time,end_time,place,cover';\n $fb = new \\Facebook\\Facebook(['app_id' => '1379982378719884',\n\t\t 'app_secret' => '6de34ab5bb6310b76e57cb18d677643b',\n\t\t 'default_graph_version' => 'v2.8',\n\t\t]);\n\t\t$response = $fb->get($url, $access_token);\n\n\t\t$arrayResult = $response->getDecodedBody();\n\t\t//$arrayResult = json_decode($response->getBody(), true);\n\n\t\t$i = 0;\n\t\tforeach ($arrayResult['data'] as $event) {\n\t\t\t$event_exists = Event::where('facebook_event_id', '=', $event['id'])->first();\n\t\t\tif (is_null($event_exists)) {\n\t\t\t\t$events[$i] = $event;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\t\t\n\t\treturn response()->json(['data'=>$events]);\t\t\n }", "public function index($user_id) \n {\n if (Controller::verifyUser($user_id) == false) {\n return redirect('/');\n }\n\n $get_events_query = \"SELECT * FROM events WHERE user_id = '\" . $user_id . \"'\";\n $users_events = \\DB::select($get_events_query);\n\n $get_user_query = \"SELECT * FROM users WHERE id = '\" . $user_id . \"'\";\n $user = \\DB::select($get_user_query)[0];\n\n\n return view(\"event.index\", ['users_events' => $users_events, 'user' => $user]);\n\n }", "public function index()\n {\n if (! Gate::allows('event_access')) {\n return abort(401);\n }\n\n $events = Event::all();\n // foreach($events as $event){\n // dd($event->subcategories);\n // }\n\n return view('admin.events.index', compact('events'));\n }", "public function index()\n {\n\n $user = Auth()->user()->id;\n\n if ( Doorman::where('user_id',$user)->first() ) {\n\n $now = new DateTime();\n $date = $now->format('Y-m-d');\n\n $future_events = Event::where('doorman',$user)->where('Date','>',$date)->orderBy('Date','ASC')->get();\n $today_events = Event::where('doorman',$user)->where('Date','=',$date)->orderBy('Date','ASC')->get();\n $past_events = Event::where('doorman',$user)->where('Date','<',$date)->orderBy('Date','ASC')->get();\n\n return view('doorman.index',compact('future_events','today_events', 'past_events'));\n\n } else {\n\n return back()->with('error','Not authorized');\n }\n\n }", "public function indexAction() {\n $this->view->events = $this->_events->getEventsAdmin($this->_getParam('page'));\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n $events = Event::all();\n return view('events::list_events',compact('events'));\n\n }", "public function index()\n {\n $eventList = Event::all();\n return view('backEnd.events.events',compact('eventList'));\n }", "public function index()\n {\n return Events::orderBy('created_at','DESC')->get();\n }", "public function all()\n {\n $model = new Event();\n $events = $model->readAll();\n return ['events'=>$events];\n }", "public function index()\n {\n Session::put('admin_page', 'event');\n $events = Event::all();\n return view('backend.events.index', compact('events'));\n }", "public function index()\n {\n $eventStarters = EventStarter::with(['user'])->latest('created_at')->paginate(5);\n return view('pages.event-starters.list', compact('eventStarters'));\n }", "public function index()\n\t{\n\t\t$events = Event::orderBy('id', 'desc')->paginate(10);\n\n\t\treturn view('events.index', compact('events'));\n\t}", "public function viewEventsByAdmin() {\n\n $events = EventDCI::with(\n array(\n 'services' =>\n function($query) {\n $query ->whereNull('event_service.deleted_at')\n ->orderBy('start_service');\n }\n )\n )\n ->whereHas('services',\n function($query) {\n $query ->whereNull('event_service.deleted_at')\n ->whereRaw('(`dci_status` = ? OR `dci_status` = ?)',\n array('Pendiente', 'En Proceso')\n );\n }\n )\n ->whereRaw('(`events`.`dci_status` = ? OR `events`.`dci_status` = ?)',\n array('Pendiente', 'En Proceso')\n )\n ->get();\n\n foreach ($events as $event) {\n $event['resources_sources'] = $event->resources_sources()->wherePivot('deleted_at', '=', NULL)->get();\n $event['witnesses'] = $event->witnesses()->wherePivot('deleted_at', '=', NULL)->get();\n $event['support_materials'] = $event->support_materials()->get();\n $event['pdi_programs'] = $event->pdi_programs()->wherePivot('deleted_at', '=', NULL)->get();\n\n foreach ($event['services'] as $service) {\n $service['tasks'] = $service\n ->pivot\n ->tasks()\n ->where('user_id', '=', Auth::user()->id)\n ->where('status', '=', 'Pendiente')\n ->get();\n }\n }\n\n return $events;\n\n }", "public function index()\n {\n Event::all();\n }", "public function index()\n {\n $events = Event::get();\n return response()->view('admin.events.index', ['events' => $events ]);\n }", "function get_events_user( $options=array() ){\n\t\tglobal $gamo, $dbh;\n\t\t\n\t\t$error_append = \" CLASS[\".__CLASS__.\"] METHOD[\".__METHOD__.\"] DATE[\".date('Y-m-d H:i:s').\"]\";\n\t\t\n\t\tif( empty( $options['user_id'] ) ){\n\t\t\t$error = Core::error($this->errors, 1);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\t\n\t\tCore::ensure_defaults(array(\n\t\t\t\t'start' => 0,\n\t\t\t\t'number' => 1\n\t\t\t),\n\t\t$options);\n\t\t\n\t\t$action_types_rsvp = Core::r('actions')->action_types_id(array(\n\t\t\t\t'action_key' => 'rsvp_fevent'\n\t\t\t)\n\t\t);\n\t\t\n\t\t$action_types_attend = Core::r('actions')->action_types_id(array(\n\t\t\t\t'action_key' => 'attend_fevent'\n\t\t)\n\t\t);\n\n\t\tif( Core::has_error($action_types_rsvp) or empty($action_types_rsvp) ){\n\t\t\t$error = Core::error($this->errors, 5);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\t\n\t\tif( Core::has_error($action_types_attend) or empty($action_types_attend) ){\n\t\t\t$error = Core::error($this->errors, 5);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\t\n\t\t\n\t\t//error_log(print_r($action_type,true));\n\t\t//error_log(print_r($action_types,true));\n\t\t//error_log(print_r($options['user_id'],true));\n\t\t\n\t\t$sql = \t\"SELECT\n\t\t\tve.id as id,\n\t\t\tdate_time as date,\n\t\t\ttitle as name,\n\t\t\t(\n\t\t\t\tSELECT\n\t\t\t\tint_info\n\t\t\t\tFROM \" . CORE_DB . \".virtual_events_info AS a\n\t\t\t\tWHERE a.event_id = ve.id\n\t\t\t\tAND a.info_type = 'launched'\n\t\t\t) AS launched,\n\t\t\tal.point_value_use+COALESCE( (\n\t\t\t\tSELECT\n\t\t\t\t\tal2.point_value_use\n\t\t\t\tFROM \".CORE_DB.\".actions_log as al2\n\t\t\t\tWHERE \n\t\t\t\t\tal2.user_id = \".$options['user_id'].\"\n\t\t\t\t\tAND al2.action_types_id = \".$action_types_attend.\"\n\t\t\t\t\tAND al2.int_other = ve.id\n\t\t\t\t\tAND al2.active = 1\n\t\t\t),0 ) as points\n\t\t\tFROM \".CORE_DB.\".\".self::$table_name.\" as ve \".\n\t\t\t\"INNER JOIN \".CORE_DB.\".actions_log as al on ve.id=al.int_other \".\n\t\t\t\"WHERE al.action_types_id = \".$action_types_rsvp.\" AND \".\n\t\t\t\"user_id = :user_id AND al.active = 1 AND al.point_value_use IS NOT NULL AND al.point_value_use > 0 ORDER BY date_time ASC LIMIT \".$options['start'].\",\".$options['number'];\n\t\t\n\t\t//error_log($sql);\n\t\t//,\".$action_types_attend.\")\n\t\t\n\t\t$stm = $dbh->prepare($sql);\n\t\tif( empty($stm) ){\n\t\t\t$error = Core::error($this->errors, 2);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\n\t\t$sres = $stm->execute( array(\n\t\t\t\t':user_id' => $options['user_id']\n\t\t) );\n\t\tif( empty($sres) ){\n\t\t\t$error = Core::error($this->errors, 3);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\n\t\t$id = $stm->fetchAll(PDO::FETCH_ASSOC);\n\t\t\n\t\tif( !empty( $id ) ){\n\t\t\n\t\t\treturn $id;\n\t\t\n\t\t}else{\n\t\t\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\t\n\t}", "public function index()\n\t{\n $events = $this->events->paginate(10);\n $no = $events->getFrom();\n return $this->view('events.index', compact('events', 'no'));\n\t}", "public function index()\n {\n $events = Event::all();\n return view('event.list',['events'=>$events]);\n }", "public function index()\n {\n $events = User_Event::all();\n return $this->sendResponse($events->toArray(), 'Partecipations retrieved successfully.');\n }", "public function index()\n {\n // $adminevent = Event::all();\n // return view('admin.adminevent.list')->with('adminevent', $adminevent);\n return view('admin/adminevent/list', ['adminevent' => Event::orderBy('start')->get()]);\n }", "public function listEvent($userId){\n\t\t$this->db->select('name, id, CAST(status AS UNSIGNED) AS status');\n\t\t$this->db->from('event');\n\t\t$this->db->where('userId',$userId);\n\t\t$this->db->order_by('creationDate', 'DESC'); \n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function index()\n {\n return $this->eventsToArray(Event::all());\n }", "public function eventsByUserName(Request $request)\n {\n $name = $request->input('searchNameValue');\n $uCname = ucwords($name);\n $nameSplit = preg_split('/\\s+/', $uCname);\n $firstname = $nameSplit[0];\n $lastname = end($nameSplit);\n\n $results = collect();\n\n $users = User::where('name', '=', \"$uCname\")\n ->orWhere('name', 'like', \"$firstname%\")\n ->orWhere('name', 'like', \"%$lastname%\")\n ->orWhere('email', '=', mb_strtolower($name))\n ->get();\n\n foreach ($users as $user) {\n $results = $results->merge($user->events()->get()->sortBy('start'));\n }\n\n $calendar_events = $calendar_events_sorted = $this->paginate(\n $results, 10, null,\n ['path' => route('calendar_events.events.userName', ['searchNameValue' => $name])]);\n\n $calendar = $this->prepCalendar($calendar_events);\n\n $admins = Admin::all()->pluck('name', 'id');\n\n return view('calendar_events.index', compact('calendar_events', 'calendar_events_sorted', 'calendar', 'admins'));\n }", "public function index()\n {\n $filters = request()->only('date', 'region');\n\n $events = $this->event\n ->when(isset($filters['date']), function ($query) use ($filters) {\n return $query->whereDate('date', $filters['date']);\n })\n ->when(isset($filters['region']), function ($query) use ($filters) {\n return $query->where('place', 'LIKE', \"%{$filters['region']}%\");\n })\n ->paginate(10);\n\n return response()->json([\n 'error' => false,\n 'message' => '',\n 'data' => [\n 'current_page' => $events->currentPage(),\n 'last_page' => $events->lastPage(),\n 'per_page' => $events->perPage(),\n 'path' => $events->path(),\n 'data' => new EventCollection($events)\n ]\n ], 200);\n }", "public function getEvents()\n {\n $qb = $this->entityManager->getRepository(Event::class)->createQueryBuilder('e')\n ->where('e.deleted = 0')\n ->orderBy('e.eventStartDate', 'DESC');\n return $qb->getQuery();\n }", "public function index()\n {\n $events = \\App\\Event::orderBy('id','DESC')->paginate(10);\n return view('admin.events.index', ['events' => $events]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('AppBundle:Event')->findBy(\n ['archived' => '0'],\n ['startDate' => 'DESC']\n );\n\n return $this->render(\n 'event/index.html.twig',\n [\n 'events' => $events,\n ]\n );\n }", "public function index()\n\t{\n\n\t\t$data['events'] = Event_Manager::paginate(15);\n\t\t$data['page_title'] = 'Events';\n\t\treturn View::make('clientside.events.index',$data);\n\t\t\n\t}", "public function actionIndex()\n {\n if(\\Yii::$app->user->can('verMarcacaoConsulta')) {\n $tempVariable = Medicos::dataByUser(Yii::$app->user->id);\n $times = MarcacaoConsulta::dataByUserBack($tempVariable['id']);\n\n $events = [];\n foreach ($times as $time) {\n\n $temp = Especialidade::dataByEspecialidade($time['id_especialidade']);\n\n\n $Event = new Event();\n $Event->id = $time['id'];\n $Event->backgroundColor = $this->chooseColor($time['status']);\n $Event->title = $temp['tipo'];\n $Event->start = date(($time['date']));\n $Event->url = 'index.php?r=marcacao-consulta/view&id=' . $time['id'];\n $events[] = $Event;\n\n }\n\n return $this->render('index', [\n 'events' => $events,\n ]);\n }\n }", "public function manage_events()\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n $allRsvps = $this->Event->EventsUser->find('all');\n $this->set('rsvps', $allRsvps);\n \n $this->EventHelper(); \n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }", "public function index()\n {\n \n return EventResource::collection(Event::all());\n\n\n }", "public function index()\n {\n $list = Event::paginate(3);\n return view('events.index', compact('list'));\n\n }", "public function index()\n {\n //\n $events=Event::Orderby('id','desc')->where('user_id',Auth::User()->id)->paginate(10);\n return view('Organizer.index',compact('events'));\n \n }", "public function index()\n {\n $events = Event::latest()->when(request()->q, function ($events) {\n $events = $events->where('title', 'like', '%' . request()->q . '%');\n })->paginate(10);\n\n return view('admin.event.index', compact('events'));\n }", "function showEvents() {\r\n\r\n\t// Lets import some globals, shall we?\r\n\tglobal $MySelf;\r\n\tglobal $DB;\r\n\tglobal $TIMEMARK;\r\n\t$delta = $TIMEMARK -259200;\r\n\t\r\n\t// is the events module active?\r\n\tif (!getConfig(\"events\")) {\r\n\t\tmakeNotice(\"The admin has deactivated the events module.\", \"warning\", \"Module not active\");\r\n\t}\r\n\r\n\t// Load all events.\r\n\t$EVENTS_DS = $DB->query(\"SELECT * FROM events WHERE starttime >= '\" . $delta . \"' ORDER BY starttime ASC\");\r\n\r\n\t// .. right?\r\n\tif ($EVENTS_DS->numRows() >= 1) {\r\n\r\n\t\t// Lets keep in mind: We have events.\r\n\t\t$haveEvents = true;\r\n\r\n\t\twhile ($event = $EVENTS_DS->fetchRow()) {\r\n\r\n\t\t\t// get the date.\r\n\t\t\t$date = date(\"d.m.y\", $event[starttime]);\r\n\r\n\t\t\t// open up a new table for each day.\r\n\t\t\tif ($date != $previousdate) {\r\n\r\n\t\t\t\t$workday = date(\"l\", $event[starttime]);\r\n\r\n\t\t\t\tif ($beenhere) {\r\n\t\t\t\t\t$html .= $temp->flush();\r\n\t\t\t\t\t$html .= \"<br>\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$beenhere = true;\r\n\r\n\t\t\t\t// We need an additional row if we are allowed to delete events.\r\n\t\t\t\tif ($MySelf->canDeleteEvents()) {\r\n\t\t\t\t\t$temp = new table(8, true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$temp = new table(7, true);\r\n\t\t\t\t}\r\n\t\t\t\t$temp->addHeader(\">> Events for \" . $workday . \", the \" . $date);\r\n\t\t\t\t$previousdate = $date;\r\n\r\n\t\t\t\t$temp->addRow(\"#060622\");\r\n\t\t\t\t$temp->addCol(\"ID\");\r\n\t\t\t\t$temp->addCol(\"Starttime\");\r\n\t\t\t\t$temp->addCol(\"Starts in / Runs for\");\r\n\t\t\t\t$temp->addCol(\"Mission Type\");\r\n\t\t\t\t$temp->addCol(\"Short Description\");\r\n\t\t\t\t$temp->addCol(\"System\");\r\n\t\t\t\t$temp->addCol(\"Security\");\r\n\t\t\t\tif ($MySelf->canDeleteEvents()) {\r\n\t\t\t\t\t$temp->addCol(\"Delete\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Add Event to the current database.\r\n\t\t\t$temp->addRow();\r\n\t\t\t$temp->addCol(\"<a href=\\\"index.php?action=showevent&id=\" . $event[id] . \"\\\">\" . str_pad($event[id], 4, \"0\", STR_PAD_LEFT) . \"</a>\");\r\n\t\t\t$temp->addCol(date(\"d.m.y H:i\", $event[starttime]));\r\n\r\n\t\t\t$delta = $TIMEMARK - $event[starttime];\r\n\t\t\tif ($TIMEMARK > $event[starttime]) {\r\n\t\t\t\t// Event underway.\r\n\t\t\t\t$temp->addCol(\"<font color=\\\"#00ff00\\\">\" . numberToString($delta) . \"</font>\");\r\n\t\t\t} else {\r\n\t\t\t\t// Event not started yet.\r\n\t\t\t\t$delta = $delta * -1;\r\n\t\t\t\t$temp->addCol(\"<font color=\\\"#ffff00\\\">\" . numberToString($delta) . \"</font>\");\r\n\t\t\t}\r\n\r\n\t\t\t$temp->addCol($event[type]);\r\n\t\t\t$temp->addCol($event[sdesc]);\r\n\t\t\t$temp->addCol($event[system]);\r\n\t\t\t$temp->addCol($event[security]);\r\n\t\t\t\r\n\t\t\tif ($MySelf->canDeleteEvents()) {\r\n\t\t\t\t$temp->addCol(\"<a href=\\\"index.php?action=deleteevent&id=$event[id]\\\">delete event</a>\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Lets recall, did we have events scheduled?\r\n\tif ($haveEvents) {\r\n\t\t// We do!\t\t\t\r\n\t\t$html = \"<h2>Scheduled Events</h2>\" . $html . $temp->flush();\r\n\t} else {\r\n\t\t// We dont!\t\t\t\r\n\t\t$html = \"<h2>Scheduled Events</h2><b>There are currently no scheduled events in the database.</b>\";\r\n\t}\r\n\t// Return what we got.\r\n\treturn ($html);\r\n\r\n}", "public function getAllEvents()\n\t{\n\t\t$events = App_Model_Event_Mapper::getInstance()->getAll(true, \"actionId = $this->_actionId\", 'eventNo');\n\n\t\treturn $events;\n\t}" ]
[ "0.7603021", "0.7460164", "0.7260369", "0.70889086", "0.7037626", "0.69777673", "0.69330263", "0.6895707", "0.689564", "0.68931645", "0.6871771", "0.6842549", "0.6841271", "0.6833024", "0.6829212", "0.6813711", "0.6800656", "0.67863303", "0.6767271", "0.6738032", "0.67366976", "0.6730748", "0.6722242", "0.6704068", "0.6699268", "0.66965073", "0.6666647", "0.6654428", "0.6624582", "0.66051733", "0.6583226", "0.65583277", "0.65445846", "0.6536747", "0.6531056", "0.6529383", "0.6529383", "0.6522522", "0.6516803", "0.650159", "0.6501004", "0.6496591", "0.64964926", "0.6493677", "0.6492161", "0.649195", "0.6487696", "0.6485636", "0.64839685", "0.64776", "0.6475503", "0.6464809", "0.6463398", "0.6436358", "0.6433954", "0.6429281", "0.64277315", "0.6416782", "0.64121133", "0.6410269", "0.63867134", "0.6382246", "0.6374191", "0.6373882", "0.63692605", "0.6367532", "0.63599926", "0.63581294", "0.63552225", "0.6344515", "0.63408405", "0.6337043", "0.63176453", "0.63161117", "0.63070893", "0.6292857", "0.62782806", "0.6277976", "0.6260004", "0.62545216", "0.62441707", "0.622699", "0.62231684", "0.6221915", "0.6219079", "0.62153643", "0.62114877", "0.62099904", "0.62072366", "0.620679", "0.62012416", "0.6199293", "0.6198957", "0.6198668", "0.6198411", "0.6197535", "0.619387", "0.6193097", "0.6190158", "0.61884195" ]
0.7017213
5
Show the form for creating a new appointment.
public function create() { if (Sentry::check()) { // Find active user and set default variables to null $user = Sentry::getUser(); $groups = null; $schoolName = null; // Permission checks if ($user->hasAnyAccess(['school', 'event'])) { // If user is a superAdmin, show all possible groups to add an event to if ($user->hasAccess(['school'])) { $groups = Group::where('school_id', '<>', '')->get(); $opening = ''; } else { // If the user isn't a superAdmin, only show the groups to which the user has permissions $user->load('school.groups.appointments'); $groups = $user->school->groups; $opening = $user->school->opening; } // Transform recieved objectList (from database) into array to send with view $smartgroup = []; foreach ($groups as $group) { $smartgroup[$group->id] = $group->name; } // Show the form where users can add appointments return View::make('calendar.create')->with('groups', $smartgroup)->with('opening', $opening); } else { // If no permissions, redirect the user to the calendar index page return Redirect::route('calendar.index'); } } else { return Redirect::route('landing'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n $model = new Appointment();\n\n return view('appointment.create', compact('model'));\n }", "public function actionCreate()\n {\n $model = new TabelAppointment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_appointment]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('drcare.appointment');\n }", "public function create()\n\t{\n\t\t$appointment = Appointment::findOrFail(Input::get('id'));\n\n\t\treturn View::make('vitalsigns.create', compact('appointment'));\n\t}", "public function actionCreate()\n {\n $model = new Appointment();\n $model->creator_id = Yii::$app->user->identity->id;\n\n if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->save()) {\n DoctorPatientPivot::createNewRecordIfNotExist($model->doctor_id, $model->patient_id);\n NursePatientPivot::createNewRecordIfNotExist($model->nurse_id, $model->patient_id);\n Yii::$app->session->addFlash( 'success', Yii::t('auth', 'You have successfully create Appointment №:'\n . $model->id .' for patient: ' . Patient::findOne($model->patient_id)->name )\n );\n $this->redirect('index');\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'patientsList' => Patient::getPatientsListDropDown(),\n 'doctorsList' => Doctor::getDoctorsListDropDown(),\n 'nursesList' => Nurse::getNursesListDropDown(),\n 'statusesList' => Appointment::STATUSES_ARRAY,\n 'createFromPatient' => false,\n 'createFromDoctor' => false,\n 'createFromNurse' => false\n ]);\n }\n }", "public function newAction()\n {\n $entity = new Appointment();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n $patients = Patient::all();\n $doctors = Doctor::all();\n return view('admin.appointments.create')->with([\n 'doctors' => $doctors,\n 'patients' => $patients\n ]);\n }", "public function create()\n {\n $physicians = Physician::all();\n $patients = Patient::all();\n $nurses = Nurse::all();\n return view('backend.appointments.create', compact('physicians', 'patients', 'nurses'));\n }", "public function create()\n {\n $records = Record::all();\n $doctors = Doctor::all();\n $patients = Patient::all();\n return view('appointments.create', compact('records', 'doctors', 'patients'));\n }", "public function create()\n {\n return view ('/appointmentBook');\n }", "public function create()\n {\n $closeDays = CloseDay::allDay();\n $doctors = Doctor::active()->get();\n $services = Service::all();\n return view('patient.appointment.create', compact('doctors', 'services', 'closeDays'));\n }", "public function create($id=-1)\n {\n if($id == '-1'){\n $pageTitle = trans('messages.add_button_form',['form' => trans('messages.appointment')]);\n $appointmentdata = new Appointment;\n $appointmentdata->date = date('d-m-Y');\n $appointmentdata->time = date('H:i');\n }else{\n $pageTitle = trans('messages.update_form_title',['form'=>trans('messages.appointment')]);\n $appointmentdata = Appointment::find($id);\n $appointmentdata->date = date('d-m-Y',strtotime($appointmentdata->date));\n }\n return view('appointment.create', compact('pageTitle' ,'appointmentdata' ));\n }", "public function create()\n {\n $action = route('events.store');\n\n return view('department.events._form')->with('action', $action);\n }", "public function addAction()\n {\n $form = new AppointmentForm();\n $form->get('submit')->setValue('Add');\n // If the request is not a POST request, then no form data has been\n // submitted, and we need to display the form\n $request = $this->getRequest();\n \n if ($request->isPost()) {\n $appointment = new Appointment();\n $form->setData($request->getPost());\n $form->setInputFilter($appointment->getInputFilter());\n \n if ($form->isValid()) {\n \n $appointment->exchangeArray($form->getData());\n // Inserting appointment data in the datbase table\n $this->appointmentTable->saveAppointment($appointment);\n } else {\n \n return array(\n 'form' => $form\n );\n }\n }\n \n return array(\n 'form' => $form\n );\n // if it is invalid return form\n // we redirect back to the list of appointments using the Redirect\n }", "public function create()\n {\n\n return view('webapp-layouts.calendar.create');\n }", "public function create()\n {\n return view ('admin.calon.add');\n }", "public function create()\n {\n return view('admin.attendance.create');\n }", "public function create()\n {\n $this->page->setTitle('Agenda Create');\n return view('data-entry.agenda.create')->with([\n 'page' => $this->page\n ]);\n }", "public function create()\n\t{\n\t\t$appointment = Appointment::find(Input::get('id'));\n $patient_id = $appointment->patient->id;\n $doctors = Employee::where('role', 'Doctor')->where('status', 'Active')->get();\n $medicines = Medicine::all()->lists('name', 'id');\n\n return View::make('prescriptions.create', compact('medicines', 'appointment', 'patient_id', 'doctors'));\n\t}", "public function create()\n {\n return view('Backend.Calendar.create');\n }", "public function addAction()\n {\n // Instantiate AppointmentForm and set the label on submit button to \"Add\"\n $form = new AppointmentForm();\n $form->get('submit')->setValue('Add');\n // get the request and fetch data from the form\n $request = $this->getRequest();\n // if request->ispost() is true ,it indicates form is submitted successfully\n if ($request->isPost()) {\n $appointment = new Appointment();\n // set the form's input filter from appointment instance\n $form->setInputFilter($appointment->getInputFilter());\n $form->setData($request->getPost());\n\n // if form form data is valid ,get data from form and call saveAppointment() to save the data into database\n if ($form->isValid()) {\n $appointment->exchangeArray($form->getData());\n $this->getAppointmentTable()->saveAppointment($appointment);\n\n // Redirect to list of appointments\n return $this->redirect()->toRoute('appointment');\n }\n }\n // return variables to assign to view i.e. form object\n return array('form' => $form);\n \n }", "public function create()\n {\n return view('admin.adminevent.create_event');\n }", "public function create()\n {\n return view('attendances.create');\n }", "public function requestappointment() {\n return view('pages.appointment');\n }", "public function create()\n {\n return view('adm.events.create');\n }", "public function create()\n {\n return view('calendar::calendar_events.create');\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create()\n {\n $data['types'] = EventsTypes::where('active', '=', true)->with('langs')->get();\n $data['restaurants'] = Restaurant::with('langs')->get();\n\n return view('admin.events.form', $data);\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn View::make('holidays.create');\n\t}", "public function viewAddScheduleForm()\n {\n $movieRepository = $this->getRepository('movie');\n $data = ['movies' => array(), 'rooms' => array()];\n try {\n $data['movies'] = $movieRepository->loadAll();\n } catch (\\Exception $ex) {\n $errorResponse['message']\n = 'We\\'re sorry, something went terribly wrong while trying to schedule movie. Please try again later.';\n\n return $this->render('schedule', $data);\n }\n\n $data['last_date'] = $this->request->get('date');\n $data['last_time'] = $this->request->get('time');\n $data['last_price'] = $this->request->get('price');\n $data['last_movie'] = $this->request->get('movie');\n $data['last_room'] = $this->request->get('room');\n\n return $this->render('schedule', $data);\n }", "public function create()\n\t{\n\t\t$fullday = Input::get('fullday');\n\t\treturn View::make('peserta.create')->with('fullday', $fullday);\n\t}", "private function createCreateForm(Appointment $entity)\n {\n $form = $this->createForm(new AppointmentType(), $entity, array(\n 'action' => $this->generateUrl('appointment_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function create()\n {\n return view('item::admin.openingtimes.create');\n }", "public function create()\n {\n return view('admin.award.form');\n }", "public function create()\n {\n return view('meetups.create');\n }", "public function create()\n {\n return view('addressbook.create');\n }", "public function create()\n {\n return view('meal.addmealform');\n }", "public function add()\n {\n return view('pages.patient.form');\n }", "public function create()\n {\n $programEvent = new ProgramEvent();\n return view('program-event.create', compact('programEvent'));\n }", "public function actionCreate() {\n $model = new Bookings();\n\n $model->load(Yii::$app->request->post());\n $query = Bookings::find()\n ->andWhere(['patients_id' => $model->patients_id])\n ->andWhere(['date' => $model->date])->one();\n\n\n if (!empty($query->doctors_id)) {\n Yii::$app->session->setFlash('error', 'You already have an appointment on this date');\n return $this->redirect(['view', 'id' => $query->id]);\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n// $model->time = Yii::$app->formatter->\n// asDate($_POST['hours'].$_POST['minutes'], 'HH:mm');\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $this->employeePermission('application' , 'create');\n $action = 'create';\n return view('admin.setting.question_form', compact('action'));\n }", "public function create()\n\t{\n\t\treturn View::make('administrator.events.create')->with('page_title','Create New Event');\n\t\t\n\t}", "public function create()\n {\n return view('instructor.instructor-form');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n\t{\n\t\treturn View::make('events.create');\n\t}", "public function create()\n {\n return view('admin.attendance.create', $this->data);\n }", "public function create()\n {\n return view('administration.pointvente.create');\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n\t{\n return View::make('patient.create');\n\t}", "public function create()\n {\n return view('pendamping.create');\n }", "public function showAppointmentForm(Request $request)\n {\n ## get specialties\n $specialties = Specialty::all();\n ## current date\n $today = Carbon::now()->format('Y-m-d');\n return view('user.appointments', compact('specialties', 'today'));\n }", "public function create()\n\t{\n\t\treturn view('events.create');\n\t}", "public function create()\n {\n return view('workouts.form');\n }", "public function create()\n {\n $item = new PilotEvent;\n\n // set default start and end date\n $item->start = \\Carbon\\Carbon::parse(date('n/j/Y g:i a'));\n $item->end = \\Carbon\\Carbon::parse(date('n/j/Y g:i a'));\n\n // set default publish on date\n $item->published_at = \\Carbon\\Carbon::parse(date('n/j/Y g:i a'));\n\n $tags = Tag::orderBy('name', 'asc')->pluck('name', 'id');\n\n $formOptions = ['route' => 'admin.event.store'];\n\n return view('pilot::admin.events.form', compact('item', 'tags', 'formOptions'));\n }", "public function create()\n {\n return view('schedule.create');\n }", "public function create() {\n\n\t\treturn view('/mailer/createform');\n\n\t}", "public function create()\n {\n return view('dashboard.eventsandoffers.create');\n }", "public function create()\n {\n return view('showtimes.create');\n }", "public function create()\n {\n return view('admin.appel.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n $doctors = Doctor::pluck('name','id')->all();\n$patients = Patient::pluck('name','id')->all();\n\n return view('appointments.create', compact('doctors','patients'));\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('events::create');\n }", "public function create()\n {\n return view('admin.hospital.add');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create()\n {\n return view('evento.create');\n }", "public function addTaskForm()\n {\n $this->checkIfLoggedIn();\n\n return view('new-task', [\n 'titlePart' => '| Add a task',\n 'user' => session()->get('user')\n ]);\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n return view('notification.form.create');\n }", "public function create()\n {\n return view('admin.event.create');\n }", "public function create()\n {\n return view('admin.event.create');\n }", "public function create()\n {\n return view('timetable::create');\n }", "public function create()\n {\n return view('promocion_aplicada.create');\n }", "public function create()\n {\n return view('events.createevent');\n }", "public function create()\n { \n Gate::authorize('admin');\n return view('aviso.avisoForm');\n }", "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 create()\n {\n return view('layouts.patients.create');\n }", "public function create()\n {\n return view(\"admin.event_create\")->with([\n\n ]);\n }", "public function create()\n {\n return view('forming');\n }", "public function create()\n {\n return view('admissions.create');\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n\t{\n\t \n\t \n\t return view('admin.schedule.create');\n\t}", "public function create()\n {\n return view('events::create_event');\n }", "public function create()\n\t{\n\t\treturn \\View::make('Evento/new_evento');\n\t}", "public function create()\n {\n return view('backend.'.Auth::user()->role.'.event_calendar.create');\n }", "public function create()\n {\n return view('admin.patients.create');\n }", "public function create()\n {\n return view('admin.patients.create');\n }", "public function create()\n {\n $viewInjection=[\n 'method'=>'POST',\n 'route'=>'patients.store',\n 'routeParameter'=>null,\n 'buttonText'=>'Guardar',\n 'rfcRequired'=>null,\n 'readOnly'=>null,\n ];\n return view('patient.form',$viewInjection);\n }", "public function create()\n {\n return view('journals.create');\n }", "public function create()\n {\n //\n return view('events.create');\n }", "public function create()\n {\n return view('prospectos.create');\n }", "public function create() //Me manda a la página para crear\n {\n return view('patients.create');\n }" ]
[ "0.8050722", "0.77210534", "0.75946885", "0.7554706", "0.7413891", "0.7382587", "0.736426", "0.7344273", "0.7212428", "0.7116643", "0.69672316", "0.69107", "0.6821059", "0.67897046", "0.67729473", "0.6713916", "0.67026234", "0.66775405", "0.6641726", "0.66286635", "0.6620729", "0.65959936", "0.6581952", "0.65817004", "0.6573213", "0.6565103", "0.6557003", "0.6535442", "0.6529819", "0.6521439", "0.6515604", "0.65063304", "0.6504856", "0.6498156", "0.6494188", "0.64798", "0.6470398", "0.64699304", "0.6469795", "0.64630526", "0.64623064", "0.64558125", "0.64551246", "0.6453262", "0.64531326", "0.64531326", "0.64531326", "0.64531326", "0.6451729", "0.64435875", "0.6443253", "0.6440618", "0.64383304", "0.6436836", "0.64247704", "0.6424467", "0.64211625", "0.6419004", "0.6418712", "0.641747", "0.64171785", "0.64117765", "0.64114517", "0.641038", "0.641038", "0.641038", "0.641038", "0.641038", "0.641038", "0.6408736", "0.63860536", "0.6384234", "0.63823164", "0.6382092", "0.63815385", "0.63790214", "0.6375902", "0.6374686", "0.6373136", "0.6373136", "0.6371363", "0.63712454", "0.6369883", "0.63648695", "0.6362259", "0.6361328", "0.63599265", "0.6358647", "0.63565445", "0.63536894", "0.6352409", "0.63509864", "0.6350613", "0.6350331", "0.6349026", "0.6349026", "0.6344356", "0.6335494", "0.63321483", "0.6328284", "0.6327912" ]
0.0
-1
Store a newly created appointment in storage.
public function store() { if (Sentry::check()) { // Find active user and set default variables to null $schools = null; $user = Sentry::getUser(); // Permission checks if ($user->hasAnyAccess(['school', 'event'])) { $endDate = new DateTime(); // Check if endDate isn't blank if (Input::get('end-date') == '') { $endDate = null; } $validator = Validator::make( [ 'group' => Input::get('group'), 'description' => Input::get('description'), 'start-date' => Input::get('start-date'), 'end-date' => $endDate, 'start-time' => Input::get('start-time'), 'end-time' => Input::get('end-time'), 'title' => Input::get('title'), 'day' => Input::get('day') ], [ 'group' => 'required', 'description' => 'required', 'start-date' => 'date', 'end-date' => 'date', 'start-time' => 'required|date_format:H:i', 'end-time' => 'required|date_format:H:i', 'title' => 'required' ] ); // If validation fails, return to the create form with errors. if ($validator->fails()) { return Redirect::route('event.create')->withInput()->withErrors($validator); } else { $title = e(Input::get('title')); $description = e(Input::get('description')); $location = e(Input::get('location')); $group_id = Input::get('group'); $start_date = e(Input::get('start-date')); $end_date = e(Input::get('end-date')); $start_time = e(Input::get('start-time')); $end_time = e(Input::get('end-time')); // TODO: Handle All day events, or decide to remove it alltogether // If the event isn't the whole day, determine the end date/time //$event->allday = false; // Recurring events handling if (Input::get('repeat')) { $dateArray = explode(',', e(Input::get('repeat-dates'))); // Check if there are any dates selected, return error if not if(count($dateArray) == 0) { $validator->getMessageBag()->add( 'end', Lang::get('validation.countmin', ['attribute ' => 'Jaarkalender ', 'min' => '1']) ); // Redirect back with inputs and validator instance return Redirect::back()->withErrors($validator)->withInput(); } else { // Loop through dates to validate them foreach($dateArray as $da) { // If date is invalid, return error if (!self::validateDate($da)) { $validator->getMessageBag()->add( 'end', Lang::get('validation.date_format', ['attribute ' => 'Jaarkalender ']) ); // Redirect back with inputs and validator instance return Redirect::back()->withErrors($validator)->withInput(); } } // If all dates are validated and correct, create parent appointment and children $parent = new AppParent(); $parent->title = $title; $parent->description = $description; $parent->location = $location; $parent->group_id = $group_id; $parent->save(); foreach($dateArray as $da) { $event = new Appointment(); $event->title = $title; $event->description = $description; $event->location = $location; $event->group_id = $group_id; $event->start_date = new DateTime($da . ' ' . $start_time); $event->end_date = new DateTime($da . ' ' . $end_time); $event->parent_id = $parent->id; $event->save(); } } return Redirect::route('calendar.index'); } else { if(!$start_date) { $validator->getMessageBag()->add( 'end', Lang::get('validation.required', ['attribute ' => 'start-date ']) ); return Redirect::back()->withErrors($validator)->withInput(); } else { $sd = new DateTime($start_date . ' ' . $start_time); if($end_date == '') { $end_date = $start_date; } $ed = new DateTime($end_date . ' ' . $end_time); // Check if end date is before start date, if so, return with error if($sd >= $ed) { $validator->getMessageBag()->add( 'end', Lang::get('validation.after', ['attribute ' => 'end-date ', 'date' => Input::get('start-date')]) ); // Redirect back with inputs and validator instance return Redirect::back()->withErrors($validator)->withInput(); } else { $event = new Appointment(); $event->title = $title; $event->description = $description; $event->location = $location; $event->group_id = $group_id; $event->start_date = $sd; $event->end_date = $ed; $event->save(); return Redirect::route('calendar.index'); } } } } } else { // If no permissions, redirect the user to the calendar index page return Redirect::route('calendar.index'); } } else { return Redirect::route('landing'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(AppointmentCreateRequest $request)\n {\n return $this->repository->save($request);\n }", "public function store(Request $request)\n {\n\n \n $data = $this->getData($request);\n \n Appointment::create($data);\n\n return redirect()->route('appointments.appointment.index')\n ->with('success_message', 'Appointment was successfully added.');\n\n }", "public function store(Request $request)\n {\n $end_time_arr = explode(\" \", $request->input('endtime'));\n $endtime = $end_time_arr[0]; $format = $end_time_arr[1];\n $endtime = explode(\":\", $endtime);\n $hr = $endtime[0]; $min = $endtime[1];\n if($format == \"PM\")\n {\n $hr = 12 + (int)$hr;\n }\n $endtime = implode(\":\", array($hr, $min));\n $enddatetime = array($request->input('enddate'), strval($endtime));\n $enddatetime = implode(\" \", $enddatetime);\n\n $start_time_arr = explode(\" \", $request->input('starttime'));\n $starttime = $start_time_arr[0]; $format = $start_time_arr[1];\n $starttime = explode(\":\", $starttime);\n $hr = $starttime[0]; $min = $starttime[1];\n if($format == \"PM\")\n {\n $hr = 12 + (int)$hr;\n }\n $starttime = implode(\":\", array($hr, $min));\n $startdatetime = array($request->input('startdate'), strval($starttime));\n $startdatetime = implode(\" \", $startdatetime);\n $patient = $request->patient;\n $nurse = $request->nurse;\n $physician = $request->physician;\n $appointment = new Appointment;\n $appointment->examinationroom = $request->input('exaroom');\n $appointment->start_date_time = $startdatetime;\n $appointment->end_date_time = $enddatetime;\n $appointment->patient_id = $patient;\n $appointment->nurse_id = $nurse;\n $appointment->physician_id = $physician;\n $appointment->save();\n $appointment->patient->status = 'curing';\n $appointment->push();\n\n //Redirect\n return redirect()->route('appointments.index')->with('status', 'stored');\n }", "public function store(CreateAppointmentRequest $request)\n {\n return $this->makeAppointment($request);\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'doc_id'=>'required',\n 'start'=>'required',\n 'end'=>'required',\n 'day'=>'required',\n 'slots'=>'required'\n ]);\n\n //Create Appointment\n $app= new Appointment();\n\n //Get appointment data\n $app->doc_id= $request->doc_id;\n $app->start=$request->start;\n $app->end=$request->end;\n $app->day=$request->day;\n $app->slots=$request->slots;\n\n //Save appointment\n $app->save();\n }", "public function store(Request $request)\n {\n $now = Carbon::now();\n $this->validate(request(), [\n 'name' => 'required|string|max:255',\n 'sns' => 'required|integer',\n 'especialidade' => 'required',\n 'data' => 'required|date|after_or_equal:tomorrow',\n 'user_id' => 'required|integer',\n ]);\n\n $appointment = Appointment::create([\n \n 'name' => request('name'),\n 'sns' => request ('sns'),\n 'especialidade' => request ('especialidade'),\n 'data' => request ('data'),\n 'user_id' => request ('user_id'),\n 'realizada' => (0)\n ]);\n\n session()->flash('message', 'Appointment created successfully!');\n \n return redirect('/help/appointment/home');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'service_id' => 'required',\n 'doctor' => 'required',\n 'start_date' => 'required|date',\n 'end_date' => 'required|date',\n ]);\n\n DB::beginTransaction();\n try {\n $appointment = Appointment::create([\n 'service_id' => $request->service_id,\n 'doctor_id' => $request->doctor,\n 'start_date' => Carbon::parse($request->start_date),\n 'end_date' => Carbon::parse($request->end_date),\n ]);\n\n $patient = Patient::find(Auth::user()->id);\n\n $appointment->patients()->attach($patient);\n\n DB::commit();\n return response()->json(['success' => true, 'appointment_id' => $appointment->id]);\n } catch (Exception $e) {\n DB::rollback();\n }\n }", "public function store(Request $request)\n {\n $request->validate([\n 'duration' => 'required|integer',\n 'price' => 'required|integer',\n 'date' => 'required|date',\n 'time' => 'required',\n 'doctor_id' => 'required|integer',\n 'patient_id' => 'required|integer'\n ]);\n $appointment = new Appointment();\n $appointment->duration = $request->input('duration');\n $appointment->price = $request->input('price');\n $appointment->date = $request->input('date');\n $appointment->time = $request->input('time');\n $appointment->doctor_id = $request->input('doctor_id');\n $appointment->patient_id = $request->input('patient_id');\n\n $appointment->save();\n return view('admin.appointments.show')->with([\n 'appointment' => $appointment\n ]);\n }", "public function store(Request $request)\n {\n $validatedData = $request->validate([\n 'title'=>'required|max:100',\n 'startDate' => 'required',\n 'endDate' => 'required',\n 'location'=> 'required',\n 'user_id'=>'required|max:100',\n 'technician_id'=>'required|max:100',\n 'approved'=>'required|boolean',\n 'rated'=>'required'\n ]);\n\n $appointment = Appointment::create($validatedData);\n AppointmentRequested::dispatch($appointment);\n\n return response(['appointment' => new AppointmentResource($appointment), 'message' => 'Created successfully'], 200);\n }", "public function store(Request $request)\n {\n $input = $request->all();\n\n $input['date'] = $input['date'] . \" \" . $input['hour'];\n\n Appointment::create($input);\n\n return redirect('citas');\n }", "public function store(StoreTimeslot $request){\n $this->isAuthorize();\n\n // Insert Data\n $insertData = $request->toArray();\n $userID = $this->request->session()->get('userID');\n $timeSlotNum = $insertData['time_slot_no'];\n if(!isset($timeSlotNum) || ($timeSlotNum == NULL) || ($timeSlotNum == '')){\n $timeSlotNum = 1;\n }\n for($i = 0 ; $i < $timeSlotNum ; $i++){\n $data = array();\n if($i > 0){\n $data['time_slot'] = date('Y-m-d H:i:s', strtotime($insertData['time_slot'].' + '.($insertData['slot_duration']*$i).' minute'));\n }else{\n $data['time_slot'] = $insertData['time_slot'];\n }\n $data['userID'] = $userID;\n $data['evtID'] = $insertData['evtID'];\n $data['agentID'] = $insertData['agentID'];\n $data['slot_duration'] = $insertData['slot_duration'];\n Apt_time_slot::create($data);\n }\n return redirect('appointments/timeslot')->with('status', 'Successfully New Timeslot Created!');\n }", "public function created(Appointment $appointment)\n {\n $appointment->saveToHistory();\n }", "public function store(Request $request)\n {\n try{\n // Start Db transaction\n DB::beginTransaction();\n\n // Validate incoming request\n $validation = $this->validator($request);\n if ($validation->fails()) {\n return response($validation->errors(), 400);\n }\n\n $appointment = new Record();\n $appointment->patient_id = $request->patient_id;\n $appointment->doctor_id = $request->doctor_id;\n $appointment->appointment_date = $request->appointment_date;\n $appointment->save();\n\n DB::commit();\n $request->session()->flash('successful', \"New appointment was created successfully!\");\n return redirect()->route('appointments.index');\n\n }catch(\\Exception $error){\n DB::rollBack();\n return $error;\n $request->session()->flash('error', \"Appointment creation failed!\");\n return redirect()->back();\n } \n }", "public function store(Request $request)\n {\n $data = $request->all();\n\n $validator = Validator::make($data,[\n 'category_id' => 'required',\n 'service_id' => 'required',\n ]);\n if($validator->fails()) {\n return redirect()->back()->withInput()->with('errors', $validator->errors()->first());\n }\n $data['date'] = isset($request->date) ? date('Y-m-d',strtotime($request->date)) : date('Y-m-d');\n\n $result = Appointment::updateOrCreate(['id' => $data['id'] ],$data);\n\n $message = trans('messages.update_form',['form' => trans('messages.appointment')]);\n if($result->wasRecentlyCreated){\n $message = trans('messages.save_form',['form' => trans('messages.appointment')]);\n }\n return redirect(route('appointment.index'))->withSuccess($message);\n }", "public function store(Request $request)\n {\n $input = $request->all();\n\n $validator = Validator::make($input, [\n 'office_id' => 'required',\n 'date' => 'required',\n 'time' => 'required',\n 'stretcher_no' => 'required',\n 'is_save'=> 'required',\n ],[\n 'is_save.required' => 'Office is closed'\n \n ]);\n\n if ($validator->fails()) {\n return redirect('appointment/create')->withErrors($validator)->withInput();\n }\n\n $model = new Appointment();\n $model->office_id = $input['office_id'];\n $model->date = $input['date'];\n $model->time = $input['time'];\n $model->stretcher_no = $input['stretcher_no'];\n $model->create_user_id =Auth::user()->id;\n\n $model->save();\n return redirect('/appointment');\n }", "public function store(Request $request)\n\t{\n\t\t//\n\t\t$rules=$this->getAppointValRules(); \n\t\t//dd($request->all()); \n\t\t$validator = Validator::make($request->all(),$rules);\n\t\tif ($validator->fails()) {\n\t\t \t# code...\n\t\t\treturn redirect()->back()->withErrors($validator); \n\t\t } \n\t\t $input=$request->all(); \n\t\t $appointment = Appointment::create(\n\t\t \t[\n\t\t \t\t'user_id'=>Auth::user()->id,\n\t\t \t\t'appoint_date'=>$input['appoint_date'],\n\t\t \t\t'appoint_time'=>$input['appoint_time'],\n\t\t \t\t'available'=>true\n\t\t \t]); \n\t\t return redirect('doctor/appointment'); \n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'first_name'=>'required|max:50',\n 'last_name'=>'required|max:50',\n 'phone'=>'required|numeric', \n ],[\n 'phone.required'=>'Phone must be a valid phone number.'\n ]); \n\n $appointment = new Appointment();\n $appointment->first_name = $request->get('first_name');\n $appointment->last_name = $request->get('last_name');\n $appointment->setServiceTypeId($request->get('service_type_id'));\n $appointment->phone = $request->get('phone');\n $appointment->setDate($request->get('date'));\n $appointment->setTime($request->get('time'));\n $appointment->message = $request->get('message');\n $appointment->save();\n return view('drcare.booking-result', ['appointment' => $appointment])->with('message', 'Create Successfull !');\n }", "public function store(Request $request)\n {\n $user=auth()->user();\n $doctor=Doctor::find($request->doctor);\n $patient=Patient::find($user->foreign_id);\n $date=$request->input('date');\n if(Appointment::where(['date'=>$date,'doc_id'=>$doctor->doc_id,\n 'patient_id'=>$patient->patient_id])->count()>0)\n return redirect('dashboard')->with('failure','You already have an appointment on that day with '.$doctor->name);\n $serialNo=Appointment::where(['date'=>$date,'doc_id'=>$doctor->doc_id])->max('serial_no');\n if(!$serialNo)\n $serialNo=1;\n else\n $serialNo++;\n $appointment=new Appointment;\n $appointment->date=$date;\n $appointment->serial_no=$serialNo;\n $appointment->doc_id=$doctor->doc_id;\n $appointment->patient_id=$patient->patient_id;\n $appointment->save();\n return redirect('dashboard')->with('success','Appointment Added!');\n }", "public function store(Request $request)\n {\n try{\n $input=$request->all();\n\n $rules=[\n 'date' => 'required|min:10',\n 'hour' => 'required',\n 'symptoms' => 'required'\n ];\n\n $messages=[\n 'date.required' => 'No has introducido una fecha',\n 'date.min' => 'El formato de fecha debe ser YYYY-MM-DD',\n 'hour.required' => 'Escoge una hora para la cita',\n 'symptoms.required' => 'No has introducido ningún síntoma'\n ];\n\n $validator = Validator::make($input,$rules,$messages);\n\n if ($validator->fails()) {\n return response()->json([$validator->errors()],400);\n }\n\n $user = Auth::user();\n $appointment = new Appointment($input);\n $appointment->user_id = $user->id;\n $appointment->save();\n return response()->json($appointment, 201);\n } catch (\\Exception $e) {\n return response()->json($e, 400);\n }\n }", "public function store(SubscriptionAppointmentRequest $request)\n {\n $Subcription_appointment = new SubscriptionAppointment();\n $Subcription_appointment->subscription_id = $request->subscription_id;\n $Subcription_appointment->service_ids = $request->service_ids;\n $Subcription_appointment->time = $request->time;\n $Subcription_appointment->date = $request->date;\n $Subcription_appointment->slot = $request->slot;\n $Subcription_appointment->status = $request->status;\n $Subcription_appointment->completed_time = $request->completed_time;\n $Subcription_appointment->coupon_flag = $request->coupon_flag;\n $Subcription_appointment->coupon_id = $request->coupon_id;\n $Subcription_appointment->save();\n \n return response(\n [\n 'error'=> false,\n 'data'=> $Subcription_appointment\n ]\n ,201);\n }", "public function store(StoreAttendanceRequest $request)\n {\n try {\n $request['note'] = str_replace([\"'\", '\"'], '', $request['note']);\n Attendance::create($request->all() + ['user_id' => auth()->id()]);\n } catch (\\Exception $exception) {\n return back()->withInput()->withError('Atendimento não cadastrado! Verifique com o suporte.');\n }\n\n return redirect()->route('attendance.index')->withSuccess('Atendimento finalizado!');\n }", "public function store(StoreAppointmentRequest $request)\n {\n \n $count = Appointment::whereDate('created_at',Carbon::now())->where('time_id',$request->input('time_id'))->count();\n if($count >= 5){\n Toastr::error('No more slot for this time duration','Appointment Failed');\n return redirect()->route('frontend.appointments.create');\n }else {\n $appointment = Appointment::create($request->all());\n Toastr::success('No more slot for this time duration','Appointment Success');\n return redirect()->route('frontend.appointments.index');\n }\n }", "public function store(Request $request)\n {\n $data = $request->all()['appointmentBook'];\n // dd($data);\n $appointmentBookCreate = AppointmentBook::create([\n // 'date' => $request->date,\n // 'time' => $request->time,\n 'date' => $data['date'],\n 'name_of_patient' => $data['name_of_patient'],\n 'contact_no' => $data['contact_no'],\n 'appointment_time' => $data['appointment_time'],\n 'consultant_name' => $data['consultant_name'],\n ]);\n if ($appointmentBookCreate) {\n return ['code' => '200','appointmentBook'=>$appointmentBookCreate->id, 'message' => 'Data Sucessfully InCreate'];\n }\n }", "public function store()\n\t{\n\t\t$MDTMeeting = new MDTMeeting;\n $MDTMeeting ->date = Input::get('date');\n $MDTMeeting ->location = Input::get('location');\n $MDTMeeting ->center_id = Auth::User()->center_id;\n $MDTMeeting->save();\n $case = Input::get('case');\n for($i=0;$i<count($case);$i++)\n {\n $MDTCase = new MDTCase;\n $MDTCase->case_id = $case[$i];\n $MDTCase->MDTMeeting_id = $MDTMeeting->id;\n $MDTCase->recommendation = Input::get('recommendation')[$i];\n $MDTCase->save();\n }\n \n return Redirect::to('MDTReport/'.$MDTMeeting->id);\n\t}", "public function store()\n {\n $timeData = Input::only('worked_hours', 'date', 'notes');\n\n $result = $this->timesRepository->create($timeData);\n\n if ($result instanceof Illuminate\\Validation\\Validator) {\n return $this->notValidResponse($result->messages());\n }\n\n return $this->response($result);\n }", "public function store() {\n try {\n $this->booking->create(Input::all());\n Notification::success( trans('app.booking_added') );\n return langRedirectRoute('admin.booking.index');\n } catch (ValidationException $e) {\n return langRedirectRoute('admin.booking.create')->withInput()->withErrors($e->getErrors());\n }\n }", "public function store(StoreTimeEntriesRequest $request)\n {\n if (! Gate::allows('time_entry_create')) {\n return abort(401);\n }\n $time_entry = TimeEntry::create($request->all());\n $time_entry->student()->sync(array_filter((array)$request->input('student')));\n\n\n\n return redirect()->route('admin.time_entries.index');\n }", "public function store(Request $request)\n {\n Doctor_timeslot::create($request->all());\n return response(array(\n 'error' => false,\n 'message' =>'Doctor Time slot Added Successfully',\n ),200);\n }", "public function store(Request $request)\n {\n $storeReponse = $this->appointmentService->store(\n $request->date,\n $request->doctor,\n $request->patient\n );\n\n if (!$storeReponse->success) {\n return redirect()->back()->withError('Erro ao agendar consulta');\n }\n\n return redirect()->back()->withSuccess('Consulta agendada!');\n }", "public function store()\n\t{\n\t\t$reserva = new Reserva;\n\t\t$reserva->persona_id = Input::get('persona_id');\n\t\t$reserva->puesto_id = Input::get('puesto_id');\n\t\t$reserva->start_date = Input::get('start_date');\n\t\t$reserva->end_date = Input::get('end_date');\n\t\t$reserva->save();\n\t}", "public function store(Request $request)\n {\n $officehours = new officehours();\n $officehours->startDate = $request['startDate'];\n $officehours->startTime = $request['startTime'];\n $officehours->endTime = $request['endTime'];\n $officehours->length = $request['length'];\n\n $dt1 = Carbon::create($officehours->startDate . $officehours->startTime);\n $dt2 = Carbon::create($officehours->startDate . $officehours->endTime);\n\n for ($i = $dt1->timestamp; $i <=$dt2->timestamp; $i+=$officehours->length*60) {\n $appointment = new Appointment(Carbon::createFromTimestamp($i));\n $appointment->save();\n }\n\n return redirect('officehours');\n // goes to officehours/index\n }", "public function store(Request $request)\n {\n $this->validate($request,array(\n 'title'=>'required|max:255'\n ));\n //insert into db\n $user = Auth::user();\n $event=new Event;\n $event->title = $request->title;\n $event->location = $request->location;\n $event->description = $request->description;\n $event->emailid = $user->email;\n\n // if(empty($request->session()->get('event'))){\n // $event=new Event;\n // $event->title = $request->title;\n // $event->location = $request->location;\n // $event->description = $request->description;\n // $event->emailid = $user->email;\n // $request->session()->put('event', $event);\n // }else{\n // $event = $request->session()->get('event');\n // $event->title = $request->title;\n // $event->location = $request->location;\n // $event->description = $request->description;\n // $event->emailid = $user->email;\n // // $product->fill($validatedData);\n // $request->session()->put('event', $event);\n // }\n $event->save();\n $dates=$request->date;\n $starttimes=$request->starttime;\n $endtimes=$request->endtime;\n\n $participant=Participant::where('emailid',$user->email)->get();\n if(!isset($participant))\n {\n $participant=new Participant;\n $participant->name=$user->name;\n $participant->emailid=$event->emailid;\n $participant->save();\n }\n\n $eventParticipation=EventParticipation::where('emailid',$user->email)->get();\n // if(!isset($eventParticipation))\n // {\n $eventParticipation= new EventParticipation;\n $eventParticipation->eventid=$event->id;\n $eventParticipation->emailid=$event->emailid;\n $eventParticipation->save();\n // }\n\n foreach($dates as $key=>$value){\n $eventSlot=new EventSlot;\n $eventParticipationSlot=new EventParticipationSlot;\n $eventSlot->slotid=$key+1;\n $eventSlot->eventid=$event->id;\n $eventSlot->date=$value;\n $eventSlot->starttime=$starttimes[$key];\n $eventSlot->endtime=$endtimes[$key];\n $eventSlot->save();\n $eventParticipationSlot->eventid=$event->id;\n $eventParticipationSlot->slotid=$eventSlot->slotid;\n $eventParticipationSlot->emailid=$event->emailid;\n $eventParticipationSlot->response=true;\n $eventParticipationSlot->save();\n // $eventSlot.save();\n }\n\n\n\n $emailerListString=$request->emaillist;\n if(isset($emailerListString))\n {\n $emailerList=explode(\";\",$emailerListString );\n foreach($emailerList as $emailTo)\n {\n Mail::to($emailTo)->send(new DemoEmail(route('events.show',$event->id)));\n }\n }\n //redirect\n return redirect()->route('events.show',$event->id);\n }", "public function store() {\n $NotepadID = request('NotepadID');\n\n //CALLS CREATE METHOD FROM TASKS MODEL AND\n //USES REQUESTS VARIABLES DATA TO STORE\n Tasks::create([\n 'task' => request('task'), \n 'description' => request('description'), \n 'NotepadID' => request('NotepadID')\n ]);\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$NotepadID\");\n }", "public function store(Request $request)\n {\n// dd($request);\n $request->validate([\n 'patient_id' => 'required',\n 'doctor_id' => 'required',\n 'doctor_schedule_id' => 'required',\n 'time' => 'required',\n 'type' => 'required',\n 'description' => 'required'\n ]);\n $appointmentNumber = sprintf(\"%03u-%s-%s\", $request->doctor_id, $request->date, $request->time);\n $oldApp = Appointment::where('appointment_number',$appointmentNumber)->where('status',0)->get();\n if ($oldApp->count() > 0){\n return back()->with('warning','You have already booked Appoitment for the selected date and time');\n }\n // dd($appointmentNumber);\n $data = [\n 'doctor_id' => $request->doctor_id,\n 'patient_id' => $request->patient_id,\n 'doctor_schedule_id' => $request->doctor_schedule_id,\n 'appointment_number' => $appointmentNumber,\n 'reason' => $request->description,\n 'time' => $request->time,\n 'type' => $request->type,\n ];\n // dd($data);\n $newApp = Appointment::create($data);\n $notification = [\n 'message' => 'appointment Has Been Created',\n 'date' => $request->date,\n 'time' => $request->time,\n 'patient' => $newApp->patient->name,\n 'doctor' => $newApp->doctor->name,\n ];\n\n if (isset($request->referral)) {\n $newApp->update(['referred_from' => $request->referral]);\n Appointment::findOrFail($request->referral)->update(['status' => 2, 'referred_to' => $newApp->id]);\n $notification['message'] = 'Appointment Referred';\n $newApp->patient->user->notify(new AppointmentNotification($notification));\n $newApp->doctor->user->notify(new AppointmentNotification($notification));\n return back()->with('success', 'Referred to another doctor successfully');\n }\n $newApp->patient->user->notify(new AppointmentNotification($notification));\n $newApp->doctor->user->notify(new AppointmentNotification($notification));\n if (isset($request->payment) && $request->payment == 'true'){\n $newApp->update(['isPaid'=>true]);\n Payment::create([\n 'appointment_id' => $newApp->id,\n 'amount' => $newApp->doctor->fees\n ]);\n }\n if ($newApp->type == 'Video'){\n $newApp->update(['meeting_link'=>$request->meeting_link]);\n }\n return back()->with('success', 'Appointment Created Successfully');\n // dd($request);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'event_date' => 'required',\n 'event_time' => 'required',\n ]);\n\n $mealid = $request->meal_id;\n $eventdate = $request->event_date;\n $eventplaces = $request->available_places;\n $eventtime = $request->event_time;\n\n\n $event = new Event();\n $event->event_date = $eventdate;\n $event->meal_id = $mealid;\n $event->event_places = $eventplaces;\n $event->event_time = $eventtime;\n $event->save();\n\n\n return Redirect::to('/mijnevents');\n }", "public function store(Apartment $apartment)\n {\n\n Reservation::create([\n\n 'apartment_id' => $apartment->id,\n 'title'=>request('title'),\n 'contact'=>request('contact'),\n 'number_of_people'=>request('number_of_people'),\n 'starts_at' => request('starts_at'),\n 'ends_at' => request('ends_at'),\n 'color' => request('color'),\n ]);\n // $apartment->AddReservation(request(['starts_at', 'ends_at']));\n\n return back();\n }", "public function store(Request $request)\n {\n $data['schedule_date'] = date('Y-m-d', strtotime($request->schedule_date));\n $data['program_id'] = $request->program_id;\n $data['start_time'] = $request->start_time;\n $data['chat_status'] = $request->chat_status;\n $data['end_time'] = $request->end_time;\n $data['schedule_note'] = $request->schedule_note;\n $data['created_at'] = date('Y-m-d');\n $data['day'] =date('l', strtotime($request->schedule_date));\n $result = DB::table('schedules')->insert($data);\n if ($result) {\n return redirect('admin/schedules')\n ->with('success', 'Added successfully.');\n } else {\n return redirect('admin/schedules')\n ->with('error', 'No successfully.');\n }\n }", "public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }", "public function store(Request $request)\n {\n return TimeActivity::Create([\n 'date_time' => $request->date_time,\n 'hours' => $request->hours,\n 'activity_id' => $request->activity_id\n ]);\n \n\n }", "public function store()\n\t{\n\t\t$vacation = new Vacation;\n\t\tif(!$vacation->validate(Input::all()))\n\t\t\tthrow new StoreResourceFailedException(\n\t\t\t\t'Fout bij het aanmaken van de vakantie', $vacation->errors());\n\n\t\t//if($vacation->save())\n\t\tif($this->vacationRepository->create(Input::all()))\n\t\t\treturn $this->created(); // HTTP Status Code 201 \"Created\"\n\t\telse\n\t\t\tthrow new StoreResourceFailedException(\n\t\t\t\t'Fout bij het aanmaken van de vakantie');\t\n\t}", "public function store(Request $request)\n {\n $this->validate($request, [\n\t\t\t'scheduled_event_id' => 'required',\n\t\t\t'student_id' => 'required',\n\t\t\t'event_id' => 'required',\n\t\t\t'event_date' => 'required',\n\t\t\t'time_in' => 'required',\n\t\t\t'time_out' => 'nullable'\n\t\t]);\n $requestData = $request->all();\n \n Attendance::create($requestData);\n\n return redirect('attendances')->with('flash_message', 'Attendance added!');\n }", "public function store(Request $request)\n {\n $time = explode(\" - \", $request->input('time'));\n \n // $adminevent=$request->all();\n // dd($adminevent);\n $adminevent = new Event();\n $adminevent->title = $request->input('title');\n $adminevent->start =$request ->start;\n $adminevent->end =$request ->end;\n $adminevent->color = $request->color;\n $adminevent->save();\n \n $request->session()->flash('success', 'The event was successfully saved!');\n return redirect('/adminevent');\n }", "public function store(Request $request)\n {\n $this->validate($request , [\n 'unit_name' => 'required',\n 'timetable_id' => 'required',\n 'lectured_by' => 'required'\n ]);\n\n $userid = Auth::user()->id;\n \n $timetabledetails = new DetailTT;\n $timetabledetails -> timetable_id = $request->input('timetable_id');\n $timetabledetails -> unit_name = $request->input('unit_name');\n $timetabledetails -> day = $request->input('day');\n $timetabledetails -> time_start = $request->input('start_at');\n $timetabledetails -> time_end = $request->input('end_at');\n $timetabledetails -> lectured_by = $request->input('lectured_by');\n $timetabledetails -> added_by = $userid;\n $timetabledetails -> updated_by = $userid;\n // $timetabledetails -> image = $filename;\n $timetabledetails -> save();\n\n return back()->with('success', 'Action Confirmed');\n // route('timetables.show',$timetable->id)\n\n }", "public function store(Request $request)\n {\n $this->openingtime->create($request->all());\n\n return redirect()->route('admin.item.openingtime.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('item::openingtimes.title.openingtimes')]));\n }", "public function store(Request $request) {\n // validate the data\n $this->validate($request, array(\n 'date' => 'required|date|date_format:\"Y-m-d H:i:s',\n 'title' => 'required|max:255',\n 'category' => 'required',\n ));\n // store in the database\n $event = new Event;\n $event->date = $request->date;\n $event->title = $request->title;\n if ($request->description != '') {\n $event->description = $request->description;\n }\n if (Auth::check()) { // check if logged in\n $event->user_id = Auth::id(); // assing user id\n }\n $event->slug = ($request->title != '' ? str_slug($request->title) : time()); // slug from title or timestamp\n if ($request->category > 0) {\n $event->category_id = $request->category;\n }\n $event->timezone = $request->timezone;\n if ($request->private == 'on') {\n $event->is_private = true;\n }\n $event->status = 1; // status == 1 == accepted\n // redirect to the specified resource if event is saved\n if ($event->save()) {\n Session::flash('success', 'Your timer is created!');\n return redirect()->route('events.show', [$event->id, $event->slug]);\n }\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'title' => 'string',\n 'description' => 'string',\n 'auditsLimit' => 'int',\n 'time' => 'date'\n ]);\n $meeting = new Meeting();\n $meeting->title = $request->input('title');\n $meeting->description = $request->input('description');\n $meeting->auditsLimit = $request->input('auditsLimit');\n $meeting->time = $request->input('time');\n if ($meeting->save()) {\n $response = ['message' => 'meeting saved successfully',\n 'data' => $meeting];\n return response()->json($response, 200);\n } else {\n $response = ['message' => 'meeting saved successfully',\n 'data' => $meeting];\n return response()->json($response, 404);\n\n }\n }", "public function store(Request $request)\n {\n //\n\n try {\n $data = $request->all();\n\n $decrypted_res = $request->input(\"key_res\");\n $User = Auth::guard('api')->user();\n // $reservations = Reservations::create($data);\n $validateForm = Validator::make($request->all(), [\n 'key_res' => 'min:8|max:255|required',\n ]);\n\n if ($validateForm->fails()) {\n return $this->Error($validateForm->errors()->first(), 401);\n }\n if ($User === null) {\n return $this->Error(\"Auth is not login \", 401);\n }\n\n if (!$this->Decrypt($decrypted_res))\n return $this->Error(\"Error Data key_Doc \", 401);\n\n\n $Reservations = Reservations::find($decrypted_res);\n\n if ($Reservations->status == 0) {\n $Appointments = Appointments::create([\n 'user_id' => $User->id,\n 'reservations_id' => $decrypted_res,\n 'status' => '0'\n ]);\n $Reservations->update([\"status\" => 1]);\n } else {\n\n return $this->Error(\"It is already booked \", 401);\n }\n\n \n\n $message = \"Save new Appointments\";\n return $this->Data('Data', [\n \"Appointments\" => $Appointments,\n \"lang\" => $this->lang(),\n\n ], $message, 200);\n } catch (\\Exception $ex) {\n return $this->Error($ex->getMessage(), 400);\n }\n }", "public function store(Request $request)\n {\n\t\t$this->validate($request, [\n\t\t\t'trainee_id' => 'required|integer|min:1|exists:trainees,id',\n\t\t\t'lecture_id' => 'required|integer|min:1|exists:lectures,id',\n\t\t\t'tIn' => 'required|date_format:H:i',\n\t\t\t'tOut' => 'required|date_format:H:i'\n\t\t]);\n\n\t\t$trainee = Trainee::find($request['trainee_id']);\n\t\t$trainee->Lecture()->attach($request['lecture_id'], [\n\t\t\t'tIn' => $request['tIn'],\n\t\t\t'tOut' => $request['tOut']\n\t\t]);\n\n\t\treturn redirect()->route('attendance.index')->with('alert-class', 'alert-success')->with('message', 'Done!');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'start_at' => 'required'\n ]);\n $requestData = $request->all();\n\n $start = $requestData['start_at'];\n $end = $requestData['end_at'];\n\n $requestData['start_at'] = date('Y-m-d H:i:s', strtotime($start));\n $requestData['end_at'] = date('Y-m-d H:i:s', strtotime($end));\n\n if ($end == '') {\n $requestData['end_at'] = date('Y-m-d', strtotime($start)) . ' 23:59:59';\n }\n\n Event::create($requestData);\n\n if ($request->wantsJson()) {\n return response()->json([\n 'message' => __('Data created successfully')\n ]);\n }\n\n return redirect(route('events.index'))->with('message', __('Data created successfully'));\n }", "public function store()\n\t{\n\t\t$entry = new Offering;\n\t\t$entry->deposit_id = Input::get('deposit_id');\t\t\n\t\t$entry->name = Input::get('name');\n\t\t$entry->created_at = Input::get('created_at');\n\t\t$entry->memo = Input::get('memo');\n\t\t$entry->save();\n\t \n\t\treturn Redirect::to('accounting/deposits/'.$entry->deposit->id.'#'.$entry->name)->with('message', 'Offering Successfully created!');\n\t}", "public function store(Request $request)\n {\n $this->validateInput($request);\n evento::create([\n 'name' => $request['name'],\n 'infoEv' => $request['infoEv'],\n 'fechaEv' => $request['fechaEv'],\n 'fechaFEv' => $request['fechaFEv']\n ]);\n\n return redirect()->intended('system-management/evento');\n }", "public function store()\n { \n $input = Input::all();\n \n $v = Validator::make($input,Evnt::$rules);\n if ($v->fails())\n {\n return Redirect::route('evnts.create')->witherrors($v)->withinput();\n } \n\n //$date = Input::get('year') .'/' . .'/' .Input::get('day') .' ' .Input::get('hour') .':'.Input::get('minute') .':' .'00';\n \n $dt = Carbon::create(Input::get('year'), Input::get('month'), Input::get('day') , Input::get('hour'), Input::get('minute'));\n // return dd($dt);\n $user = Auth::user()->id; \n $evnt = New Evnt(array(\n 'name' => Input::get('name'),\n 'user_id' => $user,\n 'when' => $dt,\n 'detail' => Input::get('detail'),\n 'admission' => Input::get('admission')\n //'flier' => $filename\n ));\n\n $venue = Venue::find(Input::get('venue'))->Evnts()->save($evnt); \n return Redirect::route('upload',$venue->slug)->with('message','Event Added Successfully. Great Job');\n }", "public function store(Request $request)\n {\n // make validator\n $validator = Validator::make($request->all(), ([\n 'name' => 'required|string|min:2|max:30',\n 'date' => 'required|string|date',\n 'announcement' => 'nullable|string',\n 'agenda' => 'required|array',\n ]));\n\n // validate fails\n if ($validator->fails()) return apiResponse(\n $request->all(),\n \"Validation Fails.\",\n false,\n 'validation.fails',\n $validator->errors(),\n 422\n );\n\n // \n $created = null;\n DB::transaction(function () use ($request, &$created) {\n $created = Schedule::create($request->only('name', 'date', 'announcement', 'agenda'));\n });\n\n // \n return apiResponse(\n $created,\n 'create data success.',\n true\n );\n }", "public function store()\n\t{\n\t\t$travelPlan = new Travelplan;\n\n\t\t$travelPlan->agency_id = Input::get(\"agency_id\");\n\t\t$travelPlan->location_id = Input::get(\"location_id\");\n\t\t$travelPlan->destination_id = Input::get(\"destination_id\");\n\t\t$travelPlan->price = Input::get(\"price\");\n\n\t\t$pickup_date = Input::get(\"pickup_date\");\n\t\t$travel_date = Carbon::parse($pickup_date);\n\t\t$date_formatted = $travel_date->toFormattedDateString();\n\t\t$travel_date = $travel_date->toDateString();\n\t\t$travelPlan->pickup_date = $travel_date;\n\t\t\n\t\t\n\n\t\t$travelPlan->pickup_time = Input::get(\"pickup_time\");\n\t\t$travelPlan->pickup_location = Input::get(\"pickup_location\");\n\t\t$travelPlan->dropoff_location = Input::get(\"dropoff_location\");\n\n\t\tif($travelPlan->save())\n\t\t{\n\t\t\t// Store the activity\n\t\t\t$activity = new Activity;\n\t\t\t$activity->type = \" Add New Travel Plan \";\n\t\t\t$activity->details = \"Travel Plan From \".$travelPlan->location_id.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\" To \".$travelPlan->destination_id.\" By Agency \".$travelPlan->agency_id.\" Added \";\n\t\t\t$activity->activity_by = Auth::user()->fullName;\n\t\t\t$activity->save();\n\n\t\t\treturn Redirect::to(\"/admin/travelplan\");\n\t\t}\n\n\t}", "public function store(CreatePatientRequest $request)\n {\n\n $request->request->add(['convive_con' => ['']]); //add request\n \n $request->request->add(['estado' => '1']);\n $input = $request->all();\n\n $patient = $this->patientRepository->create($input);\n $patient->patientOther()->create(['patient_id' => $patient->id]);\n $patient->patientInfo()->create(['patient_id' => $patient->id, 'ayuda_soc' => [''], 'tipo_disc' => ['']]);\n\n\n $patient->patientHealth()->create(['patient_id' => $patient->id]);\n\n $today = Carbon::parse($request->fecha_alta_paciente);\n $patient->patientPia()->create([\n 'fecha_limite' => $today->addMonths(3),\n 'fecha_Real' => '',\n 'tipo_pia' => 'Inicial',\n 'url_pia' => '',\n 'obs_pia' => '',\n 'patient_id' => $patient->id,\n ]);\n\n $today = Carbon::parse($request->fecha_alta_paciente);\n $patient->patientPia()->create([\n 'fecha_limite' => $today->addMonths(9),\n 'fecha_Real' => '',\n 'tipo_pia' => 'Seguimiento',\n 'url_pia' => '',\n 'obs_pia' => '',\n 'patient_id' => $patient->id,\n ]);\n\n Flash::success('Persona atendida guardada correctamente.');\n return redirect()->route('patients.edit', $patient->id);\n }", "public function store(Requests\\AgendaRequest $request)\n {\n $agenda = Agenda::create($request->all());\n if(is_null($agenda)){\n abort(500);\n }\n Session::flash('agenda-registered','Telah Ditambahkan');\n return redirect(action('AgendaController@index'));\n }", "public function store(Request $request)\n {\n $timetable = new Timetable;\n\n $timetable->day = $request->day;\n $timetable->subject = $request->subject;\n $timetable->slot = $request->slot;\n $timetable->teacher = $request->teacher;\n $timetable->stage = $request->stage;\n $timetable->room = $request->room;\n $timetable->school_id = auth()->user()->school_id;\n $timetable->save();\n\n\n }", "public function store()\n\t{\n\t\tif( !$this->validator->passes() )\n\t\t{\n\t\t\treturn Redirect::back()->withInput()->withErrors($this->validator->errors);\n\t\t}\n\t\t\n\t\t$foodEntry = $this->foodEntry->create(Input::all());\n\n\t\treturn Redirect::back()\n\t\t->with('success', 'Entry added successfully');\n\t}", "public function store(){\n\t\tif( Authority::can('create', 'Event') ){\n\t\t\t$input = Input::all();\n\t\t\t$memory = $this->memory->store($input);\n\t\t\treturn Redirect::route('memories.show', $memory->id);//->with('success', 'The new memory has been created');\n\t\t}\n throw new NotAllowedException();\n\t}", "public function store(Request $request)\n {\n $data = request()->validate([\n 'description' => 'required',\n 'timing' => 'required',\n 'duration' => 'required',\n ]);\n\n $slot = new Slot();\n\n //prepare the time\n $hour = request('timing');\n $timing = $hour . \":00\";\n\n // Getting data \n $slot->description = request('description');\n $slot->timing = $timing;\n $slot->duration = request('duration');\n $slot->venueID = request('venueID');\n\n $saved = $slot->save();\n if ($saved) {\n return redirect('/venue');\n }\n }", "public function persist()\n {\n $uid = $this->getIdentifier() == 0 ? 'NEW' . rand(100000, 999999) : $this->getIdentifier();\n $data = [\n trim(static::$storageTableName) => [\n $uid => $this->getPersistableDataArray()\n ]\n ];\n // New records always must have a pid\n if ($this->getIdentifier() == 0) {\n $data[trim(static::$storageTableName)][$uid]['pid'] = 0;\n }\n /** @var \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $tce */\n $tce = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\DataHandling\\DataHandler::class);\n $tce->start($data, []);\n $tce->process_datamap();\n }", "public function store(Request $request)\n {\n $path = $request->file('photo')\n ->store('events/images');\n $event = new Event();\n $event->title = $request->title;\n $event->vacancy = $request->vacancy;\n $event->user_id = 1;\n $event->price = $request->price;\n $event->start_date = $request->start_date;\n $event->final_date = $request->final_date;\n $event->description = $request->description;\n $event->picture = $path;\n $event->payment_deadline = $request->payment_deadline;\n $event->meeting_point = $request->meeting_point;\n $event->meeting_point_map = $request->meeting_point;\n $event->equipment = $request->equipment;\n $event->food = $request->food;\n $event->what_is_included = $request->what_is_included;\n $event->what_is_not_included = $request->what_is_not_included;\n\n $event->save();\n\n return redirect()->route('evento.index')\n ->with([\n 'aviso' => 'Evento cadastrado com sucesso.',\n 'type' => 'success'\n ]);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'Fecha' => 'required',\n 'Hora' => 'required',\n 'Disponibilidad' => 'required',\n 'odontologo' => 'required',\n ]);\n\n $agenda = new Agenda();\n $agenda->Fecha = $request->Fecha;\n $agenda->Hora = $request->Hora;\n $agenda->Disponibilidad = $request->Disponibilidad;\n $agenda->IdOdontol = $request->odontologo;\n $agenda->save();\n \n BitacoraController::store($request, \"Datos de la Agenda Modificadados\");\n return redirect()->route('agendas.index')\n ->with('success', 'Funcion completada existosamente');\n \n }", "public function store(Request $request)\n {\n $app_time = $request->get('app_time');\n $app_address = $request->get('app_address');\n $app_officer = $request->get('app_officer');\n $fileid = $request->get('fileid');\n\n if($request->ajax()) {\n\n if(UserFileTypes::updateOrCreate(\n\n [\n 'user_id' => $app_officer,\n 'file_id' => $request->get('fileid'),\n ]\n\n )){\n\n if(Appointments::Create(\n\n [\n 'ref_file' => $fileid ,\n 'appointment_time' => $app_time,\n 'address' => $app_address,\n 'signing_officer' => $app_officer,\n\n ]\n\n )){\n\n echo 'SUCCESS';\n\n }\n }\n\n }\n }", "public function store(Request $request)\n {\n\n // Validation\n $this->validate($request, [\n 'title' => 'required|min:5|max:20',\n 'content' => 'required|min:5|max:100',\n 'time' => 'required',\n ]);\n\n $inputs = $request->all();\n\n $time = explode(\" - \", $request->input('time'));\n\n $inputs['start_time'] = $this->change_date_format($time[0]);\n $inputs['end_time'] = $this->change_date_format($time[1]);\n\n Event::create($inputs);\n\n Session::flash('created_event', 'The event was successfully created!');\n\n return redirect('admin/calendar');\n\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n \"newTaskNote\"=>\"required|string|max:20000\",\n \"taskID\"=>\"required|integer\",\n ]);\n $task_note = new TaskNote;\n $task_note->report = $request->newTaskNote;\n $task_note->task_id = $request->taskID;\n $task_note->save();\n $task = Task::find($request->taskID);\n return redirect(redirect()->getUrlGenerator()->previous() . \"#TP\". $task->time_period_id);\n }", "public function store(ReservationRequest $request)\n {\n\n try {\n // return $request;\n DB::beginTransaction();\n\n $DoctorSchedule= DoctorSchedule::create([\n 'doctor_id' => (int)$request->doctor_id,\n 'scheduleDate' => $request->scheduleDate,\n 'startTime' => $request->startTime,\n 'endTime' => $request->endTime,\n 'bookAvailable' => $request->bookAvailable,\n ]);\n\n Appointment::create([\n 'doctor_id' => (int)$DoctorSchedule->id,\n 'name' => $request->name,\n 'phone' => $request->phone,\n ]);\n DB::commit();\n return redirect()->route('reservation.index')->with(['success' => 'تم ألاضافة بنجاح']);\n } catch (\\Exception $ex) {\n DB::rollback();\n return redirect()->route('reservation.index')->with(['error' => 'حدث خطا ما برجاء المحاوله لاحقا']);\n }\n }", "public function store(Request $request)\n {\n //\n /**\n * Find patient in database\n *\n * @var <type>\n */\n $patient = Patient::find($request->patient);\n\n /**\n * Find service in database\n *\n * @var <type>\n */\n $service = Service::find($request->service);\n\n /**\n * initial where array to find patient service\n * based on posted service id\n *\n * @var array\n */\n $where2 = array('service_id'=>$request->service,'patient_id'=>$request->patient);\n\n /**\n * find patient service\n *\n * @var <type>\n */\n $patientService = $patient->reminderService()->where($where2)->first();\n\n \n /**\n * check current patient service \n * active or not if action then \n * change its is changed value\n */\n \n if($patientService->status==1):\n\n /**\n * Assign value one for ischanged object\n */\n $patientService->ischanged = 1;\n\n /**\n * Save patient service\n */\n $patientService->save();\n\n endif;\n\n /**\n * check current action \n * if current action is add\n * then insert patient reminder times in db\n */\n if($request->action=='add'):\n\n /**\n * intialize patient reminder time object\n * and assign service ,patient and patient service\n * and time id to patientReminderDays object\n * and save it\n * @var <type>\n */\n $patientReminderTime = new PatientReminderTime;\n $patientReminderTime->service_id = $request->service;\n $patientReminderTime->patient_id = $request->patient;\n $patientReminderTime->pat_ser_id = $patientService->id;\n $patientReminderTime->time_id = $request->time_id;\n $patientReminderTime->save();\n else:\n\n /**\n * initialize where for service_id,patient_id and time_id\n *\n * @var array\n */\n $where = array('service_id'=>$request->service,'patient_id'=>$request->patient,'time_id'=>$request->time_id);\n \n /**\n * delete day id based on service_id,patient_id and time_id\n *\n * @var <type>\n */\n \n $patientReminderTime = PatientReminderTime::where($where)->delete(); \n endif;\n \n /**\n * Pass pateient and service object in \n * service view and return view for ajax response\n */\n return \\Response::view('partials.ajax.service',compact('patient','service'));\n\n }", "public function store()\n {\n $this->storeKeys();\n }", "public function store()\n {\n $this->validate([\n 'name' => 'required',\n 'content' => 'required',\n ]);\n \n Todo::updateOrCreate(['id' => $this->todo_id], [\n 'name' => $this->name,\n 'content' => $this->content\n ]);\n \n session()->flash('message', \n $this->todo_id ? 'Todo successfully updated.' : 'Todo successfully created.');\n \n $this->closeModal();\n $this->resetInputFields();\n }", "public function store()\n {\n $this->plot->fill($this->params['plot']);\n\n if ($this->plot->save()) {\n\n $application = ServiceApplication::create([\n 'FormID' => 3,\n 'ServiceID' => 1603,\n 'ServiceStatusID' => 1,\n 'SubmissionDate' => date('Y-m-d H:i:s'),\n 'CustomerID' => $this->currentUser->agentAccount->id\n ]);\n\n $application->save();\n\n return redirect('/dashboard')->with('message', 'Application Submitted!');\n\n } else {\n dd('error!');\n }\n }", "public function store()\n\t{\n $data \t\t= $this->inputAll();\n $rules = $this->events->getRules();\n\n\n $properties = array();\n unset($data['storage_events_id']);\n if(isset($data['properties_id']) && count($data['properties_id']))\n {\n $properties = (is_array($data['properties_id'])) ? $data['properties_id'] : [];\n unset($data['properties_id']);\n }\n\n $data['is_arifmetic'] = (isset($data['is_arifmetic'])) ? $data['is_arifmetic'] : 0;\n\n $validator \t= $this->validator->make($data, $rules);\n if ($validator->fails())\n {\n return $this->redirect->back()->withErrors($validator)->withInput();\n }\n\n $eventCreated = $this->events->create($data);\n if($eventCreated)\n {\n if(count($properties))\n foreach($properties as $num => $id)\n StorageEventsHasEventsProperties::create(array(\"storage_events_id\" => $eventCreated->id, \"event_prop_id\" => $id));\n }\n\n return $this->redirect('events.index');\n\t}", "public static function store()\n {\n $user = User::getUser(Authentication::$user_email);\n Tutor::create_tutor($user->getEmail(), '', 0);\n }", "public function save()\n {\n // make sure there is a maximum of 1 unassigned appointment\n if( is_null( $this->assignment_id ) )\n {\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'participant_id', '=', $this->participant_id );\n $modifier->where( 'assignment_id', '=', NULL );\n if( !is_null( $this->id ) ) $modifier->where( 'id', '!=', $this->id );\n if( 0 < static::count( $modifier ) )\n throw lib::create( 'exception\\runtime',\n 'Cannot have more than one unassigned appointment per participant.', __METHOD__ );\n }\n\n parent::save();\n }", "public function store(VendaRequest $request)\n {\n //\n }", "public function store(Request $request)\n {\n //\n // return $request->input('title');\n $title = Input::get('title');\n $start = Input::get('start');\n $end = Input::get('end');\n \n $event = new calendarevent;\n $event->doctor_id = Auth::user()->id;\n $event->title = $title;\n $event->start_time = $start;\n $event->end_time = $end;\n $event->status = calendarevent::STATUS_NONE;\n $event->type = calendarevent::TYPE_SHORT;\n $event->save();\n return Response::json(array(\n 'success' => true,\n 'data' => 'sucess'\n ));\n }", "public function store(Request $request)\n {\n $id = Auth::id();\n if (request ('customer_type') == \"Prospect\") {\n\n $strApp = new Appointment;\n $strApp ->is_a_deal = 0;\n $strApp ->id_act_type = 1;\n\n $strScTp = new Schedule_type;\n $strScTp ->telp_flag = 1;\n $strScTp->id_appt = sizeof(Appointment::select('id')->get());\n\n $strSch = new Schedule;\n $strSch->is_done = 0;\n $strSch->time = request('time');\n $strSch->notes = request('notes');\n $strSch->customer_type_id = sizeof(Schedule_type::select('id')->get());;\n $strSch->id_customer = request('{{$customerz->id}}');\n $strSch->id_user_sp = $id;\n $strSch->save();\n\n }\n else if (request ('customer_type') == \"Pending\") {\n $strScTp = new Schedule_type;\n $strScTp ->telp_flag = 0;\n\n $strSch = new Schedule;\n $strSch->is_done = 0;\n $strSch->time = request('time');\n $strSch->notes = request('notes');\n $strSch->customer_type_id = sizeof(Schedule_type::select('id')->get());;\n $strSch->id_customer = request('{{$customerz->id}}');\n $strSch->id_user_sp = $id;\n $strSch->save();\n }\n else {\n\n }\n\n\n\n\n }", "public function store()\n {\n $attributes = request()->validate([\n 'title' => 'bail|required|min:3|max:255|string',\n 'body' => 'bail|required|string|min:5',\n 'attachment' => 'sometimes|nullable|file|mimes:png,jpeg,gif,pdf|max:1024'\n ]);\n \n if (request()->hasFile('attachment')) {\n $path = request()->file('attachment')->store('/', 'ticket');\n $attributes['attachment'] = $path;\n }\n \n $ticket = auth()->user()->tickets()->create($attributes);\n \n if (request()->expectsJson()) {\n return response()->json($ticket->load('replies'));\n }\n \n return redirect(route('tickets.create', app()->getLocale()));\n }", "public function store(Request $request)\n {\n $the_apt_date= ($request->apt_date.\" \".$request->apt_time);\n $date= Carbon::parse($the_apt_date)->format('Y-m-d H:i:s');\n\n $now=Carbon::now();\n if($date>=$now){\n\n $date0= Carbon::parse($date);\n $date_end1=$date0->addHour(1);\n\n $p_id= $request->patient_id;\n $d_id= $request->doctor;\n\n if($p_id!=null && $d_id!=null){\n if($request->apt_time==null ){\n return redirect()->back()->with(\"warning\",\"Saat bilgisi alınamadı. Lütfen tekrar deneyiniz!\");\n }\n if($request->apt_date==null ){\n return redirect()->back()->with(\"warning\",\"Tarih bilgisi alınamadı. Lütfen tekrar deneyiniz!\");\n }\n\n $chk_if_exist= Appointments::where(['patients_id'=>$p_id,'doctors_id'=>$d_id])->where('apt_date',\"=\",$date)->first();\n if($chk_if_exist==null){\n Appointments::create([\n 'patients_id' => $p_id,\n 'doctors_id' => $d_id,\n 'apt_date' => $date,\n 'apt_date_end' => $date_end1,\n 'apt_time' => $request->apt_time,\n 'apt_status' => $request->apt_status,\n ]);\n\n return redirect()->back()->with('success','Randevu Kaydı Başarıyla Yapılmıştır');\n }else{\n return redirect()->back()->with('warning','Bu Hasta İçin, Aynı Tarihte Zaten Bir Randevu Kaydı Açılmıştır. ');\n }\n }else{\n return redirect()->back()->with('warning', 'Lütfen Geçerli Bir Hasta Adı Seçiniz.');\n }\n }else{\n\n return redirect()->back()->with('warning','Geçmiş Bir Tarih İçin Randevu Alınamaz.');\n }\n\n }", "public function store()\n\t{\n $input = Input::only('name','duration','start','finish','summaries_id','user_id');\n\n $this->taskForm->validate($input);\n\n Tasks::create($input);\n\n return Redirect::to('/tasks')->with('flash_message','Task Successfully Saved');\n\n\t}", "public function store(StoreAttendanceRequest $request)\n {\n $request->createAttendance();\n\n return response()->json([\n 'message' => __('Checked in successfully!')\n ]);\n }", "public function store(Request $request)\n {\n $timetable=new Timetable();\n $timetable->class_id=$request->class;\n $timetable->teacher_id=$request->teacher;\n $timetable->date=$request->date;\n $timetable->start_time=$request->start_time;\n $timetable->end_time=$request->end_time;\n $timetable->save();\n return redirect('/timetable');\n\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'titulo' => ['required', 'string', 'min:1', 'max:100'],\n 'nota' => ['required', 'string', 'min:1', 'max:100000'],\n ]);\n $fecha = Carbon::now('America/Mexico_City');\n $hora = $fecha->hour . \":\" . $fecha->minute;\n Note::create(\n [\n 'titulo' => $request['titulo'],\n 'nota' => $request['nota'],\n 'expedient_id' => $request['expedient'],\n 'user_id' => $request['id'],\n 'date' => $fecha,\n 'hora' => $hora\n ]\n );\n return redirect()->route('note.index', $request['expedient']);\n }", "public function store(Request $request)\n {\n try {\n\n $dentalLogInfo = Session::get('request');\n\n $date = $dentalLogInfo['date'];\n $time = $dentalLogInfo['time'];\n $datetime = date('Y-m-d H:i:s');\n\n $logPatient = new DentalLog;\n\n $logPatient->patientID = Session::get('patientInfo.patientID');\n $logPatient->dentistID = Session::get('accountInfo.id');\n $logPatient->clinicType = 'D';\n $logPatient->nurseID = \" \";\n $logPatient->symptoms = $request->symptoms;\n $logPatient->clinicLogDateTime = $datetime;\n $logPatient->concern = Session::get('patientInfo.concern');\n\n $logPatient->save();\n\n // SAVE TO PRESCRIPTION\n\n //TAKING RECENTLY ADDED CLINIC LOG\n $clinicLogID = DentalLog::orderBy('created_at', 'desc')\n ->select('cliniclogs.clinicLogID')\n ->where([['cliniclogs.isDeleted', '<>', '1'],['cliniclogs.clinicType', '=', 'D']])\n ->first();\n\n //SAVE TO DIAGNOSIS\n $diagnosis = new Diagnosis;\n\n $diagnosis->clinicLogID = $clinicLogID['clinicLogID'];\n // $diagnosis->logReferralID = ' ';\n $diagnosis->diagnosisDescription = Session::get('diagnosis');\n $diagnosis->save();\n\n //SAVE CLINICLOGID TO VITALSIGNS\n $vitalSigns = VitalSigns::orderBy('created_at', 'desc')\n ->where('vitalsigns.isDeleted', '<>', '1')\n ->first();\n\n $vitalSigns->clinicLogID = $clinicLogID['clinicLogID'];\n $vitalSigns->save();\n\n if(Input::get('appointmentDate') != ''){\n //SAVE CLINICLOGID TO APPOINTMENTS\n $appointments = new Appointments;\n\n $appointments->clinicLogID = $clinicLogID['clinicLogID'];\n $appointments->appointmentLogID = $clinicLogID['clinicLogID'];\n $appointments->appointmentType = 2;\n $appointments->appointmentDesc = $request->appointmentDesc;\n $appointments->appointmentDate = $request->appointmentDate;\n $appointments->save();\n }\n\n $consultAppointment = Appointments::join('cliniclogs', 'cliniclogs.clinicLogID', '=', 'appointments.appointmentLogID')\n ->join('patients', 'patients.patientID', '=', 'cliniclogs.patientID')\n ->select('cliniclogs.*', 'patients.*', 'appointments.*')\n // ->where('cliniclogs','cliniclogs.clinicLogID', '=', 'appointments.appointmentLogID')\n // ->where('cliniclogs', 'cliniclogs.patientID', '=', 'patients.patientID')\n ->orderBy('appointments.created_at', 'desc')\n // ->where('patients', 'patients.patientID', '=', 'cliniclogs.patientID')\n ->first();\n \n $consultAppointment->isAppointed = 3;\n $consultAppointment->save();\n\n //TAKING RECENTLY ADDED DIAGNOSIS FOR DIAGNOSIS ID INSERTION IN TREATMENT TABLE.\n $diagnosisID = Diagnosis::orderBy('created_at', 'desc')\n ->select('diagnoses.diagnosisID')\n ->where('diagnoses.isDeleted', '<>', '1')\n ->first();\n // SAVE TO TREATMENT\n $patientTreatment = new Treatment;\n\n $patientTreatment->clinicLogID = $clinicLogID['clinicLogID'];\n $patientTreatment->dentalExamination = $request->dentalExam;\n $patientTreatment->oralProphylaxis = $request->oralProphylaxis;\n $patientTreatment->othersTreatment = $request->othersTreatment;\n $patientTreatment->treatmentDescription = $request->treatment;\n $patientTreatment->restoration = $request->restorationChk;\n $patientTreatment->restorationTooth = $request->restorationTxt;\n $patientTreatment->extraction = $request->extractionChk;\n $patientTreatment->extractionTooth = $request->extractionTxt;\n $patientTreatment->diagnosisID = $diagnosisID['diagnosisID'];\n $patientTreatment->save();\n $patientTreatmentID = $patientTreatment->treatmentID;\n\n \n $outsideReferral = OutsideReferrals::orderBy('created_at', 'desc')\n ->where('outsidereferrals.isDeleted', '<>', '1')\n ->first();\n\n if(!empty($outsideReferral)){\n $outsideReferral->treatmentID = $patientTreatmentID;\n $outsideReferral->save();\n }\n \n \n\n for ($i=0; $i < count(Input::get('medArray')) ; $i++) {\n\n $prescription = new Prescription;\n $prescription->treatmentID = $patientTreatmentID;\n // $prescription->medicineID = Input::get('medicineID')[$i];\n // $prescription->quantity = Input::get('medQuantity')[$i];\n // $prescription->medicineUnit = Input::get('medicineUnit')[$i];\n // $prescription->medication = Input::get('medication')[$i];\n // $prescription->dosage = Input::get('dosage')[$i];\n // $prescription->isPrescribed = Input::get('isPrescribed')[$i];\n // $prescription->isGiven = Input::get('isGiven')[$i];\n $prescription->medicineID = Input::get('medArray')[$i]['medicineID'];\n $prescription->quantity = Input::get('medArray')[$i]['medicineQuantity'];\n $prescription->dosage = Input::get('medArray')[$i]['medicineDosage'];\n $prescription->medication = Input::get('medArray')[$i]['medicineMedication'];\n $prescription->isPrescribed = Input::get('medArray')[$i]['isPrescribed'];\n $prescription->isGiven = Input::get('medArray')[$i]['isGiven'];\n $prescription->save();\n }\n\n for ($i=0; $i < count(Input::get('prescribedArray')) ; $i++) {\n\n $prescription = new Prescription;\n $prescription->treatmentID = $patientTreatmentID;\n $prescription->medicineID = Input::get('prescribedArray')[$i]['medicineID'];\n $prescription->quantity = Input::get('prescribedArray')[$i]['medicineQuantity'];\n $prescription->dosage = Input::get('prescribedArray')[$i]['medicineDosage'];\n $prescription->medication = Input::get('prescribedArray')[$i]['medicineMedication'];\n $prescription->isPrescribed = Input::get('prescribedArray')[$i]['isPrescribed'];\n $prescription->isGiven = Input::get('prescribedArray')[$i]['isGiven'];\n $prescription->save();\n }\n\n for ($i=0; $i < count(Input::get('suppArray')) ; $i++){\n\n $usedMedSupply = new UsedMedSupply;\n $usedMedSupply->treatmentID = $patientTreatmentID;\n $usedMedSupply->medSupplyID = Input::get('suppArray')[$i]['medicalSupplyID'];\n $usedMedSupply->quantity = Input::get('suppArray')[$i]['medicalSupplyQuantity'];\n $usedMedSupply->suppliesUnit = Input::get('suppArray')[$i]['medicalSupplyUnit'];\n $usedMedSupply->save();\n }\n \n return Response::json(['message' => 'Successfully Added!']);\n\n } catch (Exception $e) {\n\n $error = $e->getMessage();\n\n return Redirect::back()->with('error', $error)->withInput();\n }\n\n }", "public function store()\n {\n /*$this->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);*/\n tray::updateOrCreate([\n// 'agency_id' => $this->agency_id,\n// 'state_id' => $this->state_id,\n 'name' => $this->name,\n 'logo' => $this->logo,\n 'email' => $this->email,\n 'phone' => $this->phone,\n 'fax' => $this->fax,\n 'address' => $this->address,\n 'facebook' => $this->facebook,\n 'instagram' => $this->instagram,\n 'youtube' => $this->youtube,\n 'viber' => $this->viber,\n 'whatsapp' => $this->whatsapp,\n 'url' => $this->url,\n ]);\n $this->exampleModal = false;\n session()->flash('message',\n $this->tray_id ? 'Tray Updated Successfully.' : 'Tray Created Successfully.');\n\n $this->resetInputFields();\n }", "public function store(Request $request) //Método store para guardar la información\n {\n $patients = new Patient(); //Instancia de pacientes \n\n //Guarda en cada columna lo que viene del formulario por el método get la vista es create\n $patients->documento = $request->get('documento');\n $patients->nombre = $request->get('nombre');\n $patients->apellido = $request->get('apellido');\n $patients->sexo = $request->get('sexo');\n $patients->eps = $request->get('eps');\n\n $patients->save(); //Método save guarda todo lo anterior\n\n return redirect('/patients'); //Recarga de nuevo la página para mostrar la info\n }", "public function store(Request $request)\n {\n $exam = new Exam();\n $exam->course = $request->course;\n $exam->level = $request->level;\n $exam->department = $request->department;\n $exam->invigilator = $request->invigilator;\n $exam->session = $request->session;\n $exam->semester = $request->semester;\n $exam->date = $request->date;\n $exam->time_from = $request->time_from;\n $exam->time_to = $request->time_to;\n $exam->hall = $request->venue;\n $save = $exam->save();\n if ($save) {\n return redirect()->back()->with('success', 'Exam has been successfully scheduled');\n } else {\n return redirect()->back()->with('error', 'Something went wrong!');\n }\n }", "public function store();", "public function store();", "public function store();", "public function store(CreateStudentAttendRequest $request)\n {\n $input = $request->all();\n\n $studentAttend = $this->studentAttendRepository->create($input);\n\n Flash::success('تم تسجيل حضور الطالب بنجاح');\n\n return redirect(route('attendance', $studentAttend->student_id));\n }", "public function store(CreateScheduleRequest $request)\n\t{\n\t \n\t\tSchedule::create($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.schedule.index');\n\t}", "public function store(Request $request)\n {\t\n\t\t$validator = Validator::make($request->all(), [\n 'meeting_room_name' => 'required|max:255',\n 'schedule_at' => 'required',\n 'from_to' => 'required',\n 'duration' => 'required',\n ]);\n\n if ($validator->fails()) {\n return response(['error' => $validator->errors(), 'Validation Error']);\n }\n\n // just to make sure that the until to is filled \n if ($request->input('duration') == \"30 mins\") {\n $uptoThisTime = date('g:i A',strtotime('30 mins',strtotime($request->input('from_to'))));\n }\n elseif ($request->input('duration') ==\"1 hour\") {\n $uptoThisTime = date('g:i A',strtotime('1 hour',strtotime($request->input('from_to'))));\n }\n\n $booking = Booking::create([\n\t\t 'meeting_room_name' => $request->input('meeting_room_name'),\n\t\t 'schedule_at' => $request->input('schedule_at'), \n\t\t 'from_to' => $request->input('from_to'),\n 'until_to' => $uptoThisTime,\n 'duration' => $request->input('duration'),\n\t\t 'user_id'\t=> Auth::User()->id,\n\t\t]);\n\n if ($booking) {\n \t$data['status'] = 1;\n \t$data['message'] = __('Succesfully add new meeting');\n }\n\n return response()->json($data, 200);\n\n }", "public function store(Request $request)\n {\n //guardo la pauta con los datos recibidos\n $pauta = Pauta::create([\n 'titulo' => $request->titulo,\n 'start_date' => Fecha::parse($request->start_date)->format('Y-m-d'),\n 'end_date' => Fecha::parse($request->end_date)->format('Y-m-d'),\n 'vendedor_id' => Auth::id(),\n 'cliente_id' => $request->cliente_id\n ]); \n\n //si existen pantallas para agregar a la pauta lo hago a continuacion\n\n if($request->pantallas != null)\n {\n foreach ($request->pantallas as $key => $pantalla) {\n PantallaCliente::create([\n 'pantalla_id' => $pantalla,\n 'pauta_id' => $pauta->id\n ]);\n }\n }\n\n //si todo ha salido bien podemos terminar retornando\n\n return;\n }", "function save()\n\t{\n\n\t\t$db =JFactory::getDBO();\n\t\t$db->setQuery('select * from #__pbbooking_customfields');\n\t\t$customfields = $db->loadObjectList();\t\t\n\t\t$db->setQuery('select * from #__pbbooking_config');\n\t\t$config = $db->loadObject();\n\t\t\n\t\t//load up the appointment data in an array.\n\t\t$data = array();\n\t\t$error = false;\n\t\tforeach ($customfields as $field) {\n\t\t\tif (JRequest::getVar($field->varname)) {\n\t\t\t\t$data[$field->varname] = is_array(JRequest::getVar($field->varname)) ? implode('|',JRequest::getVar($field->varname)) : JRequest::getVar($field->varname);\n\t\t\t} else if ($field->is_required == 1) {\n\t\t\t\t$error = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$data['treatment_id'] = JRequest::getInt('treatment_id',0);\n\t\t$data['date'] = JRequest::getVar('date',\"\");\n\t\t$data['treatment_time'] = JRequest::getVar('treatment_time');\n\t\t$data['cal_id'] = JRequest::getInt('cal_id');\n\t\t\n\t\t//redirect on error or missing data\n\t\tif ($error || $data['treatment_id'] == 0 || $data['date'] == \"\" || $data['treatment_time'] == \"\") {\n\t\t\t$this->setRedirect('index.php?option=com_pbbooking',JText::_('COM_PBBOOKING_MISSING_DATA'));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t//verify the appointment is actually available \n\t\t$valid = Pbbookinghelper::valid_appointment($data);\n\t\tif ($valid) {\n\t\t\t//create pending event and email user\n\t\t\t$pending_id = Pbbookinghelper::save_pending_event($data);\n\t\t\tif ($pending_id) {\n\t\t\t\t$data['pending_id'] = $pending_id;\n\n\t\t\t\tPbbookinghelper::email_user($data);\n\t\t\t\t\n\t\t\t\t//now redirect - load up the view\n\t\t\t\t$view = $this->getView('PBBooking','html');\n\t\t\t\t$view->setLayout('success');\n\t\t\t\t\n\t\t\t\t//populate needed data into the view.\n\t\t\t\t$db->setQuery('select * from #__pbbooking_treatments where id = '.$db->escape($data['treatment_id']));\n\t\t\t\t$view->service = $db->loadObject();\n\t\t\t\t$view->config = $config;\n\t\t\t\t$db->setQuery('select * from #__pbbooking_pending where id = '.$db->escape($pending_id));\n\t\t\t\t$view->pending = $db->loadObject();\n\n\t\t\t\t//display the view\n\t\t\t\t$view->display();\t\t \t\n\t\t\t} else {\n\t\t\t\t$this->setRedirect('index.php/option=com_pbbooking',JText::_('COM_PBBOOKING_BOOKING_PROBLEM'));\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\t$this->setRedirect('index.php/option=com_pbbooking',JText::_('COM_PBBOOKING_BOOKING_PROBLEM'));\n\t\t}\n\t}", "public function store()\n {\n request()->validate([\n 'nome' => ['required','max:30'],\n 'cal' => ['required', 'min:0', 'max:100000'],\n 'nota' => ['required','max:100']\n ]);\n\n $prato = new Prato(request(['nome','cal','nota']));\n $prato->user_id = auth()->id();\n $prato->save();\n \n\n return redirect('/pratos');\n }", "public function store(Request $request)\n {\n $param = $this->processFormData($request);\n\n $this->timeperiodManager->register($param);\n\n return redirect()->route('admin.timeperiods.index');\n }", "public function store(AddTaskRequest $request)\n {\n $input = $request->validated();\n $input['created_at'] = Carbon::now();\n $input['created_by'] = auth()->user()->id;\n\n try {\n $task = Task::create($input);\n } catch (\\Throwable $th) {\n throw new ItemNotCreatedException('Task');\n }\n\n $task = Task::find($task->id);\n\n $task->project;\n $task->responsible;\n $task->task_status;\n $task->deadline;\n\n return $this->sendResponse(new TaskResource($task), 'Task created successfully.'); \n }", "public function store($date) {\n\n \t// Empty the database before adding new date\n \t$this->truncate();\n\n \t$this->time = $date;\n \t$this->save();\n }", "public function store(Request $request)\n {\n //validate\n $this->validate($request, array(\n 'name' => 'required',\n 'description' => 'required',\n ));\n //store\n $event = new Event;\n\n $event->name = $request->name;\n $event->description = $request->description;\n $event->start = $request->start;\n $event->end = $request->end;\n $event->save();\n\n $adress = new Adresses;\n\n $adress->line1 = $request->line1;\n $adress->city = $request->city;\n $adress->ZIP = $request->ZIP;\n $adress->country = $request->country;\n\n $event->adresses->save($adress);\n \n //Redirect\n Session::flash('succes', 'The event was succesfully saved!');\n\n return redirect()->route('events.index');\n }", "public function store(Request $request)\n {\n $event = new EventCalendar;\n $event->title = $request->title;\n $starting_date = strtotime($request->starting_date);\n $event->starting_date = date('Y-m-d',$starting_date).' 00:00:01';\n $ending_date = strtotime($request->ending_date);\n $event->ending_date = date('Y-m-d', $ending_date).' 23:59:59';\n $event->school_id = school_id();\n $event->session = get_schools();\n if($event->save()) {\n flash(translate('event_has_been_created_successfully'))->success();\n \n }\n return redirect()->back();\n }" ]
[ "0.72652537", "0.717766", "0.7097097", "0.7054648", "0.7051368", "0.7024076", "0.6999663", "0.6835445", "0.679555", "0.67383486", "0.6634755", "0.66209185", "0.65978706", "0.6595191", "0.6539228", "0.6530597", "0.64826113", "0.6471175", "0.6418263", "0.63065606", "0.6302398", "0.6273868", "0.626835", "0.6263095", "0.6216029", "0.61764854", "0.6156148", "0.613506", "0.613302", "0.61294526", "0.6094141", "0.6077021", "0.6075138", "0.6064813", "0.60523266", "0.6046939", "0.6022556", "0.6012526", "0.5983438", "0.5971012", "0.5957524", "0.5955058", "0.594526", "0.59369034", "0.59354764", "0.5927054", "0.5922609", "0.59185547", "0.5915192", "0.5908119", "0.5903315", "0.58970207", "0.5895974", "0.5886825", "0.58753794", "0.58718145", "0.5869166", "0.5867322", "0.5865799", "0.58615184", "0.5856066", "0.585021", "0.5843897", "0.5838267", "0.5827198", "0.5824095", "0.58173865", "0.5813247", "0.5809902", "0.58095074", "0.5803642", "0.57996684", "0.5798475", "0.5797955", "0.5797797", "0.5795773", "0.57957333", "0.57902014", "0.57889163", "0.5788684", "0.5781516", "0.57805073", "0.5775622", "0.5773079", "0.5768941", "0.5762224", "0.5762104", "0.5755271", "0.5755271", "0.5755271", "0.57447296", "0.5743872", "0.5736721", "0.5736452", "0.5729555", "0.572792", "0.5725344", "0.57205534", "0.5719707", "0.5717544", "0.57161677" ]
0.0
-1
Show the form for editing the specified appointment.
public function edit($id) { if (Sentry::check()) { // Find active user $user = Sentry::getUser(); // Check permissions if ($user->hasAnyAccess(['school', 'event'])) { $event = Appointment::find($id); // Check if user is superAdmin if ($user->hasAccess(['school'])) { $groups = Group::where('school_id', '<>', '')->get(); } elseif ($user->school_id == $event->group->school_id) { // Check if User belongs to group/school which the appointment is from $user->load('school.groups.appointments'); $groups = $user->school->groups; } else { return Redirect::route('calendar.index'); } // Make a list of all the groups in a school to show with the view $smartgroup = []; foreach ($groups as $group) { $smartgroup[$group->id] = $group->name; } $event = Appointment::find($id); return View::make('calendar.edit')->with('groups', $smartgroup)->with('event', $event); } else { // If no permissions, redirect the user to the calendar index page return Redirect::route('calendar.index'); } } else { return Redirect::route('landing'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Appointment $appointment)\n {\n //\n }", "public function edit(Appointment $appointment)\n {\n //\n }", "public function edit($id)\n {\n $appointment = Appointment::find($id);\n return view('admin.appointments-edit', ['appointment' => $appointment]);\n }", "public function edit($id)\n {\n $appointment = $this->repository->find($id);\n\n return view('appointments.edit', compact('appointment'));\n }", "public function edit(Appointments $appointments)\n {\n //\n }", "public function editAction()\n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if (!$id) {\n return $this->redirect()->toRoute('appointment', array(\n 'action' => 'add'\n ));\n }\n\n // Get the Appointment with the specified id. An exception is thrown\n // if it cannot be found, in which case go to the index page.\n try {\n $appointment = $this->getAppointmentTable()->getappointment($id);\n }\n catch (\\Exception $ex) {\n return $this->redirect()->toRoute('appointment', array(\n 'action' => 'index'\n ));\n }\n \n $form = new AppointmentForm();\n //attach model to the form\n $form->bind($appointment);\n \n // Display appointment start and end time on form as Y-m-d\\TH:i because seconds should be 00 for a valid input of //datetimelocal\n $form->setData([\n 'start_time' => date_create_from_format('Y-m-d H:i:s', $appointment->start_time)->format('Y-m-d\\TH:i'), \n 'end_time' => date_create_from_format('Y-m-d H:i:s', $appointment->end_time)->format('Y-m-d\\TH:i'),\n ]);\n \n \n $form->get('submit')->setAttribute('value', 'Edit');\n\n // perform similar steps as Add action\n $request = $this->getRequest();\n if ($request->isPost()) {\n $form->setInputFilter($appointment->getInputFilter());\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $this->getAppointmentTable()->saveAppointment($appointment);\n\n // Redirect to list of appointments\n return $this->redirect()->toRoute('appointment');\n } else {\n // $validator = new Zend_Validate_Date();\n // $validator->setMessage( 'Please input 00 in seonds !',Zend_Validate_Date::INVALID_DATE);\n $messages = $form->getMessages();\n }\n }\n\n \n return array(\n 'id' => $id,\n 'form' => $form,\n );\n }", "public function edit(Request $request, Appointment $appointment)\n {\n return view('workbench.edit', compact('appointment'));\n }", "public function edit($id)\n {\n $appointment = Appointment::findOrFail($id);\n $patients = Patient::all();\n $doctors = Doctor::all();\n return view('admin.appointments.edit')->with([\n 'appointment' => $appointment,\n 'doctors' => $doctors,\n 'patients' => $patients\n ]);\n }", "public function edit($id)\n {\n $model = Appointment::whereId($id)->first();\n if (empty($model)) {\n return abort('404');\n }\n return view('appointment.update', compact('model'));\n }", "public function edit(SubscriptionAppointment $subscriptionAppointment)\n {\n //\n }", "public function edit($id)\n {\n $appointment = Appointment::find($id);\n $users = User::whereHas('role', function($q){\n $q->where('name', 'Doctor');\n })->get();\n\n $proficiencies = Proficiency::All();\n return view ('help.appointment.edit', compact('appointment', 'users', 'proficiencies'));\n }", "public function edit($id)\n\t{\n\t\t$vitalsign = Vitalsign::where('appointment_id', $id)->get()->first();\n\n\t\treturn View::make('vitalsigns.edit', compact('vitalsign'));\n\t}", "public function edit()\n {\n return view('timetable::edit');\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 show(Appointment $appointment)\n {\n //\n }", "public function show(Appointment $appointment)\n {\n //\n }", "public function edit(Event $event)\n {\n $action = route('events.update', $event);\n\n return view('department.events._form', compact('event'))->with('action', $action)->with('method', 'put');\n }", "public function edit($id)\n {\n $appointment = Appointment::findOrFail($id);\n $doctors = Doctor::pluck('name','id')->all();\n$patients = Patient::pluck('name','id')->all();\n\n return view('appointments.edit', compact('appointment','doctors','patients'));\n }", "public function edit($id)\n {\n\n $appointment = $this->appointmentRepo->update_status($id, 1);\n \n $files = Storage::disk('public')->files(\"patients/\". $appointment->patient->id .\"/files\");\n \n return view('appointments.edit',compact('appointment', 'files'));\n\n }", "public function edit($id)\n {\n $programEvent = ProgramEvent::find($id);\n\n return view('program-event.edit', compact('programEvent'));\n }", "public function edit($patient_id)\n {\n $patient = Patient::findOrFail($patient_id);\n \n $doctors = Doctor::all();\n\n $appointments = DB::table('appointments')\n ->join('patients', 'patient_id_fk', 'patient_id')\n ->join('doctors', 'doctor_id_fk', 'doctor_id')\n ->select('*', 'doctors.name as doctor_name', 'patients.name as patient_name')\n ->where('patient_id', $patient_id)\n ->orderBy('appointment_id', 'desc')\n ->get();\n\n\n return view('patients-record.edit', compact('patient', 'doctors','appointments'));\n }", "public function edit(PatientAppointmentReminders $patientAppointmentReminders)\n {\n //\n }", "public function edit($id)\n {\n $agenda = Agenda::find($id);\n if(is_null($agenda)){\n abort(404);\n }\n $this->page->setTitle('Agenda Edit');\n return view('data-entry.agenda.edit')->with([\n 'page' => $this->page,\n 'agenda' => $agenda\n ]);\n }", "public function edit($id_app)\n {\n $app = KatApp::findOrFail($id_app);\n return view('admin.application.edit')->withApp($app);\n }", "public function edit($id)\n {\n $adminevent = Event::find($id);\n return view('admin/adminevent.edit',compact('adminevent'));\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 edit($id)\n {\n $reservation = Appointment::findOrFail($id);\n\n $Doctors = Doctor::get();\n\n return view('Admin.reservations.edit', compact('reservation', \"Doctors\"));\n }", "public function edit() {\n $this->authorize(PermissionEnum::getInstance(PermissionEnum::EventBookingImmediate)->key, User::class);\n $events = auth()->user()->eventsToBook()->getModels();\n return view('events.my', ['events' => $events]);\n }", "public function edit(MedioPlataforma $medioPlataforma)\n {\n //\n }", "public function edit(Meeting $meeting)\n {\n //\n }", "public function edit(enquiryForm $enquiryForm)\n {\n //\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n\t{\n\t\t$app = App::find($id);\n\t \n\t \n\t\treturn view('admin.app.edit', compact('app'));\n\t}", "public function editappointment($id = null){\n $appointments_table = TableRegistry::get('Appointments');\n $users_table = TableRegistry::get('Users');\n $appointment = $appointments_table->get($id, [\n 'contain' => []\n ]);\n if ($this->request->is(['patch', 'post', 'put'])) {\n $appointment_time = $this->request->getData('appointment_time');\n $appointment_date = $this->request->getData('appointment_date');\n $time = $appointment_date.' '.$appointment_time;\n $appointment = $appointments_table->patchEntity($appointment, $this->request->getData());\n $appointment->appointment_date = date('Y-m-d H:i A', strtotime($time));\n if ($appointments_table->save($appointment)) {\n $userscontroller = new UsersController();\n $ip = $userscontroller->get_client_ip();\n $userscontroller->makeLog('Updated Appointment', $this->Auth->user('id'), 'Doctor Edited an appointment', $ip, 'Edit');\n $this->Flash->success(__('The appointment has been updated.'));\n\n return $this->redirect(['action' => 'viewappointments']);\n }\n $this->Flash->error(__('The appointment could not be updated. Please, try again.'));\n }\n $doctors = $users_table->find('list', ['limit' => 200])->where(['role_id'=>2]);\n $patients = $appointments_table->Patients->find('list', ['limit' => 200]);\n $this->set(compact('appointment', 'doctors', 'patients'));\n \n $this->viewBuilder()->setLayout('backend');\n }", "public function edit(Appoinment $appoinment)\n {\n $analysts = Analyst::pluck('name', 'id');\n $services = Service::pluck('name', 'id');\n \n $appoinmentsTime = Config::get('app.appoinment_slots_time');\n $appoinmentsTime = $array_object = json_decode(json_encode($appoinmentsTime)); // convert array to Object\n\n return view('app.appoinments.edit', compact('appoinment', 'services', 'analysts', 'appoinmentsTime'));\n }", "public function edit()\n {\n if (Entry::canCreateOrEdit() === false) {\n return Redirect::route('entry.index')\n ->withMessage(\"Sorry, the competition has now started and entries cannot be changed.\");\n }\n\n $entry = $this->getEntry();\n\n if ($entry) {\n return View::make('entry.edit')\n ->with('entry', $entry);\n }\n\n return Redirect::route('entry.index');\n }", "public function edit(Apartment $apartment)\n {\n //\n }", "public function edit($id)\n\t{\n return View::make('depts.edit');\n\t}", "public function edit($id)\n {\n\n $event = Event::findOrFail($id);\n\n $event->start_time = $this->change_date_format_fullcalendar($event->start_time);\n \n $event->end_time = $this->change_date_format_fullcalendar($event->end_time);\n \n return view('webapp-layouts.calendar.edit', compact('event'));\n \n }", "public function edit(Event $event)\n {\n return view('events.edit', compact('event'));\n }", "public function getEdit(){\t\n\n\t\t$rec = Calendar::find(Session::get('calendar_id'));\n\n\t\tif($rec){\n\t\t\treturn View::make('calendar.edit')\n\t\t\t\t\t\t->with('record', $rec);\n\t\t}\t\n\t\treturn Redirect::to('/');\n\t}", "public function edit(Event $event)\n {\n return view('events::edit_event',['event' => $event]);\n }", "public function edit($id)\n\t{\n\t\t$evento = Evento::find($id);\n\t\treturn \\View::make('Evento/update_evento',compact('evento'));\n\t}", "public function edit($id)\n {\n $event = EventCalendar::find($id);\n return view('backend.'.Auth::user()->role.'.event_calendar.edit', compact('event'));\n }", "public function edit($id)\n {\n //\n $plataforma = Plataforma::findOrFail($id);\n return view(\"private.edit-plataforma\",compact(\"plataforma\"));\n }", "public function edit($timeslotID){\n $this->isAuthorize();\n\n // Get Specific Data\n $userID = $this->request->session()->get('userID');\n $allEvents = Apt_event::where('userID','=',$userID)->pluck('evtName', 'id');\n $allEmployee = DB::table('users AS u')\n ->join('role_user AS ur', 'u.id', '=', 'ur.id')\n ->select('u.id','u.name')\n ->where('ur.userType', '=', 4)\n ->where('ur.parentID', '=', $userID)\n ->orderBy('ur.user_id', 'ASC')\n ->pluck('name', 'id');\n $timeslot = Apt_time_slot::where('userID','=',$userID)->where('id','=',$timeslotID)->firstOrFail();\n return view('appointments.timeslot.edit', compact('timeslot','allEvents', 'allEmployee'));\n }", "public function edit($id)\n\t{\n $event = CalendarEvent::find($id);\n if(!$event) {\n Session::flash('errorMessage', \"Post with id of $id is not found\");\n App::abort(404);\n }\n\t\treturn View::make('events.edit')->with(['event' => $event]);\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t\t$app = \\App\\Application::find( $id);\n\t\t\n return view('applications.edit')->with(compact('app'));\n\t}", "public function edit(Event $event)\n {\n return view('event.edit',compact('event'));\n }", "public function edit(Appel $appel)\n {\n return view('admin.appel.edit',compact('appel'));\n }", "public function edit($id)\n {\n $afirmador = Afirmador::find($id);\n $enlaces = Enlace::all();\n return view('admin.servidores.afirmadores.edit')->with('enlaces',$enlaces)->with('afirmador',$afirmador);\n }", "public function edit($id)\n {\n $apartment = Apartment::findOrFail($id);\n $this->authorize('update',$apartment);\n return view('apartments.edit',[\n 'apartment' => $apartment\n ]);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_time\n\t\t$fbf_time = FbfTime::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_time\n\t\t$this->layout->content = View::make('fbf_time.edit')\n->with('fbf_time', $fbf_time);\n\t}", "public function edit(Application $application)\n {\n $found_application = Application::where('id', $application->id)->first();\n return view('applications.edit')->with('applicant', $found_application);\n }", "function edit_appointment($appointment_id) {\r\n\t\tif ($this->session->userdata('user_name') == '') {\r\n redirect('login/index');\r\n } else {\r\n\t\t\t$this->form_validation->set_rules('patient_id', 'Patient Name', 'required');\r\n\t\t\t$this->form_validation->set_rules('doctor_id', 'Doctor Name', 'required');\r\n\t\t\t$this->form_validation->set_rules('start_time', 'Start Time', 'required');\r\n\t\t\t$this->form_validation->set_rules('end_time', 'End Time', 'required');\r\n\t\t\t$this->form_validation->set_rules('appointment_date', 'Date', 'required');\r\n\t\t\t$data['def_dateformate'] = $this->settings_model->get_date_formate();\r\n\t\t\t$data['def_timeformate'] = $this->settings_model->get_time_formate();\r\n\t\t\tif ($this->form_validation->run() === FALSE){\r\n\t\t\t\t$appointment = $this->appointment_model->get_appointments_id($appointment_id);\r\n\t\t\t\t$data['appointment']=$appointment;\r\n\t\t\t\t$patient_id = $appointment['patient_id'];\r\n\t\t\t\t$data['curr_patient']=$this->patient_model->get_patient_detail($patient_id);\r\n\t\t\t\t$data['patients']=$this->patient_model->get_patient();\r\n\t\t\t\t$doctor_id = $appointment['userid'];\r\n\t\t\t\t$data['doctor'] = $this->admin_model->get_doctor();\r\n\t\t\t\t$data['clinic']\t=\t$this->settings_model->get_clinics();\r\n\t\t\t\t$data['selected_doctor_id'] = $doctor_id;\r\n\t\t\t\t$data['selected_clinic_id']\t=\t$appointment['clinic_id'];\r\n\t\t\t\t$this->load->view('templates/header');\r\n\t\t\t\t$this->load->view('templates/menu');\r\n\t\t\t\t$this->load->view('form', $data);\r\n\t\t\t\t$this->load->view('templates/footer');\r\n\t\t\t}else{\r\n\t\t\t\t$patient_id = $this->input->post('patient_id');\r\n\t\t\t\t$curr_patient = $this->patient_model->get_patient_detail($patient_id);\r\n\t\t\t\t$title = $curr_patient['first_name'].\" \" .$curr_patient['middle_name'].$curr_patient['last_name']; \r\n\t\t\t\t$this->appointment_model->update_appointment($title);\r\n\t\t\t\t$year = date('Y', strtotime($this->input->post('appointment_date')));\r\n\t\t\t\t$month = date('m', strtotime($this->input->post('appointment_date')));\r\n\t\t\t\t$day = date('d', strtotime($this->input->post('appointment_date')));\r\n\t\t\t\t$this->index($year, $month, $day);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function edit(Event $event)\n {\n return view('admin.event.edit', compact('event'));\n }", "function appointment_form($form, &$form_state, Appointment $appointment, $op = 'edit', $entity_type) {\n // Add the breadcrumb for the form's location.\n appointment_set_breadcrumb();\n \n $form['#prefix'] = '<div id=\"appointment-form-wrapper\">';\n $form['#suffix'] = '</div>';\n \n $manager = new AppointmentManager($appointment);\n \n if(user_access('edit any appointment')) {\n $form['practitioner'] = [\n '#type' => 'select',\n '#title' => 'Practitioner',\n '#options' => $manager->getPractitionerOptions(),\n '#required' => TRUE,\n '#default_value' => $appointment->practitioner,\n '#empty_option' => ' - Please select -',\n '#ajax' => [\n 'callback' => 'appointment_form_type_ajax_callback',\n 'wrapper' => 'appointment-form-wrapper',\n 'method' => 'replace',\n ],\n '#weight' => 0,\n ];\n }\n else {\n $form['practitioner'] = [\n '#type' => 'hidden',\n '#name' => 'practitioner',\n '#value' => $appointment->practitioner,\n ];\n }\n \n $form['type'] = [\n '#type' => 'checkboxes',\n '#title' => 'Available for...',\n '#options' => [\n 'assessment' => 'Assessment',\n 'counselling' => 'Counselling',\n ],\n '#required' => TRUE,\n '#weight' => 10,\n ];\n // Hide type field if practitioner volunteer\n global $user;\n /** @var \\Drupal\\practitioner\\Entity\\Practitioner $practitioner */\n $practitioner = practitioner_load_from_uid($user->uid);\n \n if ($practitioner && $practitioner->type == 'volunteer') {\n $form['type'] += [\n '#default_value' => ['counselling'],\n '#prefix' => '<div style=\"display: none;\">',\n '#suffix' => '</div>',\n ];\n }\n else {\n $form['type'] += [\n '#default_value' => !empty($appointment->type) ? $appointment->getTypeValue() : ['assessment', 'counselling'],\n ];\n \n }\n \n $default_date = !empty($appointment->date)? date('Y-m-d', $appointment->date) : date('Y-m-d', REQUEST_TIME);\n $default_time_start = !empty($appointment->time_start) ? $appointment->time_start : date('H', REQUEST_TIME) . ':00';\n $default_time_end = !empty($appointment->time_end) ? $appointment->time_end : date('H', REQUEST_TIME + 3600) . ':00';\n \n $query = drupal_get_query_parameters();\n \n if(!empty($query)) {\n if(isset($query['date'])) {\n $default_date = $query['date'];\n }\n \n if(isset($query['time_start'])) {\n $default_time_start = $query['time_start'];\n }\n \n if(isset($query['time_end'])) {\n $default_time_end = $query['time_end'];\n }\n }\n \n $form['date'] = [\n '#type' => 'date_popup',\n '#title' => 'Date',\n '#default_value' => $default_date,\n '#required' => TRUE,\n '#date_type' => DATE_UNIX,\n '#date_timezone' => date_default_timezone(),\n '#date_format' => 'd/m/Y',\n '#date_increment' => 1,\n '#date_year_range' => '0:+3',\n '#weight' => 20,\n ];\n \n $time_options_start = appointment_get_hours_range(8,20, 1800);\n \n $form['time_start'] = [\n '#type' => 'select',\n '#title' => 'Time start',\n '#options' => $time_options_start,\n '#default_value' => $default_time_start,\n '#required' => TRUE,\n '#weight' => 30,\n '#ajax' => [\n 'callback' => 'appointment_form_timestart_ajax_callback',\n 'wrapper' => 'appointment-form-wrapper',\n 'method' => 'replace',\n ],\n ];\n \n \n $time_options_end = appointment_get_hours_range(9,21, 1800);\n \n $form['time_end'] = [\n '#type' => 'select',\n '#title' => 'Time end',\n '#options' => $time_options_end,\n '#default_value' => $default_time_end,\n '#required' => TRUE,\n '#weight' => 40,\n '#ajax' => [\n 'callback' => 'appointment_form_timeend_ajax_callback',\n 'wrapper' => 'appointment-form-wrapper',\n 'method' => 'replace',\n ],\n ];\n \n if (module_exists('chosen')) {\n $form['time_start']['#chosen'] = FALSE;\n $form['time_end']['#chosen'] = FALSE;\n }\n \n // Add the field related form elements.\n $form_state['appointment'] = $appointment;\n field_attach_form('appointment', $appointment, $form, $form_state);\n \n $form['actions'] = array(\n '#type' => 'container',\n '#attributes' => array('class' => array('form-actions')),\n '#weight' => 400,\n );\n \n // We add the form #submit array to this button along with the actual submit\n // handler to preserve any submit handlers added by a form callback_wrapper.\n $submit = array();\n \n if (!empty($form['#submit'])) {\n $submit += $form['#submit'];\n }\n \n if($op == 'edit' && $appointment->state == APPOINTMENT_STATE_SCHEDULED) {\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n '#submit' => $submit + array('appointment_edit_form_submit'),\n '#limit_validation_errors' => [],\n '#name' => 'delete',\n );\n }\n \n $form['actions']['save'] = array(\n '#type' => 'submit',\n '#value' => empty($appointment->identifier()) ? t('Save Appointment'): t('Update Appointment'),\n '#submit' => $submit + array('appointment_edit_form_submit'),\n '#name' => 'save',\n );\n \n if($op == 'add') {\n $form['actions']['add_one'] = array(\n '#type' => 'submit',\n '#value' => t('Save and add more'),\n '#submit' => $submit + array('appointment_edit_form_submit'),\n '#name' => 'add_one',\n );\n }\n\n // We append the validate handler to validate in case a form callback_wrapper\n // is used to add validate handlers earlier.\n $form['#validate'] = array('appointment_edit_form_validate');\n \n return $form;\n}", "public function edit($id) //Debe llevar a la pagina del edit \n {\n $patient = Patient::find($id); //Traerá un solo paciente\n return view('patients.edit')->with('patient',$patient); //Retorna a la vista de editar\n }", "public function edit(Agenda $agenda)\n {\n //\n }", "public function edit()\n {\n return view('panel.order-management.payment.form-edit');\n }", "public function edit($id)\n {\n //\n $attendance= PhysiotherapyRegister::find($id);\n $client=Client::find($attendance->client_id);\n return view('attendances.physiotherapy.edit',compact('attendance','client'));\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function edit($id)\n {\n return view('event::edit');\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "public function edit($id)\n {\n return view('booking/edit')->with('name', $id);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $calendar_event = CalendarEvent::findOrFail($id);\n\n return view('calendar::calendar_events.edit', compact('calendar_event'));\n }", "public function edit($id)\n {\n $apartment = Apartment::findOrFail($id);\n $this->authorize('view',$apartment);\n return view('apartments.edit',[\n 'apartment' => $apartment\n ]);\n }", "public function edit($id)\n\t{\n\t\t$calendar = Calendar::findOrFail($id);\n\t\treturn view('calendarEdit',compact('calendar'));\n\t}", "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(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\n $patient = Patient::findOrFail($id);\n\n\n return view('admin.patients.edit')->with([\n 'patient' => $patient,\n\n ]);\n }", "public function edit($id)\n {\n $evento = evento::findOrFail($id);\n\n return view('evento.edit', compact('evento'));\n }", "public function edit($id)\n {\n $data['event'] = Event::find($id);\n return view(\"Event::edit\", $data);\n }", "public function edit($id)\n {\n $outlet_data = Outlet::find($id);\n $companies = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', compact('outlet_data', 'companies'));\n }", "public function show($id)\n {\n $pageTitle = trans('messages.view_form_title',['form' => trans('messages.appointment') ]);\n $appointmentdata = Appointment::where('id',$id)->first();\n return view('appointment.view', compact('pageTitle' ,'appointmentdata'));\n }", "public function edit()\n {\n return view('Person.edit');\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('common::edit');\n }", "function showApprentice() {\n\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\n\t\t\t\t\t$editForm = new h2o('views/editApprentice.html');\n\t\t\t\t\techo $editForm->render(compact('apprentice'));\n\t\t\t\t}", "public function edit($id)\n {\n //\n //find record of given id\n $edit_form = Assignatory::find($id);\n\n if($edit_form->kind == 'R'){\n $records = Assignatory::all()->where('kind', '=', 'R');\n }elseif ($edit_form->kind == 'AA') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'AA');\n }elseif ($edit_form->kind == 'C') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'C');\n }elseif ($edit_form->kind == 'A') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'A');\n }\n \n $dept = Office::all();\n \n\n //show edit form and pass the info to it\n return View('signatory.editsignatory', compact('edit_form','records','dept')); \n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit($id)\n {\n $event = \\App\\Event::findOrFail($id);\n \n return view('admin.events.edit')->withEvent($event);\n }", "public function edit_m_app($id)\n\t{\n\t\t//dd($id);\n\t\t$m_app = M_app::find($id);\n\t\t\n\t\t//dd($m_app);\n\t\t\n\t\treturn view('admin.m_app.edit_m_app', compact('m_app'));\n\t}", "public function edit(Event $event)\n { \n // $event = Event::findOrFail($id);\n return view('events.edit',compact('event'));\n }", "public function edit($id)\n {\n $eventandoffer = EventsAndOffers::find($id);\n return view('dashboard.eventsandoffers.edit', ['eventandoffer' => $eventandoffer]);\n }", "public function edit(JobApplicant $applicant)\n {\n return view('applicants.edit')->with([\n 'applicant' => $applicant,\n 'vacancy' => $applicant->vacancy,\n 'sexes' => Employee::$sexes,\n 'countries' => countries(true),\n ]);\n }", "public function edit(Doctor_timeslot $doctor_timeslot)\n {\n //\n }", "public function edit($id)\n {\n $programa=Programa::find($id);\n return view('admin.programa.edit')->with('programa',$programa);\n }", "public function edit(PatientAdmission $obj)\n\t{\n\t\t$bed_no = BedNo::all();\n\n\t\t/* Generate Bed List */\n\t\t$data['bed_list'][''] = \"Select Bed No\";\n\t\tforeach($bed_no as $key=>$value):\n\t\t\t$data['bed_list'][$value->id] = $value->bedType->name . ' - ' . $value->name;\n\t\tendforeach;\n\n\t\t$data['doctors_list'] = Doctor::lists('name','id');\n\t\t$data['patient_admission_info'] = $obj;\n\n\t\treturn view('hospital.patient_admission.edit',$data);\n\t}", "public function edit($id)\n {\n $automovel= Automovel::find($id);\n $action= route('admin.automovel.update', $automovel->id);\n return view(\"admin.automovel.form\", compact('automovel','action'));\n\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\n $app = App::findOrFail($id);\n\n return view('pages.app.edit')->with(['app' => $app]);\n }", "public function edit($id)\n {\n //\n \n $event = Event::find($id);\n return view('frontend.editEvent',compact('event'));\n }", "public function edit($id)\n {\n $event = Event::findOrFail($id);\n $start_time = $event->start;\n\n\n return view('event.edit', compact('event', 'start_time'));\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 {\n $event = Event::find($id);\n return view('editEvent')->with(compact('event'));\n }", "public function editTask() {\n return $this->render('enterprise/task/task_form.html.twig');\n }", "public function edit($id)\n {\n $servicio = Postventa::find($id);\n return view('adm.php.editarPostventa')->with('postventa', $servicio);\n }" ]
[ "0.7876415", "0.7876415", "0.7531846", "0.74802816", "0.7450407", "0.7381043", "0.73699325", "0.7182009", "0.71166945", "0.687212", "0.6809398", "0.6797569", "0.67198473", "0.67047286", "0.6619423", "0.6619423", "0.66059333", "0.6579944", "0.65676814", "0.6566292", "0.6487564", "0.6467072", "0.6457418", "0.64507467", "0.63823265", "0.6367939", "0.63569826", "0.6344549", "0.63407713", "0.63378865", "0.63339067", "0.6314428", "0.630966", "0.63087565", "0.6303833", "0.6302027", "0.6300632", "0.6296649", "0.6295597", "0.62905425", "0.62893474", "0.6273268", "0.6271572", "0.6263957", "0.62595534", "0.62532413", "0.6249285", "0.623935", "0.6237641", "0.6221841", "0.62171775", "0.6208027", "0.6207237", "0.62060225", "0.6201638", "0.61969936", "0.6195688", "0.6186715", "0.6185835", "0.6185338", "0.6185227", "0.6185206", "0.6183079", "0.6177035", "0.61746764", "0.61731887", "0.616573", "0.6165674", "0.6161411", "0.6161227", "0.615791", "0.6156535", "0.61534894", "0.6153078", "0.61530465", "0.6151771", "0.6147609", "0.61429554", "0.6141301", "0.61388", "0.6138344", "0.6129972", "0.61291903", "0.612324", "0.6114535", "0.61140245", "0.61116207", "0.61113846", "0.6110777", "0.6110648", "0.6110219", "0.6110032", "0.6109134", "0.61068445", "0.61050993", "0.6104348", "0.61020786", "0.60999703", "0.60992575", "0.60989803" ]
0.62560236
45
Update the specified appointment in storage.
public function update($id) { if (Sentry::check()) { // Find active user $user = Sentry::getUser(); $event = Appointment::find($id); // Check if User belongs to group/school which the appointment is from if ($user->hasAccess('school') || ($user->hasAccess( 'event' ) && $user->school_id == $event->group->school_id) ) { $endDate = new DateTime(); // Check if endDate isn't blank if (Input::get('end-date') == '') { $endDate = null; } $validator = Validator::make( [ 'group' => Input::get('group'), 'description' => Input::get('description'), 'start-date' => Input::get('start-date'), 'end-date' => $endDate, 'start-time' => Input::get('start-time'), 'end-time' => Input::get('end-time'), 'title' => Input::get('title'), 'day' => Input::get('day') ], [ 'group' => 'required', 'description' => 'required', 'start-date' => 'date', 'end-date' => 'date', 'start-time' => 'required|date_format:H:i', 'end-time' => 'required|date_format:H:i', 'title' => 'required' ] ); if ($validator->fails()) { return Redirect::route('event.edit', $id)->withInput()->withErrors($validator); } else { $title = e(Input::get('title')); $description = e(Input::get('description')); $location = e(Input::get('location')); $group_id = Input::get('group'); $start_date = e(Input::get('start-date')); $end_date = e(Input::get('end-date')); $start_time = e(Input::get('start-time')); $end_time = e(Input::get('end-time')); $parents = Input::get('par'); // TODO: Handle All day events, or decide to remove it alltogether // TODO: Update date/time if needed // If the event isn't the whole day, determine the end date/time //$event->allday = false; // Handle datetime if(!$start_date) { $validator->getMessageBag()->add( 'end', Lang::get('validation.required', ['attribute ' => 'start-date ']) ); return Redirect::back()->withErrors($validator)->withInput(); } else { $sd = new DateTime($start_date . ' ' . $start_time); if ($end_date == '') { $end_date = $start_date; } $ed = new DateTime($end_date . ' ' . $end_time); // Check if end date is before start date, if so, return with error if ($sd >= $ed) { $validator->getMessageBag()->add( 'end', Lang::get('validation.after', ['attribute ' => 'end-date ', 'date' => Input::get('start-date')]) ); // Redirect back with inputs and validator instance return Redirect::back()->withErrors($validator)->withInput(); } } // Recurring events handling if ($event->parent_id) { if($parents) { $parent = AppParent::find($event->parent_id); // Update parent event $parent->title = $title; $parent->description = $description; $parent->location = $location; $parent->group_id = $group_id; $parent->save(); Appointment::where('parent_id', $parent->id)->update([ 'title' => $title, 'description' => $description, 'location' => $location, 'group_id' => $group_id ]); } else { // If event had a parent_id, but the checkbox was unchecked, unlink event from parent $event->parent_id = null; } } $event->title = $title; $event->description = $description; $event->location = $location; $event->group_id = $group_id; $event->start_date = $sd; $event->end_date = $ed; $event->save(); return Redirect::route('calendar.index'); } } else { // If no permissions, redirect the user to the calendar index page return Redirect::route('calendar.index'); } } else { return Redirect::route('landing'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(Request $request, appointment $appointment)\n {\n //\n }", "public function update(Request $request, Appointment $appointment)\n {\n //\n }", "public function update(Request $request, Appointment $appointment)\n {\n //\n }", "public function update(Request $request, Appointment $appointment, $id)\n {\n $this->validate(request(), [\n 'name' => 'required|string|max:255',\n 'sns' => 'required|integer',\n 'especialidade' => 'required',\n 'data' => 'required|date|after_or_equal:tomorrow',\n 'user_id' => 'required|integer',\n ]);\n\n $appointment = Appointment::findOrFail($id);\n\n\n if ($appointment->realizada == 0){\n $appointment->update($request->all());\n\n session()->flash('message', 'Appointment updated successfully!');\n \n return redirect('/help/appointment/home');\n }\n else \n {\n session()->flash('message', 'Impossible to updade an medical consultation alredy performed');\n return redirect('/help/appointment/home');\n }\n \n }", "public function updated(Appointment $appointment)\n {\n $appointment->saveToHistory();\n }", "public function update(Request $request, Appointment $appointment)\n {\n $appointment = Appointment::find($request->id);\n $appointment->title = $request->title;\n $appointment->startDate = $request->startDate;\n $appointment->endDate = $request->endDate;\n $appointment->location = $request->location;\n $appointment->update(); // $note->update();\n\n return response([ 'appointment' => new AppointmentResource($appointment), 'message' => 'Retrieved Successfuly'],200);\n }", "public function update(Request $request, Appointments $appointments)\n {\n //\n }", "public function update($id, Request $request)\n {\n\n \n $data = $this->getData($request);\n \n $appointment = Appointment::findOrFail($id);\n $appointment->update($data);\n\n return redirect()->route('appointments.appointment.index')\n ->with('success_message', 'Appointment was successfully updated.');\n\n }", "public function update(Request $request, Appointment $appointment)\n {\n // dd($request);\n $request->validate([\n 'patient_id' => 'required',\n 'doctor_id' => 'required',\n 'doctor_schedule_id' => 'required',\n 'time' => 'required',\n 'description' => 'required'\n ]);\n $appointmentNumber = sprintf(\"%03u-%s-%s\", $request->doctor_id, $request->date, $request->time);\n $data = [\n 'doctor_id' => $request->doctor_id,\n 'patient_id' => $request->patient_id,\n 'doctor_schedule_id' => $request->doctor_schedule_id,\n 'appointment_number' => $appointmentNumber,\n 'reason' => $request->description,\n 'time' => $request->time,\n 'status' => 0\n ];\n $appointment->update($data);\n $notification = [\n 'message' => 'Appointment Has Ben Updated',\n 'date' => $appointment->schedule->date,\n 'time' => $appointment->time,\n 'patient' => $appointment->patient->name,\n 'doctor' => $appointment->doctor->name,\n ];\n $appointment->patient->user->notify(new AppointmentNotification($notification));\n $appointment->doctor->user->notify(new AppointmentNotification($notification));\n return back()->with('success', 'Appointment Updated Successfully');\n }", "public function AppointmentUpdate($data, $appointment) {\r\n if (isset($data['Appointment']) && $data['Appointment'] != '') {\r\n $updateappointment = $data['Appointment'];\r\n $appointment->license_expiry_date = $this->ChangeDateFormate($updateappointment['license_expiry_date']);\r\n $appointment->contract_start_date = $this->ChangeDateFormate($updateappointment['contract_start_date']);\r\n $appointment->contract_end_date = $this->ChangeDateFormate($updateappointment['contract_end_date']);\r\n $appointment->sales_person_commission = $updateappointment['sales_person_commission'];\r\n $appointment->multiple_total = $data['multiple_total'];\r\n $appointment->one_time_total = $data['one_time_total'];\r\n $appointment->save(FALSE);\r\n }\r\n return TRUE;\r\n }", "public function update(Request $request, Appointment $appointment)\n {\n $id = Auth::id();\n if($appointment->user_id != $id){\n\n $appointment->user_id = $id;\n $appointment->statuses_id = 2;\n $appointment->save();\n session()->flash('message', 'Reservering succesvol geplaatst.');\n return redirect()->route('appointments.index');\n }else{\n\n $appointment->user_id = NULL;\n $appointment->statuses_id = 1;\n $appointment->save();\n session()->flash('message', 'Reservering succesvol geanulleerd.');\n return redirect()->route('appointments.index');\n }\n\n }", "public function update(StoreTimeslot $request, $timeslotID){\n $this->isAuthorize();\n\n // Update the Specific Data\n $userID = $this->request->session()->get('userID');\n $timeslot = Apt_time_slot::where('userID','=',$userID)->where('id','=',$timeslotID)->firstOrFail();\n $timeslot->evtID = $request['evtID'];\n $timeslot->agentID = $request['agentID'];\n $timeslot->time_slot = $request['time_slot'];\n $timeslot->slot_duration = $request['slot_duration'];\n $timeslot->save();\n return redirect('appointments/timeslot')->with('status', 'Successfully Time Slot Updated!');\n }", "public function update($meeting)\n {\n\n }", "public function updated(AppointmentNote $note)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $appointment = Appointment::findOrFail($id);\n $request->validate([\n 'duration' => 'required|integer',\n 'price' => 'required|integer',\n 'date' => 'required|date',\n 'time' => 'required',\n 'doctor_id' => 'required|integer',\n 'patient_id' => 'required|integer'\n ]);\n $appointment->duration = $request->input('duration');\n $appointment->price = $request->input('price');\n $appointment->date = $request->input('date');\n $appointment->time = $request->input('time');\n $appointment->doctor_id = $request->input('doctor_id');\n $appointment->patient_id = $request->input('patient_id');\n\n $appointment->save();\n return view('admin.appointments.show')->with([\n 'appointment' => $appointment\n ]);\n }", "public function edit(Appointment $appointment)\n {\n //\n }", "public function edit(Appointment $appointment)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'first_name'=>'required|max:50',\n 'last_name'=>'required|max:50',\n 'phone'=>'required|numeric', \n ],[\n 'phone.required'=>'Phone must be a valid phone number.'\n ]); \n $appointment = Appointment::find($id);\n $appointment->first_name = $request->get('first_name');\n $appointment->last_name = $request->get('last_name');\n $appointment->setServiceTypeId($request->get('service_type_id'));\n $appointment->phone = $request->get('phone');\n $appointment->setDate($request->get('date'));\n $appointment->setTime($request->get('time'));\n $appointment->message = $request->get('message');\n $appointment->save();\n return Redirect::route('admin-appointments-index')->with('message', 'Update Successfull !');\n }", "public function update(Request $request, PatientAppointmentReminders $patientAppointmentReminders)\n {\n //\n }", "public function update(Request $request)\n {\n $id = $request->id;\n $input = $request->all();\n\n $input['date'] = date('Y-m-d',strtotime($request->date));\n\n $appointment = Appointment::find($id);\n $appointment->fill($input)->update();\n return response()->json([ 'status' => true , 'message' => trans('messages.update_form',['form' => trans('messages.appointment')]) ]);\n }", "public function editAppointMent(appointmentClass $info,$id)\n { \n $values = array();\n $sqlUpdate=\"UPDATE appointment SET customer_name='\".$info->getCustomerName().\"',customer_mail='\".$info->getCustomerMail().\"',customer_id='\".$info->getCustomerID().\"',appointment_time='\".$info->getAppointment_time().\"',appointment_date='\".$info->getAppointment_date().\"' WHERE appointment_id='\".$id.\"'\";\n $this->execute($sqlUpdate,$values);\n }", "public function update(Request $request, PatientReminderTime $patientReminderTime)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $input = $request->all();\n\n $validator = Validator::make($input, [\n 'office_id' => 'required',\n 'date' => 'required',\n 'time' => 'required',\n 'stretcher_no' => 'required',\n 'is_save'=> 'required',\n ],[\n 'is_save.required' => 'Office is closed'\n \n ]);\n \n if ($validator->fails()) {\n return redirect('appointment/create')->withErrors($validator)->withInput();\n }\n \n $model = Appointment::whereId($id)->first();\n if (empty($model)) {\n return abort('404');\n }\n $model->office_id = $input['office_id'];\n $model->date = $input['date'];\n $model->time = $input['time'];\n $model->stretcher_no = $input['stretcher_no'];\n $model->create_user_id =Auth::user()->id;\n \n $model->save();\n return redirect('/appointment');\n }", "public function update(Request $request, $id)\n {\n return redirect('/patient/appointment');\n }", "public function update(AppointmentUpdateRequest $request, $id)\n {\n try {\n\n $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_UPDATE);\n\n $appointment = $this->repository->update($request->all(), $id);\n\n $response = [\n 'message' => 'Appointment updated.',\n 'data' => $appointment->toArray(),\n ];\n\n if ($request->wantsJson()) {\n\n return response()->json($response);\n }\n\n return redirect()->back()->with('message', $response['message']);\n } catch (ValidatorException $e) {\n\n if ($request->wantsJson()) {\n\n return response()->json([\n 'error' => true,\n 'message' => $e->getMessageBag()\n ]);\n }\n\n return redirect()->back()->withErrors($e->getMessageBag())->withInput();\n }\n }", "public function update() {\n\n //GETS TASK, DEPENDING ON TASK ID (ID)\n $data=Tasks::find(request('task_id'));\n\n //GETS REQUEST AND REPLACES TASK TITLE & DESCRIPTION\n $data->task=request('task');\n $data->description=request('description');\n\n //SAVES DB\n $data->save();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$data->NotepadID\");\n }", "public function update(Request $request, Meeting $meeting)\n {\n //\n }", "public function update(Request $request, Patient $patient)\n {\n //\n }", "public function update(Request $request, Patient $patient)\n {\n //\n }", "public function updated(Patient $patient)\n {\n\n }", "public function update(Request $request)\n {\n\n $meeting = Meeting::findOrFail($request->meeting_id);\n $schedule = Schedule::findOrFail($request->schedule_id);\n\n //$this->authorize('AtenderCita', $schedule);\n\n $meeting->update([\"estado\"=>\"1\", \"observacion_med\" => $request->observacion]);\n $schedule->update([\"estado\"=>\"2\"]);\n\n return redirect()->route('horarios.index')->with('mensaje','La cita ha finalizado correctamente');\n\n }", "public function update(Request $request, $id)\n {\n $starttime = new \\DateTime($request->starttime);\n $endtime = new \\DateTime($request->endtime);\n DB::table('appointments')\n ->where('id', $id)\n ->update([\n 'physician_id' => $request->physician,\n 'nurse_id' => $request->nurse,\n 'patient_id' => $request->patient,\n 'examinationroom' => $request->exaroom,\n 'start_date_time' => $request->startdate . \" \" . $starttime->format('H:i:s'),\n 'end_date_time' => $request->enddate . \" \" . $endtime->format('H:i:s'),\n ]);\n $dp = DB::table('appointments')->get();\n $dp_obj = $dp->map(function ($element){\n $startdatetime = new Carbon($element->start_date_time);\n $enddatetime = new Carbon($element->end_date_time);\n $patient = Patient::find($element->patient_id)->user->name;\n $physician = Physician::find($element->physician_id)->user->name;\n $nurse = Nurse::find($element->nurse_id)->user->name;\n return [\n 'patient' => $patient, \n 'physician' => $physician,\n 'nurse' => $nurse,\n 'url' => url('admin/appointments'),\n 'id' => $element->id,\n 'exaroom' => $element->examinationroom,\n 'startdatetime' => $startdatetime->toDayDateTimeString(),\n 'enddatetime' => $enddatetime->toDayDateTimeString()\n ];\n });\n return response()->json($dp_obj);\n }", "public function updated(Apartment $apartment)\n {\n //\n }", "function editPatientNotesInDatabase($fileNumber, $name, $phoneNo, $dateOfBirth, $firebaseId, $progressNotes)\n{\n $result = ['result' => false, 'message' => 'Unable to edit patient notes !'];\n\n $isPatientDataValid = isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth);\n if (!$isPatientDataValid['result']) {\n $result['message'] = $isPatientDataValid['message'];\n return $result;\n }\n if (!$firebaseId) {\n $result['message'] = 'Please Select Patient Again';\n return $result;\n }\n\n $data = [];\n $patient = getAppointments(['param' => 'FirebaseId', 'operator' => '==', 'value' => $firebaseId], true);\n if (count($patient) > 0) {\n $data = $patient; // old data\n }\n $data['FirebaseId'] = $firebaseId;\n $data['FileNumber'] = $fileNumber;\n $data['PatientName'] = $name;\n $data['PatientNo'] = $phoneNo;\n $data['DOB'] = $dateOfBirth;\n\n $data['ProgressNotes'] = $progressNotes;\n $appObject = getAppointmentObject($data);\n $appObject = setAppointmentId($appObject);\n $patientSaved = saveRecord(APPOINTMENTS_COLLECTION, $appObject, false);\n\n if ($patientSaved) {\n $result['message'] = \"Patient Notes Saved Successfully\";\n $result['result'] = true;\n return $result;\n }\n return $result;\n}", "public function editappointment($id = null){\n $appointments_table = TableRegistry::get('Appointments');\n $users_table = TableRegistry::get('Users');\n $appointment = $appointments_table->get($id, [\n 'contain' => []\n ]);\n if ($this->request->is(['patch', 'post', 'put'])) {\n $appointment_time = $this->request->getData('appointment_time');\n $appointment_date = $this->request->getData('appointment_date');\n $time = $appointment_date.' '.$appointment_time;\n $appointment = $appointments_table->patchEntity($appointment, $this->request->getData());\n $appointment->appointment_date = date('Y-m-d H:i A', strtotime($time));\n if ($appointments_table->save($appointment)) {\n $userscontroller = new UsersController();\n $ip = $userscontroller->get_client_ip();\n $userscontroller->makeLog('Updated Appointment', $this->Auth->user('id'), 'Doctor Edited an appointment', $ip, 'Edit');\n $this->Flash->success(__('The appointment has been updated.'));\n\n return $this->redirect(['action' => 'viewappointments']);\n }\n $this->Flash->error(__('The appointment could not be updated. Please, try again.'));\n }\n $doctors = $users_table->find('list', ['limit' => 200])->where(['role_id'=>2]);\n $patients = $appointments_table->Patients->find('list', ['limit' => 200]);\n $this->set(compact('appointment', 'doctors', 'patients'));\n \n $this->viewBuilder()->setLayout('backend');\n }", "public function update(Agenda $agenda)\n {\n //\n }", "public function update(Request $request, AgendaItemSpeaker $agendaItemSpeaker)\n {\n //\n }", "public function update(Request $request,$doctor_timeslot)\n {\n Doctor_timeslot::find($doctor_timeslot)->update($request->all());\n return response(array(\n 'error' => false,\n 'message' =>'Doctor time slot Record updated successfully',\n ),200);\n }", "public function edit(Appointments $appointments)\n {\n //\n }", "public function update(Request $request,$id)\n {\n $SubscriptionAppointment = SubscriptionAppointment::find($id);\n $SubscriptionAppointment->update($request->all());\n return response(\n [\n 'error'=> false,\n 'data'=> $SubscriptionAppointment\n ]\n ,201);\n }", "public function update(Request $request, $id)\n {\n $time = explode(\" - \", $request->input('time'));\n \n // $adminevent=$request->all();\n // dd($adminevent);\n $adminevent = Event::find($id);\n $adminevent->title = $request->title;\n $adminevent->start =$request ->start;\n $adminevent->end =$request ->end;\n $adminevent->color = $request->color;\n $adminevent->save();\n \n $request->session()->flash('success', 'The event was successfully edit!');\n return redirect('/adminevent');\n }", "public function update(Request $request, Apartment $apartment){\n $apartment->update($request->all());\n $apartment->services()->sync($request['services']);\n return response()->json($apartment);\n }", "public function update(Request $request, $apt_id){\n // return $request->all();\n // return $request->tooth_record[0][\"itm_id\"];\n\n // $apt_url= url(\"\").\"/Appointments\"; //http://klinik.com:8080\n //return url()->previous();\n //$q_url=url()->previous();//http://klinik.com:8080/Dashboard\n $Appointments_dr_ptn_success=0;\n $Appointments_cahanges_success=0;\n\n $now= Carbon::now();\n $the_apt_date= ($request->apt_date.\" \".$request->apt_time);\n\n $date=Carbon::parse($the_apt_date)->format(\"Y-m-d H:i:s\");// change the format as the db format\n if($date>=$now){\n\n // $date=Carbon::parse($the_apt_date)->format(\"Y-m-d H:i:s\");// change the format as the db format\n $date_e= Carbon::parse($the_apt_date);\n $date_end=$date_e->addHour(1); // slot time\n\n $new_doctor_id=$request->doctor;//it may new doctor or the exist doctor\n $previous_doctor_id=$request->prev_doctor;//it may previous doctor or the exist doctor\n\n if($apt_id!=null && $new_doctor_id!=null && $previous_doctor_id!=null) {\n if($request->apt_time==null ){\n return redirect()->back()->with(\"warning\",\"Saat bilgisi alınamadı\");\n }\n if($request->apt_date==null ){\n return redirect()->back()->with(\"warning\",\"Tarih bilgisi alınamadı\");\n }\n\n if($new_doctor_id==$previous_doctor_id && $request->apt_date==$request->prev_date && $request->prev_time==$request->apt_time ){\n Appointments::where(['id'=>$apt_id])->update([\n // 'doctors_id' => $new_doctor_id,\n //'apt_date' => $date,\n //'apt_date_end' => $date_end,\n //'apt_time' => $request->apt_time,\n 'apt_status' => $request->apt_status,\n 'apt_reason' => $request->apt_rsn,\n ]);\n $Appointments_cahanges_success=1;\n }\n $chk_if_exist = Appointments::where(['doctors_id' => $new_doctor_id, 'patients_id' => $request->patient_id])->where(\"id\",\"!=\",$apt_id)->where(\"apt_date\",\"=\",$date)->first();\n // return $chk_if_exist = Appointments::where(['apt_date'=>$date])->first();\n if ( $chk_if_exist == null ) { //if not exist same patient infos at another doctor page\n Appointments::where(['id'=>$apt_id])->update([//, 'patients_id' => $patient_id, 'doctors_id' => $previous_doctor_id\n 'doctors_id' => $new_doctor_id,\n 'apt_date' => $date,\n 'apt_date_end' => $date_end,\n 'apt_time' => $request->apt_time,\n 'apt_status' => $request->apt_status,\n 'apt_reason' => $request->apt_rsn,\n ]);\n $Appointments_dr_ptn_success=1;\n if(Auth::user()->the_role()!=\"Doktor(Master)\"){\n if($new_doctor_id!=$previous_doctor_id ){\n if(url(\"\").\"/Dashboard\"!=url()->previous())\n return redirect()->to(\"Appointments\")->with(\"success\",\"Doktor değişikliğine gidildiği için; Randevu anasayfasına yönlendirildiniz!\");\n }\n }\n }\n\n\n\n /*****clinic problems ******/\n $the_clinic_problems = Clinic_Problems::where(['apt_problmes_id'=>$apt_id])->get();\n $data_prob=array();\n if(!empty($request->problems)) {\n foreach ( $request->problems as $prob_id => $val ) {\n // return \"id:\".$prob_id.\" Problem:\".$val;\n $data_prob[] = $prob_id;// collect all items(problems) at data array\n }\n }\n if($the_clinic_problems!=null){\n foreach ($the_clinic_problems as $item_prob){// search the db data at items, if not match just delete it\n if(in_array($item_prob->id,$data_prob)==false){// false=if data removed from web\n Clinic_Problems::where('id',$item_prob->id)->delete();\n }\n }\n }\n\n if( !empty($request->notes['notes']['problem'])) { //if there is a new data then create it at db\n foreach ( $request->notes[ 'notes' ][ 'problem' ] as $val ) {\n Clinic_Problems::create([\n 'apt_problmes_id' => $apt_id, //appointments_id\n 'problems' => $val,\n ]);\n }\n }\n /*****End clinic problems ******/\n\n /*****End clinic observations ******/\n $the_clinic_observations = Clinic_Observations::where(['apt_observations_id'=>$apt_id])->get();\n $data_obs=array();\n if(!empty($request->observations)) {\n foreach ( $request->observations as $obs_id => $val_obs ) {\n // return \"id:\".$prob_id.\" Problem:\".$val;\n $data_obs[] = $obs_id;// collect all request items(problems) at data array\n }\n }\n if($the_clinic_observations!=null){\n foreach ( $the_clinic_observations as $item_obs ) {// search the db data at request items, if not match just delete it\n if ( in_array($item_obs->id, $data_obs) == false ) {\n Clinic_Observations::where('id', $item_obs->id)->delete();\n }\n }\n }\n\n if(!empty($request->notes['notes']['observation'])) { //if there is a data create it at db\n foreach ( $request->notes['notes'][ 'observation'] as $val_obs ) {\n Clinic_Observations::create([\n 'apt_observations_id' => $apt_id, // appointments_id\n 'observations' => $val_obs,\n ]);\n }\n }\n\n /*****End clinic observations ******/\n\n /*****End clinic diagnosis(teşhis) ******/\n $the_clinic_diagnosis = Clinic_Diagnosis::where(['apt_diagnoses_id'=>$apt_id])->get();\n $data_diag=array();\n if(!empty($request->diagnosis)) {\n foreach ( $request->diagnosis as $diag_id => $val_diag ) {\n // return \"id:\".$prob_id.\" Problem:\".$val;\n $data_diag[] = $diag_id;// collect all request items(problems) at data array\n }\n }\n if($the_clinic_diagnosis!=null){\n foreach ( $the_clinic_diagnosis as $item_diag ) {// search the data at request items, if not match just delete it from db\n if ( in_array($item_diag->id, $data_diag) == false ) {\n Clinic_Diagnosis::where('id', $item_diag->id)->delete();\n }\n }\n }\n if(!empty($request->notes['notes']['diagnosis'])) { //if there is a new data then create it at db\n foreach ( $request->notes['notes'][ 'diagnosis'] as $val_diag ) {\n Clinic_Diagnosis::create([\n 'apt_diagnoses_id' => $apt_id, //appointments_id\n 'diagnoses' => $val_diag,\n ]);\n }\n }\n\n /*****End clinic diagnosis(araştırma) ******/\n\n /***** clinic investigations ******/\n $the_clinic_investigations = Clinic_Investigations::where(['apt_investigations_id'=>$apt_id])->get();\n $data_invt=array();\n if(!empty($request->investigations)){\n foreach ($request->investigations as $invt_id=>$val_invt){\n // return \"id:\".$prob_id.\" Problem:\".$val;\n $data_invt[]=$invt_id;// collect all request items(problems) at data array\n }\n }\n if($the_clinic_investigations!=null){\n foreach ($the_clinic_investigations as $item_invt){// search the db data at request items, if not match just delete it\n if(in_array($item_invt->id,$data_invt)==false){\n Clinic_Investigations::where('id',$item_invt->id)->delete();\n }\n }\n }\n if(!empty($request->notes['notes']['investigation'])) { //if there is a new data just create it at db\n foreach ( $request->notes['notes'][ 'investigation'] as $val_invt ) {\n Clinic_Investigations::create([\n 'apt_investigations_id' => $apt_id,// appointments_id\n 'investigations' => $val_invt,\n ]);\n }\n }\n /*****End clinic investigations ******/\n\n /***** clinic notes advices ******/\n $the_clinic_note_advices = clinicNotes_advices::where(['apt_notes_adv_id'=>$apt_id])->get();\n $data_note=array();\n if(!empty($request->notes_advices)){\n foreach ($request->notes_advices as $note_id=>$val_note){\n // return \"id:\".$prob_id.\" Problem:\".$val;\n $data_note[]=$note_id;// collect all request items(problems) at data array\n }\n }\n if($the_clinic_note_advices!=null){\n foreach ($the_clinic_note_advices as $item_note){// search the db data at request items, if not match just delete it\n if(in_array($item_note->id,$data_note)==false){\n clinicNotes_advices::where('id',$item_note->id)->delete();\n }\n }\n }\n if(!empty($request->notes['notes']['notes'])) { //if there is a data create it at db\n foreach ( $request->notes['notes']['notes'] as $val_note ) {\n clinicNotes_advices::create([\n 'apt_notes_adv_id' => $apt_id, // appointments_id\n 'notes_advices' => $val_note,\n ]);\n }\n }\n\n /*****End clinic notes advices ******/\n\n /****Teeth Processes *****/\n $teeth_arr=array();\n if(!empty($request->tooth_record)){\n foreach ($request->tooth_record as $tt){\n Teeth_Process::where(\"id\",$tt[\"id\"])->update([\n \"prc_name\"=>$tt[\"name\"],\n \"itm_id\"=>$tt[\"itm_id\"],\n \"piece\"=>$tt[\"piece\"],\n \"itm_type\"=>$tt[\"type\"],\n \"exp_prc\"=>$tt[\"exp\"],\n \"teeth_num\"=>$tt[\"tooth\"],\n ]);\n $teeth_arr[]=$tt[\"id\"]; //set at array all exist ids which at web side\n /*--update teeth of product--*/\n /* $data_product= Product_Stocks::where(\"id\",$tt[\"itm_id\"])->first();\n Product_Stocks::where(\"id\",$tt[\"itm_id\"])->update([\n \"have_products\"=>($data_product->have_products-$tt[\"piece\"]),\n ]); */\n /*--End.update teeth of product--*/\n }\n }\n $teeth_data= Teeth_Process::where(\"apt_id\",$apt_id)->get();\n if($teeth_data!=null){ // if exist data at db\n foreach ($teeth_data as $dd){\n if(in_array($dd->id,$teeth_arr)==false){\n Teeth_Process::where(\"id\",$dd->id)->delete();\n }\n }\n }\n\n if(!empty($request->teeth[\"tooth\"])){ //for new line\n foreach ( $request->teeth[\"tooth\"] as $value){\n if(empty($value[\"itm_id\"])){\n return redirect()->back()->with(\"warning\",\"Yapılan işlemler sayfasında İşlem Adı Bilgisi Alınamadı, Lütfen Açılan Listeden BirSeçim Yapınız!\");\n }\n Teeth_Process::create([\n \"apt_id\"=>$apt_id,\n \"prc_name\"=>$value[\"name\"],\n \"itm_id\"=>$value[\"itm_id\"],\n \"piece\"=>$value[\"piece\"],\n \"itm_type\"=>$value[\"type\"],\n \"exp_prc\"=>$value[\"exp\"],\n \"teeth_num\"=>$value[\"tooth\"],\n ]);\n\n /*___*/\n /*---update parent table of product---*/\n /* $data_product0=Product_Stocks::where([\"id\"=>$value[\"itm_id\"],\"type\"=>0])->first();\n if($data_product0!=null){\n Product_Stocks::where([\"id\"=>$value[\"itm_id\"],\"type\"=>0])->update([\n \"have_products\"=>($data_product0->have_products-$value[\"piece\"]),\n ]);\n } */\n /*---End.update parent table of product---*/\n $data_product1=Product_Stocks::where([\"id\"=>$value[\"itm_id\"],\"type\"=>0])->first(); //as updated\n $data_his_product=product_history::where([\"apt_id\"=>$apt_id,\"product_id\"=>$value[\"itm_id\"]])->first();\n if($data_his_product!=null){\n /* product_history::where([\"apt_id\"=>$apt_id,\"product_id\"=>$value[\"itm_id\"]])->update([\n \"process_date\" =>Carbon::now(),\n \"sold\"=>($data_his_product->sold+$value[\"piece\"]),\n \"remaining\"=>($data_his_product->remaining-$value[\"piece\"]),\n ]); */\n }elseif($data_his_product==null){ //$data_his_product->sold+\n /* product_history::create([\n \"apt_id\"=>$apt_id,\n \"process_date\" =>Carbon::now(),\n \"product_id\"=>$value[\"itm_id\"],\n \"ptn_id\"=>$request->patient_id,\n \"Explanation\"=>$request->patient_name,\n \"sold\"=>$value[\"piece\"],\n \"remaining\"=>$data_product1->have_products\n ]);*/\n }\n /*____*/\n }\n }\n /****End. Teeth Processes *****/\n\n /**** Prescripton *****/\n $pres_arr=array();\n if(!empty($request->pres)){\n foreach ($request->pres as $tt){\n Prescriptions::where(\"id\",$tt[\"id\"])->update([\n \"mdc_name\"=>$tt[\"name\"],\n \"mdc_generic\"=>$tt[\"generic\"],\n \"mdc_dose\"=>$tt[\"dose\"],\n \"mdc_duration\"=>$tt[\"duration\"],\n \"mdc_instruction\"=>$tt[\"instruction\"],\n ]);\n $pres_arr[]=$tt[\"id\"]; //set at array all exist ids which at web side\n }\n }\n $pres_data= Prescriptions::where(\"apt_id\",$apt_id)->get();\n if($pres_data!=null){ // if exist data at db\n foreach ($pres_data as $dd){\n if(in_array($dd->id,$pres_arr)==false){\n Prescriptions::where(\"id\",$dd->id)->delete();\n }\n }\n }\n if(!empty($request->prescription[\"medicine\"])){\n foreach ( $request->prescription[\"medicine\"] as $value){\n Prescriptions::create([\n \"apt_id\"=>$apt_id,\n \"mdc_name\"=>$value[\"name\"],\n \"mdc_generic\"=>$value[\"generic\"],\n \"mdc_dose\"=>$value[\"dose\"],\n \"mdc_duration\"=>$value[\"duration\"],\n \"mdc_instruction\"=>$value[\"instruction\"],\n ]);\n }\n }\n /****End. Prescripton *****/\n\n if($Appointments_cahanges_success==1){\n return redirect()->back()->with(\"success\",\"Değişiklikler Kaydedildi\");\n }elseif( $Appointments_dr_ptn_success==1){\n return redirect()->back()->with(\"success\",\"Randevu ile ilgili değişiklikler başarıyla kaydedilmiştir!\");\n }else{\n return redirect()->back()->with(\"warning\",\"Belirtilen hasta için randevu tarihi daha önce alınmıştır!\");\n }\n }else{\n return redirect()->back()->with(\"warning\",\"Kayıt düzenlemesi için gerekli bilgiler alınamadı.\");\n }\n\n\n }else{\n return redirect()->back()->with(\"warning\",\"Geçmiş bir tarih için randevu işlemleri yapılamaz.\");\n }\n // return $request->prescription['medicine'][0]['name'];\n //return $request->all();\n }", "public function update(PatientAdmission $obj, PatientAdmissionRequest $request)\n\t{\n\t\t$obj->update($request->all());\n\t}", "public function edit(SubscriptionAppointment $subscriptionAppointment)\n {\n //\n }", "public function update($data) {}", "public function update($data) {}", "public function update(Request $request, $id)\n {\n\n $data = $request->all();\n $request->validate([\n 'title' => 'required|max:50',\n 'description' => 'required',\n 'rooms' => 'required|min:1',\n 'beds' => 'required|min:1',\n 'baths' => 'required|min:1',\n 'mq' => 'required|min:1',\n 'address' => 'required|max:60',\n 'published' => 'boolean',\n ]);\n\n $apartment = Apartment::findOrFail($id);\n if (!empty($request->cover)) {\n $path = Storage::disk('public')->put('images', $data['cover']);\n $apartment->cover = $path;\n }\n $apartment->fill($data)->update();\n\n if (!empty($data['services'])) {\n $apartment->services()->sync($data['services']);\n } else {\n $apartment->services()->detach();\n }\n\n return redirect('admin/apartments')->with('success_message', 'Appartemento modificato correttamente');\n }", "public function update(Request $request, $id)\n {\n try{\n if($request->input('paciente_id') != ''){ #Atualizar\n $paciente = Paciente::find($request->input('paciente_id'));\n $paciente->telefone = $request->input('telefone');\n $paciente->celular = $request->input('celular');\n }else{ # Insere\n $dadoPaciente['nome'] = strtoupper(removeAcentos($request->input('nome_paciente')));\n $dadoPaciente['telefone'] = $request->input('telefone');\n $dadoPaciente['celular'] = $request->input('celular');\n $paciente = new Paciente($dadoPaciente);\n }\n $paciente->save();\n $dados['data'] = $request->input('data_marcar');\n $dados['plano_saude'] = $request->input('plano');\n $dados['especialidade_id'] = $request->input('especialidade');\n $dados['medico_id'] = $request->input('medico');\n $dados['horario'] = $request->input('horario_marcado');\n $dados['paciente_id'] = $paciente->id;\n $dados['marcou_user_id'] = Auth::id();\n $dados['unidade_id'] = $request->input('unidade_id');\n $data = explode('/',$request->input('data_marcar'));\n $agenda = Agenda::find($id);\n if($agenda->agenda_status_id == 2){ # Desistiu\n $dados['agenda_status_id'] = 1; # Marcado\n }\n if($agenda->update($dados)){\n $msg = 'alert-success|Consulta alterada com sucesso!';\n }else{\n $msg = 'alert-warning|Erro ao alterar consulta! Se o erro persistir, entre em contato com o administrador.';\n }\n }catch(Throwable $e){\n report($e);\n $msg = 'alert-warning|Erro ao alterar consulta! Se o erro persistir, entre em contato com o administrador.';\n }\n return redirect()->route('agenda.index', ['dia' => $data[0],'mes'=>$data[1],'ano'=>$data[2]])->with('alertMessage', $msg);\n }", "public function update(Request $request, $id)\n {\n // waktu approve/tolak permintaan\n if($request->pilihan == 'Y'){\n $pilihan = 'Y';\n $isi_notifikasi = 'Permintaan appointment kamu diterima. Silahkan buka dan lakukan login di aplikasi E-Care dengan klik link ini: http://trialscode.ddns.net/e-care/ untuk melakukan konseling online dengan Konselor';\n }\n else{\n $pilihan = 'T';\n $keterangan = $request->deskripsitolak;\n $isi_notifikasi = 'Permintaan appointment kamu ditolak, karena: '.$keterangan.'. Silahkan melakukan permintaan chat diwaktu yang berbeda';\n }\n $upd_status = Appointment::find($id)->update([\n 'status' => $pilihan,\n ]);\n $appointment = Appointment::find($id);\n $notif = Notification::create([\n 'user_id' => $appointment->user_id,\n 'message' => $isi_notifikasi,\n ]);\n $event = broadcast(new SendNotification($notif));\n $notif_approve = true;\n $email_mhs = '[email protected]';\n // $email_mhs = '[email protected]';\n // if($data_app->jenis_layanan == 'konseling'){\n // $when = Carbon\\Carbon::now()->addMinutes(1);\n // Mail::to($email_mhs)->later($when, new NotifEmail('Notif', compact('isi_notifikasi','notif_approve')));\n Mail::send('isi-email', compact('isi_notifikasi','notif_approve'), function ($message) use ($email_mhs)\n {\n $message->subject('Notifikasi E-Care');\n $message->from(env('MAIL_USERNAME'), env('MAIL_NAME'));\n $message->to($email_mhs);\n });\n // }\n // return redirect()->action('AppointmentController@index')->with('status', 'Data appointment berhasil diupdate');\n return redirect('jadwalkonselor')->with('status', 'Data appointment berhasil diupdate');\n }", "public function update( )\n {\n\n $rules = array(\n 'animalID' => 'required',\n 'progressDescription' => 'required',\n 'progressID' => 'required'\n\n );\n\n $id = Request::get('progressID');\n\n $validator = Validator::make(Request::all(), $rules);\n\n if ($validator->fails()){\n return Redirect::to('mobileapp/progress/'.$id.'create')\n ->withErrors($validator)\n ->withInput(Request::except('password'));\n } else {\n\n\n $progress= Progress::find($id);\n $progress->progressDescription = Request::get('progressDescription');\n $progress->animalID = Request::get('animalID');\n $progress->save();\n\n Session::flash('message','progress point successfully edited');\n return Redirect::to('mobileapp/animals/'. Request::get('animalID').'/edit');\n }\n }", "public function saveApps(Request $request)\n {\n $apps=$request->results;\n\n foreach(json_decode($apps, true) as $app)\n {\n $appt=Appointment::where('day', '=', $app['day'])->where('doc_id','=', $request->doc_id)->first();\n\n if($app['start'] == \"-\" || $app['end'] == \"-\")\n {\n //Check if appointment already exists in database\n //If exists delete\n if($appt!=null) $appt->delete();\n\n }\n else\n {\n //Check if appointment already exists in database\n //If appointment does not exist create new one\n if($appt==null) $appt= new Appointment();\n\n //Set appointment data\n $appt->doc_id= $request->doc_id;\n $appt->start=$app['start'];\n $appt->end=$app['end'];\n $appt->day=$app['day'];\n $appt->slots=$app['slots'];\n $appt->free_slots=$app['slots'];\n\n //Save appointment\n $appt->save(); \n \n } \n }\n}", "public function update(Request $request, $id)\n {\n $validate = Validator::make($request->all(),[\n 'edit_event'=>'required',\n 'edit_venue'=>'required',\n 'edit_date_of_event'=>'required',\n 'edit_start_of_event'=>'required',\n 'edit_end_of_event'=>'required',\n 'edit_time_in_allowance'=>'required',\n 'edit_time_out_allowance'=>'required',\n ]);\n\n if($validate->fails()){\n return response()->json(array('success'=>false, 'messages'=>'Please input valid data!'));\n }else{\n // try {\n // DB::beginTransaction();\n\n $department = $this->getDepartment(\\Auth::user())->department_position['department_id'];\n $status = ($department == '1')? true : false;\n\n $event = Event::findOrFail($id);\n\n $old_summary = EventSummary::where('event_id', '=', $event->id)->where('status', '=', '1')->first();\n\n /* update title on attendance if update title on event */\n if($event->title != convertData($request['edit_event']) && $old_summary->required_attendance == '1'){\n $attendance = Attendance::where('event_id', '=', $id)->first();\n $attendance->title = convertData($request['edit_event']);\n $attendance->save();\n }\n\n /* event */\n $event->title = convertData($request['edit_event']);\n $event->description = convertData($request['edit_description']);\n $event->department_id = ($status)? $request['department']: $department;\n $changes = $event->getDirty();\n $event->save();\n // dd($request['edit_event_type']);\n\n /* event summaries */\n $old_summary->exclusive = !empty($request['edit_event_type'])? $request['edit_event_type']: '0';\n $old_summary->required_attendance = !empty($request['edit_required_attendance'])? $request['edit_required_attendance']: '0';\n $old_summary->save();\n\n\n /* create attendance if update required_attendance to true */\n if($old_summary->required_attendance === '1'){\n\n $attendance = Attendance::where('event_id', '=', $id)->where('status', '=', '0')->first();\n if(!empty($attendance)){\n $attendance->status = '1';\n $attendance->save();\n }else{\n $attendance = new Attendance;\n $attendance->title = $event->title;\n $attendance->attendance_code = $event->event_code;\n $attendance->event_id = $event->id;\n $attendance->status = '1';\n $attendance->save();\n }\n }else{\n $attendance = Attendance::where('event_id', '=', $id)->where('status', '=', '1')->first();\n if(!empty($attendance)){\n $attendance->status = '0';\n $attendance->save();\n }\n }\n\n\n /* event summaries */\n if($old_summary->date_of_event != $request['edit_date_of_event'] ||\n $old_summary->time_of_event_from != $request['edit_start_of_event'] ||\n $old_summary->time_of_event_to != $request['edit_end_of_event'] ||\n $old_summary->attendees_capacity != $request['edit_attendees_capacity'] ||\n $old_summary->time_in_allowance != $request['edit_time_in_allowance'] ||\n $old_summary->time_out_allowance != $request['edit_time_out_allowance'] ||\n $old_summary->venue != $request['edit_venue']){\n\n $old_summary->status = '0';\n $old_summary->reasons = $request['edit_reason'];\n $old_summary->save();\n\n $summary = new EventSummary;\n $summary->event_id = $event->id;\n $summary->venue = convertData($request['edit_venue']);\n $summary->date_of_event = $request['edit_date_of_event'];\n $summary->time_of_event_from = $request['edit_start_of_event'];\n $summary->time_of_event_to = $request['edit_end_of_event'];\n $summary->attendees_capacity = $request['edit_attendees_capacity'];\n $summary->time_in_allowance = $request['edit_time_in_allowance'];\n $summary->time_out_allowance = $request['edit_time_out_allowance'];\n $summary->required_attendance = $request['edit_required_attendance'];\n $summary->exclusive = $old_summary['exclusive'];\n $summary->required_attendance = $old_summary['required_attendance'];\n $summary->reasons = '';\n $summary->exclusive = $old_summary->exclusive;\n $summary->required_attendance = $old_summary->required_attendance;\n $summary->status = '1';\n $changes = array_merge($changes, $summary->getDirty());\n $summary->save();\n }\n\n // DB::commit();\n\n /* logs */\n action_log('Event Mngt', 'Update', array_merge(['id' => $event->id], $changes));\n\n return response()->json(array('success'=>true, 'messages'=>'Record successfully updated!'));\n // } catch (\\PDOException $e) {\n // DB::rollBack();\n // return response()->json(array('success'=> false, 'error'=>'SQL error!', 'messages'=>'Transaction failed!'));\n // }\n }\n }", "public function update(Request $request, Venta $venta)\n {\n //\n \n $vventa = Venta::find($venta->id);\n $data=$request->all();\n $vventa->update($data);\n return redirect('ventas');\n }", "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, TimeSlot $timeSlot)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $proceeding = Proceeding::findOrFail($id);\n\n $action_point_ids = array();\n foreach($request->input('action_points') as $key => $rackp) {\n $action_point_ids[] = $key;\n }\n //dd($action_point_ids);\n\n $proceeding->date_of_order = date('Y-m-d', strtotime($request->input('date_of_order')));\n $proceeding->litigation_id = $request->input('litigation_id');\n $proceeding->act = $request->input('act');\n $proceeding->document_type = $request->input('document_type');\n $proceeding->order_from = $request->input('order_from');\n //$proceeding->action_points = implode(\",\", $request->input('action_points'));\n $proceeding->notes = $request->input('notes');\n $proceeding->save();\n $proceeding->actpoints()->sync($action_point_ids);\n $request->session()->flash('message', 'Proceeding Updated Successfully');\n return back();\n }", "public function update(Request $request, Speaker $speaker)\n {\n //\n }", "public function update(Request $request, Apartments $apartment)\n {\n //\n }", "public function updateAppointmentRequest($appointment_uuid, $appointment_base, $x_access_token = null, $x_secret_token = null, $authorization = null, $ehelply_active_participant = null, $ehelply_project = null, $ehelply_data = null)\n {\n // verify the required parameter 'appointment_uuid' is set\n if ($appointment_uuid === null || (is_array($appointment_uuid) && count($appointment_uuid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $appointment_uuid when calling updateAppointment'\n );\n }\n // verify the required parameter 'appointment_base' is set\n if ($appointment_base === null || (is_array($appointment_base) && count($appointment_base) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $appointment_base when calling updateAppointment'\n );\n }\n\n $resourcePath = '/appointments/appointments/{appointment_uuid}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($x_access_token !== null) {\n $headerParams['x-access-token'] = ObjectSerializer::toHeaderValue($x_access_token);\n }\n // header params\n if ($x_secret_token !== null) {\n $headerParams['x-secret-token'] = ObjectSerializer::toHeaderValue($x_secret_token);\n }\n // header params\n if ($authorization !== null) {\n $headerParams['authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n // header params\n if ($ehelply_active_participant !== null) {\n $headerParams['ehelply-active-participant'] = ObjectSerializer::toHeaderValue($ehelply_active_participant);\n }\n // header params\n if ($ehelply_project !== null) {\n $headerParams['ehelply-project'] = ObjectSerializer::toHeaderValue($ehelply_project);\n }\n // header params\n if ($ehelply_data !== null) {\n $headerParams['ehelply-data'] = ObjectSerializer::toHeaderValue($ehelply_data);\n }\n\n // path params\n if ($appointment_uuid !== null) {\n $resourcePath = str_replace(\n '{' . 'appointment_uuid' . '}',\n ObjectSerializer::toPathValue($appointment_uuid),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($appointment_base)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($appointment_base));\n } else {\n $httpBody = $appointment_base;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\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 = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function update(StoreApartmentsRequest $request, $id)\n {\n $apartments = Apartments::where('id', $id)->first();\n $data = $request->only(array_keys($request->rules()));\n\n $apartments->fill($data);\n $apartments->save();\n return Redirect::route(Administration::routeName('apartments.index'));\n }", "public function update(PatientRequest $request, Patient $patient)\n {\n $patient->first_name = $request->input('first_name');\n $patient->last_name = $request->input('last_name');\n $patient->phone = $request->input('phone');\n $patient->address = $request->input('address');\n $patient->email = $request->input('email');\n $patient->birth_date = $request->input('birth_date');\n $patient->gender = $request->input('gender');\n $patient->photo = $request->input('photo');\n\n $patient->save();\n\n return redirect()->route('patients.index');\n\n\n }", "public function update(Request $request, Patient $patient)\n {\n $request->validate([\n\n ]);\n $patient->update($request->all());\n return redirect()->route('patients.index')\n ->with('success','Compte Patient successfully');\n }", "public function update(Store $request, $id)\n {\n $user = Auth::user();\n $booking = Booking::query()->find($id);\n if ($request->total_person > $booking->room->room_capacity) {\n return redirect()->back()->with('danger', \"Total person is more than the room's capacity!\");\n } else {\n $booking->update([\n 'total_person' => $request->total_person,\n 'note' => $request->note,\n 'booking_time' => $request->booking_time,\n 'check_in_time' => date_create($request->booking_time)->setTime(9, 00),\n 'check_out_time' => date_create($request->booking_time)->setTime(16, 00)\n ]);\n Mail::to($user->email)->send(new BookingUpdateMail());\n return redirect('user/bookings')->with('message', 'Your booking has been updated!');\n }\n }", "public function update(StoreApplication $request,$id)\n {\n $application=Application::findOrFail($id);\n $application->applicant_name=$request->applicant_name;\n $application->vacancy_id=$request->vacancy_id;\n $application->status=$request->status;\n $application->created_at=$request->created_at;\n\n $application->save();\n Session::flash('success', 'The Application was successfully saved!');\n return redirect()->route('applications.show',$application->status);\n\n }", "public function update(UpdatePatientRecordRequest $request, PatientRecord $patientRecord)\n {\n //\n }", "public function update(ApartmentRequest $request, $id)\n {\n $apartment = Apartment::findOrFail($id);\n $this->authorize('update',$apartment);\n $apartment->name = $request->input('name');\n $apartment->num_floor = $request->input('num_floor');\n $apartment->num_room = $request->input('num_room');\n $apartment->save();\n return redirect()->route('apartments.show',['apartment' => $id]);\n }", "public function update($persona);", "public function update(Request $request, Attandance $attandance)\n {\n //\n }", "public function store(Request $request)\n {\n// dd($request);\n $request->validate([\n 'patient_id' => 'required',\n 'doctor_id' => 'required',\n 'doctor_schedule_id' => 'required',\n 'time' => 'required',\n 'type' => 'required',\n 'description' => 'required'\n ]);\n $appointmentNumber = sprintf(\"%03u-%s-%s\", $request->doctor_id, $request->date, $request->time);\n $oldApp = Appointment::where('appointment_number',$appointmentNumber)->where('status',0)->get();\n if ($oldApp->count() > 0){\n return back()->with('warning','You have already booked Appoitment for the selected date and time');\n }\n // dd($appointmentNumber);\n $data = [\n 'doctor_id' => $request->doctor_id,\n 'patient_id' => $request->patient_id,\n 'doctor_schedule_id' => $request->doctor_schedule_id,\n 'appointment_number' => $appointmentNumber,\n 'reason' => $request->description,\n 'time' => $request->time,\n 'type' => $request->type,\n ];\n // dd($data);\n $newApp = Appointment::create($data);\n $notification = [\n 'message' => 'appointment Has Been Created',\n 'date' => $request->date,\n 'time' => $request->time,\n 'patient' => $newApp->patient->name,\n 'doctor' => $newApp->doctor->name,\n ];\n\n if (isset($request->referral)) {\n $newApp->update(['referred_from' => $request->referral]);\n Appointment::findOrFail($request->referral)->update(['status' => 2, 'referred_to' => $newApp->id]);\n $notification['message'] = 'Appointment Referred';\n $newApp->patient->user->notify(new AppointmentNotification($notification));\n $newApp->doctor->user->notify(new AppointmentNotification($notification));\n return back()->with('success', 'Referred to another doctor successfully');\n }\n $newApp->patient->user->notify(new AppointmentNotification($notification));\n $newApp->doctor->user->notify(new AppointmentNotification($notification));\n if (isset($request->payment) && $request->payment == 'true'){\n $newApp->update(['isPaid'=>true]);\n Payment::create([\n 'appointment_id' => $newApp->id,\n 'amount' => $newApp->doctor->fees\n ]);\n }\n if ($newApp->type == 'Video'){\n $newApp->update(['meeting_link'=>$request->meeting_link]);\n }\n return back()->with('success', 'Appointment Created Successfully');\n // dd($request);\n }", "public function update($question_id, StoreQuestion $request)\n {\n $validated = $request->validated();\n $question = Question::findOrFail($question_id);\n $question->update([\n 'content' => $validated['question'],\n 'expe' => $validated['expe'],\n 'file_id' => $validated['file']\n ]);\n\n return redirect()->route('gamePointIndex', [$question->game->id, $question->point->id])->with('success', 'La question a bien été modifiée');\n }", "public function update(Request $request, Anime $anime)\n {\n //\n }", "public function update(Request $request, Attendance $attendance)\n {\n //\n }", "public function store(Request $request)\n {\n $end_time_arr = explode(\" \", $request->input('endtime'));\n $endtime = $end_time_arr[0]; $format = $end_time_arr[1];\n $endtime = explode(\":\", $endtime);\n $hr = $endtime[0]; $min = $endtime[1];\n if($format == \"PM\")\n {\n $hr = 12 + (int)$hr;\n }\n $endtime = implode(\":\", array($hr, $min));\n $enddatetime = array($request->input('enddate'), strval($endtime));\n $enddatetime = implode(\" \", $enddatetime);\n\n $start_time_arr = explode(\" \", $request->input('starttime'));\n $starttime = $start_time_arr[0]; $format = $start_time_arr[1];\n $starttime = explode(\":\", $starttime);\n $hr = $starttime[0]; $min = $starttime[1];\n if($format == \"PM\")\n {\n $hr = 12 + (int)$hr;\n }\n $starttime = implode(\":\", array($hr, $min));\n $startdatetime = array($request->input('startdate'), strval($starttime));\n $startdatetime = implode(\" \", $startdatetime);\n $patient = $request->patient;\n $nurse = $request->nurse;\n $physician = $request->physician;\n $appointment = new Appointment;\n $appointment->examinationroom = $request->input('exaroom');\n $appointment->start_date_time = $startdatetime;\n $appointment->end_date_time = $enddatetime;\n $appointment->patient_id = $patient;\n $appointment->nurse_id = $nurse;\n $appointment->physician_id = $physician;\n $appointment->save();\n $appointment->patient->status = 'curing';\n $appointment->push();\n\n //Redirect\n return redirect()->route('appointments.index')->with('status', 'stored');\n }", "public function update(Request $request, Planta $planta)\n {\n //\n $vplanta = planta::find($planta->id);\n $data = $request->all();\n $vplanta->update($data);\n return redirect('plantas');\n }", "public function update(Request $request, $id) \n {\n $patient = Patient::find($id); //Trae un solo paciente y el criterio es el id\n\n $patient->documento = $request->get('documento');\n $patient->nombre = $request->get('nombre');\n $patient->apellido = $request->get('apellido');\n $patient->sexo = $request->get('sexo');\n $patient->eps = $request->get('eps');\n\n $patient->save();\n\n return redirect('/patients');\n }", "public function update(Request $request, Venta $venta)\n {\n //\n }", "public function update(Request $request, Venta $venta)\n {\n //\n }", "public function update(Request $request, AttendanceRequest $attendanceRequest)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'string',\n 'description' => 'string',\n 'auditsLimit' => 'int',\n 'time' => 'date'\n ]);\n $meeting = Meeting::findOrFail($id);\n $meeting->title = $request->input('title');\n $meeting->description = $request->input('description');\n $meeting->auditsLimit = $request->input('auditsLimit');\n $meeting->time = $request->input('time');\n if ($meeting->update()) {\n $response = [\n 'message' => 'data updated successfully',\n 'data' => $meeting\n ];\n return response()->json($response, 200);\n } else {\n $response = [\n 'message' => 'error data not updated',\n 'data' => null\n ];\n return response()->json($response, 404);\n }\n }", "public function update(Request $request){\n $code = $request->codigo_semestre;\n $period = Period::where(['codigo_semestre' => $code])->first();\n $period->timestamps = false;\n\n if ($period != null){\n if ($period->estado === 1){\n //$period->estado = 0;\n $period->update(['estado' => 0]);\n }\n else{\n //$period->enabled = 1;\n //$period->description = $request->description;\n }\n //$period->save();\n }\n return redirect('/dashboard/periods');\n }", "public function update(Request $request, $id)\n {\n $alarm = Alarm::find($id)->update($request->all());\n return redirect()->route('alarms.index')\n ->with('success','Alarma actualizado correctamente!');\n }", "public function update(Request $request, Observation $observation)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'remark' => 'required',\n 'value' => 'required',\n ]);\n\n $main_data = $request->all();\n $main_data['updated_by'] = Auth::user()->id;\n if($observation->update($main_data)){\n $notification = array(\n 'message' => $request->name.' Period is updated successfully!',\n 'alert-type' => 'success'\n );\n }else{\n $notification = array(\n 'message' => $request->name.' Period could not be updated!',\n 'alert-type' => 'error'\n );\n }\n return redirect()->route('admin.observation.index')->with($notification);\n }", "public function update(Request $request, $a)\n {\n //\n try {\n $data = $request->all();\n $act = $data[\"act\"];\n\n $act[\"contractDate\"] = date('Y-m-d 00:00:00', strtotime($act[\"contractDate\"]));\n $act[\"actDate\"] = date('Y-m-d 00:00:00', strtotime($act[\"actDate\"]));\n\n DB::beginTransaction();\n try {\n $a = Act::find($a);\n $a->update($act);\n\n $this->saveActProducts($data[\"products\"], $act[\"actId\"]);\n\n }catch (\\Exception $exception){\n DB::rollBack();\n\n return $exception->getMessage();\n }\n\n DB::commit();\n\n return [\"message\"=>\"success\", \"ok\"=>true];\n\n } catch (\\Exception $exception){\n\n return $exception->getMessage();\n }\n\n\n\n }", "public function update(AttendancePolicyRequest $request)\n {\n $attendance_policy_head = $this->attendance_policy_head->update($request);\n if ($attendance_policy_head == 0){\n return redirect('attendance-policy/create')->with('flashMessageError','Unable to create attendance policy');\n }\n $agent = $this->attendance_policy->update($request,$attendance_policy_head);\n if ($agent) {\n return redirect('attendance-policy')->with('flashMessageSuccess','The attendance policy successfully updated.');\n }\n return redirect('attendance-policy')->with('flashMessageError','Unable to updated attendance policy');\n }", "public function update(Request $request, $id)\n {\n $patients = Patients::find($id);\n //Updates\n $patients->save();\n }", "public function update($attream);", "public function update(Request $request, $id)\n {\n // make validator\n // return $request->all();\n $validator = Validator::make($request->all(), ([\n 'name' => 'required|string|min:2|max:30',\n 'date' => 'required|string|date',\n 'announcement' => 'nullable|string',\n 'agenda' => 'required|array',\n ]));\n\n // validate fails\n if ($validator->fails()) return apiResponse(\n $request->all(),\n \"Validation Fails.\",\n false,\n 'validation.fails',\n $validator->errors(),\n 422\n );\n\n // \n $place = Schedule::findOrFail($id);\n\n // \n $update = null;\n DB::transaction(function () use ($request, $place, &$update) {\n $update = $place->update($request->only('name', 'date', 'announcement', 'agenda'));\n });\n\n // \n return apiResponse(\n $place,\n 'update data success.',\n true\n );\n }", "public function update(Request $request, Application $applicant)\n {\n $found_applicant = Application::find($applicant->id);\n //$found_applicantn->user_id =\n $found_applicantion->workshop_id = $request->workshop_id;\n $found_applicant->save();\n return redirect()->action('ApplicationController@index');\n }", "public function putAction()\n {\n try\n {\n $trackingReq = $this->_helper->TrackingRequest($this->_request->getRawBody());\n }\n catch (\\InvalidArgumentException $e)\n {\n $this->sendAlteredResponse(400, 'Malformed APP Envelope');\n }\n\n try\n {\n $this->trackingService->changeFulfillmentStatus($trackingReq);\n }\n catch (\\InvalidArgumentException $e)\n {\n $this->sendAlteredResponse(400, 'No ID passed in content');\n }\n catch (SE\\Infrastructure\\Tracking\\Exception $e)\n {\n $this->sendAlteredResponse(403, 'No Tracking Request Resource With This ID');\n }\n }", "public function update(ApartmentRequest $request, $id)\n {\n\n// $validated = $request->validate([\n// 'name' => ['required','min:3','max:255'],\n// 'floors' => ['required','integer','min:1']\n// ]);\n\n $apartment = Apartment::findOrFail($id);\n $this->authorize('update',$apartment);\n $apartment->name = $request->input('name');\n $apartment->floors = $request->input('floors');\n// $apartment->floors = $request->floors;\n $apartment->save();\n return redirect()->route('apartments.show',['apartment' => $id]);\n\n }", "public function update(Request $input, $id)\n {\n $this->validate($input, [\n 'meeting_date'=>'required', \n 'meeting_start_time'=>'required',\n 'meeting_end_time'=>'required',\n 'purpose'=>'required',\n 'meeting_room'=>'required',\n ]);\n $bookingUpdate = bookings::find($id);\n $bookingUpdate->meeting_date = $input->meeting_date;\n $bookingUpdate->meeting_start_time = $input->meeting_start_time;\n $bookingUpdate->meeting_end_time = $input->meeting_end_time;\n $bookingUpdate->purpose = $input->purpose;\n $bookingUpdate->meeting_room = $input->meeting_room;\n // echo $post;\n $bookingUpdate->save();\n $bookings = bookings::all();\n if (Auth::user()->role=='user'){\n return view('welcome')->with('bookings', $bookings);\n }elseif (Auth::user()->role=='teamlead') {\n return view('teambookings')->with('bookings', $bookings);\n }else{\n return view('admindashboard')->with('bookings', $bookings);\n }\n // echo \"string\";\n }", "public function update(Request $request, Agromeet $agromeet)\n {\n // Validation\n $request->validate([\n 'meeting_title' => 'required',\n 'meeting_title_hindi' => 'required',\n 'meeting_description' => 'required',\n 'meeting_description_hindi' => 'required',\n ]);\n \n $agromeet->meeting_title = $request->input('meeting_title');\n $agromeet->meeting_title_hindi = $request->input('meeting_title_hindi');\n $agromeet->meeting_description = $request->input('meeting_description');\n $agromeet->meeting_description_hindi = $request->input('meeting_description_hindi');\n $agromeet->status = $request->input('status');\n // $agromeet->meeting_date_time = date(\"Y-m-d H:i:s\", strtotime($request->input('meeting_date_time')));\n $file = $request->file('meeting_image');\n if($file){\n $filename = $file->getClientOriginalName();\n $name = \"agromeet_banner\";\n $extension = $file->extension();\n $filenew = date('d-M-Y').'_'.str_replace($filename,$name,$filename).'_'.time().''.rand(). \".\" .$extension;\n $file->move(base_path('/public/uploads/banner'), $filenew);\n $agromeet->meeting_image = asset('/uploads/banner/'.$filenew);\n }\n \n $res = $agromeet->save();\n\n if ($request->ajax()) {\n return response()->json([\n 'success'=>'The Agromeet has been successfully updated.'\n ]);\n }\n return redirect(route('admin.agromeets.index'))->with('ok', __('The Agromeet has been successfully updated'));\n }", "public function updateEvent(Request $request){\n try {\n $token = $request->get('token');\n $eventId = $request->get('eventId');\n $status = $request->get(\"status\");\n if ((is_null($token))\n ||(is_null($eventId))\n ||(is_null($status))){\n return Response::json([\"No content. Fill all the details\",HttpResponse::HTTP_NO_CONTENT]);\n }\n $parent = JWTAuth::toUser($token);\n $parentId = $parent->id;\n $parentDetails = UserDetails::where('user_id',$parentId)->first();\n $parentName = $parentDetails->name;\n }catch (TokenExpiredException $e){\n return Response::json (['Token expired'],498);\n }catch (TokenInvalidException $e){\n return Response::json (['Token invalid']);\n }\n $appointmentSlot = TeacherAppointmentSlots::where('calendarEventsId',$eventId)->first();\n $appointmentSlotId = $appointmentSlot->id;\n $appointmentRequest = AppointmentRequest::where('teacherAppointmentsSlot_id',$appointmentSlotId)->first();\n $appointmentRequestId = $appointmentRequest->id;\n //confirmed\n if($status ==2){\n try {\n $parentContact = $request->get('parentContact');\n if (is_null($parentContact)){\n return Response::json([\"Partial content. Fill all the details\",HttpResponse::HTTP_PARTIAL_CONTENT]);\n }\n DB::beginTransaction();\n DB::table('appointmentRequests')\n ->where('id', $appointmentRequestId)\n ->update(\n ['isApproved' => 1,\n 'isCancel' => 0,\n 'isAwaited' => 0,\n 'parentContact'=>$parentContact\n ]);\n $appointmentLog = new AuditAppointments();\n $appointmentLog->eventId = $eventId;\n //Appointment Request confirmation state\n $appointmentLog->Appointmentstate = 2;\n $appointmentLog->triggeredBy = $parentName;\n $appointmentLog->save();\n }catch (Exception $e){\n DB::rollback();\n $httpStatus = HttpResponse::HTTP_CONFLICT;\n return Response::json([\"Conflict in Confirmation\",$httpStatus]);\n }\n DB::commit();\n $httpStatus = HttpResponse::HTTP_OK;\n return Response::json([\"Success in Confirmation\",$httpStatus]);\n }\n //cancelled\n elseif ($status==3){\n $cancellationReason = $request->get('cancellationReason');\n if (is_null($cancellationReason)){\n return Response::json([\"Partial content. Fill all the details\",HttpResponse::HTTP_PARTIAL_CONTENT]);\n }\n try {\n DB::beginTransaction();\n DB::table('appointmentRequests')\n ->where('id', $appointmentRequestId)\n ->update([\n 'isApproved' => 0,\n 'isCancel' => 1,\n 'isAwaited' => 0,\n 'cancellationReason'=>$cancellationReason\n ]);\n DB::table('teacherAppointmentsSlots')\n ->where('id', $appointmentSlotId)\n ->update(['isBooked' => 0]);\n $appointmentLog = new AuditAppointments();\n $appointmentLog->eventId = $eventId;\n //Appointment Request cancellation state\n $appointmentLog->Appointmentstate = 3;\n $appointmentLog->triggeredBy = $parentName;\n $appointmentLog->save();\n }catch (Exception $e){\n DB::rollback();\n $httpStatus = HttpResponse::HTTP_CONFLICT;\n return Response::json([\"Conflict in Cancellation\",$httpStatus]);\n }\n DB::commit();\n $httpStatus = HttpResponse::HTTP_OK;\n return Response::json([\"Success in Cancellation\",$httpStatus]);\n }\n else{\n return Response::json([\"invalid status\"]);\n }\n }", "public function update(Request $request, $id)\n {\n $param = $this->processFormData($request);\n \n $this->timeperiodManager->update($id,$param);\n\n return redirect()->route('admin.timeperiods.index');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_appointment]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request, $id)\n {\n $input = $request->all();\n BookingTimesPackage::findOrFail($id)->update($input);\n\n //set session message and redirect back booking-times.index\n Session::flash('booking_time_updated', __('backend.booking_time_package_updated'));\n return redirect('/booking-times-package?category='.$input['selectedCategory'].'&package='.$input['selectedPackage']);\n }", "public function update(Request $request, Slot $slot)\n {\n $data = request()->validate([\n 'description' => 'required',\n 'timing' => 'required',\n 'duration' => 'required',\n ]);\n\n //prepare the time\n $hour = request('timing');\n $timing = $hour . \":00\";\n\n // Getting the updated data \n $slot->description = request('description');\n $slot->timing = $timing;\n $slot->duration = request('duration');\n $slot->venueID = request('venueID');\n\n\n $saved = $slot->save();\n // if it saved, we send them to the venue page\n if ($saved) {\n return redirect('/venue');\n }\n }", "public function update(Request $request, int $id) \n {\n $openingTimes = OpeningTimes::findOrFail($id);\n\n $openingTimes->update($request->all());\n\n return $openingTimes;\n }", "public function update(Request $request, $id)\n {\n $this->authorize('isAdminAuthor');\n\n// dd($request->healthcare_provider, $request->medical_record_no);\n $admissionRecord = AdmissionRecord::findorFail($id);\n $admissionRecord->fill($request->all())->save();\n\n return back()->with(['message' => 'Patient updated successfully']);\n }" ]
[ "0.71745104", "0.7076224", "0.7076224", "0.67707264", "0.6688829", "0.6650198", "0.66402316", "0.65066075", "0.64632875", "0.6430749", "0.6334951", "0.6274428", "0.6246911", "0.60774255", "0.60741013", "0.60684973", "0.60684973", "0.6068037", "0.6035936", "0.597246", "0.59170276", "0.5871026", "0.58499974", "0.58079934", "0.57922125", "0.57893676", "0.5788998", "0.5785737", "0.5785737", "0.5776949", "0.5771597", "0.57668924", "0.5760958", "0.57042086", "0.56664664", "0.56624174", "0.5657182", "0.5648516", "0.56302035", "0.5622817", "0.5584786", "0.5572024", "0.5571407", "0.55524844", "0.5517418", "0.5515359", "0.5515359", "0.54853916", "0.5468482", "0.5455439", "0.54546857", "0.5451661", "0.54449934", "0.5436906", "0.5432831", "0.5431244", "0.54258454", "0.5417464", "0.54139644", "0.5404318", "0.5403747", "0.5403366", "0.5401583", "0.5399834", "0.53823185", "0.5381527", "0.53782666", "0.5374025", "0.5370717", "0.53658545", "0.5361416", "0.53562766", "0.5353281", "0.53437895", "0.53321135", "0.53285015", "0.5315102", "0.5315102", "0.5304458", "0.530252", "0.52989507", "0.52984273", "0.52963734", "0.52956784", "0.5295307", "0.52928656", "0.52901834", "0.52895385", "0.52892894", "0.5286295", "0.5284876", "0.5279099", "0.52636987", "0.52613705", "0.5260296", "0.52592516", "0.52525765", "0.52475727", "0.5240872", "0.52302283" ]
0.5449817
52
Remove the specified appointment from storage.
public function destroy($id) { if (Sentry::check()) { // Find active user $user = Sentry::getUser(); $event = Appointment::find($id); // Check if User belongs to group/school which the appointment is from if ($user->hasAccess('school') || ($user->hasAccess('event') && $user->school_id == $event->group->school_id)) { $event->delete(); } return Redirect::route('calendar.index'); } else { return Redirect::route('landing'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(appointment $appointment)\n {\n //\n }", "public function destroy(Appointment $appointment)\n {\n //\n }", "public function delAppointMent(appointmentClass $info)\n { \n $values=array($info->getAppointmentID());\n $sqlDel=\"DELETE FROM appointment WHERE appointment_id=?\";\n $this->execute($sqlDel,$values);\n }", "public function destroy(Appointment $appointment, $id)\n {\n $appointment = Appointment::find($id);\n $appointment->delete();\n\n session()->flash('message', 'Appointment deleted successfully!');\n \n return redirect('/help/appointment/home');\n }", "public function destroy(Appointments $appointments)\n {\n //\n }", "public function destroy(SubscriptionAppointment $subscriptionAppointment)\n {\n //\n }", "public function destroy($id)\n {\n $appointment=Appointment::find($id);\n $nextAppointments=Appointment::where(['date'=>$appointment->date,'doc_id'=>$appointment->doc_id,\n ['serial_no','>',$appointment->serial_no]])->get();\n if($appointment->delete())\n {\n foreach($nextAppointments as $appt)\n {\n $appt->serial_no--;\n $appt->save();\n }\n return redirect('dashboard')->with('success','Appointment Deleted!');\n }\n else\n return redirect('dashboard')->with('failure','Appointment Deletion Failed!');\n }", "public function destroy($id)\n {\n $appointment = Appointment::findOrFail($id);\n $appointment->delete();\n return redirect()->route('admin.appointments.index');\n }", "public function destroy($id)\n {\n $appointmentdata = Appointment::where('id',$id)->first();\n if($appointmentdata != ''){\n $appointmentdata->delete();\n $message = trans('messages.delete_form',['form' => trans('messages.appointment')]);\n }\n else{\n $message = trans('messages.not_found_entry',['form' => trans('messages.appointment')]);\n }\n return redirect(route('appointment.index'))->withSuccess($message);\n }", "public function delete($id)\n {\n $appointmentDeletedToPusher = $this->appointmentRepo->findById($id);\n $appointment = $this->appointmentRepo->delete($id);\n \n if($appointment !== true) return $appointment; //no se elimino correctamente\n\n event(new AppointmentDeleted($appointmentDeletedToPusher));\n event(new AppointmentDeletedToAssistant($appointmentDeletedToPusher));\n\n return '';\n\n\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function destroy($id)\n {\n $model = Appointment::whereId($id)->first();\n if (empty($model)) {\n return abort('404');\n }\n $model->delete();\n return redirect('/appointment');\n }", "public function destroy($timeslotID){\n $this->isAuthorize();\n\n // Delete the Specific Data\n $userID = $this->request->session()->get('userID');\n $timeslot = Apt_time_slot::where('userID','=',$userID)->where('id','=',$timeslotID)->firstOrFail();\n $timeslot->forceDelete();\n return redirect('appointments/timeslot')->with('status', 'Successfully Time Slot Deleted!');\n }", "public function deleteById(int $id): void\n {\n $this->client->delete(\"Appointments/$id\");\n }", "public function deleted(AppointmentNote $note)\n {\n //\n }", "public function removeEvent($event);", "public function deleted(Apartment $apartment)\n {\n //\n }", "public function destroy($id)\n {\n Appointment::destroy($id);\n return Redirect::route('admin-appointments-index')->with('message', 'Delete Successfull !');\n }", "public function delete($episode);", "public function destroy(PatientAppointmentReminders $patientAppointmentReminders)\n {\n //\n }", "public function delete($id)\n {\n try{\n $record = Appointment::find($id);\n if(!is_null($record)){\n $record->delete();\n return $this->respondWithSuccess(ApiCode::NOTIFICATION_DELETE_SUCCESS);\n }\n else{\n return $this->respondNotFound(ApiCode::ERROR_GET_DATA);\n }\n }\n catch(Exception $ex){\n return $this->respondWithError(ApiCode::ERROR_REQUEST, 402);\n }\n }", "public function destroy(Attendace $attendace)\n {\n //\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function destroy($id)\n {\n try {\n $appointment = Appointment::findOrFail($id);\n $appointment->delete();\n\n return redirect()->route('appointments.appointment.index')\n ->with('success_message', 'Appointment was successfully deleted.');\n } catch (Exception $exception) {\n\n return back()->withInput()\n ->withErrors(['unexpected_error' => 'Unexpected error occurred while trying to process your request.']);\n }\n }", "public function remove() {\n\n //GETS TASK RECORD WITH REQUEST TASK ID (ID)\n $task = Tasks::findorfail(request('TaskID'));\n\n //DELETES TASK RECORD FROM DB\n $task->delete();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$task->NotepadID\");\n }", "public function deleteAppointmentRequest($appointment_uuid, $x_access_token = null, $x_secret_token = null, $authorization = null, $ehelply_active_participant = null, $ehelply_project = null, $ehelply_data = null)\n {\n // verify the required parameter 'appointment_uuid' is set\n if ($appointment_uuid === null || (is_array($appointment_uuid) && count($appointment_uuid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $appointment_uuid when calling deleteAppointment'\n );\n }\n\n $resourcePath = '/appointments/appointments/{appointment_uuid}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($x_access_token !== null) {\n $headerParams['x-access-token'] = ObjectSerializer::toHeaderValue($x_access_token);\n }\n // header params\n if ($x_secret_token !== null) {\n $headerParams['x-secret-token'] = ObjectSerializer::toHeaderValue($x_secret_token);\n }\n // header params\n if ($authorization !== null) {\n $headerParams['authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n // header params\n if ($ehelply_active_participant !== null) {\n $headerParams['ehelply-active-participant'] = ObjectSerializer::toHeaderValue($ehelply_active_participant);\n }\n // header params\n if ($ehelply_project !== null) {\n $headerParams['ehelply-project'] = ObjectSerializer::toHeaderValue($ehelply_project);\n }\n // header params\n if ($ehelply_data !== null) {\n $headerParams['ehelply-data'] = ObjectSerializer::toHeaderValue($ehelply_data);\n }\n\n // path params\n if ($appointment_uuid !== null) {\n $resourcePath = str_replace(\n '{' . 'appointment_uuid' . '}',\n ObjectSerializer::toPathValue($appointment_uuid),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\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 = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function remove(string $location): void;", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy(PatientReminderTime $patientReminderTime)\n {\n //\n }", "public function destroy($id)\n {\n //\n DB::table('appointments')->where('id', $id)->delete();\n $dp = DB::table('appointments')->get();\n $dp_obj = $dp->map(function ($element){\n $startdatetime = new Carbon($element->start_date_time);\n $enddatetime = new Carbon($element->end_date_time);\n $patient = Patient::find($element->patient_id)->user->name;\n $physician = Physician::find($element->physician_id)->user->name;\n $nurse = Nurse::find($element->nurse_id)->user->name;\n return [\n 'patient' => $patient, \n 'physician' => $physician,\n 'nurse' => $nurse,\n 'url' => url('admin/appointments'),\n 'id' => $element->id,\n 'exaroom' => $element->examinationroom,\n 'startdatetime' => $startdatetime->toDayDateTimeString(),\n 'enddatetime' => $enddatetime->toDayDateTimeString()\n ];\n });\n return response()->json($dp_obj);\n }", "public function patientRemove() {\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n try {\n //On démarre la transaction, toujours mettre la table enfant avant la table parente pour éviter les soucis de suppression.\n $this->pdo->beginTransaction();\n $queryAppointment = 'DELETE FROM `appointments` WHERE `idPatients` = :idPatients';\n $deleteAppointmentResult = $this->pdo->prepare($queryAppointment);\n $deleteAppointmentResult->bindValue(':idPatients', $this->id, PDO::PARAM_INT);\n $deleteAppointmentResult->execute();\n $queryPatient = 'DELETE FROM `patients` WHERE `id` = :id';\n $deletePatientResult = $this->pdo->prepare($queryPatient);\n $deletePatientResult->bindValue(':id', $this->id, PDO::PARAM_INT);\n $deletePatientResult->execute();\n //On valide la transaction.\n $this->pdo->commit();\n } catch (Exception $ex) {\n //Si une erreur survient, on annule les changements.\n $this->pdo->rollBack();\n echo 'Erreur : ' . $ex->getMessage();\n }\n }", "public function destroy($id){ // id del meeting\n\n $meeting = Meeting::findOrFail($id);\n\n //ACTUALIZAMOS EL HORARIO DEL DOCTOR\n $meeting->schedule->update([\"estado\"=>\"0\"]);\n\n //BORRAMOS LA CITA CREADA\n $meeting->delete();\n\n return redirect()->route('cita.ver.index')\n ->with('mensaje','ok',);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function destroy(Patient $patient)\n {\n //\n }", "public function destroy(Patient $patient)\n {\n //\n }", "public function destroy(Patient $patient)\n {\n //\n }", "public function destroy(Request $request)\n {\n $appointment = Appointment::find($request->id);\n AppointmentWasCancelled::dispatch($appointment);\n $appointment->delete();\n\n\n return response(['message' => 'Deleted']);\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy(Attendance $attendance)\n {\n //\n }", "public function destroy(Attendance $attendance)\n {\n //\n }", "public function destroy(Attendance $attendance)\n {\n //\n }", "public function destroy($id)\n {\n $gambarhotel = GambarHotel::find($id);\n $hotel_id=$gambarhotel->hotel_id;\n \n if(file_exists(public_path().$gambarhotel->path)){\n //lokasi public/event\n //skrip untuk menghapus gambar ketika di update\n unlink($gambarhotel->path);\n }\n $gambarhotel->delete();\n return redirect(\"hotel/\".$hotel_id);\n}", "public function removeTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken();\n\n\t\tif (!User::authorise('core.delete', $this->_option))\n\t\t{\n\t\t\tApp::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));\n\t\t}\n\n\t\t// Incoming\n\t\t$ids = Request::getArray('rid', array());\n\t\t$ids = (!is_array($ids) ? array($ids) : $ids);\n\n\t\t$removed = 0;\n\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t$entry = Respondent::oneOrFail(intval($id));\n\n\t\t\t// Delete the entry\n\t\t\tif (!$entry->destroy())\n\t\t\t{\n\t\t\t\tNotify::error($entry->getError());\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Trigger before delete event\n\t\t\t\\Event::trigger('onEventsAfterDeleteRespondent', array($id));\n\n\t\t\t$removed++;\n\t\t}\n\n\t\tif ($removed)\n\t\t{\n\t\t\tNotify::success(Lang::txt('COM_EVENTS_RESPONDENT_REMOVED'));\n\t\t}\n\n\t\t// Output messsage and redirect\n\t\tApp::redirect(\n\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&id[]=' . Request::getInt('event', 0), false)\n\t\t);\n\t}", "public function delete(): void\n {\n $this->record(new AgendaWasDeleted($this->identity));\n }", "protected function removeDayFromStorage(\\DateTime $day)\n {\n unset($this->dateTimeStorage[$day->format('U')]);\n }", "public function remove($path);", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "public function delete(){\n $this->delete_from('task');\n }", "public function forceDeleted(Apartment $apartment)\n {\n //\n }", "public function Remove()\r\n {\r\n $appId = JVar::GetPost(\"appId\");\r\n \r\n AppHelper::Remove($this->Core, $appId);\r\n }", "public function actionRemove($app, $domain)\r\n {\r\n Az::debug($app, 'application');\r\n Az::$app->smart->adder->remove($app, $domain);\r\n }", "public function destroy($patient_id)\n {\n $patient = Patient::find($patient_id)->delete();\n }", "public function delete(){\n $this->probe_requests()->detach();\n\n // Delete the event itself\n $result = parent::delete();\n\n return $result;\n }", "public function delete($event): void;", "public final function delete() {\n }", "public function remove($item);", "abstract public function remove();", "abstract public function remove();", "abstract public function remove();", "public function deleted(Patient $patient)\n {\n\n $patient->consentRequests()->delete();\n\n }", "public function deleteEvent($event)\n {\n $this->entityManager->remove($event);\n $this->entityManager->flush();\n }", "public function forceDeleted(AppointmentNote $note)\n {\n //\n }", "function timetracking_type_delete(timetrackingType $type) {\n $type->delete();\n}", "public function destroy(Admission $admission)\n {\n //\n }", "public function destroy($tea,$id)\n {\n //\n try{\n $team= Team::whereName($tea)->firstOrFail();\n $player= Player::find($id);\n $player_image='images/team/players/'.$player->player_image;\n if($player->delete()){\n //remove pivot\n $team->players()->detach($player->id);\n //delete player\n unlink($player_image);\n return redirect()->route('viewTeam',$team->name)->with('res','Player was successfully removed');\n }\n }catch (ModelNotFoundException $e){\n\n }\n }", "public function destroy($id)\n {\n //\n $event = Event::findOrFail($id);\n\n if(isset($event->photo->file))\n unlink(public_path().$event->photo->file);\n\n $event->delete();\n\n// return redirect('events');\n\n return response()->json([\n 'Message' => 'Successful'\n ], 200);\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function destroy(Attention $attention){\n\n $attention->delete();\n $attention->resetAutoIncrement();\n return $this->successResponse($attention);\n }", "public function destroy(Agenda $agenda)\n {\n //\n }", "public function delete()\n {\n if ($this->sportevent) {\n return $this->sportevent->delete();\n }\n }", "public function destroy($id)\n {\n $deleted = $this->repository->delete($id);\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'message' => 'Appointment deleted.',\n 'deleted' => $deleted,\n ]);\n }\n\n return redirect()->back()->with('message', 'Appointment deleted.');\n }", "public function onRemove();", "public static function deleteOne($event) {\n $field = self::$response_field;\n try {\n DB::beginTransaction();\n $event->attributions()->delete();\n $event->offers()->delete();\n $event->needs()->delete();\n $event->staffs()->delete();\n $event->tickets()->delete();\n $event->performers()->delete();\n foreach ($event->sharings as $sharing) {\n Sharing::deleteOne($sharing);\n }\n foreach ($event->printings as $printing) {\n Printing::deleteOne($printing);\n }\n if ($event->delete()) {\n if (isset($event->contract_src) && $event->contract_src != NULL) {\n $url = 'v1/files/' . $event->contract_src;\n $route = Request::create($url, 'DELETE');\n Route::dispatch($route);\n }\n $response['success'] = [\n 'response' => [\n 'title' => trans('success.event.deleted', array('name' => $event->$field)),\n ]];\n DB::commit();\n } else {\n DB::rollback();\n $response['error'] = trans('error.event.deleted', array('name' => $event->$field));\n }\n } catch (\\Laravel\\Database\\Exception $e) {\n DB::rollback();\n $response['error'] = trans('error.event.deleted', array('name' => $event->$field));\n }\n return $response;\n }", "public function delete()\n {\n global $_PM_;\n $api = 'handler_'.$this->handler.'_api';\n $this->api = new $api($_PM_, PHM_API_UID, $this->principalId);\n $this->api->remove_item($this->item['id']);\n }", "public function destroy(int $id)\n {\n try {\n $deleted = Appointment::whereId($id)->delete();\n if ($deleted)\n return response()->json(['message' => 'Appointment deleted succesfully.'], 200);\n else\n return response()->json(['message' => 'Nothing to delete.'], 200);\n } catch (\\Exception $e) {\n return response()->json($e, 400);\n }\n }", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function destroy(Employeepatient $employeepatient)\n {\n //\n }", "public function delete($task);", "public function destroy($id)\n {\n $event = Event::where('id', $id)->first();\n $path = \"/uploads/image/event/\";\n if (substr($event->image, 0, strlen($path)) == $path) {\n unlink(public_path() . $event->image);\n }\n $event->delete();\n return redirect()->intended('/event')->with(\"message\", \"Success Deleted Event!\");\n }", "public function destroy($doctor_timeslot)\n {\n Doctor_timeslot::find($doctor_timeslot)->delete();\n return response(array(\n 'error' => false,\n 'message' =>'Doctor time slot Record deleted successfully',\n ),200);\n }", "public function destroy($id)\n {\n \n /* $n_room = reserve::where('id',$id)\n ->join ('room','reserve.id_room','=','room.id')\n ->first();\n\n $person= $n_room ->person;*/\n\n room::where('id',$id )\n ->update(['available' => 0, 'vacancies' => $person->person ]); \n\n\n\n\n reserve::where('id',$id)->delete();\n return redirect()->back();\n }", "public function del_mtp(Request $request)\n {\n $mtp = Mtp::where('id',strip_tags($request->mtp_id))->first();\n $mtp_pitch_count = Mtp_pitch::where('mtp_id',strip_tags($mtp->id))->count();\n if ($mtp_pitch_count > 0) {\n $mtp_pitch = Mtp_pitch::where('mtp_id',strip_tags($mtp->id))->get();\n $mtp_pitch ->delete();\n }\n $mtp ->delete();\n }", "public function destroy(Patient $patient)\n{\n\n $patient->delete();\n return redirect('/pacientes')->with('status', 'La enfermera se elimino de forma permanente!');\n \n\n}", "public function destroy(AttendanceRequest $attendanceRequest)\n {\n //\n }", "public function destroy($event_id,$presenter)\n {\n $event = Event::find($event_id);\n if($event->organiser->id != auth()->user()->id){\n return redirect()->route(\"events.index\");\n }\n if($event->presenters()->where(\"user_id\",$presenter)->count() == 1){\n $event->presenters()->detach($presenter);\n }\n return redirect()->route(\"presenters.create\",['event_id'=>$event_id]);\n\n }", "public function removeEntryPath($path);", "function delete()\r\n\t{\r\n\t\tglobal $debug;\r\n\t\t$dbh = getOpenedConnection();\r\n\r\n\t\t// Delete current item\r\n\t\t$sql = \"delete from tbl_Pistol_CompetitionDay\r\n\t\t\twhere Id = $pid;\r\n\t\t\";\r\n\r\n\t\t\r\n\t\tif ($debug)\r\n\t\t\tprint_r(\"SQL: \" . $sql);\r\n\t\t\t\r\n\t\tmysqli_query($dbh,$sql);\r\n\t\tif (mysqli_errno($dbh)!=0) {\r\n\t\t\tprint_r(mysqli_error($dbh));\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$this->clear(); // Clear current object\r\n\r\n\t}", "public function cancel(Appointment $appointment)\n {\n // dd($appointment);\n $appointment->update(['status' => 3]);\n $notification = [\n 'message' => 'appointment Has beeb Cancelled',\n 'date' => $appointment->schedule->date,\n 'time' => $appointment->time,\n 'patient' => $appointment->patient->name,\n 'doctor' => $appointment->doctor->name,\n ];\n $appointment->patient->user->notify(new AppointmentNotification($notification));\n $appointment->doctor->user->notify(new AppointmentNotification($notification));\n return back()->with('success', 'Appointment Cancelled Successfully');\n }", "public function destroy($id){\n\t\tif( Authority::can('delete', 'Event') ){\n\t\t\t$this->memory->destroy($id);\n\t\t\treturn Redirect::route('memories.index');//->with('success', 'The memory has been deleted');\n\t\t}\n throw new NotAllowedException();\n\t}", "public function removeEntryUuid($uuid);", "public function removeTask()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_task]))\n\t\t{\n\t\t\tunset($this->primarySearchData[$this->ref_task]);\n\t\t}\n\t}", "public function eliminar(Request $request){\n $salidaPlanta= salidaPlanta::findOrFail($request->id);\n $salidaPlanta->delete();\n\n Session::flash('message','La salida de planta ha sido eliminada');\n return redirect('plantula/salidaplanta');\n }", "public function destroy($id)\n {\n\n $apartment = Apartment::find($id);\n if (Storage::disk('public')->exists($apartment->image)) {\n Storage::disk('public')->delete([$apartment->image]);\n };\n\n $apartment->delete();\n\n\n return redirect('admin/apartments')->with('success_message', 'Appartemento eliminato correttamente');\n }", "public function deleted(PersonalAssignment $personalAssignment)\n {\n //\n }", "public function destroy($ID,Request $request)\n {\n $data = Appointment::findOrFail($ID);\n\n // Delete Data\n $data->delete();\n\n if($request->ajax()){\n return ['status'=> true,'msg'=> __('Appointment has been deleted successfully')];\n }else{\n redirect()\n ->route('system.appointment.index')\n ->with('status','success')\n ->with('msg',__('This Appointment has been deleted'));\n }\n }" ]
[ "0.68832755", "0.68545467", "0.6007891", "0.59282535", "0.5914371", "0.58983636", "0.5877409", "0.57334447", "0.565454", "0.55886143", "0.5548132", "0.55439216", "0.54324424", "0.54234135", "0.5404481", "0.5396329", "0.5330864", "0.53280264", "0.5322762", "0.531665", "0.5311618", "0.5310035", "0.5285145", "0.5283955", "0.5275615", "0.5275615", "0.5275615", "0.5275615", "0.5274201", "0.52426493", "0.5171884", "0.5160915", "0.51502293", "0.51492596", "0.51432127", "0.51298505", "0.51265603", "0.5097466", "0.5091563", "0.5091563", "0.5091563", "0.5081633", "0.5078788", "0.507753", "0.507753", "0.507753", "0.50685525", "0.5067696", "0.50674313", "0.5055122", "0.5043854", "0.5043032", "0.5033631", "0.50316954", "0.49790683", "0.49673104", "0.4957294", "0.4952992", "0.4949651", "0.49469727", "0.49462235", "0.4931877", "0.4931877", "0.4931877", "0.49256074", "0.4923882", "0.49222985", "0.49200585", "0.49198666", "0.4915044", "0.49139866", "0.49086908", "0.49070045", "0.4896712", "0.48951527", "0.48933333", "0.48915583", "0.48885164", "0.48871624", "0.48828846", "0.48793545", "0.48661354", "0.48660585", "0.48644745", "0.4861642", "0.48615277", "0.48562574", "0.48514983", "0.48464507", "0.48387873", "0.48384258", "0.48310265", "0.48263904", "0.48249516", "0.48244667", "0.4820865", "0.48144343", "0.48129815", "0.4809809", "0.4804594" ]
0.5239537
30
Create a new controller instance.
public function __construct(GDPRRepository $gdprRepository,GDPRDataRequestRepository $gdprDataRequestRepository) { $this->middleware('admin'); $this->gdprRepository = $gdprRepository; $this->gdprDataRequestRepository = $gdprDataRequestRepository; $this->_config = request('_config'); }
{ "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
Display a listing of the resource.
public function index() { $data = $this->gdprRepository->first(); return view($this->_config['view'], [ 'gdprData' => $data, ]); }
{ "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
Store a newly created resource in storage.
public function store($id) { if(request()->get('enabled_gdpr') == 'on') { $gdprStatus = 1; } else { $gdprStatus = 0; } if(request()->get('customer_agreement') == 'on') { $customerAgreementStatus = 1; } else { $customerAgreementStatus = 0; } if(request()->get('enabled_cookie_notice') == 'on') { $cookieStatus = 1; } else { $cookieStatus = 0; } $params = request()->except('_token') + [ 'gdpr_status'=>$gdprStatus, 'customer_agreement_status'=>$customerAgreementStatus, 'cookie_status'=>$cookieStatus ]; $this->gdprRepository->findOneWhere([ 'id' => $id, ]); $params['agreement_content'] = str_replace('=&gt;', '=>', $params['agreement_content']); unset($params['enabled_gdpr']); unset($params['customer_agreement']); unset($params['enabled_cookie_notice']); $this->gdprRepository->where('id',$id)->update($params); Artisan::call('optimize'); session()->flash('success', trans('gdpr::app.admin.create-gdpr.update-success')); return redirect()->route($this->_config['redirect']); }
{ "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 a listing of the resource.
public function customerDataRequest() { return view($this->_config['view']); }
{ "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 Data Request edit form
public function edit($id) { $data = $this->gdprDataRequestRepository->find($id); return view($this->_config['view'], compact('data')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function editAction()\n {\n \n $id = $this->_request->getParam(\"id\");\n \n // Get object from form Request\n $request_info=array();\n // Get value from Request POST\n $body = $this->_request->getParam(\"desc\");\n // to send Id to database\n $request_info['id']=$id;\n $request_info['desc']=$body;\n // Get object from model Requests\n $request_model=new Application_Model_Requests();\n // Calling edit request function to edit data\n $request_model->editRequest($request_info);\n // redirect to list Request\n // $this->redirect(\"Requests/list\");\n\n\t \n \n \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 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 }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit($id)\n {\n// $showEditClientRequest = RequestCallback::find($id);\n//\n// return view('admin.request_client.edit',compact('showEditClientRequest'));\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Gc_Service_OrderShow::getOrderShow(intval($id));\n\t\n\t\t//状态\n\t\t$this->assign('ordershow_status', $this->ordershow_status);\n\t\t\n\t\t//渠道\n\t\tlist(,$ordershow_channel) = Gc_Service_OrderChannel::getAllOrderChannel();\n\t\t$ordershow_channel = Common::resetKey($ordershow_channel, 'id');\n\t\t$this->assign('ordershow_channel', $ordershow_channel);\n\t\t\t\t\n\t\t$this->assign('info', $info);\n\t}", "public function edit($id_requisito,Request $request)\n {\n \n }", "public function edit() {\n\t\t\t\n\t\t}", "public function edit( )\r\n {\r\n //\r\n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function editForm(): void\n {\n $this->articleId = $_GET['id'];\n $query = $this->articleModel->displayOneArticle($this->articleId);\n $editArticle = $query->fetch();\n\n $this->title = $editArticle['title'];\n $this->content = $editArticle['content'];\n $this->category = $editArticle['category'];\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 showEdit()\n {\n\n }", "function edit(){\n\t\t$arr = $this->uri->uri_to_assoc(3);\n\t\t$data['arr'] = $arr['id'];\n\t\t\n\t\t/* membuat value */\n\t\t$this->user->setID($arr['id']);\n\n\t\t/* fungsi ambil data */\n\t\t$result = $this->user->ambil_data();\n\n\t\t/* data dropdown */\n\t\t$data['role'] = role_dropdown();\n\t\t$data['result'] = $result;\n\n\t\t/* load view */\n\t\t$this->template->write_view('edit', $data);\n\t}", "public function edit()\n {\n \n \n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function actionEdit()\n\t{\n\t\t$field = $this->_getFieldOrError($this->_input->filterSingle('field_id', XenForo_Input::STRING));\n\t\treturn $this->_getFieldAddEditResponse($field);\n\t}", "public function editAction() {}", "public function edit() {\n }", "function edit($request){\r\n //get edit\r\n\r\n \t$obj= new $this->model;\r\n $validate=new Validator();\r\n $validate->validate($request->get,['id'=>'Requierd|Integer']);\r\n\r\n\r\n\r\n $data= $obj::find($request->get['id']);\r\n\r\n if(!$data){\r\n header(\"HTTP/1.0 404 Not Found\");\r\n if($request->UseApi())\r\n {\r\n return json_error(\"Not found item\");\r\n }\r\n\r\n return $this->view(\"Error/index\",['ErrorNumber'=>404]);\r\n }\r\n $data->mode='edit';\r\n\r\n if($request->UseApi())\r\n {\r\n return json_success(\"Getting success\",$data);\r\n }\r\n return $this->view(compact('data'));\r\n\r\n\r\n\r\n }", "public function edit($id)\n\t{\n\t\t$receivingrequest = ReceivingRequest::find($id);\n\t $warehouselist = WarehouseList::pluck(\"name\", \"id\")->prepend('Please select', 0);\n\t\t$businessunit = BusinessUnit::pluck(\"name\", \"id\")->prepend('Please select', 0);\n\n\t \n\t\treturn view('.transactions.ReceivingRequest.edit', compact('receivingrequest', \"warehouselist\", \"businessunit\"));\n\t}", "public function edit()\n\t{\n\t\t\n\t}", "public function getEditForm();", "public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\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 editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Activity_Service_ShareQq::get(intval($id));\n\t\t$this->assign('info', $info);\n\t}", "public function editrequest() {\n\t\tif($this->session->userdata('username')) {\n\t\t\t$data['title'] = \"Edit Request\";\n\t\t\t$rid= $this->uri->segment(2);\n\t\t\t$this->load->model('Addrequest_model');\n\t\t\t$this->load->model('Addasset_model');\n\t\t\t$this->load->model('Addmember_model');\n\t\t\t$result = $this->Addrequest_model->Editrequests($rid);\n\t\t\t$data['option_member'] = $this->Addmember_model->fetchMembers();\n\t\t\t$data['rid'] = $result[0]['rid'];\n\t\t\t$data['project'] = $result[0]['project'];\n\t\t\t$data['request_assest'] = $result[0]['request_assest'];\n\t\t\t$data['request_type'] = $result[0]['request_type'];\n\t\t\t$data['request_title'] = $result[0]['request_title'];\n\t\t\t$data['description'] = $result[0]['description'];\n\t\t\t$data['member_name'] = $result[0]['member_name'];\n\t\t\t$data['request_status'] = $result[0]['request_status'];\n\t\t\t\n\t\t\t\n\t\t\t$data['query1'] = $this->Addasset_model->getProject();\n\t\t\t$data['option_request'] = $this->Addrequest_model->fetchRequesttype();\n\t\t\t$data['option_asset'] = $this->Addasset_model->fetchAssettype();\t\t\n\t\t\t$this->load->view('header', $data);\n\t\t\t$this->load->view('edit_request', $data);\n\t\t\t$this->load->view('footer', $data);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\telse {\n\t\t\tredirect('welcome/index','refresh');\n\t\t}\n\t}", "public function edit_admin_show($edit)\n\t{\n\t\t$sql=\"SELECT * FROM `create_admin` WHERE id = '$edit'\";\n\t\t$result=$this->db->query($sql);\n\t\t$data= $result->fetch_array();\n\t\techo \"<input class='id' type='text' name='id' value='$data[serial_id]'>\n <br><br>\n <input class='name' type='text' name='name' value='$data[name]'>\n <br><br>\n <input class='email' type='email' name='email' value='$data[email]'>\n <br><br>\n <input class='pass' type='password' name='pass' value='$data[password]'>\n <br><br>\n <select class='categore' name='categore'>\n <option value='$data[categore]' selected='selected'>$data[categore]</option>\n <option value='super-admin'>Super-Admin</option>\n <option value='admin'>Admin</option>\n <option value='sub-admin'>Sub-Admin</option>\n </select>\n \n <select class='stat' name='stat'>\n \t<option value='$data[stat]'>$data[stat]</option>\n <option value='1'>Active</option>\n <option value='0'>Inactive</option>\n </select>\n <br><br>\n <button type='submit' class='submit' name='update' >Update Admin</button>\";\n\t}", "public function display_edit_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=update' method='post'>\";\n echo \"<input type='hidden' name='id' value=\".$this->id.\" />\";\n echo \"Name: <input type='text' name='name' value=\".$this->name.\" /><br />\";\n echo \"Description: <textarea name='description'>\".$this->description.\"</textarea><br />\";\n echo \"<input type='submit' value='Update' />\";\n echo \"</form>\";\n }", "public function edit($request_id) {\n \n # query statement\n $q = 'SELECT content FROM requests WHERE request_id =' .$request_id;\n \n # delete post from DB\n $request_text = DB::instance(DB_NAME)->select_field($q);\n \n # Setup view\n $this->template->content = View::instance('v_requests_edit');\n $this->template->title = \"Edit your Prayer Request\";\n $this->template->content->request_text = $request_text;\n $this->template->content->request_id = $request_id;\n \n # Render template\n echo $this->template;\n }", "public function edit($id)\n\t{\n\t\t$this->is_allowed('amuco_details_request_office_update');\n\n\n\t\t$this->data['amuco_details_request_office'] = $this->model_amuco_details_request_office->find($id);\n\n\t\t$this->template->title('Amuco Details Request Office Update');\n\t\t$this->render('backend/standart/administrator/amuco_details_request_office/amuco_details_request_office_update', $this->data);\n\t}", "public function edit($id)\n {\n $requestt = Requestt::getById($id);\n // dd($requestt);\n if($requestt == NULL){\n return \"Không có yêu cầu nào có mã yêu cầu = \".$id;\n }\n \n return view('request.edit',['requestt'=>$requestt]);\n }", "public function edit(dataset $dataset){\n return view('admin.datasets.requests.edit', ['dataset' => $dataset, 'publications' => Publication::all()]);\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit(Request $request,$id)\n {\n return $this->__formUiGeneration($request,$id);\n }", "public function edit(Request $request, $id = null)\n {\n $data = AccountModel::find($id);\n $parent= $this->parentAccountList();\n $people= $this->getBusinessPartners();\n \n return view('setup.accounts.edit')->with(\"data\",$data)->with(\"people\",$people)->with(\"parent\",$parent);\n \n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Request $request) {\n\n $tenures = auth()->user()->entity->tenures;\n $branches = Branch::where('user_union_id', auth()->user()->entity->id);\n\n $forml = FormL::findOrFail($request->id);\n\n $error_list = $this->getErrors($forml);\n\n return view('change-officer.l.index', compact('tenures','branches','forml','error_list'));\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit(Request $request)\n {\n\n }", "public function edit(Request $request)\n {\n\n }", "public function edit(Handelrequest $handelrequest)\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()\n {\n //\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "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 postEdit(Request $request){\n $id = intval($request['Id']);\n\n $this->data['edit_officer_id'] = $id;\n// $this->data['row'] = $this->giveRA->getDataByRowId($id);\n $this->data['listOfficer'] = json_encode($this->giveRA->getListOfficer());\n $this->data['listRole'] = json_encode($this->giveRA->getMeetingRoom());\n $this->data['listRoleCheck'] = json_encode(array(array('text'=>'', 'value'=>'')));\n return view($this->viewFolder.'.giveroomaccess.new')->with($this->data);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "public function officer_edit(Request $request) {\n\n $log = new LogSystem;\n $log->module_id = 20;\n $log->activity_type_id = 3;\n $log->description = \"Popup kemaskini Borang L - Butiran Pegawai Yang Memegang Jawatan\";\n $log->url = $request->fullUrl();\n $log->method = strtoupper($request->method());\n $log->ip_address = $request->ip();\n $log->created_by_user_id = auth()->id();\n $log->save();\n\n $states = MasterState::all();\n $countries = MasterCountry::all();\n $designations = MasterDesignation::all();\n $officer = FormLOfficer::findOrFail($request->officer_id);\n $forml = FormL::findOrFail($request->id);\n\n return view('change-officer.l.forml.tab3.edit', compact('officer', 'forml','states', 'countries', 'designations'));\n }", "public function editForm($id)\n {\n $record = HistoryDb::findOrFail($id);\n $this->edit_id = $id;\n $this->title = $record->title;\n $this->description = $record->description;\n $this->event_date = $record->event_date;\n $this->mode = 'edit';\n $this->submit_text = \"Update\";\n\n // Util::showAlert($this,'Test content...!');\n\n }", "public function editAction()\r\n {\r\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit() {\n\n }", "public function editAction() {\n# process the edit form.\n# check the post data and filter it.\n\t\tif(isset($_POST['cancel'])) {\n\t\t\tAPI::Redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t$input_check = $this->_model->check_input($_POST);\n\t\tif(is_array($input_check)) {\n\t\t\tAPI::Error($input_check);\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t// all hooks will stack their errors onto the API::Error stack\n\t\t// but WILL NOT redirect.\n\t\tAPI::callHooks(self::$module, 'validate', 'controller', $_POST);\n\t\tif(API::hasErrors()) {\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\n\t\t$this->_model->set_data($_POST);\n\n\t\t// auto call the hooks for this module/action\n\t\tAPI::callHooks(self::$module, 'save', 'controller');\n\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\n\n\t}", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function edit()\n {\n $id = $this->request->getParameter('id'); // récupérer le paramètre de l'ID\n $post = $this->post->getPost($id); // je récupère le post\n\n // j'arrive en post car des données sont saisies dans le formulaire\n if($this->request->parameterExist('title') && $this->request->parameterExist('content')) {\n\n $this->post->updatePost(\n $this->request->getParameter('title'),\n $this->request->getParameter('content'),\n $id\n );\n\n $this->redirect(\"admin\", \"post/\" . $post['id']); // une fois le post créé, je redirige vers la vue Admin/post/iddupost\n }\n\n // j'arrive sur la vue en Get\n $this->buildView(array('post'=>$post));\n }", "public function get_edit(){\n\t\tif (Auth::check()){\n\t\t\t$customer_id = Auth::user()->customer_id;\n\n\t\t\t$customer_types = array('' => 'Select One','Buyer'=>'Buyer','Vendor'=>'Vendor');\n\n\t\t\t$countries = array('' => 'Select One') + \n\t\t\t\tCountry::lists('country_name', 'country_id');\n\n\t\t\t$titles = array('' => 'Select One','Mr.'=>'Mr.','Mrs.'=>'Mrs.','Ms.'=>'Ms.','Miss'=>'Miss','Master'=>'Master',\n\t\t\t\t'Rev.'=>'Rev. (Reverend)','Fr.'=>'Fr. (Father)','Dr.'=>'Dr. (Doctor)','Atty.'=>'Atty. (Attorney)',\n\t\t\t\t'Prof.'=>'Prof. (Professor)','Hon.'=>'Hon. (Honorable)','Pres.'=>'Pres. (President)',\n\t\t\t\t'Gov.'=>'Gov. (Governor)','Coach'=>'Coach','Ofc.'=>'Ofc. (Officer)');\n\n\t\t\t$this->layout->content = View::make('frontend.customers.edit')\n\t\t\t\t->with('title', 'Edit Customer')\n\t\t\t\t->with('customer', Customer::find($customer_id))\n\t\t\t\t->with('customer_type',$customer_types)\n\t\t\t\t->with('customer_countryId', $countries)\n\t\t\t\t->with('customer_title', $titles);\n\t\t}\n\t}", "public function edit()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'edit',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/edit', $data);\n }", "public function edit()\n {\n $this->title = sprintf('%s: %s', _('Edit'), $this->obj->get('name'));\n unset($this->headerData);\n $this->attributes = array(\n array(),\n array(),\n );\n $this->templates = array(\n '${field}',\n '${input}',\n );\n $fields = array(\n _('LDAP Connection Name') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"name\" name=\"name\" value=\"%s\"/>',\n (\n $_REQUEST['name'] ?\n $_REQUEST['name'] :\n $this->obj->get('name')\n )\n ),\n _('LDAP Server Description') => '<textarea name=\"description\">'\n . (\n $_REQUEST['description'] ?\n $_REQUEST['description'] :\n $this->obj->get('description')\n )\n . '</textarea>',\n _('LDAP Server Address') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"address\" name=\"address\" value=\"%s\"/>',\n (\n $_REQUEST['address'] ?\n $_REQUEST['address'] :\n $this->obj->get('address')\n )\n ),\n _('LDAP Server Port') => '<select id=\"port\" name=\"port\">'\n . sprintf(\n '<option value=\"\">- %s -</option>',\n self::$foglang['PleaseSelect']\n )\n . sprintf(\n '<option value=\"389\"%s>389</option>',\n (\n $_REQUEST['port'] == 389 ?\n ' selected' :\n (\n $this->obj->get('port') == 389 ?\n ' selected' :\n ''\n )\n )\n )\n . sprintf(\n '<option value=\"636\"%s>636</option>',\n (\n $_REQUEST['port'] == 636 ?\n ' selected' :\n (\n $this->obj->get('port') == 636 ?\n ' selected' :\n ''\n )\n )\n )\n . '</select>',\n _('Use Group Matching (recommended)') => '<select id=\"useGroupMatch\" '\n . 'name=\"useGroupMatch\">'\n . sprintf(\n '<option value=\"0\"%s>%s</option>',\n (\n $_REQUEST['useGroupMatch'] < 1 ?\n ' selected' :\n (\n $this->obj->get('useGroupMatch') < 1 ?\n ' selected' :\n ''\n )\n ),\n _('No')\n )\n . sprintf(\n '<option value=\"1\"%s>%s</option>',\n (\n $_REQUEST['useGroupMatch'] > 0 ?\n ' selected' :\n (\n $this->obj->get('useGroupMatch') > 0 ?\n ' selected' :\n ''\n )\n ),\n _('Yes')\n )\n . '</select>',\n _('Search Base DN') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"searchDN\" name=\"searchDN\" value=\"%s\"/>',\n (\n $_REQUEST['searchDN'] ?\n $_REQUEST['searchDN'] :\n $this->obj->get('searchDN')\n )\n ),\n _('Group Search DN') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"grpSearchDN\" name=\"grpSearchDN\" value=\"%s\"/>',\n (\n $_REQUEST['grpSearchDN'] ?\n $_REQUEST['grpSearchDN'] :\n $this->obj->get('grpSearchDN')\n )\n ),\n _('Admin Group') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"adminGroup\" name=\"adminGroup\" value=\"%s\"/>',\n (\n $_REQUEST['adminGroup'] ?\n $_REQUEST['adminGroup'] :\n $this->obj->get('adminGroup')\n )\n ),\n _('Mobile Group') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"userGroup\" name=\"userGroup\" value=\"%s\"/>',\n (\n $_REQUEST['userGroup'] ?\n $_REQUEST['userGroup'] :\n $this->obj->get('userGroup')\n )\n ),\n _('Initial Template') => '<select class=\"smaller\" '\n . 'id=\"inittemplate\">'\n . '<option value=\"pick\" selected >Pick a template</option>'\n . '<option value=\"msad\">Microsoft AD</option>'\n . '<option value=\"open\">OpenLDAP</option>'\n . '<option value=\"edir\">Generic LDAP</option>'\n . '</select>',\n _('User Name Attribute') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"userNamAttr\" name=\"userNamAttr\" value=\"%s\"/>',\n (\n $_REQUEST['userNamAttr'] ?\n $_REQUEST['userNamAttr'] :\n $this->obj->get('userNamAttr')\n )\n ),\n _('Group Member Attribute') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"grpMemberAttr\" name=\"grpMemberAttr\" value=\"%s\"/>',\n (\n $_REQUEST['grpMemberAttr'] ?\n $_REQUEST['grpMemberAttr'] :\n $this->obj->get('grpMemberAttr')\n )\n ),\n _('Search Scope') => '<select id=\"searchScope\" name=\"searchScope\">'\n . sprintf(\n '<option value=\"\">- %s -</option>',\n self::$foglang['PleaseSelect']\n )\n . sprintf(\n '<option value=\"0\"%s>%s</option>',\n (\n isset($_REQUEST['searchScope'])\n && $_REQUEST['searchScope'] == 0 ?\n ' selected' :\n (\n $this->obj->get('searchScope') == 0 ?\n ' selected' :\n ''\n )\n ),\n _('Base only')\n )\n . sprintf(\n '<option value=\"1\"%s>%s</option>',\n (\n $_REQUEST['searchScope'] == 1 ?\n ' selected' :\n (\n $this->obj->get('searchScope') == 1 ?\n ' selected' :\n ''\n )\n ),\n _('Base and subtree')\n )\n . sprintf(\n '<option value=\"2\"%s>%s</option>',\n (\n $_REQUEST['searchScope'] == 2 ?\n ' selected' :\n (\n $this->obj->get('searchScope') == 2 ?\n ' selected' :\n ''\n )\n ),\n _('Subtree and below')\n )\n . '</select>',\n _('Bind DN') => '<input class=\"smaller\" type=\"text\" '\n . sprintf(\n 'id=\"bindDN\" name=\"bindDN\" value=\"%s\"/>',\n (\n $_REQUEST['bindDN'] ?\n $_REQUEST['bindDN'] :\n $this->obj->get('bindDN')\n )\n ),\n _('Bind Password') => '<input class=\"smaller\" type=\"password\" '\n . sprintf(\n 'id=\"bindPwd\" name=\"bindPwd\" value=\"%s\"/>',\n (\n $_REQUEST['bindPwd'] ?\n $_REQUEST['bindPwd'] :\n $this->obj->get('bindPwd')\n )\n ),\n '&nbsp;' => sprintf(\n '<input class=\"smaller\" name=\"update\" type=\"submit\" value=\"%s\"/>',\n _('Update')\n ),\n );\n foreach ((array)$fields as $field => &$input) {\n $this->data[] = array(\n 'field' => $field,\n 'input' => $input,\n );\n unset($input);\n }\n unset($fields);\n self::$HookManager->processEvent(\n 'LDAP_EDIT',\n array(\n 'headerData' => &$this->headerData,\n 'data' => &$this->data,\n 'templates' => &$this->templates,\n 'attributes' => &$this->attributes\n )\n );\n printf('<form method=\"post\" action=\"%s\">', $this->formAction);\n $this->render();\n echo '</form>';\n }", "public function edit($id, $request)\n {\n\n }", "public function showUpdateInfoForm ()\n {\n return view($this->updateInfoView);\n }", "public function edit($id)\n {\n $viewedit = Data::where ('id', $id)->first();\n\t\t$jobOpt = Job::all();\n\t\treturn view ('editdata', compact ('viewedit', 'jobOpt'));\n }", "public function editarCarreraController(){\n $datosController = $_GET[\"id\"];\n //Enviamos al modelo el id para hacer la consulta y obtener sus datos\n $respuesta = Datos::editarCarreraModel($datosController, \"carreras\");\n //Recibimos respuesta del modelo e IMPRIMIMOS UNA FORM PARA EDITAR\n echo'<input type=\"hidden\" value=\"'.$respuesta[\"id\"].'\"\n name=\"idEditar\">\n <input type=\"text\" value =\"'.$respuesta[\"nombre\"].'\"\n name=\"carreraEditar\" required>\n <input type=\"submit\" value= \"Actualizar\">';\n }", "public function edit($id)\n {\n $department = Department::findOrFail($id);\n $this->department_id = $id;\n $this->name = $department->name;\n \n //$this->updateMode = true;\n $this->openModal(); \n }", "public function edit1()\n\t{\n \t// $table_form5->tanggapan_audit = $request->auditi;\n \t// $table_form5->rencana_perbaikan = $request->perbaikan;\n \t// $table_form5->save();\n\n\t\t// $table_form5 = \\App\\Ptpp::findOrFail($request->idd);\n\t\t$table_form5->update($request->all());\n\n\t\treturn back()->with('sukses', 'Data sukses ditambahkan');;\n\t}", "public function edit()\n {\n //\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Ad::getAd(intval($id));\n\t\t$game_info = Resource_Service_Games::getResourceGames($info['link']);\n\t\t$this->assign('game_info', $game_info);\n\t\t$this->assign('ad_types', $this->ad_types);\n\t\t$this->assign('info', $info);\n\t}", "public function edit()\n { }", "public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}", "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()\n {\n return view('admincp::edit');\n }", "public function Edit()\n\t{\n\t\t\n\t}", "public function edit(Request $request)\n {\n //\n }", "public function edit(Request $request)\n {\n //\n }", "public function edit(Request $request)\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()\r\n {\r\n return view('petro::edit');\r\n }" ]
[ "0.7657809", "0.73775655", "0.72208655", "0.71993315", "0.71850157", "0.7152821", "0.7146952", "0.7122321", "0.71009517", "0.70702475", "0.70661986", "0.70405096", "0.70242906", "0.70203125", "0.7004985", "0.6997775", "0.698509", "0.69787824", "0.6971246", "0.69535756", "0.6951726", "0.6923771", "0.6919733", "0.6916173", "0.6911373", "0.68992627", "0.6891204", "0.68858784", "0.68858784", "0.68858784", "0.6884317", "0.6874375", "0.6852157", "0.68270797", "0.68246347", "0.6822405", "0.6810068", "0.6796493", "0.67959356", "0.67959356", "0.6790766", "0.6784253", "0.67720544", "0.676562", "0.67520684", "0.67493767", "0.67435205", "0.67435205", "0.67435205", "0.6734357", "0.6734357", "0.67252016", "0.6721792", "0.6721792", "0.6721792", "0.6721792", "0.6721792", "0.6721792", "0.6721792", "0.6721792", "0.6721792", "0.6721792", "0.6721792", "0.6721792", "0.67196506", "0.6718937", "0.6716737", "0.6708215", "0.6703488", "0.6701473", "0.669801", "0.6686357", "0.66855454", "0.6684099", "0.6681615", "0.66806585", "0.6674612", "0.667461", "0.6673555", "0.66696274", "0.6664749", "0.66572416", "0.6656199", "0.6656091", "0.6651636", "0.66495866", "0.66483957", "0.6642941", "0.66384894", "0.6635182", "0.6626338", "0.6626125", "0.66249764", "0.6621905", "0.6621905", "0.6621905", "0.661855", "0.661855", "0.661855", "0.661855", "0.66162497" ]
0.0
-1
Method to update the Data Request information.
public function update() { $data = request()->except('_token'); $request = $this->gdprDataRequestRepository->where('id',$data['id'])->get(); foreach($request as $value) { $requestData = $value; } $result = $this->gdprDataRequestRepository->find($data['id'])->update($data); $params = $data + [ 'customer_id'=>$requestData->customer_id, 'email'=>$requestData->email, ]; if($result) { try { Mail::queue(new AdminUpdateDataRequestMail($params)); session()->flash('success', trans('gdpr::app.response.update-success', ['name' => 'Data Request'])); } catch(\Exception $e) { session()->flash('success', trans('gdpr::app.response.update-success-unsent-email', ['name' => 'Data Request'])); } } return redirect()->route($this->_config['redirect']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setPutData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "abstract public function updateData();", "public function update($data) {}", "public function update($data) {}", "public function Update($data) {\n\n }", "protected function setGetData()\n\t{\n\t\t$this->request->addParams($this->query->getParams());\n\t}", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function legacy_update() {\n\n\t\t/* Request data was moved from controller option to requests option in v1.1 */\n\n\t\t// get legacy requests data\n\t\t$legacy_requests = $this->get_option( 'requests', array() );\n\n\t\t// something to update\n\t\tif ( $legacy_requests && is_array( $legacy_requests ) ) {\n\n\t\t\t// new requests structure\n\t\t\t$requests = get_option( $this->get_requests_option_key(), array() );\n\n\t\t\t// merge requests\n\t\t\t$requests = array_merge( $legacy_requests, $requests );\n\n\t\t\t// fill new structure with data\n\t\t\tupdate_option( $this->get_requests_option_key(), $requests );\n\n\t\t}\n\n\t\t// destroy old structure data\n\t\tif ( $legacy_requests ) {\n\n\t\t\t$options = get_option( $this->get_id(), array() );\n\t\t\tunset( $options['requests'] );\n\t\t\tupdate_option( $this->get_id(), $options );\n\n\t\t}\n\n\t}", "public function update($request_data){\n $c_id = $request_data['c_id'];\n\n //getting data from $request_data\n $c_name = $request_data['c_name'];\n $c_cont_no = $request_data['c_cont_no'];\n $c_food_pref = $request_data['c_food_pref'];\n\n $dbs = new DatabaseControls();\n $qry = \"update \".$this->table_name.\" set c_name = '\".$c_name.\"',c_cont_no = '\".$c_cont_no.\"',c_food_preference = '\".$c_food_pref.\"' where c_id = \".$c_id;\n $result = $dbs->run_update_qry($qry); \n \n \n return json_encode($result);\n }", "public function update() {\n $updateData = $this->data;\n $model = new ReferralModel;\n $ref = $model->findOne($updateData['id']);\n if ($ref) {\n $ref->set($updateData);\n $keepNullFields = [\n 'route_id', 'estimator_id', 'date_requested',\n 'date_service', 'class_id', 'lat', 'lng'\n ];\n foreach ($keepNullFields as $field) {\n if (!$updateData[$field]) {\n $ref->set($field, null);\n }\n }\n $ref->save();\n $this->renderJson([\n 'success' => true,\n 'message' => 'Job request updated successfully',\n 'data' => $ref->asArray()\n ]);\n } else {\n http_response_code(404);\n $this->renderJson([\n 'success' => false,\n 'message' => 'Resource not found'\n ]);\n }\n }", "public function update_with($new_data)\n {\n }", "protected function setPostData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "public function setRequestData()\n {\n $this->setHeaderInformation();\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function updateData(){\n try{\n $this->dbConnection->query($this->query);\n $this->message = $this->moduleName.' Successfully Updated';\n $this->data = array();\n $this->data['id'] = $this->dbConnection->lastInsertId();\n $this->sendJSONResponse();\n \n }catch( PDOException $ex ) {\n $this->message = 'Error storing '.$this->moduleName.' :'. $ex->getMessage();\n $this->sendJSONErrorReponse();\n }\n }", "protected function update() {}", "public function updateData(array $data);", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function update(Request $request, ProData $proData)\n {\n //\n }", "public function update_data()\n {\n $token = $this->getAuthHeader();\n $data = $this->request->getJSON();\n\n //get data from token\n $result = $this->_checkToken( $token );\n\n if ( !isset( $result ) ) {\n $dataDB['status'] = \"error\";\n $dataDB['message'] = $this->db->error()['message'];\n $dataDB['data'] = \"\";\n\n return $this->respond( $dataDB, TOKEN_NOT_FOUND );\n }\n\n if ( $data->id == '-1' ) {\n unset($data->id);\n $data->active_flag = true;\n $data->create_date = date( DATE_FORMAT_YMDHMS );\n $data->create_user = $result->user_id;\n } else {\n $data->active_flag = true;\n $data->update_date = date( DATE_FORMAT_YMDHMS );\n $data->update_user = $result->user_id;\n }\n\n $my_date = explode(\"/\",$data->exam_date);\n\n if ( count($my_date) == 3 ) {\n $data->exam_date = $my_date[2].\"-\".$my_date[1].\"-\".$my_date[0];\n }\n $data->question_12 = ($this->calculateBMI($data->weight,$data->height) < 18.5) ? 1 : 0;\n $data->living_status = $this->getLivingStatus($data);\n $data->hypokinesia = $this->getHypokinesia($data);\n $data->decreased_nutrition = $this->getDecreasedNutrition($data);\n $data->deterioration_mouth = $this->getDeteriorationMouth($data);\n $data->withdrawal = $this->getWithdrawal($data);\n $data->forget = $this->getForget($data);\n $data->depression = $this->getDepression($data);\n $data->total_score = $this->getTotalScore($data);\n $data->frailty_judgment = $this->getFrailtyJudgment($data->total_score);\n\n $this->db->transStart();\n if ( $this->prgExaminersFraAModel->save($data) === false ) {\n $dataDB['status'] = \"error\";\n $dataDB['message'] = $this->prgExaminersFraAModel->errors();\n $dataDB['data'] = \"\";\n\n return $this->respond( $dataDB, HTML_STATUS_DB_ERROR );\n }\n\n $this->db->transComplete();\n\n $dataDB['status'] = \"success\";\n $dataDB['message'] = \"\";\n $dataDB['data'] = $data;\n\n return $this->respond( $dataDB, HTML_STATUS_SUCCESS );\n }", "protected function updateRequestTime()\n {\n $this->requestTimestamp = microtime(true);\n }", "private function updateOrderData()\n {\n $sign = $this->connector->signRequestKid(\n null,\n $this->connector->accountURL,\n $this->orderURL\n );\n\n $post = $this->connector->post($this->orderURL, $sign);\n if (strpos($post['header'], \"200 OK\") !== false) {\n $this->status = $post['body']['status'];\n $this->expires = $post['body']['expires'];\n $this->identifiers = $post['body']['identifiers'];\n $this->authorizationURLs = $post['body']['authorizations'];\n $this->finalizeURL = $post['body']['finalize'];\n if (array_key_exists('certificate', $post['body'])) {\n $this->certificateURL = $post['body']['certificate'];\n }\n $this->updateAuthorizations();\n } else {\n //@codeCoverageIgnoreStart\n $this->log->error(\"Failed to fetch order for {$this->basename}\");\n //@codeCoverageIgnoreEnd\n }\n }", "public function setUpdateParametersFromRequest($request)\n {\n if (!isset($request->from))\n {\n $this->from = '';\n }\n else\n {\n $this->from = $request->from;\n }\n\n if (!isset($request->until))\n {\n $this->until = '';\n }\n else\n {\n $this->until = $request->until;\n }\n\n if (!isset($request->set))\n {\n $this->set = '';\n }\n else\n {\n $this->set = $request->set;\n }\n\n if (!isset($request->metadataPrefix))\n {\n $this->metadataPrefix = 'oai_dc';\n }\n else\n {\n $this->metadataPrefix = $request->metadataPrefix;\n }\n\n // If cursor not supplied, define as 0\n if (!isset($request->cursor))\n {\n $this->cursor = 0;\n }\n else\n {\n $this->cursor = $request->cursor;\n }\n }", "public function getRequestData();", "public function update(Request $request, data_operator $data_operator)\n {\n //\n }", "function getDataFromRequest( &$data ) {\n\n\t\t$requestVar = KRequest::getInt($this->propertyName, NULL);\n\n\t\tif (empty($requestVar)) {\n\t\t\t$data->{$this->propertyName} = NULL;\n\t\t}\n\t\telse {\n\t\t\t$data->{$this->propertyName} = $requestVar;\n\t\t}\n\n\t}", "public function update($request,$id) {\n \n\n }", "public function updateMultiple_data()\n {\n \n }", "public function update(Request $request)\n\t{\n\n\t}", "public function update()\n {\n }", "public function testUpdateServiceData()\n {\n\n }", "public function updateInfo($data){\n $this->updateAttrs($data);\n return true;\n }", "public function update(Request, $request)\n {\n \n\n }", "protected function _update()\n\t{\n\t}", "public function update($data) { \n\n\t\tif ($data['name'] != $this->name) { \n\t\t\t$this->update_name($data['name']); \n\t\t} \n\t\tif ($data['pl_type'] != $this->type) { \n\t\t\t$this->update_type($data['pl_type']); \n\t\t} \n\n\t}", "public function update() {\r\n\r\n\t}", "public function update(Request $request, BankData $bankData)\n {\n //\n }", "public function update(Request $request) {\n echo '<pre>';\n print_r($request->all());exit;\n }", "public function update(array $data);", "public function update(array $data);", "public function update(array $data);", "public function updateDataAction()\n {\n $contentService = Dm_Session::GetServiceFactory()->getContentService();\n /* @var $contentService Service_Api_Handler_Content_Baseo */\n $filter = new Service_Api_Filter_Content();\n $filter->id = $this->_getParam('id');\n\n $data = array();\n foreach (array('name', 'description', 'tags', 'shareWithNetwork', 'datePublication', 'dateExpiration')\n as $attrName) {\n if (($val = $this->_getParam($attrName)) !== null) {\n $data[$attrName] = $val;\n }\n }\n if (sizeof($data) > 0) {\n try {\n $count = $contentService->contentsUpdate($filter, $data);\n $this->view->assign(\n array_merge(\n get_object_vars($count) ?: array(),\n array('message' => ucfirst($this->view->translate('content updated successfully'))))\n );\n } catch (Mk_ApiException $e) {\n $this->view->error = $this->view->getHelper('errors')->translateFullException($e);\n }\n }\n }", "public function update(Request $request)\n {\n \n }", "public function update()\r\n {\r\n \r\n }", "public function update(Request $request)\n {\n \n \n\t\t\n \n }", "public function update(Request $request, Data $data)\n {\n $data->fill($request->all());\n $data->update();\n\n return redirect()->back()->with('success', 'Atualizado com sucesso'); \n }", "public function update(Request $request)\r\n {\r\n }", "public function update(Request $request)\r\n {\r\n }", "public function update() {\r\n }", "public function update(Request $request)\n {\n $now = date(\"Y-m-d H:i:s\");\n $data_updated = $request->all();\n $field = $data_updated['fieldch'];\n $value = $data_updated['valuech'];\n $response = MotorcycleTechnology::where('m_t_id', $data_updated['m_t_id'])->update([\n $field => $value,\n 'operation' => 'U',\n 'date_operation' => $now,\n 'user_id' => auth()->id(),\n ]);\n if ($response) {\n return response()->json(['response' => 'Información actualizada', 'error' => []]);\n } else {\n return response()->json(['error' => ['response' => 'No se pudo actualizar la información']]);\n }\n }", "public function update(string $key, $newData);", "protected function _set_request_data_from_params(){\n \n //if( !$this->request->is('post') && !empty($this->request->params['named'])){\n// $this->request->data['Region']['id'] = $this->request->params['named']['region_id'];\n// $this->request->data['Area']['id'] = $this->request->params['named']['area_id'];\n// $this->request->data['House']['id'] = $this->request->params['named']['house_id'];\n// \n// if( isset($this->request->params['named']['house_id']) ){\n// $this->request->data['House']['id'] = $this->request->params['named']['house_id'];\n// }\n// if( isset($this->request->params['named']['representative_id']) ){\n// $this->request->data['Representative']['id'] = $this->request->params['named']['representative_id'];\n// }\n// if( isset($this->request->params['named']['section_id']) ){\n// $this->request->data['Section']['id'] = $this->request->params['named']['section_id'];\n// }\n// if( isset($this->request->params['named']['outlet_id']) ){\n// $this->request->data['Outlet']['id'] = $this->request->params['named']['outlet_id'];\n// }\n// if( isset($this->request->params['named']['from_date']) ){\n// $this->request->data['from_date'] = $this->request->params['named']['from_date'];\n// }\n// if( isset($this->request->params['named']['till_date']) ){\n// $this->request->data['till_date'] = $this->request->params['named']['till_date'];\n// }\n //} \n \n $this->request->data['Region']['id'] = $this->request->query['region_id'];\n $this->request->data['Area']['id'] = $this->request->query['area_id'];\n $this->request->data['House']['id'] = $this->request->query['house_id'];\n \n \n if( isset($this->request->params['named']['representative_id']) ){\n $this->request->data['Representative']['id'] = $this->request->query['representative_id'];\n }\n if( isset($this->request->params['named']['section_id']) ){\n $this->request->data['Section']['id'] = $this->request->query['section_id'];\n }\n if( isset($this->request->params['named']['outlet_id']) ){\n $this->request->data['Outlet']['id'] = $this->request->query['outlet_id'];\n }\n if( isset($this->request->params['named']['from_date']) ){\n $this->request->data['from_date'] = $this->request->query['from_date'];\n }\n if( isset($this->request->params['named']['till_date']) ){\n $this->request->data['till_date'] = $this->request->query['till_date'];\n }\n }", "abstract protected function updateResponse(Model $data);", "public function updateEntityData(EntityData $entityData);", "public function updateData()\n {\n return ([\n [\"2\", \"9898989898\", \"pune\", 302, \"manager-records\"]\n ]);\n }", "public function updateDbFromRequest()\n\t\t{\n\t\t\t$this->columnsInfo->data_seek(0);\n\t\t\t$pkExistsInRequest = true;\n\t\t\t$PK = \"1=1\";\n\t\t\t$upd = \"\";\n\t\t\twhile($column = $this->columnsInfo->fetch_assoc())//$info->fetch_row()\n\t\t\t{\n\t\t\t\tif($column[\"COLUMN_KEY\"] == \"PRI\")\n\t\t\t\t{\n\t\t\t\t\tif($pkExistsInRequest = $pkExistsInRequest && isset($_REQUEST[$column[\"COLUMN_NAME\"]]))\n\t\t\t\t\t\t$PK = \"$PK and \".$column[\"COLUMN_NAME\"].\"=\".$this->wherePkValue($_REQUEST[$column[\"COLUMN_NAME\"]], $column[\"DATA_TYPE\"]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$upd = \"$upd, \".$column[\"COLUMN_NAME\"].\"=\".$this->insertColumnValue($_REQUEST[$column[\"COLUMN_NAME\"]], $column[\"IS_NULLABLE\"], $column[\"DATA_TYPE\"], $column[\"CHARACTER_MAXIMUM_LENGTH\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($pkExistsInRequest)\n\t\t\t{\n\t\t\t\t$query = \"update $this->table set \".substr($upd, 2, strlen($upd)).\" where $PK\";\n\t\t\t\techo \"<br>$query<br>\";\n\t\t\t}\n\t\t\telse\n\t\t\t\techo \"<br>PK dont exists in request<br>\";\n\t\t}", "protected function mapRequest() {\n foreach($_REQUEST as $key => $value) {\n $this->data[$key] = $value;\n }\n }", "function update_data($data_update_item) {\n\t}", "protected function _updatefields() {}", "public function update(Request $request)\n {\n \n }", "public function update(FormsDataRequest $request) {\n \t\t//$input = Input::all();\n \t\t$input = $request->all();\n \t\t//if (array_key_exists(\"data\", $input)) $input = $input['data'];\n \t\t$txtDebug = \"FormsDataController->update(FormsDataRequest \\$request) \\$request - \".print_r($request->all(), 1);\n \t\t$txtDebug .= \", \\$input - \".print_r($input, 1);\n \t\t//$txtDebug = \"FormsDataController->update(FormsRequest \\$request) \\$request - \".print_r($request, 1).\", \\$input - \".print_r($input,1);\n \t\t//die(\"<pre>{$txtDebug}</pre>\");\n \t\t//$ajax = $input['ajax'] ?: 0;\n \t\t$ajax = array_key_exists(\"ajax\", $input) ? $input['ajax'] : 0;\n \t\t//$ajax = var_export((bool)$input['ajax'],1);\n \t\t$id = $input['id'];\n \t\t$form_id = $input['formId'];\n \t\t$fields = FormField::where('form_id',$form_id)->orderBy(\"order\")->get()->toArray();\n \t\t$table = \"\";\n \t\tforeach ($fields AS $fi=>$f) if ($f['table']) $table = $f['table'];\n \t\t$txtDebug .= \"\\n \\$table - {$table}, \\$ajax - {$ajax} ( == true - \".($ajax == true).\", == false - \".($ajax == false).\")\";\n\t\t\t$form = Form::where('id',$form_id)->first();//->toArray();\n\t\t\t$arrForm = $form->toArray();\n\t\t\t$txtDebug .= \"\\n \\$form - \".print_r($form,1);\n\t\t\t$txtDebug .= \"\\n \\$arrForm - \".print_r($arrForm,1);\n \t\t//if ($table != \"\") $formdata->table = $table;\n\t\t\tif ($table) {\n\t\t\t\t$formdata = new FormsData(array('form_id'=>$form_id, 'table'=>$table));\n\t\t\t} else {\n\t\t\t\tif ($id != -1) $formdata = FormsData::where('id',$id)->first();//->toArray();\n\t\t\t\telse $formdata = new FormsData(array('form_id'=>$form_id, 'table'=>$table));\n\t\t\t}\n\n\t\t\t$data = array();\n\t\t\t$txtDebug .= \"\\n Data Stuff\";\n \t\tforeach ($input['data'] AS $k=>$v) if (is_array($v)) {\n \t\t\t$txtDebug .= \"\\n Array\";\n\t\t\t\t$data[$k] = json_encode($v);\n\t\t\t\t/*foreach ($v AS $vi=>$vv) {\n\t\t\t\t\tif ($vv == \"\") continue;\n\t\t\t\t\tforeach ($fields AS $fi=>$f) {\n\t\t\t\t\t\t//$fff = sprintf(\"%0.1f\", $f['order']);\n\t\t\t\t\t\tlist($whole, $frac) = sscanf($f['order'], \"%d.%d\");\n\t\t\t\t\t\tif ($frac == $vi) {\n\t\t\t\t\t\t\t$txtDebug .= \"\\n \\$frac - {$frac}, order - {$f['order']}, \\$fi - {$fi}\";\n\t\t\t\t\t\t\t//if (array_key_exists($k,$data)) $data[$k] .= \"{$vv}\";\n\t\t\t\t\t\t\t//else $data[$k] = \"{$vv}\";\n\t\t\t\t\t\t\t$optss = json_decode($f['options'], true);\n\t\t\t\t\t\t\t$joiner = \"\";\n\t\t\t\t\t\t\tif ($optss['joiner'] == \"line\") $joiner = \"\\n\";\n\t\t\t\t\t\t\telse if ($optss['joiner'] == \"comma\") $joiner = \", \";\n\t\t\t\t\t\t\telse if ($optss['joiner'] == \"space\") $joiner = \" \";\n\t\t\t\t\t\t\t$data[$k] .= \"{$f['label']} - {$vv}{$joiner}\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if (array_key_exists($k,$data)) $data[$k] .= \"\\n{$vv}\";\n\t\t\t\t\t//else $data[$k] = \"{$vv}\";\n\t\t\t\t}*/\n\t\t\t} else $data[$k] = $v;\n\t\t\t$txtDebug .= \"\\n \\$data - \".print_r($data,1);\n\t\t\t$data = json_encode($data);\n\t\t\t$txtDebug .= \"\\n \\$formdata - \".print_r($formdata,1);\n\t\t\t///die(\"<pre>{$txtDebug}</pre>\");\n \t\t$formdata->data = $data;\n\n \t\t\n \t\t$txtDebug .= \"\\n \\$data - \".print_r($data,1);\n \t\t$txtDebug .= \"\\n \\$formdata - \".print_r($formdata,1);\n \t\t//\n \t\t$txtDebug .= \"\\n \\$fields - \".print_r($fields, 1).\"\";\n \t\t\n \t\t$opts = array('id'=>$id, 'table'=>$table);\n \t\t\n \t\t//die(\"<pre>{$txtDebug}</pre>\");\n \t\t$saved = $formdata->save($opts);\n \t\tif ($saved) \\Session::flash('success', 'well done! Form Data has been successfully updated!');\n \t\telse \\Session::flash('failure', 'Whoops! Error updating Form Data');\n\n \t\tif ($ajax) return json_encode($saved);\n \t\telse return redirect()->back()->withInput();\n\t\t}", "public function update(Request $request)\n {\n }", "public function updateData()\n\t{\n\t\tif(empty($this->_queryIds))\n\t\t\tthrow new Exception('Unable to update, no data!');\n\t\t\n\t\t$sQueryIds = implode(', ', $this->_queryIds);\n\t\t$iTimeStamp = time();\n\n\t\t$sSql = \"UPDATE se_query SET xml_parsed = 1, pingback_timestamp = $iTimeStamp WHERE id IN ($sQueryIds)\";\n\t\t$this->_db->query($sSql);\n\t\t\n\t\t$this->_queryIds = array();\n\t}", "public function update(Request $request) {\n \n \n }", "public function update(Request $req)\n { \n\n }", "function editEmployeeData( Request $request )\n\t\t\t{\n\t\t\t\tif ( $this->employeeExists( $request->emp_id ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$result = Employee::where( 'id', $request->emp_id )->update( [ 'name' => $request->name ] );\n\n\t\t\t\t\t\tif ( ! empty( $result ) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->finalResponse( 'success', 'Record updated!', 'Employee data has been updated successfully.' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->finalResponse( '', 'Unable to update record!', '' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}", "public function update(Request $request) {\n }", "public function update(Request $request) {\n }", "public function update(Request $request)\n { }", "public function update() {\n \n }", "public function update(Request $request, ScrapeData $scrapeData)\n {\n //\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update()\n\t{\n\n\t}" ]
[ "0.69999284", "0.69462097", "0.6585133", "0.6585133", "0.6366481", "0.6352112", "0.6312204", "0.6312204", "0.6312204", "0.6312204", "0.63089144", "0.6290382", "0.6226385", "0.62078196", "0.6197155", "0.61705434", "0.6137441", "0.6104258", "0.60515916", "0.60465497", "0.6037429", "0.6037429", "0.6010817", "0.6009602", "0.6005253", "0.59562314", "0.59342766", "0.590416", "0.58606964", "0.5849378", "0.58394426", "0.58382577", "0.5838183", "0.5822089", "0.58159375", "0.58057344", "0.5800147", "0.5799649", "0.5795589", "0.57896954", "0.5782365", "0.57803583", "0.5777071", "0.5777071", "0.5777071", "0.57750785", "0.5763247", "0.5761868", "0.5758526", "0.57489693", "0.5723437", "0.5723437", "0.5722844", "0.5721581", "0.5716642", "0.5710226", "0.5706842", "0.5700423", "0.56977534", "0.569607", "0.5694479", "0.56938535", "0.56937057", "0.56927574", "0.56919396", "0.5685187", "0.5679105", "0.56765354", "0.56751704", "0.5668125", "0.56649375", "0.56649375", "0.5663911", "0.56567806", "0.5653791", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.564678", "0.563751" ]
0.6220794
13
Remove the specified resource from storage.
public function delete($id) { try { $this->gdprDataRequestRepository->delete($id); session()->flash('success', trans('gdpr::app.response.delete-success', ['name' => 'Data Request'])); } catch (\Exception $e) { session()->flash('error', trans( 'gdpr::app.response.attribute-reason-error', ['name' => 'Data Request'])); } return redirect()->back(); }
{ "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
Set the "iid" parameter for the current command
public function setIid($iid) { return $this->set('pio_iid', $iid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setId_ubi($iid_ubi)\n {\n $this->iid_ubi = $iid_ubi;\n }", "function setId_ubi($iid_ubi)\n {\n $this->iid_ubi = $iid_ubi;\n }", "function setId_ubi($iid_ubi = '')\n {\n $this->iid_ubi = $iid_ubi;\n }", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "function setId_item($iid_item = '')\n {\n $this->iid_item = $iid_item;\n }", "function setId_asignatura($iid_asignatura = '')\n {\n $this->iid_asignatura = $iid_asignatura;\n }", "function setId_asignatura($iid_asignatura)\n {\n $this->iid_asignatura = $iid_asignatura;\n }", "public function __construct( $iid ) {\n\t\t$this->init($iid);\n\t}", "function setId_activ($iid_activ = '')\n {\n $this->iid_activ = $iid_activ;\n }", "function setId_situacion($iid_situacion = '')\n {\n $this->iid_situacion = $iid_situacion;\n }", "function setId_activ($iid_activ)\n {\n $this->iid_activ = $iid_activ;\n }", "public function setIDfromArgV() {}", "function setId_nom($iid_nom)\n {\n $this->iid_nom = $iid_nom;\n }", "function setId_nom($iid_nom)\n {\n $this->iid_nom = $iid_nom;\n }", "function setId_situacion($iid_situacion)\n {\n $this->iid_situacion = $iid_situacion;\n }", "function setId_nivel($iid_nivel = '')\n {\n $this->iid_nivel = $iid_nivel;\n }", "function setId_serie($iid_serie)\n {\n $this->iid_serie = $iid_serie;\n }", "function setId_nivel($iid_nivel)\n {\n $this->iid_nivel = $iid_nivel;\n }", "function setId_dl($iid_dl = '')\n {\n $this->iid_dl = $iid_dl;\n }", "function setId_nom_new($iid_nom_new = '')\n {\n $this->iid_nom_new = $iid_nom_new;\n }", "function setId_region($iid_region = '')\n {\n $this->iid_region = $iid_region;\n }", "function setId_preceptor($iid_preceptor = '')\n {\n $this->iid_preceptor = $iid_preceptor;\n }", "function setId_preceptor($iid_preceptor = '')\n {\n $this->iid_preceptor = $iid_preceptor;\n }", "function setId_situacion($iid_situacion = '')\n {\n $this->iid_situacion = (int)$iid_situacion;\n }", "public function setIdif($value)\n {\n $this->setParam('idif', $value);\n }", "public function setEtatCmdIdAttribute($input)\n {\n $this->attributes['etat_cmd_id'] = $input ? $input : null;\n }", "function setAmocrmIntegreationId(string $id): void {\n\t}", "public function setIdVit($id){\n\t\t$this->id = $id;\n\t}", "public function setID($iD = null)\n {\n // validation for constraint: string\n if (!is_null($iD) && !is_string($iD)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($iD)), __LINE__);\n }\n if (is_null($iD) || (is_array($iD) && empty($iD))) {\n unset($this->ID);\n } else {\n $this->ID = $iD;\n }\n return $this;\n }", "protected function set_iri($iri)\n {\n }", "public function setID($iD)\n {\n $this->iD = $iD;\n return $this;\n }", "public function setID($iD)\n {\n $this->iD = $iD;\n return $this;\n }", "public function setID($iD)\n {\n $this->iD = $iD;\n return $this;\n }", "public function setID($iD)\n {\n $this->iD = $iD;\n return $this;\n }", "public function setDeviceIMEI($val)\n {\n $this->_propDict[\"deviceIMEI\"] = $val;\n return $this;\n }", "function setId_tarifa($iid_tarifa)\n {\n $this->iid_tarifa = $iid_tarifa;\n }", "function setItemId($a_item_id)\n\t{\n\t\t$this->item_id = $a_item_id;\n\t}", "public function setID($id) {\n $this->id = $id; \n }", "public function setIdpension($idpension){\n $this->idpension = $idpension;\n }", "private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}", "private function setIcon(\\Scrivo\\Str $icon) {\n\t\t$this->icon = $icon;\n\t}", "function setITipo($iTipo) {\n $this->iTipo = $iTipo;\n }", "function setDocumentID($iNewValue) {\n\t\t$this->iDocumentID = $iNewValue;\n\t}", "function set_id(string $id) {\n\t\tif (!in_array($id, slides_id_list())) {\n\t\t\tthrow new ArgException(\"Slide $id doesn't exist.\");\n\t\t}\n\t\t$this->id = $id;\n\t\t$this->mk_paths($id);\n\t}", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "public function modify_information($i_id=0)\r\n {}", "private function setUserID($iUser) {\n\t\t\t$this->user($iUser); \n//\t\t\t$this->iUser = $iUser; \n\t\t\tglobal $oPage; \n\t\t\t$oPage->iUser = $iUser; \n\t\t}", "public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}", "function setIdadeFilho( $iIndiceFilho, $iIdade ) {\n $this->{\"iIdadeFilho$iIndiceFilho\"} = $iIdade;\n }", "public function API_setInterface($int_num, $if)\n {\n $ret = $this->setInterface($int_num, $if);\n\n if( $ret )\n {\n $con = findConnector($this);\n $xpath = $this->getXPath();\n\n $con->sendSetRequest($xpath, \"<\".$int_num.\">{$if->name()}</\".$int_num.\">\");\n }\n\n return $ret;\n }", "public function setID($id){\n $this->id = $id;\n }", "public function set_iri($iri, $clear_cache = \\false)\n {\n }", "function setFieldID($iNewVale) {\n\t\t$this->iFieldID = $iNewValue;\n\t}", "public function setID($id){\n $this->ID = $id;\n }", "public function setCi($_ci)\n {\n $this->ci = $_ci;\n }", "function setid_exp($val)\n { $this->id_exp=$val;}", "function setIdentifier($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }", "function setId($id){\n\t\t$this->id = $id;\n\t}", "protected function setInternalIdentifier($id)\n {\n $this->_id = $id;\n }", "public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}", "private function setItemId(string $itemId) {\n $this->itemId = $itemId;\n }", "public function setID($id) {\n\t\t$this->id = $id;\n\t}", "function setid_exp($val)\n { $this->id_exp=$val;}", "function setid_exp($val)\n { $this->id_exp=$val;}", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "function __construct( $iid, $layout ) {\n\t\tparent::__construct( $iid );\n\n\t\t$this->layout = $layout;\n\t}", "function set_id($id)\n {\n $this->id = $id;\n }", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "public function setId($id) { $this->id = $id; }", "function setId($id) {\r\n\t\t$this->setAttributeNS(self :: TEXT, 'text:id', $id);\r\n\t}", "public function setID($id){\n $this->id=$id;\n }", "public function sendPutModifyNotificationByID(ApiTester $I)\n {\n $data = [\n 'entityClass' => 'host',\n 'entityId' => fake::create()->randomNumber(2),\n 'category' => 'info',\n 'message' => fake::create()->text(20)\n ];\n $I->sendPUT($this->route.'/'.$this->userID[0], $data);\n $I->seeResponseCodeIs(200);\n }", "function setId($id) {\r\n $this->_id = $id;\r\n }", "public function setId($id){\n $this->_id = $id;\n }", "private function setCodigo($iCodigo) {\n $this->iCodigo = $iCodigo;\n }", "public function setIdp($idp)\n {\n $this->idp = $idp;\n }", "public function set_id($setid){\n $this->id = $setid;\n }", "function SetId($value) { $this->id=$value; }", "public function setId($id){\n\t\t$this->id = $id;\n\t}", "function setId($id) {\n $this->id = $id;\n }", "function setId($id) {\n $this->id = $id;\n }", "private function set_game($iGame) {\r\n $this->game = $iGame;\r\n }", "public function setId($x) { $this->id = $x; }", "private function set_game($iGame) {\n $this->game = $iGame;\n }", "public function set_editicon($param)\n\t{\n\t\t$this->editicon = (string)$param;\n\t\treturn $this;\n\t}", "public function setIdentifier(){\n\n \t$this->fileIdentifier = $this->getIdentifier();\n }", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}", "function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "function SetKey( $i ) { $this->_key = $i; $this->SetValue('_key', $i ); }", "public function set_id($id){\n $this->id = $id;\n }", "public function setMaconomyId(string $key): void\n {\n $this->data['instancekeyField'] = $key;\n }", "public function setID($id);", "public function setID($id)\n {\n $this->ID = $id;\n }", "public function setId( $id )\n {\n $this->id = $id;\n }" ]
[ "0.68654287", "0.68654287", "0.6860936", "0.6767778", "0.6767778", "0.67226034", "0.65090114", "0.63108695", "0.62251186", "0.6211543", "0.6206826", "0.6198715", "0.61696315", "0.61487794", "0.61487794", "0.61411536", "0.6100642", "0.60032284", "0.5945139", "0.5840505", "0.57852787", "0.5723957", "0.5721381", "0.5721381", "0.5697482", "0.5673136", "0.54845876", "0.5384184", "0.5365046", "0.53486466", "0.528728", "0.52680427", "0.52680427", "0.52680427", "0.52680427", "0.5267608", "0.52529234", "0.52167636", "0.52122027", "0.51954246", "0.51857984", "0.51818526", "0.51804227", "0.51693225", "0.51683635", "0.51445407", "0.51372063", "0.51253843", "0.51035947", "0.5102199", "0.5099822", "0.50919163", "0.5076371", "0.5068488", "0.50631124", "0.5057304", "0.5053256", "0.50499815", "0.5049585", "0.50462425", "0.50461984", "0.5034763", "0.50297934", "0.5026084", "0.5026084", "0.5024872", "0.5022144", "0.5015059", "0.50147885", "0.50030905", "0.4991738", "0.49914142", "0.49905854", "0.4987885", "0.49841964", "0.49644494", "0.49590772", "0.49553", "0.49496725", "0.49463466", "0.49449268", "0.49449268", "0.4927972", "0.49186772", "0.49139687", "0.49062634", "0.4898086", "0.48975706", "0.48975706", "0.48971823", "0.48924717", "0.48920494", "0.48920494", "0.48920494", "0.48915598", "0.48901805", "0.48883826", "0.48874414", "0.48855907", "0.48747104" ]
0.72621
0
Create the request object that will carry out the command. Used internally by Guzzle.
protected function build() { $this->request = $this->client->createRequest(RequestInterface::DELETE, 'items/' . $this->get('pio_iid')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createRequest()\n {\n return new ChipVN_Http_Request;\n }", "public function createRequest();", "public function createRequest();", "protected function buildCliRequest()\n {\n global $argv;\n \n $args = $argv;\n $params = array();\n $route = '';\n \n foreach ($args as $arg) {\n if ($arg === $_SERVER['PHP_SELF']) {\n continue;\n }\n \n if (strpos($arg, '-') === 0) {\n list($key, $value) = $this->parseArgument($arg);\n \n $params[$key] = $value;\n } else {\n if ($route !== '') {\n $route .= ' ';\n }\n \n $route .= $arg;\n }\n }\n \n $base = $argv[0];\n \n $operatingSystem = $this->getOperatingSystem();\n \n return new CliRequest($route, $params, $base, 'en_US', $operatingSystem);\n }", "public function buildRequest()\n {\n if (php_sapi_name() === 'cli') {\n return $this->buildCliRequest();\n } else {\n return $this->buildWebRequest();\n }\n }", "private function createRequest(): ServerRequest\n {\n return new ServerRequest(\n 'POST',\n 'https://localhost/',\n [\n 'Accept' => '*/*',\n 'content-type' => 'application/json',\n 'User-Agent' => 'GitHub-Hookshot/0000000',\n 'X-GitHub-Delivery' => '00000000-0000-0000-0000-000000000000',\n 'X-GitHub-Event' => 'ping',\n 'X-Hub-Signature' =>\n 'sha1=5563c89a2f4743278567358293adc9a65680725b',\n ],\n '{\"zen\":\"Approachable is better than simple.\",\"hook_id\":202756468,\"sender\":{\"url\":\"https://api.github.com/users/loilo\"}}'\n );\n }", "private function createRequest()\n {\n $requests = $this->createGuzzleRequests();\n if (count($requests) == 1) {\n $request = reset($requests);\n } else {\n $multipartRequest = new MultipartRequest($this->client, new ApiRequest([\n 'version' => 'latest',\n 'requests' => $requests,\n 'boundary' => ApiHelper::generateId(),\n 'multipartType' => 'mixed',\n ]));\n $request = $this->createGuzzleRequest($multipartRequest->getMethod(), $multipartRequest->getUri(), $multipartRequest->getHeaders(), $multipartRequest->getBody());\n }\n\n return $request;\n }", "public function toRequest(): Request\n {\n // Create URI\n $uri = new Uri(sprintf($this->uriTemplate, $this->shop));\n\n // Create headers\n $authenticatedRequestHeader = $this->accessTokenTransformer\n ->toAuthenticatedRequestHeader($this->accessToken);\n\n // Create headers\n $headers = array_merge($this->headers, $authenticatedRequestHeader);\n\n // Create request\n return new Request($this->httpMethod, $uri, $headers);\n }", "protected function createRequest()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n $this->call('wizard:request', $params);\n }", "protected function createRequests()\n {\n $this->call('make:request', [\n 'name' => 'Store'.$this->getNameInput().'Request',\n '--type' => 'store',\n ]);\n\n $this->call('make:request', [\n 'name' => 'Update'.$this->getNameInput().'Request',\n '--type' => 'update',\n ]);\n }", "private function makeRequest()\n {\n $credentials = $this->generateCredentials();\n\n return $this->engine->client->request('POST', $this->endpoint, [\n 'json' => $credentials,\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n ],\n ]);\n }", "function request() {\n return new Request;\n }", "protected function _getRequest() {\n\t\treturn new Request;\n\t}", "protected function getCreateRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"id\": 1}');\n\t\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "public function getRequest(): Request\n\t{\n\t\t//Get php://input for PUT and DELETE methods\n\t\tparse_str(file_get_contents('php://input'), $_DATA);\n\t\treturn new Request($_SERVER, $_GET + $_POST + $_DATA);\n\t}", "public static function create()\n {\n $contentType = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : 'text/html';\n return (new Request(\n $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI'] ,\n $_REQUEST, $contentType\n ))->processBody();\n }", "public function createRequest(): IRequest;", "public function createRequest(Request $request)\n {\n $body = ConnectClient::getInstance()->fulfillment->sendRequest('POST', '/requests', $request);\n return Model::modelize('Request', json_decode($body));\n }", "private function buildRequest(): void\n {\n if (isset($this->parameters) && !Str::contains($this->requestUri, '?')) {\n $this->requestUri .= '?';\n $params = $this->parameters;\n array_walk($params, function (&$a, $b) {\n $a = \"$b=$a\";\n });\n $this->requestUri .= implode('&', $params);\n }\n \n if (isset($this->queries) && sizeof($this->queries) > 0) {\n $this->addJsonParam('query', '{'.implode(',', $this->queries).'}');\n }\n \n $this->options['headers'] = $this->headers;\n \n if (isset($this->json)) {\n $this->options['json'] = $this->json;\n }\n if (isset($this->body)) {\n $this->options['body'] = $this->body;\n }\n }", "public function request() {\r\n\t\t$this->verbose('protocol', $this->protocol);\r\n\t\t$this->verbose('method', $this->method);\r\n\t\t$this->verbose('host', $this->host);\r\n\t\t$this->verbose('path', $this->path);\r\n\t\t$this->verbose('query', $this->query);\r\n\t\t$this->verbose('headers', $this->headers);\r\n\t\t$this->verbose('body', $this->body);\r\n\t\t$this->verbose('timeout', $this->timeout);\r\n\r\n\t\t$this->addQueryToPath();\r\n\t\t$this->verbose('path + query', $this->path);\r\n\t\t$this->cleanHost();\r\n\t\t$this->verbose('cleanHost', $this->host);\r\n\r\n\t\t$url = $this->protocol . '://' . $this->host . $this->path;\r\n\t\t$this->verbose('url', $url);\r\n\r\n\t\t$this->headers['Authorization'] = $this->makeAuthHeader();\r\n\r\n\r\n\t\tforeach ($this->headers as $header_key => $header_value) {\r\n\t\t\t$header_array[] = $header_key . \":\" . $header_value;\r\n\t\t}\r\n\r\n\t\t$ch = curl_init();\r\n\t\t$options = array(\r\n\t\t\tCURLOPT_URL => $url,\r\n\t\t\tCURLOPT_RETURNTRANSFER => 1,\r\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->method,\r\n\t\t\tCURLOPT_POSTFIELDS => $this->body,\r\n\t\t\tCURLOPT_HEADER => false,\r\n\t\t\tCURLINFO_HEADER_OUT => true,\r\n\t\t\tCURLOPT_HTTPHEADER => $header_array,\r\n\t\t\tCURLOPT_TIMEOUT => $this->timeout\r\n\t\t);\r\n\t\tcurl_setopt_array($ch, $options);\r\n\r\n\t\t$this->verbose('body at exec', $this->body);\r\n\t\t$response_body = curl_exec($ch);\r\n\t\t$response_error = curl_error($ch);\r\n\t\t$response_headers = curl_getinfo($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$response['error'] = $response_error;\r\n\t\t$response['body'] = $response_body;\r\n\t\t$response['header'] = $response_headers;\r\n\t\treturn $response;\r\n\t}", "private function createRequest()\n {\n $xml = new DOMDocument();\n $xml->formatOutput = true;\n\n $trackRequest = $xml->appendChild($xml->createElement(\"TrackRequest\"));\n $trackRequest->setAttribute('xml:lang', 'en-US');\n\n $request = $trackRequest->appendChild($xml->createElement(\"Request\"));\n\n $node = $xml->importNode($this->createTransactionNode(), true);\n $request->appendChild($node);\n\n $request->appendChild($xml->createElement(\"RequestAction\", \"Track\"));\n\n if (null !== $this->requestOption) {\n $request->appendChild($xml->createElement(\"RequestOption\", $this->requestOption));\n }\n\n if (null !== $this->trackingNumber) {\n $trackRequest->appendChild($xml->createElement(\"TrackingNumber\", $this->trackingNumber));\n }\n\n return $xml->saveXML();\n }", "public function request()\n {\n return $this->applyRequestOptions(\n $this->newRequestWithoutOptions()\n );\n }", "public function createInternalRequestClient();", "public function createNewRequest()\n { \n return $this->clientManager->createNewRequest('user');\n }", "protected function _buildBasicRequest()\n {\n $request = Mage::getModel('paypal/hostedpro_request');\n $request->setData(array(\n 'METHOD' => self::BM_BUTTON_METHOD,\n 'BUTTONCODE' => self::BM_BUTTON_CODE,\n 'BUTTONTYPE' => self::BM_BUTTON_TYPE\n ));\n return $request;\n }", "protected function create_new_request( $data )\n {\n $request = new \\WP_REST_Request();\n\n $request->set_header( 'X-POC-Access-Token', '8wdT9UsxXd' );\n\n $request->set_header( 'Content-Type', 'application/json' );\n\n $request->set_body( json_encode( $data ) );\n\n return $request;\n }", "protected function buildRequest() {\n\t\t/* @var $request \\TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request */\n\t\t$request = $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Web\\\\Request');\n\t\t$request->setControllerVendorName($this->vendorName);\n\t\t$request->setControllerExtensionName($this->extensionName);\n\t\t$request->setPluginName($this->pluginName);\n\t\t$request->setControllerName($this->controllerName);\n\t\t$request->setControllerActionName($this->actionName);\n\t\t$request->setFormat($this->formatName);\n\t\t$request->setArguments($this->arguments);\n\t\treturn $request;\n\t}", "public function createRequest($method = RequestInterface::GET, $uri = null, $headers = null, $body = null, array $options = array())\n {\n if (is_array($body)) {\n $body['pio_appkey'] = $this->getConfig()->get(\"appkey\");\n } else {\n $body = array('pio_appkey' => $this->getConfig()->get(\"appkey\"));\n }\n\n // Remove Guzzle internals to prevent them from going to the API\n unset($body[AbstractCommand::HEADERS_OPTION]);\n unset($body[AbstractCommand::ON_COMPLETE]);\n unset($body[AbstractCommand::DISABLE_VALIDATION]);\n unset($body[AbstractCommand::RESPONSE_PROCESSING]);\n unset($body[AbstractCommand::RESPONSE_BODY]);\n unset($body[AbstractCommand::HIDDEN_PARAMS]);\n\n if ($method == RequestInterface::GET || $method == RequestInterface::DELETE) {\n $request = parent::createRequest($method, $uri, $headers, null, $options);\n $request->getQuery()->replace($body);\n } else {\n $request = parent::createRequest($method, $uri, $headers, $body, $options);\n }\n $request->setPath($request->getPath() . \".json\");\n\n return $request;\n }", "public function prepareRequest() {\n $auth = new WebServiceSoap\\SveaAuth(\n $this->conf->getUsername($this->orderType, $this->countryCode),\n $this->conf->getPassword($this->orderType, $this->countryCode),\n $this->conf->getClientNumber($this->orderType, $this->countryCode) \n );\n\n $address = new WebServiceSoap\\SveaAddress( \n $auth, \n (isset($this->companyId) ? true : false), \n $this->countryCode, \n (isset($this->companyId) ? $this->companyId : $this->ssn) \n );\n\n $this->request = new WebServiceSoap\\SveaRequest( $address );\n\n return $this->request;\n }", "function request()\n\t{\n\t\treturn phanda()->create(\\Phanda\\Foundation\\Http\\Request::class);\n\t}", "public function getRequest() {\n if (is_null($this->Request)) {\n $this->Request = new Request();\n $this->Request->setTransport(Request::TRANSPORT_CURL);\n $this->Request->setUrl(self::ENDPOINT_SEND);\n }\n return $this->Request;\n }", "public function getRequest(): \\GuzzleHttp\\Psr7\\Request\n {\n }", "private function getBuilder(): RequestBuilder\n {\n return new RequestBuilder(new StreamFactory());\n }", "public static function createFromGlobals()\n {\n $class = __CLASS__;\n\n \n //Modification for modouth flow TODO: extend request class and override createFromGlobals method\n //to handle params stored in session\n \n $OAUTH_PARAMS = array();\n \n $clientKey = 'modoauth-clientid';\n $resTypeKey = 'modoauth-responsetype';\n $stateKey = 'modoauth-state';\n \n if(isset($_SESSION['modoauth'])){\n $oauthParams = $_SESSION['modoauth'];\n $OAUTH_PARAMS = array(\n \"client_id\"=>$oauthParams[$clientKey],\n \"response_type\"=>$oauthParams[$resTypeKey],\n \"state\"=>$oauthParams[$stateKey]\n );\n }\n \n $request = new $class(array_merge($_GET,$OAUTH_PARAMS), $_POST, array(), $_COOKIE, $_FILES, $_SERVER);\n\n $contentType = $request->server('CONTENT_TYPE', '');\n $requestMethod = $request->server('REQUEST_METHOD', 'GET'); \n if (0 === strpos($contentType, 'application/x-www-form-urlencoded')\n && in_array(strtoupper($requestMethod), array('PUT', 'DELETE'))\n ) {\n parse_str($request->getContent(), $data);\n $request->request = $data;\n } elseif (0 === strpos($contentType, 'application/json')\n && in_array(strtoupper($requestMethod), array('POST', 'PUT', 'DELETE'))\n ) {\n $data = json_decode($request->getContent(), true);\n $request->request = $data;\n }\n \n return $request;\n }", "public function createHttpRequest()\n {\n /*\n * A patch which will take JSON bodies passed in POST requests and fill them into $_POST array,\n * so they are parsed by create HTTP request method.\n */\n if (!empty($_SERVER['REQUEST_METHOD']) && strtoupper($_SERVER['REQUEST_METHOD']) == 'POST'\n && !empty($_SERVER['CONTENT_TYPE']) && strpos(strtolower($_SERVER['CONTENT_TYPE']), 'application/json') !== false) {\n $body = file_get_contents('php://input');\n try {\n $json = Json::decode($body, Json::FORCE_ARRAY);\n }\n catch (JsonException $e) {\n throw new BadRequestException(\"Parsing of the JSON body failed: \" . $e->getMessage());\n }\n\n if (!is_array($json)) {\n throw new BadRequestException(\"A collection is expected as JSON body. Scalar value was given instead.\");\n }\n\n $_POST = $json;\n }\n\n return parent::createHttpRequest();\n }", "public function toIlluminateRequest()\n {\n list($get, $post, $cookie, $files, $server, $content)\n = $this->transformIlluminateParameters($this->swooleRequest);\n\n return $this->createIlluminateRequest(\n $get, $post, $cookie, $files, $server, $content\n );\n }", "protected function obtainRequest() {\n return Request::createFromGlobals();\n }", "public static function request() {\n\t\tif (!isset(self::$_request)) {\n\t\t\tself::$_request=new \\GO\\Base\\Request();\n\t\t}\n\t\treturn self::$_request;\n\t}", "public function createServerRequestFromGlobals(): ServerRequestInterface;", "public function createServerRequestFromGlobals(): ServerRequestInterface;", "public function newRequestWithoutOptions()\n {\n return new RequestBuilder(\n $this, $this->getPostProcessor()\n );\n }", "protected function _createRequest($spec)\n {\n if (isset($spec['input'])) {\n $spec['post'] = [];\n }\n $request = ServerRequestFactory::fromGlobals(\n array_merge($_SERVER, $spec['environment'], ['REQUEST_URI' => $spec['url']]),\n $spec['query'],\n $spec['post'],\n $spec['cookies']\n );\n $request = $request->withAttribute('session', $spec['session']);\n\n if (isset($spec['input'])) {\n $stream = new Stream('php://memory', 'rw');\n $stream->write($spec['input']);\n $stream->rewind();\n $request = $request->withBody($stream);\n }\n\n return $request;\n }", "protected function createPrivateKeyRequest()\n {\n\n $resourcePath = '/v1/account/privkey';\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function request(): RequestContract;", "public function getRequestBuilder()\n {\n return new RequestBuilder();\n }", "public function & GetRequest ();", "public static function createRequest($rawRequest) {\n if(self::isHttpPostRequest($rawRequest)) {\n return new HttpPostRequest($rawRequest);\n }\n // if it is not a post request, create a get request\n else {\n return new HttpGetRequest($rawRequest);\n }\n }", "protected function getShopRequest()\n {\n $resourcePath = '/shop';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getRequest(){\n $client = $this->client;\n if(!$client instanceof Client){\n $client = new Client();\n }\n return $client;\n }", "function getRequest()\n {\n if ( !$this->_request )\n {\n if ( method_exists( $this, '_getRequest' ) )\n {\n $object = $this->_getRequest();\n if ( $object instanceof \\Hotlink\\Framework\\Model\\Api\\Request )\n {\n $this->setRequest( $object );\n }\n }\n if ( !$this->_request )\n {\n //$request = Mage::getModel('hotlink_framework/api_request');\n $request = $this->interactionApiRequestFactory->create();\n $this->setRequest( $request );\n }\n }\n return $this->_request;\n }", "public function createRequest(string $method, $uri): RequestInterface;", "public function getRequest() {}", "public function getRequest() {}", "protected function createRequest($body)\n {\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling '\n );\n }\n\n $resourcePath = '/campaigns';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n if (is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function prepareRequest() { \n \n $this->validateRequest();\n \n $soapRequest = new \\Svea\\WebPay\\AdminService\\AdminSoap\\CancelOrderRequest( \n new Authentication( \n $this->orderBuilder->conf->getUsername( ($this->orderBuilder->orderType), $this->orderBuilder->countryCode ), \n $this->orderBuilder->conf->getPassword( ($this->orderBuilder->orderType), $this->orderBuilder->countryCode ) \n ),\n $this->orderBuilder->orderId, \n AdminServiceRequest::CamelCaseOrderType( $this->orderBuilder->orderType ),\n $this->orderBuilder->conf->getPassword(($this->orderBuilder->orderType), $this->orderBuilder->countryCode)\n );\n \n return $soapRequest;\n }", "public function execute(): object\n {\n $this->buildRequest();\n $client = new HttpClient();\n Log::debug('Creating Digicert Request', [\n 'Method' => $this->requestMethod,\n 'RequestURI' => $this->requestUri,\n 'Options' => $this->options,\n ]);\n RateLimiter::checkLimit();\n $request = $client->request($this->requestMethod, $this->requestUri, $this->options);\n \n return json_decode($request->getBody());\n }", "public function build(HttpRequest $request): Request\n {\n $headers = (new HeaderResourceBuilder())->build($request);\n\n return new Request($request->getMethod(), $request->getUri(), ...$headers);\n }", "abstract protected function _setRequestServiceBuilder();", "public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactored because it is hard to replace or overwrite it.\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($curl);\n // @todo: very important: check the curl errors here.\n\n return $this->parser->parse($response);\n }", "public function build(): CreateInvoiceRequest\n {\n return CoreHelper::clone($this->instance);\n }", "public function createRequest(PushMessage $message) : RequestInterface\n {\n $request = new Request(\n 'POST',\n $this->getUri($message),\n $this->getHeaders($message),\n $this->getBody($message)\n );\n\n return $request;\n }", "protected function build()\n {\n $this->request = $this->client->createRequest(RequestInterface::POST, 'actions/u2i/conversion', null, $this->getAll());\n }", "public function build(): CreateShiftRequest\n {\n return CoreHelper::clone($this->instance);\n }", "public function request() : ServerRequestInterface;", "public function getRequest()\n {\n if (is_null($this->_request)) {\n $this->_request = new Request();\n }\n return $this->_request;\n }", "public function get_request()\n {\n $request = new midgardmvc_core_request();\n $request->set_method($this->appserver_context['env']['REQUEST_METHOD']);\n if (isset($this->appserver_context['env']['HTTP_X_HTTP_METHOD_OVERRIDE']))\n {\n $request->set_method($this->appserver_context['env']['HTTP_X_HTTP_METHOD_OVERRIDE']);\n }\n\n // Parse URL into components (Mjolnir doesn't do this for us)\n $url_components = parse_url(\"http://{$this->appserver_context['env']['HTTP_HOST']}{$this->appserver_context['env']['REQUEST_URI']}\");\n\n // Handle GET parameters\n if (!empty($url_components['query']))\n {\n $get_parameters = array();\n parse_str($url_components['query'], $get_parameters);\n $request->set_query($get_parameters);\n }\n\n $request->resolve_node($url_components['path']);\n\n return $request;\n }", "public function createRequestToExchange(string $code) : RequestInterface\n {\n $request = RequestFactory::createStandardIntuitRequest(RequestType::OAUTH);\n $request->setMethod(RequestInterface::POST)\n ->setUrl($this->getDiscoveryURLs()->getTokenEndpointUrl())\n ->setHeader($this->generateHeaderForTokenRequest())\n ->setBody($this->generateBodyForTokenRequest($code));\n return $request;\n }", "public function request(): Request\n {\n if (class_exists('Src\\Http\\Request')) {\n return new Request;\n }\n }", "protected function getDestinyManifestRequest()\n {\n\n $resourcePath = '/Destiny2/Manifest/';\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 if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-Key');\n if ($apiKey !== null) {\n $headers['X-API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getRequest()\n {\n SecurityHelper::sanitize_array($_REQUEST);\n \n $files = array();\n\t\tforeach ( $_FILES as $k=>$file )\n\t\t\t$files[$k] = new FileUploadRequest($file['error'], $file['tmp_name'], $file['size'], $file['type'], $file['name']);\n \n return new Request($_REQUEST, $files);\n }", "static public function createFromGlobals()\n {\n $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);\n\n if (0 === strpos($request->server->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded')\n && in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE'))\n ) {\n parse_str($request->getContent(), $data);\n $request->request = new Collection($data);\n }\n\n return $request;\n }", "public function request();", "protected function _request() {}", "protected function getRequest() {}", "public static function factory()\n {\n $request = new Request();\n static::$_current = $request;\n return $request;\n }", "public function buildRequest($addReq = null) {\n \t// Build Authentication\n \t$this->request['WebAuthenticationDetail'] = array(\n\t\t\t'UserCredential'=> array(\n\t\t\t\t'Key' \t\t=> $this->key, \n\t\t\t\t'Password'\t=> $this->password\n\t\t\t)\n\t\t);\n\n\t\t//Build Client Detail\n\t\t$this->request['ClientDetail'] = array(\n\t\t\t'AccountNumber' => $this->acct_num, \n\t\t\t'MeterNumber' \t=> $this->meter_num\n\t\t);\n\n\t\t// Build Customer Transaction Id\n\t\t$this->request['TransactionDetail'] = array(\n\t\t\t'CustomerTransactionId' => $this->customerTransactionId\n\t\t);\n\t\t\n\t\t// Build API Version info\n\t\t$this->request['Version'] = array(\n\t\t\t'ServiceId' \t=> $this->service_id, \n\t\t\t'Major' \t\t=> $this->major, \n\t\t\t'Intermediate'\t=> $this->intermediate, \n\t\t\t'Minor' \t\t=> $this->minor\n\t\t);\n\n\t\t// Enable detailed scans\n\t\t$this->request['ProcessingOptions'] = 'INCLUDE_DETAILED_SCANS';\n\n\t\tif(!is_null($addReq))\n\t\t\t$this->request = array_merge($this->request, $addReq);\n\n\t\treturn $this->request;\n }", "private function newRequest($queryString= '') {\n return new Request(new TestInput('GET', '/'.$queryString));\n }", "protected function _buildRequest()\n {\n // prepare API\n $this->setShippingMethod('Other');\n $this->setCustomerIP(Mage::helper('core/http')->getRemoteAddr());\n $version = Mage::helper('ewayrapid')->getExtensionVersion();\n $this->setDeviceID('Magento ' . Mage::getEdition() . ' ' . Mage::getVersion().' - eWAY '.$version);\n if (Mage::helper('ewayrapid')->isBackendOrder()) {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_MOTO);\n } else {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_PURCHASE);\n }\n $this->setCustomerReadOnly(true);\n\n // add Billing Address\n $billingAddress = $this->_quote->getBillingAddress();\n $customerParam = Mage::getModel('ewayrapid/field_customer');\n \n $title = $this->_fixTitle($billingAddress->getPrefix());\n \n $customerParam->setTitle($title)\n ->setFirstName($billingAddress->getFirstname())\n ->setLastName($billingAddress->getLastname())\n ->setCompanyName($billingAddress->getCompany())\n ->setJobDescription($billingAddress->getJobDescription())\n ->setStreet1($billingAddress->getStreet1())\n ->setStreet2($billingAddress->getStreet2())\n ->setCity($billingAddress->getCity())\n ->setState($billingAddress->getRegion())\n ->setPostalCode($billingAddress->getPostcode())\n ->setCountry(strtolower($billingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($billingAddress->getEmail())\n ->setPhone($billingAddress->getTelephone())\n ->setMobile($billingAddress->getMobile())\n ->setComments('')\n ->setFax($billingAddress->getFax())\n ->setUrl('');\n $this->setCustomer($customerParam);\n\n // add Shipping Address\n $shippingAddress = $this->_quote->getShippingAddress();\n\n // copy BillingAddress to ShippingAddress if checkout with guest or register\n $checkoutMethod = $this->_quote->getCheckoutMethod();\n if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST\n || $checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER\n ) {\n $shippingAddress = $billingAddress;\n }\n\n $shippingParam = Mage::getModel('ewayrapid/field_shippingAddress');\n $shippingParam->setFirstName($shippingAddress->getFirstname())\n ->setLastName($shippingAddress->getLastname())\n ->setStreet1($shippingAddress->getStreet1())\n ->setStreet2($shippingAddress->getStreet2())\n ->setCity($shippingAddress->getCity())\n ->setState($shippingAddress->getRegion())\n ->setPostalCode($shippingAddress->getPostcode())\n ->setCountry(strtolower($shippingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($shippingAddress->getEmail())\n ->setPhone($shippingAddress->getTelephone())\n ->setFax($shippingAddress->getFax());\n $this->setShippingAddress($shippingParam);\n\n return $this;\n }", "public function createRequest(\n string $method,\n $uri,\n array $headers = [],\n $body = null,\n string $protocol = '1.1'\n ): RequestInterface;", "protected function createPublicKeyRequest()\n {\n\n $resourcePath = '/v1/account/pubkey';\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function build(): RequestCacheNamesRequest\n\t{\n\t\t$instance = new RequestCacheNamesRequest();\n\t\t$instance->securityOrigin = $this->securityOrigin;\n\t\t$instance->storageKey = $this->storageKey;\n\t\t$instance->storageBucket = $this->storageBucket;\n\t\treturn $instance;\n\t}", "protected function buildWebRequest()\n {\n $args = $_REQUEST;\n $params = array();\n\n $route = $_SERVER['REQUEST_URI'];\n $posQuestionMark = strpos($route, '?');\n if ($posQuestionMark !== false) {\n $route = substr($route, 0, $posQuestionMark);\n }\n \n $posIndex = strpos($route, 'index.php');\n if ($posIndex !== false) {\n $route = substr($route, $posIndex + strlen('index.php'));\n }\n \n // Transform the arguments\n foreach ($args as $key => $value) {\n if (is_numeric($value)) {\n // Transform the value into the correct data type\n $value = $value * 1;\n }\n \n $params[$key] = $value;\n }\n\n // Generate the full url and extract the base\n $scheme = $this->getScheme();\n $fullUrl = $scheme . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n $isSsl = false;\n if ($scheme == 'https') {\n $isSsl = true;\n }\n \n $routePosition = strlen($fullUrl);\n if ($route !== '' && $route !== '/') {\n $routePosition = strpos($fullUrl, $route);\n }\n \n $method = $_SERVER['REQUEST_METHOD'];\n $requestedUrl = $this->getRequestedUrl();\n $base = substr($fullUrl, 0, $routePosition);\n $headers = $this->getHeaders($_SERVER);\n $protocol = $_SERVER['SERVER_PROTOCOL'];\n \n $locale = 'en_US';\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $locale = $this->getLocale($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n }\n \n $operatingSystem = $this->getOperatingSystem();\n\n return new WebRequest($method, $requestedUrl, $route, $params, $base, $locale, $operatingSystem, $isSsl, $headers, $protocol);\n }", "protected function apiRequest()\n {\n $request = 'post';\n if ($this->method->isGetRequest()) {\n $request = 'get';\n }\n\n return $this->getTelegram()->{$request}($this->method->apiEndpoint(), $this->method->toArray());\n }", "public function newProductRequest(): ProductRequest\n {\n return new ProductRequest($this->_apiKey);\n }", "protected function buildRequest()\n {\n $rules = collect($this->columns)->pluck('column')->transform(function ($rule) {\n return $rule.':required';\n })->implode('|');\n\n $this->request = [\n 'name' => $this->class,\n '--rules' => $rules,\n '--module' => $this->module->id,\n ];\n }", "private function createGuzzleRequests()\n {\n $guzzleRequests = [];\n if (empty($this->requests)) {\n throw new InvalidCallException('Empty API request!');\n }\n foreach ($this->requests as $request) {\n if ($request->isRestCompatible()) {\n $httpRequest = new RestRequest($this->client, $request);\n } elseif (isset($request->pollId)) {\n $httpRequest = new PollRequest($this->client, $request);\n } else {\n $httpRequest = new CustomRequest($this->client, $request);\n }\n $guzzleRequest = $this->createGuzzleRequest($httpRequest->getMethod(), $httpRequest->getUri(), $httpRequest->getHeaders(), $httpRequest->getBody());\n $modeHeader = $request->mode;\n if ($request->ttl) {\n $modeHeader .= ';ttl=' . $request->ttl;\n }\n if ($request->expire) {\n $modeHeader .= ';expire=' . $request->expire;\n }\n $guzzleRequest = $guzzleRequest->withHeader($this->client->buildCustomHeader('Mode'), $modeHeader);\n if (isset($request->notificationUrl)) {\n $guzzleRequest = $guzzleRequest->withHeader($this->client->buildCustomHeader('Notification-Url'), $request->notificationUrl);\n }\n if (isset($request->userAgent)) {\n if (substr($request->userAgent, 0, 1) == '!') {\n $userAgent = substr($request->userAgent, 1);\n } else {\n $config = (new \\GuzzleHttp\\Client())->getConfig();\n $userAgent = isset($config['headers']['User-Agent']) ? $config['headers']['User-Agent'] . ' ' . $request->userAgent : $request->userAgent;\n }\n $guzzleRequest = $guzzleRequest->withHeader('User-Agent', $userAgent);\n }\n $this->createFiles($request);\n if (empty($request->files)) {\n $guzzleRequests[] = $guzzleRequest;\n } else {\n $multipartRequest = $this->createMultipartRelatedRequest($request, $guzzleRequest);\n $guzzleRequests[] = $this->createGuzzleRequest($multipartRequest->getMethod(), $multipartRequest->getUri(), $multipartRequest->getHeaders(), $multipartRequest->getBody());\n }\n }\n\n return $guzzleRequests;\n }", "private function getBasicFetchRequest()\n {\n $obj_request = new \\google\\appengine\\datastore\\v4\\RunQueryRequest();\n $obj_request->setSuggestedBatchSize(1000);\n $obj_request->mutableReadOptions();\n $obj_partition = $obj_request->mutablePartitionId();\n $obj_partition->setDatasetId('Dataset');\n return $obj_request;\n }", "protected function _getNewEmptyRequest()\n {\n return $this->_getNewSdkInstance('Radial_RiskService_Sdk_Request');\n }", "private function setRequest() {\n // Create request object\n $this->request = Request::createFromGlobals();\n // Check caching and exit if so\n // - create a dummy response for possible 304\n $response = new Response();\n $seconds = Config::get()->pagecachetime;\n $response->setLastModified(new DateTime('-' . $seconds . ' seconds'));\n if ($response->isNotModified($this->getRequest())) {\n $response\n ->setSharedMaxAge($seconds)\n ->send();\n exit();\n }\n // Add better json request support\n // check request Content-Type\n $ctCheck = 0 === strpos(\n $this->request->headers->get('CONTENT_TYPE')\n , 'application/json'\n );\n // check request Method\n $methodCheck = in_array(\n strtoupper($this->request->server->get('REQUEST_METHOD', 'GET'))\n , array('PUT', 'DELETE', 'POST')\n );\n if ($ctCheck && $methodCheck) {\n $params = (array) json_decode($this->request->getContent());\n $this->request->request = new ParameterBag($params);\n }\n }", "public static function fromRingRequest(array $request)\n {\n $options = [];\n if (isset($request['version'])) {\n $options['protocol_version'] = $request['version'];\n }\n if (!isset($request['http_method'])) {\n throw new \\InvalidArgumentException('No http_method');\n }\n return new Request($request['http_method'], Core::url($request), isset($request['headers']) ? $request['headers'] : [], isset($request['body']) ? Stream::factory($request['body']) : null, $options);\n }", "public function makeRequest(\n string $method,\n $uri,\n array $headers = [],\n $body = null,\n string $version = '1.1'\n ): RequestInterface {\n return new Request($method, $uri, $headers, $body, $version);\n }", "private function createRequest(int $status, string $body = null) : Request\n {\n $mockHandler = new MockHandler([\n new GuzzlePsrResponse($status, [], $body)\n ]);\n\n $handlerStack = HandlerStack::create($mockHandler);\n\n $client = new Client(['handler' => $handlerStack]);\n\n return new Request($client);\n }", "private function initCurlRequest() {\n $method = strtoupper($this->method);\n\n // Construct request\n $curlRequest = curl_init($this->finalUrl);\n curl_setopt($curlRequest, CURLOPT_RETURNTRANSFER, 1); // Return contents instead of boolean on exec\n curl_setopt($curlRequest, CURLOPT_BINARYTRANSFER, 1);\n curl_setopt($curlRequest, CURLOPT_HEADER, 1); // Return headers in response\n if ($this->followRedirects)\n curl_setopt($curlRequest, CURLOPT_FOLLOWLOCATION, true); // Follow redirects\n\n // Timeouts\n if ($this->connectTimeout !== null)\n curl_setopt($curlRequest, CURLOPT_CONNECTTIMEOUT, $this->connectTimeout);\n if ($this->executeTimeout !== null)\n curl_setopt($curlRequest, CURLOPT_TIMEOUT, $this->executeTimeout);\n\n // Method-specific\n $acceptsBody = false;\n if ($method === 'POST') {\n curl_setopt($curlRequest, CURLOPT_POST, 1);\n $acceptsBody = true;\n }\n\n // BUG: curl will attempt to set \"Transfer-Encoding: chunked\" header if doing a PUT\n // the workaround is to POST, using an X-HTTP-Method-Override instead.\n // BEWARE: This also requires the server to know how to handle this header.\n if (in_array($method, array('PUT', 'PATCH'))) {\n $this->headers[] = \"X-HTTP-Method-Override: $method\";\n curl_setopt($curlRequest, CURLOPT_POST, 1);\n $acceptsBody = true;\n }\n\n if ($method === 'DELETE')\n curl_setopt($curlRequest, CURLOPT_DELETE, 1);\n\n // Body\n $sendBlankExpect = false;\n if ($acceptsBody) {\n if ($this->files !== null && count($this->files) > 0) {\n $files = [];\n foreach ($this->files as $fileKey => $localPath)\n $files[$fileKey] = '@' . $localPath;\n \n curl_setopt($curlRequest, CURLOPT_POSTFIELDS, $files);\n\n // Workaround for CURL issue where curl_exec() returns both 100/CONTINUE and 200/OK separated by\n // blank line when using multipart form data.\n $sendBlankExpect = true;\n }\n elseif ($this->body) {\n // Default content-type of POST body\n if ($this->json && count(preg_grep('/content-type:/i', $this->headers)) === 0)\n $this->headers[] = 'Content-Type: application/json';\n\n // Seems to implicitly set CURLOPT_POST=1\n curl_setopt($curlRequest, CURLOPT_POSTFIELDS, $this->body);\n }\n }\n\n // Add headers\n $headers = $this->headers;\n if (!$headers)\n $headers = [];\n\n if ($this->json && count(preg_grep('/accept:/i', $headers)) === 0)\n $headers[] = 'Accept: application/json';\n if ($sendBlankExpect)\n $headers[] = 'Expect:';\n\n if (count($headers) > 0)\n curl_setopt($curlRequest, CURLOPT_HTTPHEADER, $headers);\n\n // Authenticate request\n if ($this->username) {\n curl_setopt($curlRequest, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($curlRequest, CURLOPT_USERPWD, $this->username . ':' . $this->password);\n }\n\n return $curlRequest;\n }", "protected function createOrderRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createOrder'\n );\n }\n $resourcePath = '/orders';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function request_token() : object\n {\n $this->parameters = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'User-Agent' => $this->config['DISCOGS_USER_AGENT'],\n 'Authorization' => 'OAuth oauth_consumer_key=' . $this->config['DISCOGS_CONSUMER_KEY']\n . ',oauth_nonce=' . time() . ',oauth_signature=' . $this->config['DISCOGS_CONSUMER_SECRET']\n . '&,oauth_signature_method=PLAINTEXT,oauth_timestamp=' . time() . ',oauth_callback='\n . $this->config['OAUTH_CALLBACK'],\n ],\n ];\n\n return $this->response('GET', \"/oauth/request_token\");\n }", "public function make()\n {\n if (empty($this->company) && empty($this->domain)) {\n throw new InvalidRequestException('Either Domain or Company fields are required.');\n }\n\n $this->query_params = [\n 'company' => $this->company ?? null,\n 'domain' => $this->domain ?? null,\n 'type' => $this->type ?? null,\n 'department' => count($this->department) ? implode(\",\", $this->department) : null,\n 'seniority' => count($this->seniority) ? implode(\",\", $this->seniority) : null,\n 'limit' => $this->limit ?? null,\n 'offset' => $this->offset ?? null,\n 'api_key' => $this->api_key ?? null\n ];\n\n return $this->query_params;\n }", "public function newGroceryRequest(): GroceryRequest\n {\n return new GroceryRequest($this->_apiKey);\n }", "public function getRequest();", "public function getRequest();", "public function getRequest();" ]
[ "0.7557845", "0.75537395", "0.75537395", "0.7226126", "0.7215273", "0.71190035", "0.7067941", "0.70635855", "0.7039969", "0.6961906", "0.6954861", "0.6900415", "0.6886262", "0.68658245", "0.67135847", "0.67044383", "0.6685606", "0.6603306", "0.65674007", "0.65506285", "0.6547272", "0.6505822", "0.64757967", "0.64596725", "0.6391182", "0.63581795", "0.63522166", "0.6326641", "0.6322973", "0.631898", "0.6311381", "0.62869614", "0.62330556", "0.6215329", "0.621451", "0.6205009", "0.61727315", "0.61720335", "0.612998", "0.612998", "0.61295027", "0.61294746", "0.6127465", "0.6126085", "0.6106978", "0.6106494", "0.60991025", "0.609002", "0.6075349", "0.6067451", "0.60608107", "0.6053015", "0.6053015", "0.6052131", "0.60363376", "0.6025828", "0.60075444", "0.6004998", "0.5993267", "0.597925", "0.597802", "0.59732246", "0.596792", "0.59481376", "0.5943037", "0.5942042", "0.5936658", "0.5925653", "0.5909238", "0.59077", "0.5907364", "0.59044915", "0.5889615", "0.5887653", "0.58860373", "0.5875591", "0.58563995", "0.58542603", "0.5848808", "0.58470935", "0.584389", "0.5832481", "0.58321965", "0.5825875", "0.58231014", "0.5817768", "0.58171487", "0.5814938", "0.5788634", "0.57873327", "0.5783486", "0.5781029", "0.57641315", "0.5763379", "0.57464427", "0.5732031", "0.5729155", "0.57250977", "0.57250977", "0.57250977" ]
0.6175907
36
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\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();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle() { // Ask the user for confirmation if we are in a production environment if (! $this->confirmToProceed()) { return; } // Establish the json encoding options $pretty = $this->option('pretty'); $jsonOptions = 0; if ($pretty) { $jsonOptions = $jsonOptions | JSON_PRETTY_PRINT; } // Which database connection shall we use? $database = $this->option('database') ?? config('database.default'); // Ensure that the specified connection exists if (!config('database.connections.' . $database)) { $this->error("You have specified an invalid connection: \"{$database}\""); return 1; } // Ensure that the specified database has a migrations table if (! Schema::setConnection(DB::connection($database))->hasTable('migrations')) { $this->error("The \"{$database}\" database does not have a migrations table."); return 1; } // Fetch the migrations table data $migrations = DB::table('migrations')->get(); // Generate the filename for the new file $now = Carbon::now()->format('Ymd'); $filename = "{$database}_migrations_{$now}.json"; // Establish the export path $filepath = ($this->option('filepath') ?? database_path()) . '/' . $filename; // Write the json to the file $file = fopen($filepath, 'w'); fwrite($file, json_encode($migrations, $jsonOptions)); fclose($file); // All set! $this->info("Exported \"{$database}\" migrations to {$filename}"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
A basic unit test example.
public function testExample() { $response = $this->json('GET', '/api/peoples/toronto'); $response ->assertStatus(200) ->assertJson([ [ "id" => 1, "full_name" => "Richard", "age" => "29", "house_id" => 1, "created_at" => null, "updated_at" => null ], [ "id" => 2, "full_name" => "John", "age" => "21", "house_id" => 1, "created_at" => null, "updated_at" => null ], [ "id" => 3, "full_name" => "Ben", "age" => "33", "house_id" => 2, "created_at" => null, "updated_at" => null ] ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExample()\n {\n }", "public function testBasicExample()\n {\n $this->assertTrue(true);\n }", "public function testBasicExample()\n {\n $this->assertEquals(1, 1);\n }", "function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}", "public function testBasicTest()\n {\n\n }", "public function testExample()\n {\n dump(\"testExample\");\n $this->assertTrue(true);\n }", "function testSample() {\n\t\t$this->assertTrue( true );\n\t}", "public function testExample()\n\t{\n\t\t$this->assertTrue(true);\n\t}", "public function testExample()\n {\n $this->assertTrue(true);\n \n }", "function test_sample() {\n\t\t$this->assertTrue( true );\n\t}", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function testExample(): void\n {\n $this->assertTrue(true);\n }", "public function testBasic()\n {\n $this->assertEquals(1, 1);\n }", "public function testExample()\n {\n // lets make it risky to destroy the green\n }", "public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }", "public function testBasicExample()\n\t{\n \t$response = $this->call('GET', '/');\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}", "public function testGetPatrimonio()\n {\n }", "public function testExample()\n {\n //this test is empty as we have not yet decided if we want to use dusk\n\n // $this->get('/')\n // ->click('About')\n // ->seePageIs('/about');\n }", "public function testGetChamado()\n {\n }", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('TROLOLOLO');\n }", "public function testSomething()\n {\n }", "public function testExample()\n {\n $response = $this->get('/api/test/');\n\n $response->assertStatus(200);\n }", "public function testBasicTest()\r\n {\r\n $this->assertTrue(true);\r\n }", "public function test() {\n\n\t}", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testGetExpedicao()\n {\n }", "public function testBasicTest()\n {\n dd('here');\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $response = $this->get('/dangthi');\n $response->assertStatus(200);\n }", "public function testBasicExample()\n\t{\n\t\t$response = $this->call('GET', '/');\n\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}", "public function testExample()\n {\n // $roomController = new RoomController();\n $request = $this->call('GET', '/room/123');\n $this->assertEquals(200, $request->status());\n }" ]
[ "0.80752075", "0.7854537", "0.780656", "0.7760198", "0.7665438", "0.7644897", "0.76254654", "0.7589822", "0.75457186", "0.75257766", "0.75108504", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7423434", "0.7400794", "0.7393162", "0.7393162", "0.7393162", "0.7393162", "0.7326179", "0.73256296", "0.72956586", "0.72758234", "0.72630125", "0.72496897", "0.7220798", "0.7215937", "0.7196073", "0.71823233", "0.71787", "0.7162814", "0.7153517", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7133477", "0.7127466", "0.71243346", "0.7115046", "0.7101194" ]
0.0
-1
0 > gx, 1> gy
private function Sobel(&$image){ $width = imagesx($image); $heigth = imagesy($image); $gxfilter = [[1,0,-1],[2,0,-2],[1,0,-1]]; $gyfilter = [[1,2,1],[0,0,0],[-1,-2,-1]]; $mag = imagecreatetruecolor($width, $heigth); $angle = imagecreatetruecolor($width, $heigth); for($i=1;$i<$heigth-1;$i++){ for($j=1;$j<$width-1;$j++){ $totalx = 0; $totaly = 0; for($k=-1;$k<2;$k++){ for($l=-1;$l<2;$l++){ $rgb = imagecolorat($image,$j+$k,$i+$l); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; $pixel = round($r * 0.3 + $g * 0.59 + $b * 0.11); $totalx += $pixel*$gxfilter[$k+1][$l+1]; $totaly += $pixel*$gyfilter[$k+1][$l+1]; } } $val = sqrt(pow($totalx,2)+pow($totaly,2)); $angleval = (int)rad2deg((@atan($totalx/$totaly))); if($angleval<0) $angleval += 180; if($val>255){ $val=255; } $color = imagecolorallocate($mag, $val, $val, $val); $anglecolor = imagecolorallocate($angle, $angleval, $angleval, $angleval); imagesetpixel($mag, $j, $i, $color); imagesetpixel($angle, $j, $i, $anglecolor); } } return [$mag,$angle]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function withinBounds($x,$y){\n return (0 <= $x && $x < $this->width) && (0 <= $y && $y < $this->height);\n }", "function ifUsed($x,$y){\n \n}", "function findPoint($px, $py, $qx, $qy) {\n return array(2*$qx - $px,2*$qy - $py);\n}", "function mindist($r1) {\r\n $debug = 0;\r\n if (($this->max->x() >= $r1->min->x()) and ($this->min->x() <= $r1->max->x())) { // Les X s'intersectent\r\n if (($this->max->y() >= $r1->min->y()) and ($this->min->y() <= $r1->max->y())) { // Les Y s'intersectent\r\n if ($debug) echo \"cas 1 : les 2 rectangles s'intersectent\\n\";\r\n return 0; // cas 1 : les 2 rectangles s'intersectent\r\n } else { // Les Y ne s'intersectent pas\r\n if ($debug) echo \"cas 3 : X s'intersectent mais pas les Y \\n\";\r\n return min (abs($this->max->y() - $r1->min->y()), abs($r1->max->y() - $this->min->y())); // cas 3: X s'intersectent mais pas les Y \r\n }\r\n } elseif (($this->max->y() >= $r1->min->y()) and ($this->min->y() <= $r1->max->y())) { // Les Y s'intersectent\r\n if ($debug) echo \"cas 2: Y s'intersectent mais pas les X\\n\";\r\n return min (abs($this->max->x() - $r1->min->x()), abs($r1->max->x() - $this->min->x())); // cas 2: Y s'intersectent mais pas les X\r\n } elseif ($this->min->x() < $r1->min->x()) {\r\n if ($this->min->y() < $r1->min->y()) { // cas 4a : r1 au NE de this\r\n if ($debug) echo \"cas 4a : r1 au NE de this\\n\";\r\n return $this->max->distance($r1->min);\r\n } else { // cas 4b : r1 au SE de this\r\n if ($debug) echo \"cas 4b : r1 au SE de this\\n\";\r\n return sqrt(square($r1->min->x() - $this->max->x()) + square($this->min->y() - $r1->max->y()));\r\n }\r\n } else {\r\n if ($this->min->y() < $r1->min->y()) { // cas 4d : r1 au NW de this\r\n if ($debug) echo \"cas 4d : r1 au NW de this\\n\";\r\n return sqrt(square($r1->max->x() - $this->min->x()) + square($this->max->y() - $r1->min->y()));\r\n } else { // cas 4c : r1 au SW de this\r\n if ($debug) echo \"cas 4c : r1 au SW de this\\n\";\r\n return $this->min->distance($r1->max);\r\n }\r\n }\r\n die(\"erreur\");\r\n }", "public function isNormal();", "public function isNormal();", "function checkSide( $x, $y ){\n\t\tif( $this->axis == 1){\n\t\t\t//x axis\t\n\t\t\tif( $x < $this->x ){\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn 1;\n\t\t\t\n\t\t}elseif( $this->axis == 2){\n\t\t\t// y axis\n\t\t\tif( $y < $this->y ){\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn 1;\t\n\t\t}\n\t\treturn 0;\n\t}", "function point_is_on_vertex($point)\n{\n $vertices = $this->vertices;\n\n foreach ($vertices as $vertex)\n {\n if ($point === $vertex)\n {\n return true;\n }\n }\n\n return false;\n}", "function gx($Z, $X, $W, $K)\n{\n\n $X = $K - $X;\n $X = $X + $Z;\n\n if ($W >= 0) {\n return $X;\n }\n $Z = $W - 1;\n $W = $Z - 1;\n\n\n gx($K, $X, $W, $Z);\n}", "function checkInter( $node ){\n\t\tif( ! is_a($node, \"KDT_node\") )\n\t\t{\n\t\t\texit(\"input error\");\n\t\t}\n\t\t\n\t\t// the node should not be a leaf node\n\t\tif( $node->is_leaf() ){\n\t\t\treturn NULL;\n\t\t}\n\t\tif( $node->is_x() ){\n\t\t\tif( eDistance($this->x,$node->y,$node->x,$node->y) < $this->r ){\n\t\t\t\treturn 0;\n\t\t\t}else{\n\t\t\t\tif( $node->x < $this->x ){\n\t\t\t\t\treturn -1;\n\t\t\t\t}else{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}elseif( $node->is_y() ){\n\t\t\tif( eDistance($node->x,$this->y,$node->y,$node->y) < $this->r ){\n\t\t\t\treturn 0;\n\t\t\t}else{\n\t\t\t\tif( $node->y < $this->y ){\n\t\t\t\t\treturn -1;\n\t\t\t\t}else{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function capture($arr){\n $x = $arr[0][0];\n $y = $arr[0][1];\n\n //echo $x . $y;\n if($arr[0][0] == $arr[1][0] || $arr[0][1] == $arr[1][1]){\n echo 'true';\n }\n else{\n echo \"false\";\n }\n\n }", "function isecrects($r1, $r2) {\n\n \n $pn; $px;\n for ($pi = 0, $pl = count($r1); $pi < $pl; $pi += 2) {\n $pn = ($pi === ($pl - 2)) ? 0 : $pi + 2; // next $po$int\n $px = ($pn === ($pl - 2)) ? 0 : $pn + 2;\n if (edgeTest([$r1[$pi], $r1[$pi+1]],\n [$r1[$pn], $r1[$pn+1]],\n [$r1[$px], $r1[$px+1]], $r2)){ return false;}\n }\n for ($pi = 0, $pl = count($r2); $pi < $pl; $pi += 2) {\n $pn = ($pi === ($pl - 2)) ? 0 : $pi + 2; // next $point\n $px = ($pn === ($pl - 2)) ? 0 : $pn + 2;\n if (edgeTest([$r2[$pi], $r2[$pi+1]],\n [$r2[$pn], $r2[$pn+1]],\n [$r2[$px], $r2[$px+1]], $r1)){return false;}\n }\n return true;\n}", "function is_x(){\n\t\tif( $this->axis == 1 ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isHit(): bool;", "public static function ge(IInt32\\Type $x, IInt32\\Type $y) : IBool\\Type { // >=\n\t\t\treturn IBool\\Type::box(IInt32\\Module::compare($x, $y)->unbox() >= 0);\n\t\t}", "function chk_from_to($from,$to) {\n\t\t$chk = ( $this->y*10000) + ( $this->m*100) + $this->d;\n\t\treturn ($from <= $chk && $chk <= $to) ? true : false;\n\t}", "protected function coordinates_match($a, $b)\n {\n }", "private function coordsRangeCheck($x, $y)\n {\n // TODO: Looks like I need to implement this correctly.\n //$this->RangeCheck($x);\n //$this->RangeCheck($y);\n return true;\n }", "function is_above($line, $locx, $locy) {\n\t\treturn (($line[1]['x'] - $line[0]['x'])*($locy - $line[0]['y']) - ($line[1]['y'] - $line[0]['y'])*($locx - $line[0]['x'])) > 0;\n\t}", "function inside( $point = array(), $vs = array() ) {\n\t\t// ray-casting algorithm based on\n\t\t// http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html\n\n\t\t$x = $point[ 0 ];\n\t\t$y = $point[ 1 ];\n\n\t\t$inside = 'no';\n\t\tfor ( $i = 0, $j = count( $vs ) - 1; $i < count( $vs ); $j = $i++ ) {\n\t\t\t$xi = $vs[ $i ][ 0 ];\n\t\t\t$yi = $vs[ $i ][ 1 ];\n\t\t\t$xj = $vs[ $j ][ 0 ];\n\t\t\t$yj = $vs[ $j ][ 1 ];\n\n\t\t\t$intersect = ( ( $yi > $y ) != ( $yj > $y ) ) && ( $x < ( $xj - $xi ) * ( $y - $yi ) / ( $yj - $yi ) + $xi );\n\t\t\t\n\t\t\tif ( $intersect ){\n\t\t\t\t$inside = 'yes';\n\t\t\t}\n\t\t}\n\t\treturn $inside;\n\t}", "public function getHasCoordinates(){\n\t\treturn ($this->coordinates != '') ? 1:0;\n\t}", "protected function checkGdLibTrueColorSupport() {}", "public function hasPoint(){\r\n return $this->_has(7);\r\n }", "function gte($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, GTE, $y, $and, ...$args);\n return $expression;\n }", "function gte($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, GTE, $y, $and, ...$args);\n return $expression;\n }", "public function hasPoint(){\r\n return $this->_has(10);\r\n }", "function xyz_rgb($x,$y,$z) {\n\t\n\t$x /= 100; //X = From 0 to ref_X\n\t$y /= 100; //Y = From 0 to ref_Y\n\t$z /= 100; //Z = From 0 to ref_Y\n\n\t$r = $x * 3.2406 + $y * -1.5372 + $z * -0.4986;\n\t$g = $x * -0.9689 + $y * 1.8758 + $z * 0.0415;\n\t$b = $x * 0.0557 + $y * -0.2040 + $z * 1.0570;\n\n\t$r=(( $r > 0.0031308 )?(1.055 * pow($r,1/2.4 ) - 0.055):($r*12.92))*255;\n\t$g=(( $g > 0.0031308 )?(1.055 * pow($g,1/2.4 ) - 0.055):($g*12.92))*255;\n\t$b=(( $b > 0.0031308 )?(1.055 * pow($b,1/2.4 ) - 0.055):($b*12.92))*255;\n\t\n\treturn array($r,$g,$b);\n}", "function rgb_xyz($r,$g,$b) {\n\n\t$r /= 255;\n\t$g /= 255;\n\t$b /= 255;\n\n\t$r=(( $r > 0.04045 )?pow(( $r + 0.055 ) / 1.055,2.4):($r/12.92))*100;\n\t$g=(( $g > 0.04045 )?pow(( $g + 0.055 ) / 1.055,2.4):($g/12.92))*100;\n\t$b=(( $b > 0.04045 )?pow(( $b + 0.055 ) / 1.055,2.4):($b/12.92))*100;\n\t\n\t//Observer. = 2°, Illuminant = D65\n\t$x = $r * 0.4124 + $g * 0.3576 + $b * 0.1805;\n\t$y = $r * 0.2126 + $g * 0.7152 + $b * 0.0722;\n\t$z = $r * 0.0193 + $g * 0.1192 + $b * 0.9505;\n\t\n\treturn array($x,$y,$z);\n}", "function maksim($x, $y, $z){\n if ($x > $y && $x > $z){\n return $x;\n } elseif ($y > $x && $y > $z) {\n return $y;\n } else {\n return $z;\n }\n }", "function isLeft($a, $b, $c) {\n return area2($a, $b, $c) > 0;\n}", "function is_inside($point, $vertex_check = true)\n {\n $this->vertex_check = $vertex_check;\n $vertices = $this->vertices;\n\n // Check if the point sits exactly on a vertex\n if ($this->vertex_check === true && $this->point_is_on_vertex($point, $vertices) === true)\n {\n return self::POINT_VERTEX;\n }\n\n // Check if the point is inside the polygon or on the boundary\n $intersections = 0;\n $vertices_count = count($vertices);\n\n for ($i = 1; $i < $vertices_count; $i ++)\n {\n $vertex1 = $vertices[$i - 1];\n $vertex2 = $vertices[$i];\n\n // Check if point is on an horizontal polygon boundary\n if ($vertex1[self::POLYGON_Y_INDEX] == $vertex2[self::POLYGON_Y_INDEX] &&\n $vertex1[self::POLYGON_Y_INDEX] == $point[self::POLYGON_Y_INDEX] &&\n $point[self::POLYGON_X_INDEX] > min($vertex1[self::POLYGON_X_INDEX], $vertex2[self::POLYGON_X_INDEX]) && $point[self::POLYGON_X_INDEX] <\n max($vertex1[self::POLYGON_X_INDEX], $vertex2[self::POLYGON_X_INDEX]))\n {\n return self::POINT_BOUNDARY;\n }\n if ($point[self::POLYGON_Y_INDEX] > min($vertex1[self::POLYGON_Y_INDEX], $vertex2[self::POLYGON_Y_INDEX]) &&\n $point[self::POLYGON_Y_INDEX] <= max($vertex1[self::POLYGON_Y_INDEX], $vertex2[self::POLYGON_Y_INDEX]) && $point[self::POLYGON_X_INDEX] <=\n max($vertex1[self::POLYGON_X_INDEX], $vertex2[self::POLYGON_X_INDEX]) &&\n $vertex1[self::POLYGON_Y_INDEX] != $vertex2[self::POLYGON_Y_INDEX])\n {\n $xinters = ($point[self::POLYGON_Y_INDEX] - $vertex1[self::POLYGON_Y_INDEX]) *\n ($vertex2[self::POLYGON_X_INDEX] - $vertex1[self::POLYGON_X_INDEX]) /\n ($vertex2[self::POLYGON_Y_INDEX] - $vertex1[self::POLYGON_Y_INDEX]) + $vertex1[self::POLYGON_X_INDEX];\n\n // Check if point is on the polygon boundary (other than horizontal)\n if ($xinters == $point[self::POLYGON_X_INDEX])\n {\n return self::POINT_BOUNDARY;\n }\n\n if ($vertex1[self::POLYGON_X_INDEX] == $vertex2[self::POLYGON_X_INDEX] ||\n $point[self::POLYGON_X_INDEX] <= $xinters)\n {\n $intersections ++;\n }\n }\n }\n // If the number of edges we passed through is even, then it's in the polygon.\n if ($intersections % 2 != 0)\n {\n return self::POINT_INSIDE;\n }\n else\n {\n return self::POINT_OUTSIDE;\n }\n}", "function inregion($grid, $x, $y){\n\n for($i = $x-1; $i < $x+1; $i++){\n for($j = $y-1; $j < $y+1; $j++){ \n if($grid[$i][$j] == \"#\"){\n return True;\n }\n } \n }\n return False;\n}", "function linesCross($x1, $y1, $x2, $y2, $u1, $v1, $u2, $v2) {\n\n\t\t// vertical lines result in a divide by 0;\n\t\t$line1Vertical = $x2 == $x1;\n\t\t$line2Vertical = $u2 == $u1;\n\t\tif ($line1Vertical && $line2Vertical) {\n\t\t\t// x=a\n\t\t\tif ($x1 == $u1) {\n\t\t\t\t// lines are the same\n\t\t\t\treturn $y1 <= $v1 && $v1 < $y2 || $y1 <= $v2 && $v2 < $y2;\n\t\t\t} else {\n\t\t\t\t// parallel -> they don't intersect!\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t} else if ($line1Vertical && !$line2Vertical) {\n\t\t\t$b2 = ($v2 - $v1) / ($u2 - $u1);\n\t\t\t$a2 = $v1 - $b2 * $u1;\n\n\t\t\t$xi = $x1;\n\t\t\t$yi = $a2 + $b2 * $xi;\n\n\t\t\treturn $yi >= $y1 && $yi <= $y2;\n\n\t\t} else if (!$line1Vertical && $line2Vertical) {\n\t\t\t$b1 = ($y2 - $y1) / ($x2 - $x1);\n\t\t\t$a1 = $y1 - $b1 * $x1;\n\n\t\t\t$xi = $u1;\n\t\t\t$yi = $a1 + $b1 * $xi;\n\n\t\t\treturn $yi >= $v1 && $yi <= $v2;\n\t\t} else {\n\n\t\t\t$b1 = ($y2 - $y1) / ($x2 - $x1);\n\t\t\t// divide by zero if second line vertical\n\t\t\t$b2 = ($v2 - $v1) / ($u2 - $u1);\n\n\t\t\t$a1 = $y1 - $b1 * $x1;\n\t\t\t$a2 = $v1 - $b2 * $u1;\n\n\t\t\tif ($b1 - $b2 == 0) {\n\t\t\t\tif ($a1 == $a2) {\n\t\t\t\t\t// lines are the same\n\t\t\t\t\treturn $x1 <= $u1 && $u1 < $x2 || $x1 <= $u2 && $u2 < $x2;\n\t\t\t\t} else {\n\t\t\t\t\t// parallel -> they don't intersect!\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// calculate intersection point xi,yi\n\t\t\t$xi = -($a1 - $a2) / ($b1 - $b2);\n\t\t\t$yi = $a1 + $b1 * $xi;\n\t\t\tif (($x1 - $xi) * ($xi - $x2) >= 0 && ($u1 - $xi) * ($xi - $u2) >= 0 && ($y1 - $yi) * ($yi - $y2) >= 0 && ($v1 - $yi) * ($yi - $v2) >= 0) {\n\t\t\t\treturn TRUE;\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}", "function checkScalars($x, $y) {\n $eps = pow(2.0,-52.0);\n if ($x == 0 & abs($y) < 10*$eps) return;\n if ($y == 0 & abs($x) < 10*$eps) return;\n if (abs($x-$y) > 10 * $eps * max(abs($x),abs($y)))\n return false;\n else\n return true;\n }", "function sci_can_build($coords,$userid,$id)\n {\n $own_db = new cl_extended_database;\n $level_to_build = $own_db->sci_building_level($userid,$id);\n // echo \"<br>\";\n //echo \"level to build: $level_to_build<br>\";\n $own_db->reinit();\n $res = $own_db->planets_res($coords); \n $res_need = $own_db->sci_get_costs($id,($level_to_build+1));\n //print_r($res);echo \"<br>\"; print_r($res_need); echo \"<br>--------------<br>\";\n if($res['fe'] >= $res_need['fe'] &&\n $res['lut'] >= $res_need['lut'] &&\n $res['h2o'] >= $res_need['h2o'] &&\n $res['h2'] >= $res_need['h2'])\n {\n return true;\n }\n else\n {\n return false;\n }\n return false;\n }", "function isTripletTriangular($P, $Q, $R): bool\n{\n if ($P + $Q > $R && $P + $R > $Q && $Q + $R > $P) {\n return true;\n }\n\n return false;\n}", "function is_y(){\n\t\tif( $this->axis == 2 ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function verifyPoint(array $p): bool\n {\n [$x, $y] = $p;\n $lhs = $y->multiply($y);\n $temp = $x->multiply($this->a);\n $temp = $x->multiply($x)->multiply($x)->add($temp);\n $rhs = $temp->add($this->b);\n\n return $lhs->equals($rhs);\n }", "function buildings_can_build($coords,$id)\n {\n $own_db = new cl_extended_database;\n $level_to_build = $own_db->planets_building_level($coords,$id);\n // echo \"<br>\";\n //echo \"level to build: $level_to_build<br>\";\n $own_db->reinit();\n $res = $own_db->planets_res($coords); \n $res_need = $own_db->building_get_costs($id,($level_to_build+1));\n //print_r($res);echo \"<br>\"; print_r($res_need); echo \"<br>--------------<br>\";\n if($res['fe'] >= $res_need['fe'] &&\n $res['lut'] >= $res_need['lut'] &&\n $res['h2o'] >= $res_need['h2o'] &&\n $res['h2'] >= $res_need['h2'])\n {\n return true;\n }\n else\n {\n return false;\n }\n return false;\n }", "function collision_detect($shapes){\n // let's start by check to see if the bottom left co-rdinate of our first shape is higher or lower than the second \n if($shapes[0]['bottom_left'][0]<$shapes[1]['bottom_left'][0]){\n \n // check to see if the right hand co-ordinate is less\n if($shapes[0]['bottom_right'][0]<$shapes[1]['bottom_left'][0]){\n // no collision\n $data['x_collision'] = false;\n }\n else{\n // collision\n $data['x_collision'] = true;\n }\n\n }\n else{\n // check to see if the right hand co-ordinate is greater\n if($shapes[0]['bottom_left'][0]>$shapes[1]['bottom_right'][0]){\n // no collision\n $data['x_collision'] = false;\n }\n else{\n // collision\n $data['x_collision'] = true;\n }\n\n }\n // checking left hand side\n // check to see the top co-ordinates intersect on y axis\n if($shapes[0]['bottom_left'][1]<$shapes[1]['bottom_left'][1]){\n \n // check to see if the second bottom co-ordinate is greater\n if($shapes[0]['top_left'][1]<$shapes[1]['bottom_left'][1]){\n // no collision\n $data['y_collision'] = false;\n }\n else{\n // collision\n $data['y_collision'] = true;\n }\n\n }\n else{\n \n // check to see if the second bottom co-ordinate is greater\n if($shapes[0]['bottom_left'][1]>$shapes[1]['top_left'][1]){\n // no collision\n $data['y_collision'] = false;\n }\n else{\n // collision\n $data['y_collision'] = true;\n }\n }\n\n // checking right hand side\n // check to see the top co-ordinates intersect\n if($shapes[0]['bottom_right'][1]<$shapes[1]['bottom_right'][1]){\n \n // check to see if the second bottom co-ordinate is greater\n if($shapes[0]['top_right'][1]<$shapes[1]['bottom_right'][1]){\n // no collision\n $data['y_collision'] = false;\n }\n else{\n // collision\n $data['y_collision'] = true;\n }\n\n }\n else{\n \n // check to see if the second bottom co-ordinate is greater\n if($shapes[0]['bottom_right'][1]>$shapes[1]['top_right'][1]){\n // no collision\n $data['y_collision'] = false;\n }\n else{\n // collision\n $data['y_collision'] = true;\n }\n }\n // let's check to see if we are dealing with a 3d shape\n if(isset($shapes[0]['bottom_left'][2])){\n // check to see shapes collide on z axis\n // let's start by check to see if the bottom left front co-rdinate of our first shape is higher or lower than the second (checking if shape 1 is in front of or behind shape 2)\n if($shapes[0]['bottom_left'][2]<$shapes[1]['bottom_left'][2]){\n // shape 1 is in front of shape 2\n // check the position of all 4 corners\n // check to see if shape 1 bottom left hand back co-ordinate is less than shape 2 bottom left front\n if($shapes[0]['bottom_left'][3]<$shapes[1]['bottom_left'][2]){\n // no collision\n $data['z_collision'] = false;\n }\n else{\n // collision\n $data['z_collision'] = true;\n }\n \n // check to see if shape 1 bottom right hand back co-ordinate is less than shape 2 bottom left front\n if($shapes[0]['bottom_right'][3]<$shapes[1]['bottom_right'][2]){\n // no collision\n $data['z_collision'] = false;\n }\n else{\n // collision\n $data['z_collision'] = true;\n }\n \n // check to see if shape 1 top left hand back co-ordinate is less than shape 2 bottom left front\n if($shapes[0]['top_left'][3]<$shapes[1]['top_left'][2]){\n // no collision\n $data['z_collision'] = false;\n }\n else{\n // collision\n $data['z_collision'] = true;\n }\n \n // check to see if shape 1 top right hand back co-ordinate is less than shape 2 bottom left front\n if($shapes[0]['top_right'][3]<$shapes[1]['top_right'][2]){\n // no collision\n $data['z_collision'] = false;\n }\n else{\n // collision\n $data['z_collision'] = true;\n }\n\n }\n else{\n // shape 1 is in behind shape 2\n // check the position of all 4 corners\n // check to see if shape 1 bottom left hand back co-ordinate is less than shape 2 bottom left front\n if($shapes[0]['bottom_left'][2]>$shapes[1]['bottom_left'][3]){\n // no collision\n $data['z_collision'] = false;\n }\n else{\n // collision\n $data['z_collision'] = true;\n }\n \n // check to see if shape 1 bottom right hand back co-ordinate is less than shape 2 bottom left front\n if($shapes[0]['bottom_right'][2]>$shapes[1]['bottom_right'][3]){\n // no collision\n $data['z_collision'] = false;\n }\n else{\n // collision\n $data['z_collision'] = true;\n }\n \n // check to see if shape 1 top left hand back co-ordinate is less than shape 2 bottom left front\n if($shapes[0]['top_left'][2]>$shapes[1]['top_left'][3]){\n // no collision\n $data['z_collision'] = false;\n }\n else{\n // collision\n $data['z_collision'] = true;\n }\n \n // check to see if shape 1 top right hand back co-ordinate is less than shape 2 bottom left front\n if($shapes[0]['top_right'][2]>$shapes[1]['top_right'][3]){\n // no collision\n $data['z_collision'] = false;\n }\n else{\n // collision\n $data['z_collision'] = true;\n }\n\n }\n }\n else{\n // if no z axis is set then we always consider z axis true\n $data['z_collision'] = true; \n }\n\n\n echo \"<hr><h3>Result</h3>\";\n\n if($data['x_collision']&&$data['y_collision']&&$data['z_collision']){\n echo \"<br><strong>Collision</strong><br>\";\n }\n else{\n // collision\n echo \"<br><strong>No Collision</strong><br>\";\n }\n\n return $data;\n\n}", "function ipbetween($between, $larger, $smaller){\r\n\tif(is_ip($between) && is_ip($larger) && is_ip($smaller) && iplarger($larger, $smaller)){\r\n\t\t$bool = (iplarger($between, $smaller) && iplarger($larger, $between));\r\n\t\t#/*debug*/ print $smaller.\" < \".$between.\" < \".$larger.\" = \".($bool ? 'true' : 'false').\" <br/>\\n\";\r\n\t\treturn $bool;\r\n\t}\r\n\treturn FALSE;\r\n}", "public function hasZ() : bool;", "public function isZeroFill();", "public function isSquare(): bool\n {\n return $this->x === $this->y;\n }", "public function isEqual(\\SetaPDF_Core_Geometry_Point $point) {}", "abstract public function coordinates();", "function laticePath($x, $y){\r\n\tif($x === 0 && $y == 0){\r\n\t\treturn 1;\r\n\t} else if($x < 0 || $y < 0) {\r\n\t\treturn 0;\r\n\t}\r\n\treturn laticePath($x-1, $y) + laticePath($x, $y-1);\r\n}", "public static function gt(IInt32\\Type $x, IInt32\\Type $y) : IBool\\Type { // >\n\t\t\treturn IBool\\Type::box(IInt32\\Module::compare($x, $y)->unbox() > 0);\n\t\t}", "function numbers($x , $y ){\n \n if($x > $y){\n echo 'X is larger than Y';\n }\n else if($x < $y){\n echo 'X is smaller than Y';\n }\n else {\n echo 'X is equal than Y';\n }\n}", "public function isReachable(int $x, int $y): bool\n {\n // C = column, \"null\" wall, empty string = out of matrix\n return !in_array($this->getValue($x, $y), ['null', 'C', '']);\n }", "public function isValid()\n {\n return $this->lat >= -90 && $this->lat <= 90 &&\n $this->lon >= -180 && $this->lon <= 180;\n }", "public function DistanceDeplacementEstValide(int $x,int $y):bool {\n if($this->getX()==$x){\n return (abs($this->getY()-$y)==1)?true:false;\n }elseif ($this->getY()==$y){\n return (abs($this->getX()-$x)==1)?true:false;\n }else{\n return false;\n }\n }", "public function intersects(Shape $s): bool\n {\n $b1 = $this->getBoundingBox();\n $b2 = $s->getBoundingBox();\n\n $first = $b1->getOrigin()->smallerThan($b2->getTop());\n $second = $b1->getTop()->greaterThanOrEqual($b2->getOrigin());\n $res = $first && $second;\n\n return $res; \n }", "function color_detect(){\n\t\t\n\t\t$hex = str_replace('#', '', $this->base_color); \n\n\t\t$r = hexdec(substr($hex,0,2));\n\t\t$g = hexdec(substr($hex,2,2));\n\t\t$b = hexdec(substr($hex,4,2));\n\t\t\n\t\tif($r + $g + $b > 750){\n\t\t\t\n\t\t\t// Light\n\t\t return 1;\n\t\t\n\t\t}elseif($r + $g + $b < 120){\n\n\t\t\t// Really Dark\n\t\t\treturn -2;\n\n\t\t}\n\t\telseif($r + $g + $b < 300){\n\t\t\n\t\t\t// Dark\n\t\t\treturn -1;\n\t\t\n\t\t}else{\n\t\t\t\n\t\t\t// Meh\n\t\t return false;\n\t\t\n\t\t}\n\t}", "function mustDrawAStarInO($i, $j, $nrLin, $nrCol) {\r\n if ($i == 1 && $j != 1 && $j != $nrCol) {\r\n return true;\r\n }\r\n\r\n if ($i == $nrLin && $j != 1 && $j != $nrCol) {\r\n return true;\r\n }\r\n\r\n if ($j == 1 && $i != 1 && $i != $nrLin) {\r\n return true;\r\n }\r\n\r\n if ($j == $nrCol && $i != 1 && $i != $nrLin) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "public function isGina(){return $this->gina;}", "function rectangle($l, $b)\r\n {\r\n\r\n for ($i = 1; $i <= $l; $i++) {\r\n for ($j = 1; $j <= $b; $j++)\r\n if (\r\n $i == 1 || $i == $l ||\r\n $j == 1 || $j == $b\r\n )\r\n echo \"*\";\r\n\r\n else\r\n echo \"*\";\r\n echo \"<br>\";\r\n }\r\n }", "public function isValid(): bool\n {\n $epsilon = pow(1, -15);\n\n return !(abs($this->p1->y - $this->p2->y) < $epsilon && abs($this->p2->y - $this->p3->y) < $epsilon);\n }", "public function isBilinear()\n\t{\n\t\treturn $this->bilinear;\n\t}", "function checkStatePoints($level)\n {\n $pontosStatus = 0;\n for($i=2;$i<=$level;$i++)\n {\n if($i <= 70) {\n $pontosStatus = $pontosStatus + 5;\n } else if(($i > 70) and ($i <= 90)) {\n $pontosStatus = $pontosStatus + 7;\n } else {\n $pontosStatus = $pontosStatus + 10;\n }\n\n }\n return $pontosStatus;\n }", "function is_in_circle(array $circle, array $proj)\r\n{\r\n\t$r = $circle['r'];\r\n\r\n\t// calculer de $d distance par rapport au centre du cercle du point $proj\r\n\t$d = pow(($circle['x'] - $proj['x']), 2) + pow(($circle['y'] - $proj['y']), 2);\r\n\r\n\t// si cette distance est inférieur au rayon du cercle c'est que le proj est dans le cercle.\r\n\tif($d < pow($r,2) ) return true;\r\n\r\n\treturn false;\r\n}", "function guifi_ND50_WG84 ( $Xs, $Ys, $Zs, $type=0 ) {\n/* $Tx = 181.5; $Ty = 90.3; $Tz = 187.2;\n $Rx = deg2rad(0.144/3600); $Ry = deg2rad(0.492/3600); $Rz = deg2rad(-0.394/3600);\n $D = 17.57 / 1000000.0 ;\n $Tx = 131.0; $Ty = 100.3; $Tz = 163.4;\n $Rx = deg2rad(-1.244/3600); $Ry = deg2rad(-0.020/3600); $Rz = deg2rad(-1.144/3600);\n $D = 9.39 / 1000000.0 ;\n*/ $Tx = 131.03; $Ty = 100.25; $Tz = 163.35;\n $Rx = deg2rad(-1.244/3600); $Ry = deg2rad(-0.019/3600); $Rz = deg2rad(-1.144/3600);\n $D = 9.39 / 1000000.0 ;\n \n if ($type) {\n $Tx = -$Tx; $Ty = -$Ty; $Tz = -$Tz; \n $Rx = -$Rx; $Ry = -$Ry; $Rz = -$Rz; \n $D = -$D;\n }\n \n $D = $D + 1.0 ;\n $Xs = $D * $Xs;\n $Ys = $D * $Ys;\n $Zs = $D * $Zs;\n\n $Xt = $Tx + ( $Xs + $Rz*$Ys - $Ry*$Zs );\n $Yt = $Ty + ( -$Rz*$Xs + $Ys + $Rx*$Zs );\n $Zt = $Tz + ( $Ry*$Xs - $Rx*$Ys + $Zs );\n \n return array( $Xt, $Yt, $Zt );\n}", "function variant_and($left, $right) {}", "function o_ge($a, $b) {\n\t\t\treturn Obj::singleton()->greaterThanOrEqual($a, $b);\n\t\t}", "function isColinear($a, $b, $c) {\n return area2($a, $b, $c) === 0;\n}", "public function isFixedPointNumber(): bool;", "function gt($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, GT, $y, $and, ...$args);\n return $expression;\n }", "function gt($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, GT, $y, $and, ...$args);\n return $expression;\n }", "function checkDiagonal($posW, $posB)\n{\n\t$xdiff = abs($posW[0] - $posB[0]);\n\t$ydiff = abs($posW[1] - $posB[1]);\n\tif ($xdiff == $ydiff)\n\t{\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function possibles($x, $y){\nreturn array_intersect(\n $this->missingBlock((int)$x / 3, (int)$y / 3),\n $this->missingColumn($x),\n $this->missingRow($y)\n);\n}", "public function isSquare(){\n if($this->panjang == $this->lebar){\n return true; // Persegi\n } else{\n return false; // Bukan persegi\n }\n }", "function above (float $value, float $min) : float\n{\n return $value < $min ? $min : $value;\n}", "function compareFloats($float1, $float2) {\n\t\n\tif (abs($float1 - $float2) < EPSILON) {\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "function gP1 ($slope, $p1, $p2) {\n $x1 = $p1->lng;\n $y1 = $p1->lat;\n $x2 = $p2->lng;\n $y2 = $p2->lat;\n $d = (pow($x2-$x1,2)+pow($y2-$y1,2));\n $c0 = 1/4*(((pow($slope,2) + 1)/pow($slope,2))*(pow($x2-$x1,2))-$d);\n $c = pow($slope,2)/(pow($slope,2)+1)*$c0;\n $x3 = (($x2 - $x1) + sqrt(pow($x2-$x1,2)-4*$c))/2 + $x1;\n $xm=($x1+$x2)/2;\n $ym=($y1+$y2)/2;\n $y3 = $ym + sqrt(($d/4)-pow($x3-$xm,2));\n return new Point($y3,$x3);\n }", "public function isDirected();", "function compare($x, $y) {\n if($x[0] == \"N\" && $x[0] == $y[0]) return 0;\n if($x[0] == \"N\" && $y[0] == \"Y\") return 1;\n if($x[0] == \"Y\" && $y[0] == \"N\") return -1;\n $type1 = intval($x[3]);\n $type2 = intval($y[3]);\n if($type1 > $type2) return -1;\n if($type1 < $type2) return 1;\n $time1 = (float)$x[1];\n $time2 = (float)$y[1];\n if($time1 > $time2) return 1;\n if($time1 < $time2) return -1;\n $len1 = intval($x[2]);\n $len2 = intval($y[2]);\n if($len1 > $len2) return 1;\n if($len1 < $len2) return -1;\n return 0;\n}", "public function hasPoint(Point $point)\n {\n $nv = $this->getNormalVector();\n\n if ($nv->getX() * $point->getX() + $nv->getY() * $point->getY()\n != $nv->getX() * $this->a->getX() + $nv->getY() * $this->a->getY()\n ) {\n return false;\n }\n\n return $point->getX() >= $this->a->getX() && $point->getX() <= $this->b->getX()\n && $point->getY() >= $this->a->getY() && $point->getY() <= $this->b->getY();\n }", "public function getYMin() {}", "public function getYMin() {}", "function laticePathSideEffect($size, $x=0, $y=0){\r\n\tif($x > $size || $y > $size){\r\n\t\treturn 0;\r\n\t} else if ($x == $size && $y == $size) {\r\n\t\treturn 1;\r\n\t}\r\n\treturn laticePathSideEffect($size, $x+1, $y) + laticePathSideEffect($size, $x, $y+1);\r\n}", "function FindPoint($x1, $y1, $x2, $y2, $x, $y){\n $x = (float)($x); // CSV data is a string at start\n $y = (float)($y);\n if ($x > $x1 and $x < $x2){\n // Is inside of Long\n if(abs($y) > abs($y1) and abs($y) < abs($y2)){\n // Disregard negative values\n return true;\n }\n }\n return false;\n}", "public function isTriangular(): bool\n {\n return $this->isLowerTriangular() || $this->isUpperTriangular();\n }", "public function getCanShipPartially();", "function findSlope ($p1, $p2) {\n $lng = $p1->lng - $p2->lng;\n if ($lng != 0) {\n return ($p1->lat - $p2->lat)/$lng;\n }\n return \"vertical\";\n }", "public function inside($shape, $coords) {\n $coordsarray = array();\n foreach(explode(',', $coords) as $coord) {\n $coordsarray[] = trim($coord);\n }\n \n $result = new qti_variable('single', 'boolean');\n\n if ($this->_isNull()) {\n return $result;\n } \n \n $result->value = false;\n \n $values = $this->value;\n if (!is_array($values)) {\n $values = array($values);\n }\n \n foreach($values as $value) {\n list($pointx, $pointy) = explode(' ', $value);\n \n switch($shape) {\n case 'rect':\n if (($coordsarray[0] <= $pointx)\n && ($coordsarray[1] >= $pointy)\n && ($coordsarray[2] >= $pointx)\n && ($coordsarray[3] <= $pointy)) {\n $result->value = true;\n return $result;\n }\n break;\n case 'circle':\n // work out distance of point from centre\n $xoffset = abs($pointx - $coordsarray[0]);\n $yoffset = abs($pointy - $coordsarray[1]);\n $distance = sqrt(pow($xoffset, 2) + pow($yoffset, 2));\n // if lte radius return true\n if ($distance <= $coordsarray[2]) {\n $result->value = true;\n return $result;\n }\n break;\n case 'poly':\n throw new Exception(\"inside poly not implemented\");\n break;\n case 'ellipse':\n throw new Exception(\"inside ellipse not implemented\");\n break;\n case 'default':\n throw new Exception(\"inside default not implemented - please call with a rect instead\");\n break;\n default:\n break;\n }\n }\n \n return $result;\r\n }", "public function globalVarConditionMatchesOnLowerThanOrEqualExpression() {}", "public function globalVarConditionMatchesOnGreaterThanOrEqualExpression() {}", "public function globalVarConditionMatchesOnLowerThanOrEqualExpression() {}", "public function globalVarConditionMatchesOnGreaterThanOrEqualExpression() {}", "private function isInverseMatch(): bool\n {\n return is_int($this->min) and is_int($this->max) and ($this->min > $this->max);\n }", "function inters($bbox1) {\r\n// echo \"$this -> BBox::inters($bbox1)<br>\\n\";\r\n $xmin = max($bbox1->min()->x(),$this->min()->x());\r\n $ymin = max($bbox1->min()->y(),$this->min()->y());\r\n $xmax = min($bbox1->max()->x(),$this->max()->x());\r\n $ymax = min($bbox1->max()->y(),$this->max()->y());\r\n if (($xmax < $xmin) or ($ymax < $ymin))\r\n return 0;\r\n// echo \"area=\",$this->area(),\", \",$bbox1->area(),\"<br>\\n\";\r\n return (($xmax-$xmin)*($ymax-$ymin)) / max($bbox1->area(), $this->area());\r\n }", "public function isSphere()\n {\n return ($this->a == $this->b);\n }", "function getCoordsForSQL2($strict = false) {\n\t\tif (is_null($this->x)) {\n\t\t\t$pos = $this->getPosition();\n\t\t\tif (!$strict) return \"`x`=$pos->x AND `y`=$pos->y\";\n\t\t\treturn \"`x`=NULL AND `y`=NULL\";\n\t\t}\n\t\treturn \"`x`=$this->x AND `y`=$this->y\";\n\t}", "function promotionLevelCompare($x, $y){\n $array = array('dev', 'qa', 'stage', 'prod');\n $x_pos = -1;\n $y_pos = -1;\n\n $count = count($array);\n for ($i = 0; $i < $count; $i++) {\n if ( strcmp($array[$i], $x) == 0 ){\n $x_pos = $i;\n }\n }\n\n $count = count($array);\n for ($i = 0; $i < $count; $i++) {\n if ( strcmp($array[$i], $y) == 0 ){\n $y_pos = $i;\n }\n }\n\n #echo $x_pos . \"<br>\";\n #echo $y_pos . \"<br>\";\n\n return $x_pos - $y_pos;\n}", "abstract public function getVerticesTarget();", "function checkPosition($stmt, $i){\n\t\t$positions = explode(' ', self::$data[$i]['Position']);\n\t\t$dataPositionX = $positions[0];\n\t\t$dataPositionY = $positions[1];\n\n\t\tif(floatval($dataPositionX) < 0 || floatval($dataPositionX) > 664){\n\t\t\t$arr = array('success' => 3, 'error_msg' => 'Wrong values');\n\t\t\techo json_encode($arr);\n\t\t\treturn false;\n\t\t}else{\n\t\t\tif(floatval($dataPositionY) < 0 || floatval($dataPositionY) > 445){\n\t\t\t\t$arr = array('success' => 3, 'error_msg' => 'Wrong values');\n\t\t\t\techo json_encode($arr);\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function pointInCircle(Point $point): bool\n {\n // We check that the triangle is valid\n if (!$this->isValid()) {\n return false;\n }\n\n // We calculate the rounded value \"0\"\n $epsilon = pow(1, -15);\n\n if (abs($this->p2->y - $this->p1->y) < $epsilon) {\n $m2 = -($this->p3->x - $this->p2->x) / ($this->p3->y - $this->p2->y);\n $mx2 = ($this->p2->x + $this->p3->x) * 0.5;\n $my2 = ($this->p2->y + $this->p3->y) * 0.5;\n\n //Calculate CircumCircle center (xc,yc)\n $xc = ($this->p2->x + $this->p1->x) * 0.5;\n $yc = $m2 * ($xc - $mx2) + $my2;\n } else if (abs($this->p3->y - $this->p2->y) < $epsilon) {\n $m1 = -($this->p2->x - $this->p1->x) / ($this->p2->y - $this->p1->y);\n $mx1 = ($this->p1->x + $this->p2->x) * 0.5;\n $my1 = ($this->p1->y + $this->p2->y) * 0.5;\n $xc = ($this->p3->x + $this->p2->x) * 0.5;\n $yc = $m1 * ($xc - $mx1) + $my1;\n } else {\n $m1 = -($this->p2->x - $this->p1->x) / ($this->p2->y - $this->p1->y);\n $m2 = -($this->p3->x - $this->p2->x) / ($this->p3->y - $this->p2->y);\n $mx1 = ($this->p1->x + $this->p2->x) * 0.5;\n $mx2 = ($this->p2->x + $this->p3->x) * 0.5;\n $my1 = ($this->p1->y + $this->p2->y) * 0.5;\n $my2 = ($this->p2->y + $this->p3->y) * 0.5;\n $xc = ($m1 * $mx1 - $m2 * $mx2 + $my2 - $my1) / ($m1 - $m2);\n $yc = $m1 * ($xc - $mx1) + $my1;\n }\n\n $dx = $this->p2->x - $xc;\n $dy = $this->p2->y - $yc;\n $rsqr = $dx * $dx + $dy * $dy;\n\n //double r = Math.Sqrt(rsqr); //Circumcircle radius\n $dx = $point->x - $xc;\n $dy = $point->y - $yc;\n $drsqr = $dx * $dx + $dy * $dy;\n\n return ($drsqr <= $rsqr);\n }", "public function hasLongitude(): bool;", "function mGREATER_EQUAL(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$GREATER_EQUAL;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:708:3: ( '>=' ) \n // Tokenizer11.g:709:3: '>=' \n {\n $this->matchString(\">=\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function isPositive(): bool;", "function is_gd_image($image)\n {\n }" ]
[ "0.5420003", "0.52030563", "0.5197373", "0.51800483", "0.5112996", "0.5112996", "0.5088358", "0.5075645", "0.5008262", "0.5006231", "0.4996112", "0.49819693", "0.49702248", "0.4969872", "0.49462107", "0.49276704", "0.49191594", "0.48866364", "0.48649186", "0.48596627", "0.4851233", "0.48375228", "0.48075798", "0.48013544", "0.48013544", "0.47619808", "0.47511935", "0.47275594", "0.47274533", "0.47225872", "0.47126383", "0.4707805", "0.47048545", "0.47043163", "0.46792108", "0.46755785", "0.46752664", "0.46700135", "0.46175286", "0.45892733", "0.45889235", "0.4587463", "0.458735", "0.45863634", "0.4580379", "0.45742542", "0.45653275", "0.45521897", "0.4535184", "0.4533729", "0.45275503", "0.4513943", "0.45098072", "0.45061374", "0.45033136", "0.44830805", "0.44820294", "0.44796804", "0.4479482", "0.44702575", "0.44423684", "0.44365144", "0.44315085", "0.44229007", "0.44215912", "0.44153637", "0.4411927", "0.4411927", "0.44076145", "0.44013512", "0.43990615", "0.43950295", "0.43881088", "0.43858188", "0.43765324", "0.43733016", "0.43690753", "0.436509", "0.436509", "0.43634504", "0.43606693", "0.4359539", "0.43479353", "0.43447912", "0.43418092", "0.43380782", "0.43372196", "0.4336991", "0.4335359", "0.43335086", "0.43334255", "0.43297514", "0.43100828", "0.4308808", "0.43075088", "0.43019038", "0.42998084", "0.4289692", "0.42896557", "0.4281124", "0.42659006" ]
0.0
-1
Returns the value of this object as a string.
public function __toString() { return $this->_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toString() : string\n {\n return $this->value;\n }", "public function __toString()\n\t{\n\t\treturn (string) $this->value;\n\t}", "final public function __toString()\n {\n return strval($this->value);\n }", "public function toString(): string\n {\n return $this->getValue();\n }", "public function __toString()\n {\n return (string)$this->value;\n }", "public function toString() : string\n {\n return strval($this->value);\n }", "public function __toString()\n {\n return (string) $this->getValue();\n }", "public function __toString()\n {\n return (string) $this->getValue();\n }", "public function __toString()\n {\n return (string) $this->getValue();\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString()\n {\n return strval($this->__value);\n }", "public function __toString() {\n\t\t\treturn $this->value;\n\t\t}", "public function __toString(): string\n {\n return (string) $this->value;\n }", "public function __toString(): string\n {\n return (string) $this->getValue();\n }", "public function __toString(): string\n {\n return (string)$this->value;\n }", "public function toString() {\n\t\treturn serialize($this->_value);\n\t}", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "public function __toString()\n {\n return $this->value;\n }", "function __toString()\n {\n return strval($this->value);\n }", "public function __toString() {\n\t\t\treturn Core\\Convert::toString($this->value);\n\t\t}", "public function string()\n {\n return (string)$this->value;\n }", "final public function __toString(): string\n {\n return (string)$this->value;\n }", "public function __toString(){\n\t\treturn $this->value;\n\t}", "public function __toString()\n\t{\n\t\treturn $this->value();\n\t}", "public function __toString()\n {\n return $this->str_value;\n }", "public function value() {\n\t\treturn $this->__toString();\n\t}", "public function getToString()\n {\n return $this->toString();\n }", "public function toString() {\n \n return $this->toScalar();\n }", "public function __toString()\n {\n $type = gettype($this->value);\n\n switch ($type) {\n case 'boolean':\n return $this->boolean($this->value);\n break;\n case 'integer':\n return $this->int($this->value);\n break;\n case 'double':\n return $this->float($this->value);\n break;\n case 'string':\n return $this->string($this->value);\n break;\n case 'array':\n return $this->array($this->value);\n break;\n case 'object':\n return $this->object($this->value);\n break;\n case 'resource':\n return $this->resource($this->value);\n break;\n case 'NULL':\n return 'NULL';\n break;\n default:\n return '(unknown type)';\n break;\n };\n }", "public function value()\n\t{\n\t\treturn (string) $this->value;\n\t}", "public function getValue(): string\n {\n return gmp_strval($this->value);\n }", "public function to_string() { return $this->__toString(); }", "public function __toString()\n {\n return strval($this->_data);\n }", "public function toString()\n {\n return $this->cast('string');\n }", "public function __toString() {\n return print_r($this->__value, true);\n }", "public function toString()\n\t{\n\t\treturn (string) $this;\n\t}", "public function toString()\n\t{\n\t\treturn (string) $this;\n\t}", "public function __toString()\n {\n if (is_array($this->value)) {\n return (string)json_encode($this->value);\n }\n return (string)$this->value;\n }", "public function value(): string\n {\n return $this->get('value');\n }", "public function getValue(): string\n {\n return $this->transform($this->value);\n }", "public function getValueAsString();", "public function & toString()\n\t{\n\t\t$x = string((string)$this->data);\n\t\treturn $x;\n\t}", "public function __toString() {\r\n return (string) $this->getMappingValue();\r\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function __toString() { return $this->as_string(); }", "public function __toString()\n\t{\n\t\treturn $this->get();\n\t}", "function to_string() {\n\t\treturn $this->get($this->name_field);\n\n\t}", "public function toString()\n {\n return $this->__toString();\n }", "public function __string()\n {\n return $this->_result;\n }", "public function __toString() {\n\t\treturn sprintf(\"%s: %s\", $this->getName(), $this->getValue());\n\t}", "public function asString(): string\n {\n return $this->result;\n }", "public function toString()\n {\n $data = $this->origin->data();\n $out = '';\n if (is_scalar($data) || is_null($data)) {\n $out = (string) $data;\n } elseif (is_object($data) && method_exists($data, '__toString')) {\n $out = (string) $data;\n }\n return $out;\n }", "public function __toString() {\r\n return $this->toString();\r\n }", "public function getValue()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'value'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'value'];\n\t\t}\n\n\t\treturn '';\n\t}", "public function __toString() {\n\t\tif ( null === $this->string ) {\n\t\t\t$this->string = call_user_func( $this->value_callback );\n\t\t\t$this->resolved();\n\t\t}\n\n\t\treturn $this->string;\n\t}", "public function __toString()\n {\n try {\n return $this->toString();\n } catch (\\Exception $e) {\n return '';\n }\n }", "public function __toString() {\n\t\tif($this->wire('hooks')->isHooked('LanguagesPageFieldValue::getStringValue()')) {\n\t\t\treturn $this->__call('getStringValue', array());\n\t\t} else {\n\t\t\treturn $this->___getStringValue();\n\t\t}\t\n\t}", "public function __toString()\n {\n return $this->str;\n }", "public function __toString() {\n return $this->as_string();\n }", "function __toString() {\n return $this->string();\n }", "public function get(): string\n {\n return $this->string;\n }", "public function __toString() {\n return $this->toString();\n }", "public function __toString() {\n return $this->toString();\n }" ]
[ "0.8840788", "0.879848", "0.87807935", "0.87536585", "0.87503517", "0.87464464", "0.873379", "0.873379", "0.873379", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.8727374", "0.87063366", "0.86465794", "0.86321294", "0.8626695", "0.8617357", "0.86132574", "0.86132574", "0.86132574", "0.86132574", "0.86132574", "0.86132574", "0.86132574", "0.8596753", "0.8583819", "0.8474868", "0.84463924", "0.84169346", "0.8412048", "0.8310731", "0.8239553", "0.8213277", "0.81898737", "0.81780106", "0.8138362", "0.8085515", "0.80631", "0.80606836", "0.80427104", "0.80096585", "0.79966223", "0.79966223", "0.79897165", "0.7934177", "0.7930753", "0.792847", "0.7890827", "0.77898186", "0.7787055", "0.7787055", "0.7787055", "0.7787055", "0.7787055", "0.7787055", "0.77119833", "0.77116835", "0.76649505", "0.7658532", "0.76522213", "0.7623991", "0.7588668", "0.75878906", "0.7580578", "0.7579713", "0.7577301", "0.7573084", "0.75684863", "0.75510037", "0.7550925", "0.75471663", "0.75334734", "0.7524092", "0.7524092" ]
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'nombre' => 'required', 'apellido' => 'required', 'documento_id' => 'required', 'num_documento' => 'required|unique:medicos|unique:pacientes,num_documento,' . $this->route('paciente'), '|min:10', 'domicilio' => 'required', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Find all phone lines
public function findAllQuery($sort) { $qBuilder = $this->_em->createQueryBuilder() ->select(" i.idkey, DATE_FORMAT(i.date, '%d/%m/%Y %H:%i:%s') as date, i.duration, i.callingNumber, i.nature, pl.number as phoneLine") ->from('Ticket:IncomingCall', 'i') ->leftJoin('i.phoneLine', 'pl'); if ($sort) { $prefix = $sort->property == 'number' ? 'pl.' : 'i.'; $qBuilder->addOrderBy($prefix . $sort->property, $sort->direction); } return $qBuilder->getQuery(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllLines();", "public function getAllLines();", "function getallphonenos()\n\t{\n\t\tinclude_once('twilio/Twilio.php');\n\t\t$twilio_creds=getTwlioCreds();\n\t\t$client = new Services_Twilio($twilio_creds['sid'], $twilio_creds['auth_token']);\n\t\t$allnos = array();\n\t\tforeach ($client->account->incoming_phone_numbers as $number) \n\t\t{\n\t\t\tif($number->voice_application_sid == $twilio_creds['app_sid'])\n\t\t\t{\n\t\t\t\t$allnos[]['incoming_no'] = $number->phone_number;\t\t \n\t\t\t}\n\t\t}\n\t\treturn($allnos);\n\t}", "public function getLines();", "public function getLines();", "public function find_lines(){\n $this->pay_min_max($this->json['pays']);\n\n $lines = $this->json['lines'];\n\n $currentIterSymb = [];\n\n foreach($lines as $key=>$line){\n $this->counWin[$key] = 1;\n foreach($line as $i=>$j){\n if(isset($currentIterSymb[$i-1]) && $this->rand_reels[$i][$j] == $currentIterSymb[$i-1]){\n $this->counWin[$key]++;\n if($this->counWin[$key] >=$this->pay_min){\n $this->profits[$key] = $this->rand_reels[$i][$j];\n }\n } else {\n if($this->counWin[$key] < $this->pay_min){\n $this->counWin[$key] = 1;\n } else {\n break;\n }\n \n }\n $currentIterSymb[$i] = $this->rand_reels[$i][$j];\n }\n }\n\n }", "protected function get_lines()\n {\n }", "function findAddress($lines) {\n //Finds address by searching for finding line with a zipcode, and then concatenating the previous line with that line. This is prone to errors, however, and is only used as an example for showing how the script would work. A better method would involve leveraging existing APIs, such as Google's GeoCoding API.\n for($i = 0; $i<count($lines); $i++) {\n if(preg_match('/[0-9]{5}/', $lines[$i])) {\n return [$lines[$i-2], $lines[$i]];\n }\n }\n return \"\";\n}", "protected function _getLines() {}", "public function phones()\n {\n return $this->hasManyThrough(Contact::class, Profile::class)\n ->select(['prefix', 'value AS number', 'is_primary'])\n ->where('type', 'phone');\n }", "public function getShipToPhone();", "public function calculate_lines(){\n\n\t\t$this->delete_existing_lines();\n\t\t$this->parse_participants_sex_count();\n\t\tif($this->event->type_of_play === 'gender'){\n\t\t\tif($this->event->singles_only == 0){\n\t\t\t\t$this->calculate_lines_gender();\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->calculate_lines_gender_singles_only();\n\t\t\t}\n\t\t}\n\t\telse if($this->event->type_of_play === 'mixed'){\n\t\t\tif($this->event->singles_only == 0){\n\t\t\t\t$this->calculate_lines_mixed();\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->calculate_lines_mixed_singles_only();\n\t\t\t}\n\t\t}\n\t\t$this->build_lines_aggregate_array();\n\t\t$this->lines->create_lines($this->event->id, $this->event->sets, $this->lines_aggregate_array);\n\n\t}", "public function getPhones()\n {\n return $this->phones;\n }", "public function getLineItems();", "public function getLineItems();", "public function getAllPhoneNumbers() {\n $query = \"SELECT phone_no FROM users;\";\n $dbResult = $this->CONN->query($query);\n $result = array();\n while($row = $dbResult->fetch_assoc()) {\n array_push($result, $row['phone_no']);\n }\n return $result;\n }", "public function getFindingAids()\n {\n return $this->getFieldArray('555', ['a', 'u']);\n //return $this->getFieldArray('555');\n }", "public function getTextLines();", "public function getPhone();", "function _getLines(&$text_lines, &$line_no, $end = \\false)\n {\n }", "public function lines()\n {\n return $this->hasMany(InvoiceLine::class);\n }", "private function _setNewLineIds()\n {\n $this->_newLineIds = [];\n\n foreach ($this->get('structure') as $line) {\n if ($line['id'] === 0) {\n continue;\n }\n\n $this->_newLineIds[] = $line['id'];\n }\n\n return $this;\n }", "public function lines()\n {\n return $this->hasMany('App\\\\RequisitionLine');\n }", "public function readLines();", "public function get_telephone();", "public function findAddress()\n {\n $regex = '/.{1,100}[A-Z]{1,2}[0-9]{1}[A-Z0-9]*\\s+[0-9]{1}[A-Z]{2}/si';\n\n if (preg_match_all($regex, $this->data, $matches)) {\n $uniques = array_values(array_unique($matches[0]));\n foreach ($uniques as $key => $address) {\n $uniques[$key] = preg_replace(\"/[\\s\\r\\n]*[|]+[\\s\\r\\n]*/\", \", \", $address);\n }\n $this->address = $uniques;\n }\n }", "public function getRoutes() {\r\n \r\n $params = array(\"line\");\r\n \r\n $results = $this->fetch(\"search\", $params);\r\n \r\n $routes = array(); \r\n \r\n foreach ($results as $row) {\r\n if ($row['result']['transport_type'] == \"train\") {\r\n $routes[$row['result']['line_id']] = array(\r\n \"id\" => $row['result']['line_id'],\r\n \"route_id\" => $row['result']['line_id'],\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => $row['result']['line_number'],\r\n \"route_long_name\" => $row['result']['line_name'],\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\",\r\n \"url\" => new Url(sprintf(\"%s/timetables?provider=%s&id=%d\", RP_WEB_ROOT, static::PROVIDER_NAME, $row['result']['line_id']))\r\n );\r\n }\r\n }\r\n \r\n return $routes;\r\n \r\n /*\r\n $routes = array(\r\n array(\r\n \"id\" => 1,\r\n \"route_id\" => 1,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Alamein Line\",\r\n \"route_long_name\" => \"Alamein Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 2,\r\n \"route_id\" => 2,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Belgrave Line\",\r\n \"route_long_name\" => \"Belgrave Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 3,\r\n \"route_id\" => 3,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Craigieburn Line\",\r\n \"route_long_name\" => \"Craigieburn Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 4,\r\n \"route_id\" => 4,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Cranbourne Line\",\r\n \"route_long_name\" => \"Cranbourne Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 6,\r\n \"route_id\" => 6,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Frankston Line\",\r\n \"route_long_name\" => \"Frankston Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 7,\r\n \"route_id\" => 7,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Glen Waverley Line\",\r\n \"route_long_name\" => \"Glen Waverley Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 8,\r\n \"route_id\" => 8,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Hurstbridge Line\",\r\n \"route_long_name\" => \"Hurstbridge Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 9,\r\n \"route_id\" => 9,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Lilydale Line\",\r\n \"route_long_name\" => \"Lilydale Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 11,\r\n \"route_id\" => 11,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Pakenham Line\",\r\n \"route_long_name\" => \"Pakenham Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n )\r\n );\r\n */\r\n \r\n printArray($routes);\r\n }", "public function lines($sql, $both = false) {\n $data_out = array();\n $sql_data = $this->data($sql);\n while ($data = $this->mfa($sql_data, $both))\n {\n $data_out[] = $data;\n }\n return $data_out;\n }", "public function getLineItems(): array;", "public function findAll()\n {\n return $this->find('/admin/v1/phones', '\\\\DuoAuth\\\\Devices\\\\Phone');\n }", "public function getSms(int $line = 1): array\n {\n $mapper = new SmsMapper(new SmsAdapter($this->sms));\n\n return $mapper->findByLine($line);\n }", "public function getPhones($dirtyString = '')\n {\n $matches = [];\n $phones = ['landline' => '','mobile' => ''];\n preg_match_all('/[0-9]{10}|[0-9]{3}[\\-][0-9]{6}|[0-9]{3}[\\s][0-9]{6}|[0-9]{3}[\\s][0-9]{3}[\\s][0-9]{4}|[0-9]{3}[\\-][0-9]{3}[\\-][0-9]{4}|[\\(][0-9]{3}[\\)][\\s][0-9]{3}[\\s][0-9]{4}/', $dirtyString, $matches);\n\n foreach ($matches[0] as $value) {\n switch ($this->typePhone('1'.str_replace(['-',' ','(',')'],\"\",$value))){\n case 'landline':\n $phones['landline'] = str_replace(['-',' ','(',')'],\"\",$value);\n break;\n case 'mobile':\n $phones['mobile'] = str_replace(['-',' ','(',')'],\"\",$value);\n break;\n default:\n $phones['landline'] = str_replace(['-',' ','(',')'],\"\",$value);\n break;\n }\n }\n return $phones;\n }", "public function getOrdersByPhone($phone) {\n $result = $this->_db->query(\" SELECT * FROM orders WHERE order_id = ' $phone ' \");\n if ($result) {\n $orders = [];\n while ($row = $result->fetch_assoc()) {\n $orders[] = $row;\n }\n return $orders;\n }\n\n return NULL;\n }", "public function getDialogLines() {\n $dialog = new Application_Model_DbTable_Dialog();\n $this->drows = $dialog->getDialogRows($this->dialog_name);\n // logit('DROWS: ' . print_r($this->drows, true));\n }", "public function fetchPhoneNumbers()\n\t{\n\t\t// database connection and sql query\n $core = Core::dbOpen();\n $sql = \"SELECT * FROM user_phone WHERE userID = :userID\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':userID', $this->userID);\n Core::dbClose();\n\t\t\n\t\ttry\n {\n if( $stmt->execute()) \n\t\t\t{\n\t\t\t\t$ouput = array();\n while ($aRow = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t\t\t$row = array();\n\t\t\t\t\t\t$row[\"phoneID\"] = $aRow[\"phoneID\"];\n\t\t\t\t\t\t$row[\"phoneNum\"] = $aRow[\"phoneNum\"];\n\t\t\t\t\t\t$row[\"ext\"] = $aRow[\"ext\"];\n\t\t\t\t\t\t$row[\"type\"] = $aRow[\"type\"];\n\t\t\t\t\t\t$output[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $output;\n }\n } catch ( PDOException $e ) {\n echo \"Fetch phone numbers failed!\";\n }\n\t\treturn NULL;\n\t}", "protected function getPhoneLine($number)\n {\n\n if (isset($this->phoneLines[$number])) {\n\n return $this->phoneLines[$number];\n }\n\n $phoneLine = $this->phoneLineRepo->find($number);\n\n if (!$phoneLine) {\n $phoneLine = new PhoneLine();\n $phoneLine->setNumber($number);\n $this->eManager->persist($phoneLine);\n }\n\n $this->phoneLines[$number] = $phoneLine;\n\n return $phoneLine;\n }", "public function getTelefones() {\n\n $aTelefones = array();\n $oDaoTelefones = new cl_telefoneescola();\n $sCampos = \"ed26_i_ddd as ddd, ed26_i_numero as numero, ed13_c_descr as tipo_telefone\";\n $sSqlTelefones = $oDaoTelefones->sql_query(null, $sCampos, \"ed26_i_numero\", \"ed26_i_escola = {$this->iCodigoEscola}\" );\n $rsTelefones = db_query($sSqlTelefones);\n\n if ( !$rsTelefones ) {\n throw new DBException(\"Erro ao buscar os telefones.\\n\" . pg_last_error());\n }\n $iTotalTelefones = pg_num_rows($rsTelefones);\n\n $oDadosTelefone = new stdClass();\n $oDadosTelefone->ddd = '';\n $oDadosTelefone->fax = '';\n $oDadosTelefone->telefone = '';\n $oDadosTelefone->telefone_publico = '';\n $oDadosTelefone->telefone_outro = '';\n\n for ($i = 0; $i < $iTotalTelefones; $i++) {\n\n $oTelefone = db_utils::fieldsMemory($rsTelefones, $i);\n\n $oDadosTelefone->ddd = $oTelefone->ddd;\n\n if (strpos(strtoupper($oTelefone->tipo_telefone), \"FAX\") !== false) {\n $oDadosTelefone->fax = $oTelefone->numero;\n continue;\n }\n\n if ( empty($oDadosTelefone->telefone_publico) && strlen($oTelefone->numero) == 8 ) {\n $oDadosTelefone->telefone_publico = $oTelefone->numero;\n continue;\n }\n\n if ( empty($oDadosTelefone->telefone) ) {\n $oDadosTelefone->telefone = $oTelefone->numero;\n continue;\n }\n\n\n if ( empty($oDadosTelefone->telefone_outro) ) {\n $oDadosTelefone->telefone_outro = $oTelefone->numero;\n continue;\n }\n }\n\n return $oDadosTelefone;\n }", "public function getCustomLineItems();", "public function returnLines($start_date,$end_date){\n\t\t$mcoData = new Application_Model_DbTable_McoData();\n\t\t$select = $mcoData->select()->setIntegrityCheck(false);\n\t\t$select ->from(array(\"mc\" => \"mco_data\"),array('DISTINCT(line),mco'))\n\t\t\t\t\t->where('start_date >= ?', Application_Model_General::dateToUs($start_date))\n\t\t\t\t\t->where('start_date <= ?', Application_Model_General::dateToUs($end_date))\n\t\t\t\t\t->where('status=1');\n\treturn $mcoData->fetchAll($select);\n\t}", "function lines(){\n\t$string = shell_exec(\"find . -name '*.php' -not -path './securimage/*' -not -path './phpmyadmin/*' -not -path './jpgraph/*' | xargs wc -l\");\n\tpreg_match_all('/[0-9]+/',$string,$matches);\n\t$linesofcode = $matches[0][count($matches[0])-1];\n\treturn $linesofcode;\n}", "public function orderLines()\n {\n return $this->hasMany('App\\OrderLine', 'order_id', 'id');\n }", "public function getLine($lineId);", "public function getLine_numbers()\n\t{\n\t\treturn $this->getParser()->line_numbers;\n\t}", "public function readerGetLines();", "public function getLinInves() {\n return $this->linInves;\n }", "function getMatchingLines($pattern, $array){\n $returnArray = Array();\n foreach ($array as $x) {\n if (preg_match($pattern, $x) == 1) {\n $returnArray[] = $x;\n }\n }\n return $returnArray;\n}", "function flashLines($orderoid){\n $r = array('hasflash'=>false, 'flashlines'=>array());\n $rs = selectQueryGetAll('select l.lnkflash as flashoid, o.KOID as offreoid, l.validfrom as linevalidfrom, l.product as productoid, l.libelle as productlibelle, o.flash offreflash, l.KOID as lineoid from '.self::$tableORDERLINE.' l left outer join '.self::$tableCATALOG.' c on c.LANG=\\'FR\\' and c.KOID=l.PRODUCT left outer join '.self::$tableOFFER.' o on o.LANG=\\'FR\\' and instr(c.offers, o.KOID) where l.LNKORDER=\\''.$orderoid.'\\' and l.linetype=\\'forf\\'');\n if (count($rs)>=1){\n foreach($rs as $ors){\n if (isset($ors['offreflash']) && $ors['offreflash'] == 1){\n $r['hasflash'] = true;\n $r['flashlines'][] = array('lineoid'=>$ors['lineoid'], 'flashoid'=>$ors['flashoid']);\n }\n }\n }\n unset($rs);\n return $r;\n }", "public function telefones() {\n return $this->hasMany('App\\Telefone', 'pessoa_id');\n }", "public function compute(array $lines) {\n list($k, $d) = array_map(function($val) {\n return (int) $val;\n }, explode(' ',$lines[0]));\n\n $strings = [];\n $l = count($lines);\n for ($i = 1; $i < $l; $i++) {\n if (!empty($lines[$i])) array_push($strings, $lines[$i]);\n }\n\n\n $motifs = [];\n for ($i = 0; $i < strlen($strings[0]) - $k + 1; $i++) {\n $patt = substr($strings[0], $i, $k);\n\n $neighbors = BioUtil::neighbors($patt, $d);\n\n foreach($neighbors as $nb) {\n\n if (Arrays::matches($strings, function($str) use ($nb,$d) {\n return BioUtil::approximate_frequency($str, $nb, $d, true) > 0;\n }) &&\n !Arrays::contains($motifs, $nb)) {\n array_push($motifs, $nb);\n }\n }\n }\n\n return $motifs;\n }", "public function select_phone($phoneid, $phone_line_templates = null)\n {\n return parent::select_phone($phoneid, 'voipaccount/voipaccountlines.tpl');\n }", "public function hasLineItems();", "abstract public function getLinesOfCode();", "public function getOutputLines();", "public function getLineWithStops($lineId);", "private function _getAddresses()\n\t {\n\t\t$hashes = [];\n\t\t$rows = $this->_db->exec(\"SELECT `city`, `address` FROM `addresses` WHERE `phone` = '\" . $this->phone . \"'\");\n\t\twhile($row = $rows->getRow())\n\t\t {\n\t\t\t$address = $row[\"city\"] . \", \" . $row[\"address\"];\n\t\t\t$sliced = new AddressSlicer($address);\n\n\t\t\tif ($sliced->valid() === true && isset($hashes[$sliced->hash]) === false)\n\t\t\t {\n\t\t\t\t$hashes[$sliced->hash] = $address;\n\t\t\t } //end if\n\n\t\t } //end while\n\n\t\treturn count($hashes);\n\t }", "public function getAll(){\n\n \t$cost = Cost::find(1);\n\n \tif( $cost == null )\n \t\treturn response()->error('Costo no configurado. No se puede obtener el saldo en segundos.', 404);\n\n \t$cost = $cost->first();\n $phone_lines = DB::table('phone_lines')\n \t\t\t\t->select(DB::raw('phone_lines.*, (phone_lines.balance DIV 35) AS balance_secs, SUM(intakes.secs) AS intakes_secs, SUM(intakes.total) AS total'))\n ->join('intakes', 'phone_lines.phone_number', '=', 'intakes.phone_number')\n ->groupBy('intakes.phone_number')\n \t\t\t\t->get();\n\n if( ! $phone_lines )\n return response()->error('Historial de consumos vacío', 404);\n\n return response()->success($phone_lines);\n }", "public function getTelephone() {}", "public function requisitionLines()\n {\n return $this->hasMany('App\\RequisitionLine', 'account_line_id', 'id');\n }", "public function phone()\n {\n return $this->hasOne('App\\Models\\User\\Contact', 'user_id')->where('medium_id', '=', Medium::SMS);\n }", "public function getOtherLines($filter)\n {\n $processor = $this->container->get('canaltp_schedule.other.lines.processor');\n return $processor->bindFromLinesFilter($filter);\n }", "public function getLines($planificationPeriod)\n {\n $qb = $this->createQueryBuilder('pl');\n $qb->where('pl.planificationPeriod = :p')->setParameter('p', $planificationPeriod);\n $qb->orderBy('pl.oorder', 'ASC');\n \n $query = $qb->getQuery();\n $results = $query->getResult();\n return $results;\n }", "public function getLines(): array {\n\t\treturn $this->_lines;\n\t}", "function getTelefonos(){\n\t\t$socio\t\t\t= $this->mCodigo;\n\t\t$mArrTelefonos\t= array();\n\t\t$sql = \"SELECT\n\t\t\t\t\tTRIM(`socios_vivienda`.`telefono_residencial`) AS 'telefono'\n\t\t\t\tFROM\n\t\t\t\t\t`socios_vivienda` `socios_vivienda`\n\t\t\t\tWHERE\n\t\t\t\t\t(`socios_vivienda`.`socio_numero` =$socio)\n\t\t\t\tUNION\n\t\t\t\tSELECT\n\t\t\t\t\tTRIM(`socios_vivienda`.`telefono_movil`)\n\t\t\t\tFROM\n\t\t\t\t\t`socios_vivienda` `socios_vivienda`\n\t\t\t\tWHERE\n\t\t\t\t\t(`socios_vivienda`.`socio_numero` =$socio)\";\n\t\t$rs\t= mysql_query($sql, cnnGeneral() );\n\t\twhile($rw = mysql_fetch_array($rs) ){\n\t\t\t$mArrTelefonos[]\t= $rw[\"telefono\"];\n\t\t}\n\t\t$mArrTelefonos[\"principal\"]\t= $this->mTelefonoP;\n\t\treturn $mArrTelefonos;\n\t}", "public function getLineMatrix() {}", "private function get_lines() {\n\t $data = \"\";\n\t while($str = @fgets($this->smtp_conn,515)) {\n\t if($this->do_debug >= 4) {\n\t echo \"SMTP -> get_lines(): \\$data was \\\"$data\\\"\" . $this->CRLF . '<br />';\n\t echo \"SMTP -> get_lines(): \\$str is \\\"$str\\\"\" . $this->CRLF . '<br />';\n\t }\n\t $data .= $str;\n\t if($this->do_debug >= 4) {\n\t echo \"SMTP -> get_lines(): \\$data is \\\"$data\\\"\" . $this->CRLF . '<br />';\n\t }\n\t // if 4th character is a space, we are done reading, break the loop\n\t if(substr($str,3,1) == \" \") { break; }\n\t }\n\t return $data;\n\t}", "public function getDivPhoneNumbers(){\n /** @var BootstrapComponent $this */\n\n /**\n * This is an access method from the Bootstrap main level\n */\n $countrycodes = $this->model->getCountryCodes();\n $ouput = array();\n $list = '';\n\n foreach ($countrycodes as $name => $code){\n $list .= $code .';' .$name .';';\n }\n\n $list = substr($list, 0,-1);\n\n\n $value = $this->model->getSubmittedVariableByName('selected_country') ? $this->model->getSubmittedVariableByName('selected_country') : $this->model->sessionGet('selected_country');\n\n\n $content[] = $this->getComponentFormFieldList($list,array(\n 'variable' => 'country_selected',\n 'style' => 'mreg_selectlist',\n 'value' => $value\n ));\n\n $cols[] = $this->getComponentText('{#cancel#}',array('style' => 'mreg_small_btn','onclick' => $this->getOnclickHideDiv('countries')));\n $cols[] = $this->getComponentText('{#select#}',array('style' => 'mreg_small_btn',\n 'onclick' => $this->getOnclickSubmit('selectcountry')\n )\n );\n\n $content[] = $this->getComponentRow($cols,array(),array(\n 'text-align' => 'center'\n ));\n\n return $this->getComponentColumn($content,array(\n 'style' => 'mreg_divbox'\n ),array(\n\n ));\n\n\n }", "private function lineData($line)\n {\n // replace tab\n $lineStr = str_replace(\"\\t\", \"*****\", $line);\n // explode string to array\n $lineData = explode('*****', $lineStr);\n\n // $data = [\n // 0 => \"460\", // mcc 所有的都是460,表示中国\n // 1 => \"0\", // mnc 0表示移动基站,1表示联通基站,\n // // 11表示电信LTE基站10000-20000表示电信CDMA基站,此时此字段的取值并非MNC,实际为电信SID\n // 2 => \"33061\", // lac 电信为nid\n // 3 => \"13256\", // cell id 电信为bid\n // 4 => \"30.573833\", // lat\n // 5 => \"104.292610\", // lon\n // 6 => \"175\", // acc 覆盖范围米\n // 7 => \"20171030\", // date\n // 8 => \"0.66\", // 精度 (正常无此字段)\n // 9 => \"四川省成都市龙泉驿区龙泉街道百工堰村;枇杷沟路与公园路路口南812米\", // addr\n // 10 => \"四川省\", // province\n // 11 => \"成都市\", // city\n // 12 => \"龙泉驿区\", // district\n // 13 => \"龙泉街道\", // township\n // ];\n\n // remove index of 8 if count is 14, sometimes this field is not exists\n if (count($lineData) == 14) {\n unset($lineData[8]);\n }\n\n return array_values($lineData);\n }", "public function findByLine(int $line): array\n {\n $messagesStates = $this->adapter->findByLine($line);\n $smsList = [];\n foreach ($messagesStates as $smsState) {\n $smsList[] = $this->mapStateToSms($smsState)->setLine($line);\n }\n return $smsList;\n }", "function getLineItems($serviceID) {\n\t\t$results = \"\";\n\t\t$sql = \"SELECT * FROM LineItem WHERE ServiceID = '$serviceID'\";\n\n\t\t$results = queryDB($sql);\n\n\t\treturn $results;\n\t}", "public function getAllLines(){\n $lines = $this->stationService->getAllLines();\n return response()->json([\"status\"=>\"success\" , \"data\"=>$lines]);\n }", "public function getLines(): array\n {\n return $this->lines;\n }", "public function hasLines(){\n return $this->_has(38);\n }", "public function findAll(): array\n {\n $messagesStates = $this->adapter->findAll();\n $smsList = [];\n foreach ($messagesStates as $lineNumber => $smsStates) {\n foreach ($smsStates as $smsState) {\n $smsList[] = ($this->mapStateToSms($smsState))->setLine($lineNumber);\n }\n }\n return $smsList;\n }", "public function getLine();", "public function getLine();", "public function getLine();", "public function getLine();", "abstract protected function getIgnoredLines(): array;", "public function computeNodesAtLineMap(): array\n {\n $result = [];\n $file_position_map = new FilePositionMap($this->contents);\n foreach ($this->getAST()->getDescendantNodes() as $node) {\n $line_for_node = $file_position_map->getStartLine($node);\n $result[$line_for_node][] = $node;\n }\n return $result;\n }", "function get_all_covered_lines($id=null)\n {\n $this->db->order_by('id', 'desc');\n if ($id == null)\n return $this->db->get('covered_lines')->result_array();\n else\n return $this->db->get_where('covered_lines', array('fk_file_id'=>$id))->result_array();\n }", "function getLines()\n\t{\n\t\t//echo 'font file = ' . $this->calculateFontFile() . ' ' . $this->textFont . '<br>';\n\t\tif(isset($this->lines) && $this->width == $this->lines[\"width\"] && $this->textSize == $this->lines[\"textSize\"])\n\t\t{\n\t\t\treturn $this->lines;\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$rawPars = explode(\"\\r\\n\", $this->contents);\n\t\t\t\n\t\t\t//\tgo through each paragraph and find the line breaks\n\t\t\t//\t\twhen we're done we should have an array processed\n\t\t\t//\t\tparagraphs. Each paragraph should be an array of \n\t\t\t//\t\tlines.\n\t\t\t//echo \"the font it is selecting \" . $this->calculateFontFile() . '<br>';\n\t\t\t$this->pdf->selectFont($this->calculateFontFile());\n\t\t\t$lines = array();\n\t\t\t$lines2 = array();\n\t\t\t$lines[\"longest\"] = 0;\n\t\t\t$lines[\"width\"] = $this->width;\n\t\t\t$lines[\"textSize\"] = $this->textSize;\n\t\t\tif(strlen($this->contents) == 1)\n\t\t\t{\n\t\t\t\t$lines[\"longest\"] = $this->pdf->getTextWidth($this->textSize, $this->contents);\n\t\t\t\t$lines[\"length\"][] = $lines[\"longest\"];\n\t\t\t\t$lines[\"text\"][] = $this->contents;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twhile( list($parNum, $thisPar) = each($rawPars) )\n\t\t\t\t{\n\t\t\t\t\t//\tinit your data\n\n\t\t\t\t\t$len = strlen($thisPar);\n\t\t\t\t\t$last = $len - 1;\n\t\t\t\t\t$lastEnd = -1;\n\t\t\t\t\t$curStart = 0;\n\t\t\t\t\t$curLen = 0;\n\n\t\t\t\t\tif( strlen($thisPar) == 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$lines[\"text\"][] = \"\";\n\t\t\t\t\t\t$lines[\"length\"][] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor($i = 1; $i < $len; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//\tif we are at a breaking point.\n\t\t\t\t\t\t//\t\ta breaking point is either\n\t\t\t\t\t\t//\t\t\ta real char before a space or\n\t\t\t\t\t\t//\t\t\tthe last char in the string\n\n\t\t\t\t\t\tif( (($thisPar[$i] == \" \") && ($thisPar[$i - 1] != \" \")) || ($i == $last) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$word = substr($thisPar, $lastEnd + 1, ($i) - $lastEnd);\n\n\t\t\t\t\t\t\t$wordLen = ($this->pdf->getTextWidth($this->textSize, $word));\n\n\t\t\t\t\t\t\t//\tdid we find a line break yet\n\n\t\t\t\t\t\t\tif($i == $last)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( $curLen + $wordLen > $this->width )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $lastEnd - $curStart + 1);\n\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen;\n\t\t\t\t\t\t\t\t\tif($curLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $lastEnd + 1, $i - $lastEnd);\n\t\t\t\t\t\t\t\t\t$word = trim($word);\n\t\t\t\t\t\t\t\t\t$this->pdf->getTextWidth($this->textSize, $word);\n\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $wordLen;\n\t\t\t\t\t\t\t\t\tif($wordLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $wordLen;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $i - $curStart + 1);\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen + $wordLen;\n\t\t\t\t\t\t\t\t\tif($curLen + $wordLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen + $wordLen;\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 if( $curLen + $wordLen > $this->width )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $lastEnd - $curStart + 1);\n\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen;\n\t\t\t\t\t\t\t\tif($curLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen;\n\n\t\t\t\t\t\t\t\t$curLen = $wordLen;\n\t\t\t\t\t\t\t\t$curStart = $lastEnd + 1;\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$curLen += $wordLen;\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t$lastEnd = $i;\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\t$this->lines = $lines;\n\t\t\t//$this->pdf->selectFont(ZOOP_DIR . \"/pdf/fonts/Helvetica-Bold.afm\");\n\t\t\t//echo_r($lines);\n\t\t\t//echo 'font = ' . $this->textFont . ' bold = ' . ($this->bold ? 1 : 0) . ' italics = ' . ($this->italics ? 1 : 0) . ' size = ' . $this->textSize . ' ' . $this->bold . ' ' . $this->bold . '<br>';\n\t\t\t//echo 'true length = ' . $this->pdf->getTextWidth($this->textSize, 'asdfkla sdfklasdfjlkas;dfgj aslkfj alkw[sfjeoifjsa fi;awesfil;ifas efjilse;filaws eji iiiiiiiiiiiiiii') . '<br>';\n\t\t\treturn $this->lines;\n\t\t}\n\t}", "public static function getLeadZohoByPhone($phone)\n {\n $zoho = self::getZohoInstance();\n $zoho->setModule('Leads');\n $response = $zoho->searchRecords('(Phone:' . $phone . ')')->getRecords();\n foreach ($response as $lead) {\n return $lead;\n }\n }", "private function makeLines()\n\t{\n\t\t$line = 1;\n\t\t/** @var Token $token */\n\t\tforeach ($this->tokens as $token)\n\t\t{\n\t\t\t$token->line = $line;\n\t\t\tif (preg_match_all(\"/\\\\n/\", $token->text, $m))\n\t\t\t{\n\t\t\t\t$line += count($m[0]);\n\t\t\t}\n\t\t}\n\t}", "public function telephone()\n {\n return $this->hasOne('App\\Telephone', 'id_siswa');\n }", "public function getPhone()\n {\n $res = $this->getEntity()->getPhone();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getPhone();\n\t\t}\n return $res;\n }", "public function getRowData()\n {\n while(1)\n {\n if ($this->_file !== null)\n {\n if (feof($this->_file))\n {\n return false;\n }\n\n if (!$line = fgets($this->_file, $this->_maxLineLength))\n {\n return false;\n }\n }\n else\n {\n if (empty($this->_lines))\n {\n return false;\n }\n\n $line = array_shift($this->_lines);\n }\n\n if (preg_match('/\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.'\n . '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]'\n . '|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b/', $line, $matches))\n {\n $row = @geoip_record_by_name(trim($matches[0]));\n if ($row && !empty($row['country_code']))\n {\n return array(\n $row['country_code'],\n !empty($row['region']) ? $row['region'] : null,\n 1\n );\n }\n }\n }\n }", "function galaxy_spy($lines) {\n\tglobal $db, $user_data;\n\n\t$nb_spy_added = $phalanx = $gate = 0;\n\t$spy_added = array();\n\tfor ($i=0 ; $i<sizeof($lines) ; $i++) {\n\t\t$line = stripslashes($lines[$i]);\n\n\t\tif (preg_match(\"/Matières premières sur/\", $line)) {\n\t\t\t$phalanx = $gate = 0;\n\t\t\t$header = str_replace(\"Matières premières sur \", \"\", $line);\n\n\t\t\tlist($coordinates, $time) = explode(\"]\", $header);\n\t\t\tif (is_null($coordinates) || is_null($time)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$time = trim($time);\n\t\t\t$time = str_replace(\"le \", \"\", $time);\n\n\t\t\tlist($planet, $coordinates) = explode(\"[\", $coordinates);\n\t\t\tif (is_null($coordinates) || is_null($time)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$planet = trim($planet);\n\n\t\t\tlist($galaxy, $system, $row) = explode(\":\", $coordinates);\n\t\t\tif (intval($galaxy) < 1 || intval($galaxy) > 9 || intval($system) < 1 || intval($system) > 499 || intval($row) < 1 || intval($row) > 15) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlist($day, $hour) = explode(\" \", $time);\n\t\t\tif (is_null($day) || is_null($hour)) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlist($month, $day) = explode(\"-\", $day);\n\t\t\tif (intval($month) < 1 || intval($month) > 12 || intval($day) < 1 || intval($day) > 31) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!checkdate($month, $day, date(\"Y\"))) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlist($hour, $minute, $seconde) = explode(\":\", $hour);\n\t\t\tif (intval($hour) < 0 || intval($hour) > 23 || intval($minute) < 0 || intval($minute) > 59 || intval($seconde) < 0 || intval($seconde) > 59) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$timestamp = mktime($hour, $minute, $seconde, $month, $day);\n\t\t\t$report = \"\";\n\t\t}\n\n\t\tif (preg_match(\"#Phalange de capteur\\s+(\\d)#\", $line, $arr)) {\n\t\t\t$phalanx = $arr[1];\n\t\t}\n\t\tif (preg_match(\"#Porte de saut spatial\\s+(\\d)#\", $line, $arr)) {\n\t\t\t$gate = 1;\n\t\t}\n\t\tif (isset($report)) {\n\t\t\t$checking = false;\n//\t\t\t$report .= $line;\n\t\t\t$report .= str_replace('.','',$line); // pour les . dans les RE http://www.ogsteam.fr/forums/viewtopic.php?pid=27659#p27659\n\t\t\tif (preg_match(\"/Probabilité de destruction de la flotte d'espionnage/\", $line)) {\n\t\t\t\t//Vérification de la validité des données\n\t\t\t\tif (!check_var($galaxy, \"Num\") || !check_var($system, \"Num\") || !check_var($row, \"Num\") || !check_var($planet, \"Galaxy\") ||\n\t\t\t\t!check_var($timestamp, \"Num\") || !check_var($phalanx, \"Num\") || !check_var($report, \"Spyreport\")) {\n\t\t\t\t\tredirection(\"index.php?action=message&id_message=errordata&info\");\n\t\t\t\t}\n\n\t\t\t\t$coordinates = $galaxy.\":\".$system.\":\".$row;\n\t\t\t\tif (galaxy_add_spy($galaxy, $system, $row, $planet, $timestamp, $report, $phalanx, $gate)) {\n\t\t\t\t\t$spy_added[] = array(1, $coordinates, $timestamp);\n\t\t\t\t\t$nb_spy_added++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$spy_added[] = array(0, $coordinates, $timestamp);\n\t\t\t\t}\n\t\t\t\t$phalanx = $gate = 0;\n\t\t\t\tunset($report);\n\t\t\t}\n\t\t}\n\t}\n\tuser_set_stat(null, null, null, $nb_spy_added);\n\n\treturn $spy_added;\n}", "public function getContactsByPhone(string $phone)\n {\n return $this->doRequest('GET', \"contacts/{$phone}\", []);\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM tbl_journal_lines';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function getLines()\n {\n return isset($this->Lines) ? $this->Lines : null;\n }", "public function hasPhone() {\n return $this->_has(5);\n }", "public function getNonEOLChips(): array {\n $stmt = $this->pdo->query(str_replace('%TABLENAME%', $this->table, self::QUERIES['getNonEOLChips']));\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "private function _getGridLineModels()\n {\n $gridLineModels = new GridLineModel();\n return $gridLineModels\n ->bySectionId($this->getId())\n ->ordered('sort')\n ->withRelations(['*'])\n ->findAll();\n }", "public function getTelephoneLink(): ?array;", "public function lines($no)\n {\n $handle = $this->getHandle($no);\n\n $handles = $this->client\n ->Quotation_GetLines([\n 'quotationHandle' => $handle\n ])\n ->Quotation_GetLinesResult;\n\n return $this->client\n ->QuotationLine_GetDataArray([\n 'entityHandles' => $handles\n ])\n ->QuotationLine_GetDataArrayResult\n ->QuotationLineData;\n }", "private static function findMark(string $pattern, array $lines): array\n {\n $tail = array_reverse(array_slice($lines, -5, 5, true), true);\n foreach ($tail as $key => $line)\n {\n if (preg_match($pattern, $line, $matches)===1)\n {\n return [$key, $matches];\n }\n }\n\n return [null, null];\n }", "public function fetch_lines($only_product = 0)\n {\n // phpcs:enable\n \t//$result=$this->fetch_lines();\n \t$this->lines=array();\n\n \t$sql = \"SELECT l.rowid, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description, l.qty,\";\n \t$sql.= \" l.vat_src_code, l.tva_tx, l.remise_percent, l.subprice,\";\n \t$sql.= \" l.localtax1_tx, l. localtax2_tx, l.localtax1_type, l. localtax2_type, l.total_localtax1, l.total_localtax2,\";\n \t$sql.= \" l.total_ht, l.total_tva, l.total_ttc, l.special_code, l.fk_parent_line, l.rang,\";\n \t$sql.= \" p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc,\";\n \t$sql.= \" l.fk_unit,\";\n \t$sql.= \" l.date_start, l.date_end,\";\n \t$sql.= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc';\n \t$sql.= \" FROM \".MAIN_DB_PREFIX.\"commande_fournisseurdet\tas l\";\n \t$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';\n \t$sql.= \" WHERE l.fk_commande = \".$this->id;\n \tif ($only_product) $sql .= ' AND p.fk_product_type = 0';\n \t$sql.= \" ORDER BY l.rang, l.rowid\";\n \t//print $sql;\n\n \tdol_syslog(get_class($this).\"::fetch get lines\", LOG_DEBUG);\n \t$result = $this->db->query($sql);\n \tif ($result)\n \t{\n \t\t$num = $this->db->num_rows($result);\n \t\t$i = 0;\n\n \t\twhile ($i < $num)\n \t\t{\n \t\t\t$objp = $this->db->fetch_object($result);\n\n \t\t\t$line = new CommandeFournisseurLigne($this->db);\n\n \t\t\t$line->id = $objp->rowid;\n \t\t\t$line->desc = $objp->description;\n \t\t\t$line->description = $objp->description;\n \t\t\t$line->qty = $objp->qty;\n \t\t\t$line->tva_tx = $objp->tva_tx;\n \t\t\t$line->localtax1_tx\t\t = $objp->localtax1_tx;\n \t\t\t$line->localtax2_tx\t\t = $objp->localtax2_tx;\n \t\t\t$line->localtax1_type\t = $objp->localtax1_type;\n \t\t\t$line->localtax2_type\t = $objp->localtax2_type;\n \t\t\t$line->subprice = $objp->subprice;\n \t\t\t$line->pu_ht\t = $objp->subprice;\n \t\t\t$line->remise_percent = $objp->remise_percent;\n\n \t\t\t$line->vat_src_code = $objp->vat_src_code;\n \t\t\t$line->total_ht = $objp->total_ht;\n \t\t\t$line->total_tva = $objp->total_tva;\n \t\t\t$line->total_localtax1\t = $objp->total_localtax1;\n \t\t\t$line->total_localtax2\t = $objp->total_localtax2;\n \t\t\t$line->total_ttc = $objp->total_ttc;\n \t\t\t$line->product_type = $objp->product_type;\n\n \t\t\t$line->fk_product = $objp->fk_product;\n\n \t\t\t$line->libelle = $objp->product_label;\n \t\t\t$line->product_label = $objp->product_label;\n \t\t\t$line->product_desc = $objp->product_desc;\n\n \t\t\t$line->ref = $objp->product_ref; // Ref of product\n \t\t\t$line->product_ref = $objp->product_ref; // Ref of product\n \t\t\t$line->ref_fourn = $objp->ref_supplier; // The supplier ref of price when product was added. May have change since\n \t\t\t$line->ref_supplier = $objp->ref_supplier; // The supplier ref of price when product was added. May have change since\n\n \t\t\t$line->date_start = $this->db->jdate($objp->date_start);\n \t\t\t$line->date_end = $this->db->jdate($objp->date_end);\n \t\t\t$line->fk_unit = $objp->fk_unit;\n\n \t\t\t// Multicurrency\n \t\t\t$line->fk_multicurrency \t\t= $objp->fk_multicurrency;\n \t\t\t$line->multicurrency_code \t\t= $objp->multicurrency_code;\n \t\t\t$line->multicurrency_subprice \t= $objp->multicurrency_subprice;\n \t\t\t$line->multicurrency_total_ht \t= $objp->multicurrency_total_ht;\n \t\t\t$line->multicurrency_total_tva \t= $objp->multicurrency_total_tva;\n \t\t\t$line->multicurrency_total_ttc \t= $objp->multicurrency_total_ttc;\n\n \t\t\t$line->special_code = $objp->special_code;\n \t\t\t$line->fk_parent_line = $objp->fk_parent_line;\n\n \t\t\t$line->rang = $objp->rang;\n\n \t\t\t// Retreive all extrafield\n \t\t\t// fetch optionals attributes and labels\n \t\t\t$line->fetch_optionals();\n\n \t\t\t$this->lines[$i] = $line;\n\n \t\t\t$i++;\n \t\t}\n \t\t$this->db->free($result);\n\n \t\treturn $num;\n \t}\n \telse\n \t{\n \t\t$this->error=$this->db->error().\" sql=\".$sql;\n \t\treturn -1;\n \t}\n }", "public function parse(string $line): array\n {\n $inOutCall = [];\n $contactName = [];\n $contactPhone = [];\n $dateTime = [];\n $targetPhone = [];\n\n // Extract if sent or received sms.\n preg_match(\n LogParser::IN_OUT_REGEX,\n $line,\n $inOutCall,\n 0,\n LogParser::IN_OUT_OFFSET\n );\n\n // Extracts the target phone.\n $phoneOffset = (int) $inOutCall[0] === 1\n ? LogParser::PHONE_OFFSET_OUTGOING_CALL\n : LogParser::PHONE_OFFSET_INCOMING_CALL;\n\n preg_match(\n LogParser::PHONE_REGEX,\n $line,\n $targetPhone,\n PREG_OFFSET_CAPTURE,\n $phoneOffset\n );\n $targetPhone = (int) current(current($targetPhone));\n\n // Extracts the datetime.\n preg_match(\n LogParser::DATE_TIME_REGEX,\n $line,\n $dateTime,\n PREG_OFFSET_CAPTURE,\n LogParser::DATE_TIME_OFFSET\n );\n $dateTime = current(current($dateTime));\n\n // Returns the parsed metadata.\n $data = [\n 'communications' => [\n 'type' => 'sms',\n 'inOut' => (int) $inOutCall[0] === 1 ? 'received' : 'sent',\n 'phone' => $targetPhone,\n 'date' => $dateTime,\n ],\n ];\n\n return $data;\n }", "public function getPhones() {\n\t\treturn empty( $this->container['phones'] ) ? null : $this->container['phones'];\n\t}", "public function getCalloutLine() {}", "public static function getInfoConnectorsById($lineId)\n\t{\n\t\t$lineId = intval($lineId);\n\t\t$filter = array(\n\t\t\t'LINE_ID' => $lineId\n\t\t);\n\n\t\t$result = self::getInfoConnectors($filter);\n\n\t\treturn $result;\n\t}" ]
[ "0.6269974", "0.6269974", "0.60505646", "0.5903658", "0.5903658", "0.5785349", "0.5533597", "0.5504137", "0.54824954", "0.54587823", "0.52045757", "0.5190081", "0.5181238", "0.5130456", "0.5130456", "0.5129896", "0.5122584", "0.5112347", "0.5050118", "0.50242054", "0.5009137", "0.49959353", "0.49904755", "0.49824452", "0.496799", "0.49582285", "0.49530482", "0.49437153", "0.49267545", "0.49260283", "0.49222726", "0.4919326", "0.4898755", "0.4894887", "0.48669904", "0.48666775", "0.4865882", "0.48513865", "0.48261166", "0.48146254", "0.48115847", "0.480741", "0.48000842", "0.47863895", "0.47831178", "0.47812152", "0.47771665", "0.4770101", "0.4766712", "0.47518092", "0.47457013", "0.47427684", "0.47402474", "0.47332656", "0.47313175", "0.4725381", "0.47232777", "0.47199252", "0.47157317", "0.4715046", "0.47074068", "0.4701664", "0.4701072", "0.46938932", "0.46917447", "0.46875036", "0.46874654", "0.46867722", "0.46776828", "0.46729335", "0.46664363", "0.46647927", "0.46477297", "0.4634964", "0.4634964", "0.4634964", "0.4634964", "0.46299964", "0.46289933", "0.46140972", "0.46120197", "0.4608175", "0.46073228", "0.4600107", "0.4594457", "0.45627493", "0.45436522", "0.45390335", "0.4531047", "0.45267242", "0.452439", "0.45195416", "0.45139933", "0.45129016", "0.45038095", "0.449059", "0.44754383", "0.44754335", "0.44714868", "0.44645986", "0.446136" ]
0.0
-1
Because there can be multiple radiobuttons. The identifier is build out of the name and the value
public function getIdentifier() { return parent::getIdentifier() . '_' . parent::getValue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function radioCustomField(): string\n {\n $value = $this->getValue($this->index);\n foreach($this->options as &$option) {\n if($option['key'] == $value) {\n $option['checked'] = true;\n break;\n }\n }\n\n return Template::build($this->getTemplatePath('radio.html'), [\n 'id' => uniqid(\"{$this->id}-\", true),\n 'name' => $this->id,\n 'label' => $this->label,\n 'options' => $this->options,\n 'index' => isset($this->index) ? $this->index : false\n ]);\n }", "function sb_slideshow_radio( $value, $key, $name, $checked = '' ) {\n\treturn '<input type=\"radio\" name=\"sb_' . esc_attr( $name ) . '\" id=\"' . esc_attr( $name . '_' . $value ) . '\"\n\t\tvalue=\"' . esc_attr( $value ) . '\"' . ($value == $checked ? 'checked=\"checked\"' : '') . ' />\n\t\t<label for=\"' . esc_attr( $name . '_' . $value ) . '\">' . $key . '</label><br />';\n}", "function option_radiobutton($label, $name, $value='', $keys, $comment='') {\r\n\t\techo \"<tr valign='top'><th scope='row'>\" . $label . \"</th>\";\r\n\t\techo \"<td>\";\r\n\r\n\t\tforeach ((array)$keys as $key => $description) {\r\n\t\t\tif ($key == $value)\r\n\t\t\t\t$checked = \"checked\";\r\n\t\t\telse\r\n\t\t\t\t$checked = \"\";\r\n\t\t\techo \"<input type='radio' id='$name' name='$name' value='\" . htmlentities($key, ENT_QUOTES, 'UTF-8') . \"' $checked />\" . $description . \"<br>\";\r\n\t\t}\r\n\t\techo $comment . \"<br>\";\r\n\t\techo \"</td></tr>\";\r\n\t}", "public function getRadioInput($key)\n\t{\n\t\t$control = parent::getControl();\n\t\t$id = $control->id;\n\t\t$value = $this->value === NULL ? NULL : (string) $this->getValue();\n\t\t$control->id = $id . '-' . $key;\n\t\t$control->checked = (string) $key == $value;\n\t\t$control->value = $key;\n\t\treturn $control;\n\t}", "function create_radio($values = array('16', '24'), $name = 'pace') {\n\n\t// Start the element:\n\tforeach ($values as $value) {\n\t\techo '<input type=\"radio\" name=\"' . $name .'\" value=\"' . $value . '\"';\n\n\t\t// Check for stickiness:\n\t\tif (isset($_POST[$name]) && ($_POST[$name] == $value)) {\n\t\t\techo ' checked=\"checked\"';\n\t\t}\n\n\t// Complete the element:\n\techo \"> $value hrs/week \";\n\t} // End of foreach loop.\n\n}", "public function generate($name, $value, $attributes = array()) {\r\n\t\t$this->init($name, $value, $attributes);\r\n\t\t\r\n\t\t$vmode = false;\r\n\t\tif(isset($this->attributes['vmode'])){\r\n\t\t\t$vmode = $this->attributes['vmode'];\r\n\t\t\tunset($this->attributes['vmode']);\r\n\t\t}\r\n\r\n\t\t$attTmp = array();\r\n\t\t$attTmp['name'] = $name;\r\n\t\t$attTmp['type'] = 'radio';\r\n\t\t\r\n\t\tif(isset($this->attributes['disabled']) && $this->attributes['disabled']){\r\n\t\t\t$attTmp['disabled'] = 'disabled';\t\r\n\t\t}\r\n\t\t// @TODO this not work corectlly in IE\r\n\t\tif(isset($this->attributes['readonly']) && $this->attributes['readonly']){\r\n\t\t\t$attTmp['onclick'] = 'return false';\r\n\t\t}\r\n\r\n\t\t$tmp = '';\r\n\t\t$check = false;\r\n\t\tforeach ($this->data as $val => $txt){\r\n\t\t $attTmp['id'] = uniqid();\r\n\t\t\t$attTmp['value'] = $val;\r\n\t\t\t\r\n\t\t\tif($value == $val || (!$value && !$check)){\r\n\t\t\t\t$attTmp['checked'] = 'checked';\r\n\t\t\t\t$check = true;\r\n\t\t\t}\r\n\t\t\t$tmp .= BASIC_GENERATOR::init()->element('div', 'style='.(!$vmode ? '' : '').'|class=radioBox_Item',//float:left|\r\n\t\t\t\tBASIC_GENERATOR::init()->createCloseTag('input', $attTmp).' <label for=\"'.$attTmp['id'].'\" class=\"radioBox_label\">'.$txt.'</label>'\r\n\t\t\t);\r\n\t\t\tunset($attTmp['checked']);\r\n\t\t}\r\n\t\t$this->attributes = BASIC_GENERATOR::init()->convertStringAtt($this->attributes);\r\n\t\tif(isset($this->attributes['id'])){\r\n\t\t\t$name = $this->attributes['id'];\r\n\t\t}\r\n\t\tif(isset($this->attributes['class'])){\r\n\t\t\t$this->attributes['class'] .= ' radioBox '.$name;\r\n\t\t}else{\r\n\t\t\t$this->attributes['class'] = 'radioBox '.$name;\r\n\t\t}\r\n\t\treturn BASIC_GENERATOR::init()->element('div', $this->attributes, $tmp);\r\n\t}", "function radio($name='',$value='',$id='',$attrib='',$rows=''){\n\t\t$n = ''; \n\t\t$brekz = 0;\n\t\t$fldname = str_replace(' ', '_', $name);\n\t\t$radio = '<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>';\n\t\tif(isset($_SESSION[$fldname])) $n = $_SESSION[$fldname];\n\t\tif(isset($_POST[$fldname])) $n = $_POST[$fldname]; \n\t\tif(empty($rows)){\n\t\t\t$rows = 4;\n\t\t}\n\t\tforeach($value as $radVal){\n\t\t\t$cndtn = ($n == $radVal)? 'checked=\"checked\"' : '';\n\t\t\tif($brekz == $rows) {\n\t\t\t\t$radio .= '</tr><tr>';\n\t\t\t\t$brekz = 0; \n\t\t\t}\n\t\t\t$radio .= '<td><input type=\"radio\" name=\"'.$fldname.'\" value=\"'.$radVal.'\" '.$cndtn.' id=\"'.$id.'\" '.$attrib.'>'.'<span style=\"font-weight:normal; color:#000;\">'.$radVal.'</span></td>'.\"\\n\";\n\t\t\t$brekz++;\n\t\t}\n\t\t$radio .= \"</tr></table>\";\n\t\techo $radio;\n\t}", "function form_radio($name, $value, $start='', $extra='', $array='', $id='') {\n\n\t$value = html_form_escape($value, $override);\n\n\tif ($array != \"\") {\n\t\t$name = $array . \"[\" . $name . \"]\";\n\t}\n\n\tif (!$id) {\n\t\t$id = $name;\n\t}\n\n\tif ($start) {\n\t\treturn \"<input type=\\\"radio\\\" name=\\\"$name\\\" id=\\\"$id\\\" value=\\\"$value\\\" checked=\\\"checked\\\" $extra />\";\n\t} else {\n\t\treturn \"<input type=\\\"radio\\\" name=\\\"$name\\\" id=\\\"$id\\\" value=\\\"$value\\\" $extra />\";\n\t}\n}", "function acf_get_radio_input($attrs = array())\n{\n}", "function createRadios($hiddenName, $outerIndex)\n{\n\t// Loop through and generate all radio buttons, giving unique names \n\tfor($i = 1; $i <= 4; $i++)\n\t{\n\t\t$id = \"radio\" . $outerIndex . $i;\n\t\t$name = \"radio\" . $outerIndex;\n\t\t\n\t\tif(isset($_REQUEST[$name]))\n\t\t\t$currentSelected = $_REQUEST[$name];\n\t\telse\n\t\t\t$currentSelected = \"\";\n\t\t\n\t\techo \"<p>\\n\";\n\t\t$checked = (strcmp($currentSelected, $id) == 0) ? \"checked\" : \"\";\n\t\techo \"<input type=\\\"radio\\\" id=\\\"$id\\\" name=\\\"$name\\\" value=\\\"$id\\\" $checked>\\n\";\n\t\t\n\t\tif($i == 1)\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/egypt.jpg\\\"/>\\n\";\n\t\telse if($i == 2)\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/disney.jpg\\\"/>\\n\";\n\t\telse if($i == 3)\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/theater_masks.jpg\\\"/>\\n\";\n\t\telse\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/wookie.jpg\\\"/>\\n\";\n\t\t\n\t\techo \"</p>\\n\";\n\t}\n}", "function mk_radio( $myTitle, $myName, $myValue, $myChek1, $myChek2, $myDesc1, $myDesc2 ){\n\t#initialize needed variables\n\t$str = $chekd1 = $chekd2 = '';\n\n\tif ($myValue == $myChek1) { $chekd1 = \"checked='checked'\"; }else{$chekd2 = \"checked='checked'\";}\n\n\t$str .= '<div class=\"row hoverHighlight\">\n\t\t\t<div class=\"col-sm-3 text-right text-muted\">\n\t\t\t\t<p class=\"text-right\">\n\t\t\t\t\t<strong>' . ucwords($myTitle) . ': </strong>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<div class=\"col-sm-9\">\n\t\t\t\t<p>';\n\t\t\t\t$str .= \"<label>\n\t\t\t\t\t<input type='radio' value='{$myChek1}' name='{$myName}' {$chekd1}> &nbsp; {$myDesc1} &nbsp; &nbsp; </label>\n\t\t\t\t\t<input type='radio' value='{$myChek2}' name='{$myName}' {$chekd2}> &nbsp; {$myDesc2} </label>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\";\n\n\treturn $str;\n}", "function zen_draw_radio_field($name, $value = '', $checked = false, $parameters = '') {\n return zen_draw_selection_field($name, 'radio', $value, $checked, $parameters);\n }", "public function callback_radio( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n $html = '<fieldset>';\n\n foreach ( $args['options'] as $key => $label ) {\n $html .= sprintf( '<label for=\"wpuf-%1$s[%2$s]\">', $name_id, $key );\n $html .= sprintf( '<input type=\"radio\" class=\"radio\" id=\"wpuf-%1$s[%2$s]\" name=\"%1$s\" value=\"%2$s\" %3$s %4$s/>', $name_id, $key, checked( $value, $key, false ), $disable );\n $html .= sprintf( '%1$s</label><br>', $label );\n }\n\n $html .= $this->get_field_description( $args );\n $html .= '</fieldset>';\n\n echo $html;\n }", "function radioButtonList($name,$values,$labels,$selected=\"\",$ids)\n\t{\n\t\t$name = $name;\n\n\t\t$str = '<div class=\"radioButton-list\" >';\n\n\t\tfor($i = 0; $i < sizeof($values); $i++){\n\t\t\tif($values[$i] == $selected){\n\t\t\t\t$str .= FormComponent::radioButton($name, $values[$i], $values[$i], $ids[$i], $labels[$i]);\n\t\t\t}else{\n\t\t\t\t$str .= FormComponent::radioButton($name, $values[$i], \"\", $ids[$i], $labels[$i]);\n\t\t\t}\n\t\t}\n\n\t\t$str .= '</div>';\n\n\t\treturn $str;\n\t}", "function we_getInputRadioField($name, $value, $itsValue, $atts){\n\t$atts['type'] = 'radio';\n\t$atts['name'] = $name;\n\t$atts['value'] = oldHtmlspecialchars($itsValue, -1, 'ISO-8859-1', false);\n\tif($value == $itsValue){\n\t\t$atts['checked'] = 'checked';\n\t}\n\treturn getHtmlTag('input', $atts);\n}", "function radio( $args ) {\n $current = Premium_Posts::get_settings( $args['key'] ) ? Premium_Posts::get_settings( $args['key'] ) : $args['default'];\n foreach( $args['options'] as $value => $label ) {\n printf(\n '<input type=\"radio\" name=\"%1$s\" value=\"%2$s\" %3$s /> %4$s<br />',\n esc_attr( $args['id'] ),\n esc_attr( $value ),\n $checked = checked( $current, $value, $echo = false ),\n esc_attr( $label )\n );\n }\n }", "function radio( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null,\n\t $options = array(),\n\t $datatype = Form::DATA_STRING\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_RADIO,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t $options,\n\t $datatype\n );\n\t}", "function minorite_radios($variables) {\n $element = $variables['element'];\n $attributes = array();\n if (isset($element['#id'])) {\n $attributes['id'] = $element['#id'];\n }\n\n return '<span class=\"form-frame form-input-group\">' . $element['#children'] . '</span>';\n}", "function radio($item, $default_value, $key, $value) {\n\n\t\t$checked = (check_plain($default_value) == $key) ? ' checked=\"checked\" ' : ' ';\n\n\t\t$retval ='<input type=\"radio\" '\n\t\t\t. 'name=\"' . $item['#name'] .'\" '\n\t\t\t. 'value=\"'. $key .'\" '\n\t\t\t. \"class=\\\"reg-level-radio\\\" \"\n\t\t\t. $checked\n\t\t\t. \" />\"\n\t\t\t;\n\n\t\tif (!is_null($item['#title'])) {\n\t\t\t$retval = \"<label class=\\\"option reg-level\\\">\" . $retval . \" \" . $value \n\t\t\t\t. \"</label><br><br>\\n\";\n\t\t}\n\n\t\treturn($retval);\n\n\t}", "public static function renderRadio();", "function addRadio ($name, $value, $checked = NULL, $id = NULL, $class = NULL, $attributes = array ())\n\t{\n\n\t\t$id = (empty($id) ? ' id=\"' . $name . '\"' : ' id=\"' . $id . '\"');\n\t\t$class = (empty($class) ? '' : ' class=\"' . $class . '\"');\n\n\t\t$html = \"<input type=\\\"radio\\\" name=\\\"\" . $name . '\"' . $id . $class . ' value=\"' . $value . '\"' . \"\";\n\n\t\tif (is_bool($checked)) {\n\t\t\tif ($checked === TRUE) {\n\t\t\t\t$html .= \" checked=\\\"checked\\\"\";\n\t\t\t}\n\t\t}\n\n\t\tif ($attributes) {\n\t\t\t$html .= $this -> addAttributes($attributes);\n\t\t}\n\t\t$html .= ' >';\n\n\t\treturn $html;\n\t}", "function tep_mod_select_option($select_array, $key_name, $key_value) {\n reset($select_array);\n while (list($key, $value) = each($select_array)) {\n if (is_int($key)) $key = $value;\n $string .= '<br><input type=\"radio\" name=\"configuration[' . $key_name . ']\" value=\"' . $key . '\"';\n if ($key_value == $key) $string .= ' CHECKED';\n $string .= '> ' . $value;\n }\n\n return $string;\n}", "function radioButtonChecked($chkName){\n\t\t$radioButtonString = '';\n\t\t$chkText = '';\n\t\tif ( $_GET[$chkName->name] == $chkName->value){\n\t\t\t\t$chkText = 'checked';\n\t\t}\n\t\t\t $radioButtonString = $radioButtonString . '<input ' .$chkText. ' ' .$chkName->status.' type=\"radio\" id =\"' .$chkName->value. '\" value=\"' .$chkName->value. '\" name=\"' .$chkName->name. '\" class=\"' .$chkName->class. '\">' .$chkName->label. ' ';\n\t\t\n\t\treturn $radioButtonString;\n\t}", "function radioButtonHtml($groupName, $buttonValue, $displayValue, $isChecked) {\n $checked = $isChecked ? ' checked' : '';\n $html = \"<input type='radio' name='$groupName' value='$buttonValue'$checked>\";\n return $html . $displayValue . '<br>';\n}", "private function _output_options_radios($arr, $name) {\n\t\t$output = '';\n\t\tforeach ($arr as $val => $opt) :\n\t\t\t$slug = $this->_make_slug($opt);\n\t\t\t$output .= '\n\t\t\t\t\t\t<input type=\"radio\" name=\"' . $name . '[]\" value=\"' . $val . '\" id=\"' . $slug . '\"';\n\t\t\t$output .= $this->form['markup'] === 'xhtml' ? ' />' : '>';\n\t\t\t$output .= '\n\t\t\t\t\t\t<label for=\"' . $slug . '\">' . $opt . '</label>';\n\t\tendforeach;\n\t\treturn $output;\n\t}", "function toHtml()\n {\n $arr_return = parent::toHtml();\n $arr_return['html'] = '';\n $arr_radios = array();\n $arr_radios = $this->getAttribute('radios');\n $checked = $this->getAttribute('checked');\n $id = $this->getAttribute('id');\n if (is_array($arr_radios))\n {\n foreach ($arr_radios as $key => $value)\n {\n $encode_key = str_replace(' ', '_', $key);\n \n $arr_return['html'] .= '<input {attr_name=attr_value} {extra_attr} id=\"'\n .\"${id}_$encode_key\".'\" value=\"'.$key.'\"';\n $arr_return['html'] .= ($key == $checked)? ' checked' : '';\n $arr_return['html'] .= '%id|checked|radios|separator% />';\n $arr_return['html'] .= ($value != '')? \n '<label for=\"{attr_id}_'.$encode_key.'\">'.$value.'</label>' : '';\n $arr_return['html'] .= $this->arr_attr['separator'].\"\\n\";\n }\n }\n return $arr_return;\n }", "function minorite_radio($variables) {\n $element = $variables['element'];\n $element['#attributes']['type'] = 'radio';\n element_set_attributes($element, array('id', 'name', '#return_value' => 'value'));\n\n if (isset($element['#return_value']) && $element['#value'] !== FALSE && $element['#value'] == $element['#return_value']) {\n $element['#attributes']['checked'] = 'checked';\n }\n _form_set_class($element, array('form-custom-radio'));\n\n drupal_add_js(\"\n jQuery('.form-custom-radio').iCheck({\n checkboxClass: 'icheckbox_square-blue',\n radioClass: 'iradio_square-blue',\n increaseArea: '20%' // optional\n });\", array('type' => 'inline', 'scope' => 'footer', 'group' => JS_THEME));\n\n return '<label for=\"' . $element['#id'] . '\"><input' . drupal_attributes($element['#attributes']) . '><span>' . $element['#title'] . '</span></label>';\n}", "function radio( $element )\n\t\t{\t\n\t\t\t$output = \"\";\n\t\t\t$counter = 1;\n\t\t\tforeach($element['buttons'] as $radiobutton)\n\t\t\t{\t\n\t\t\t\t$checked = \"\";\n\t\t\t\tif( $element['std'] == $counter ) { $checked = 'checked = \"checked\"'; }\n\t\t\t\t\n\t\t\t\t$output .= '<span class=\"ace_radio_wrap\">';\n\t\t\t\t$output .= '<input '.$checked.' type=\"radio\" class=\"'.$element['class'].'\" ';\n\t\t\t\t$output .= 'value=\"'.$counter.'\" id=\"'.$element['id'].$counter.'\" name=\"'.$element['id'].'\"/>';\n\t\t\t\t\n\t\t\t\t$output .= '<label for=\"'.$element['id'].$counter.'\">'.$radiobutton.'</label>';\n\t\t\t\t$output .= '</span>';\n\t\t\t\t\n\t\t\t\t$counter++;\n\t\t\t}\t\n\t\t\t\t\n\t\t\treturn $output;\n\t\t}", "static public function radio($name = '', $options = array(), $checked = '', $attrib = '')\n {\n $options = (array)($options);\n if(!is_array($options) or empty($options)) return false;\n\n $string = '';\n foreach($options as $key => $value)\n {\n $string .= \"<input type='radio' name='$name' value='$key' \";\n $string .= ($key == $checked) ? \" checked ='checked'\" : \"\";\n $string .= $attrib;\n $string .= \" /> $value\\n\";\n }\n return $string;\n }", "function tep_mod_select_option($select_array, $key_name, $key_value) {\n foreach ( $select_array as $key => $value ) {\n if (is_int($key)) $key = $value;\n $string .= '<br /><input type=\"radio\" name=\"configuration[' . $key_name . ']\" value=\"' . $key . '\"';\n if ($key_value == $key) $string .= ' checked=\"checked\"';\n $string .= ' /> ' . $value;\n }\n\n return $string;\n }", "function acf_radio_input($attrs = array())\n{\n}", "public static function radioButton($name,$value,$selected=\"\",$id=\"\",$label=\"\",$class=\"\")\n\t{\n\t\tif(strlen(trim($id))){\n\t\t\t$id_html = ' id=\"'.$id.'\" ';\n\t\t}else{\n\t\t\t$id_html = ' ';\n\t\t}\n\n\t\tif($value == $selected){\n\t\t\t$selected_html = ' checked=\"checked\" ';\n\t\t}else{\n\t\t\t$selected_html = ' ';\n\t\t}\n\t\tob_start(); ?>\n\t\t\t<div class=\"radio <?php echo $class; ?>\">\n\t\t\t\t<label for=\"<?php echo $id; ?>\">\n\t\t\t\t\t<input type=\"radio\" id=\"<?php echo $id; ?>\" name=\"<?php echo $name; ?>\" value=\"<?php echo $value; ?>\" <?php echo $selected_html; ?> />\n\t\t\t\t\t<span class=\"cr\"><i class=\"cr-icon fa fa-circle\"></i></span>\n\t\t\t\t\t<?php echo $label; ?>\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t<?php\n\t\treturn ob_get_clean();\n\t}", "public static function radio($name='', $value='', $label_text='', $attributes='') {\n\t\t\t$output = HtmlHelper::label_open();\n\t\t\t$output .= HtmlHelper::input_radio($name, $value, $attributes);\n\t\t\t$output .= ' ' . $label_text;\n\t\t\t$output .= HtmlHelper::label_close();\n\t\t\treturn $output;\n\t\t}", "public function getRadioLabel($key)\n\t{\n\t\t$label = Html::el('label');\n\t\t$control = parent::getControl();\n\t\t$id = $control->id;\n\t\t$label->for = $id . '-' . $key;\n\t\t$label->setHtml($this->items[$key]);\n\t\treturn $label;\n\t}", "public function radio($name, $value = NULL, $checked = FALSE, array $attributes = NULL) {\n $this->load_values($name, $value, $attributes);\n $result = '<li>'.Kohana_Form::radio($name, $value, $checked, $attributes);\n // add error span\n if (isset($this->errors[$name])) {\n $result .= '<span class=\"error\">'.ucfirst($this->errors[$name]).'</span>';\n } else if (isset($attributes['info'])) {\n // else add info span\n $result .= '<span class=\"info\">'.$attributes['info'].'</span>';\n }\n if (isset($attributes['label'])) {\n $result .= ' '.$attributes['label'];\n }\n $result .= '</li>';\n return $result;\n\t}", "public function getRadioSelector( $key, $item )\n {\n return '#field-' . $this->formId . '-' . $key . '-' . $item;\n }", "function radio_button($object, $field, $tag_value, $options = array()) {\n $form = new FormHelper($object, $field);\n return $form->to_radio_button_tag($tag_value, $options);\n}", "protected static function radio()\n {\n }", "function _field_radio($fval) \n {\n $res = \"<div class=\\\"formexRadio\\\">\\n\";\n\n $opts = $this->opts; # $this->_array_stringify($this->opts);\n foreach ($opts as $k => $v) {\n $res .= \"<div class=\\\"formexRadioItem\\\">\\n\";\n $btn = sprintf(\"<input type=\\\"radio\\\" value=\\\"%s\\\" name=\\\"%s\\\" id=\\\"%s\\\" class=\\\"%s\\\" %s %s />\",\n $k,\n $this->fname,\n $this->fname,\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n ($fval !== \"\" && $fval == $k)? \"checked=\\\"1\\\"\" : \"\",\n $this->extra_attribs);\n\n $label = sprintf(\"<label class=\\\"%s\\\">%s\",\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n $v);\n\n $res .= $label . $btn . '</label>';\n $res .= \"</div>\";\n }\n $res .= \"</div>\";\n return $res;\n }", "function form_radio_yn($name, $array='', $yes='0', $empty='0', $extra='', $value_y = 1, $value_n = 0) {\n\n\tif ($array) {\n\t\t$name = $array . \"[\" . $name . \"]\";\n\t}\n\n\t$id = 'radio_yn' . $name . $array;\n\n\t$html = \"<div style=\\\"white-space: nowrap;\\\">\";\n\n\tif ($empty) {\n\t\tif ($yes == \"1\") {\n\t\t\t$html .= \"<label for=\\\"either_$id\\\">Either:</label> <input id=\\\"either_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"xxxNULLxxx\\\" $extra>\\n\";\n\t\t\t$html .= \"<label for=\\\"yes_$id\\\">Yes:</label> <input id=\\\"yes_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_y\\\" checked=\\\"checked\\\" $extra />\\n\";\n\t\t\t$html .= \"<label for=\\\"no_$id\\\">No:</label> <input id=\\\"no_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_n\\\" $extra />\\n\";\n\t\t} elseif ($yes == \"0\") {\n\t\t\t$html .= \"<label for=\\\"either_$id\\\">Either:</label> <input id=\\\"either_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"xxxNULLxxx\\\" $extra>\\n\";\n\t\t\t$html .= \"<label for=\\\"yes_$id\\\">Yes:</label> <input id=\\\"yes_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_y\\\" $extra />\\n\";\n\t\t\t$html .= \"<label for=\\\"no_$id\\\">No:</label> <input id=\\\"no_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_n\\\" checked=\\\"checked\\\" $extra />\\n\";\n\t\t} else {\n\t\t\t$html .= \"<label for=\\\"either_$id\\\">Either:</label> <input id=\\\"either_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"xxxNULLxxx\\\" checked=\\\"checked\\\" $extra>\\n\";\n\t\t\t$html .= \"<label for=\\\"yes_$id\\\">Yes:</label> <input id=\\\"yes_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_y\\\" $extra />\\n\";\n\t\t\t$html .= \"<label for=\\\"no_$id\\\">No:</label> <input id=\\\"no_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_n\\\" $extra />\\n\";\n\t\t}\n\t} else {\n\t\tif ($yes) {\n\t\t\t$html .= \"<label for=\\\"yes_$id\\\">Yes:</label> <input id=\\\"yes_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_y\\\" checked=\\\"checked\\\" $extra />\\n\";\n\t\t\t$html .= \"<label for=\\\"no_$id\\\">No:</label> <input id=\\\"no_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_n\\\" $extra />\\n\";\n\t\t} else {\n\t\t\t$html .= \"<label for=\\\"yes_$id\\\">Yes:</label> <input id=\\\"yes_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_y\\\" $extra />\\n\";\n\t\t\t$html .= \"<label for=\\\"no_$id\\\">No:</label> <input id=\\\"no_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_n\\\" checked=\\\"checked\\\" $extra />\\n\";\n\t\t}\n\t}\n\n\t$html .= \"</div>\";\n\n\treturn $html;\n}", "function input_radiocheck($type, $element_name, $values, $element_value) {\r\n print '<input type=\"' . $type . '\" name=\"' . $element_name .'\"id=\"'.$element_name.'\" value=\"' . $element_value . '\" ';\r\n if ($element_value == $values[$element_name]) {\r\n print ' checked=\"checked\"';\r\n }\r\n print '/>';\r\n}", "function UpdateRadioFields(){\n $_tabs = array_keys($this->form_fields);\n foreach ($_tabs as $_tab) {\n $sizeof = sizeof($this->form_fields[$_tab]);\n for ($j = 0; $j < $sizeof; $j ++) {\n if ($this->form_fields[$_tab][$j][\"control\"] == \"checkbox\") {\n $valueOn = $this->form_fields[$_tab][$j][\"checkOn\"];\n $valueOff = $this->form_fields[$_tab][$j][\"checkOff\"];\n $isRadio = $this->form_fields[$_tab][$j][\"is_radio\"];\n if ($isRadio) {\n if ($this->_data[$this->form_fields[$_tab][$j][\"field_name\"]] == $valueOn) {\n $this->Storage->GroupUpdate($this->custom_var, array(\n $this->custom_val), array(\n $this->form_fields[$_tab][$j][\"field_name\"] => $valueOff));\n }\n }\n }\n }\n } // foreach\n }", "function miradio($name, $opts, $form = array()) {\n\t$output = \"\";\n\tforeach ($opts as $key => $content) {\n\t\tif (isset($form[$name]) && $form[$name] == $key) {\n\t\t\t// this is the default\n\t\t\t$checked = \"checked=\\\"checked\\\" \";\n\t\t} else {\n\t\t\t$checked = \"\";\n\t\t}\n\t\tif (empty($output)) { // first row\n\t\t\t$output .= \"<input type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$key\\\" $checked/>$content [{\" . $name . \"_MOD}]<br />\";\n\t\t} else {\n\t\t\t$output .= \"<input type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$key\\\" $checked/>$content<br />\";\n\t\t}\n\t}\n\n\treturn $output;\n}", "function form_radio_group($field, $options) {\n\n}", "function ffw_port_radio_callback( $args ) {\n global $ffw_port_settings;\n\n foreach ( $args['options'] as $key => $option ) :\n $checked = false;\n\n if ( isset( $ffw_port_settings[ $args['id'] ] ) && $ffw_port_settings[ $args['id'] ] == $key )\n $checked = true;\n elseif( isset( $args['std'] ) && $args['std'] == $key && ! isset( $ffw_port_settings[ $args['id'] ] ) )\n $checked = true;\n\n echo '<input name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . '][' . $key . ']\" type=\"radio\" value=\"' . $key . '\" ' . checked(true, $checked, false) . '/>&nbsp;';\n echo '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . '][' . $key . ']\">' . $option . '</label><br/>';\n endforeach;\n\n echo '<p class=\"description\">' . $args['desc'] . '</p>';\n}", "public function renderRadio(): string\n\t{\n\t\t$gateUrl = $this->config->gateUrl;\n\t\t$queryArgs = [\n\t\t\t'merchantId' => $this->config->merchantId,\n\t\t\t'accountId' => $this->config->accountId,\n\t\t\t'name' => $this->name,\n\t\t\t'value' => $this->value,\n\t\t\t'showIcon' => $this->showIcon,\n\t\t\t'selected' => $this->isTpMethodChosen() ? (int) $_REQUEST['tp_radio_value'] : '',\n\t\t];\n\t\t// Currency is an optional argument. For compatibility reasons, it is\n\t\t// not present in the query at all if its value is empty.\n\t\tif ($this->currency) {\n\t\t\t$queryArgs['currency'] = $this->currency;\n\t\t}\n\n\t\t$queryArgs['signature'] = $this->createSignature($queryArgs);\n\n\t\t$queryArgs = http_build_query($queryArgs);\n\t\t$thepayGateUrl = \"{$gateUrl}radiobuttons/index.php?{$queryArgs}\";\n\t\t$thepayGateUrl = Escaper::jsonEncode($thepayGateUrl);\n\n\t\t$href = \"{$gateUrl}radiobuttons/style/radiobuttons.css?v=\" . time();\n\t\t$out = \"<link href=\\\"{$href}\\\" type=\\\"text/css\\\" rel=\\\"stylesheet\\\" />\\n\";\n\t\t$out .= \"<script type=\\\"text/javascript\\\">\\n\";\n\t\t$out .= \"\\tvar thepayGateUrl = {$thepayGateUrl};\\n\";\n\n\t\tif ($this->appendCode) {\n\t\t\t$thepayAppendCode = Escaper::jsonEncode($this->appendCode);\n\t\t\t$out .= \"\\tvar thepayAppendCode = {$thepayAppendCode};\\n\";\n\t\t}\n\n\t\t$out .= \"</script>\\n\";\n\n\t\t$src = \"{$gateUrl}radiobuttons/js/jquery.js?v=\" . time();\n\t\t$out .= \"<script type=\\\"text/javascript\\\" src=\\\"{$src}\\\" async=\\\"async\\\"></script>\\n\";\n\n\t\t$src = \"{$gateUrl}radiobuttons/js/radiobuttons.js?v=\" . time();\n\t\t$out .= \"<script type=\\\"text/javascript\\\" src=\\\"{$src}\\\" async=\\\"async\\\"></script>\\n\";\n\n\t\t$out .= \"<div id=\\\"thepay-method-box\\\"></div>\\n\";\n\n\t\treturn $out;\n\t}", "public function getDomObject()\n\t\t{\n\t\t\t$fieldset = new \\System\\XML\\DomObject( 'fieldset' );\n\t\t\t$fieldset->setAttribute( 'id', $this->getHTMLControlId() );\n//\t\t\t$fieldset->setAttribute( 'class', ' radiobuttonlist' );\n\n\t\t\tif( !$this->visible )\n\t\t\t{\n\t\t\t\t$fieldset->setAttribute( 'style', 'display:none;' );\n\t\t\t}\n\n\t\t\tfor( $i = 0, $count = $this->items->count; $i < $count; $i++ )\n\t\t\t{\n\t\t\t\t$input = $this->createDomObject( 'input' );\n\t\t\t\t$input->setAttribute( 'id', $this->getHTMLControlId() . '__' . $i );\n//\t\t\t\t$input->setAttribute( 'class', 'radiobuttonlist_input' );\n\t\t\t\t$input->setAttribute( 'value', $this->items->itemAt( $i ));\n\t\t\t\t$input->setAttribute( 'title', $this->tooltip );\n\n\t\t\t\tif( $this->submitted && !$this->validate() )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'class', 'invalid' );\n\t\t\t\t}\n\n\t\t\t\tif( $this->autoPostBack )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'onclick', 'Rum.id(\\''.$this->getParentByType('\\System\\Web\\WebControls\\Form')->getHTMLControlId().'\\').submit();' );\n\t\t\t\t}\n\n\t\t\t\tif( $this->ajaxPostBack )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'onclick', 'Rum.evalAsync(\\'' . $this->ajaxCallback . '\\',\\''.$this->getHTMLControlId().'=\\'+encodeURIComponent(this.value)+\\'&'.$this->getRequestData().'\\',\\'POST\\','.\\addslashes($this->ajaxStartHandler).','.\\addslashes($this->ajaxCompletionHandler).');' );\n\t\t\t\t}\n\n\t\t\t\tif( $this->readonly )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'readonly', 'readonly' );\n\t\t\t\t}\n\n\t\t\t\tif( $this->disabled )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'disabled', 'disabled' );\n\t\t\t\t}\n\n\t\t\t\tif( $this->multiple )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'type', 'checkbox' );\n\t\t\t\t\t$input->setAttribute( 'name', $this->getHTMLControlId() .'[]' );\n\n\t\t\t\t\tif( in_array( $this->items->itemAt( $i ), $this->value, false ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$input->setAttribute( 'checked', 'checked' );\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$input->setAttribute( 'type', 'radio' );\n\t\t\t\t\t$input->setAttribute( 'name', $this->getHTMLControlId() );\n\n\t\t\t\t\tif( $this->value === $this->items->itemAt( $i ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$input->setAttribute( 'checked', 'checked' );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$input->setAttribute( 'onclick',\tstr_replace( '%value%', $this->items->itemAt( $i ), $this->onclick ));\n\t\t\t\t$input->setAttribute( 'ondblclick', str_replace( '%value%', $this->items->itemAt( $i ), $this->ondblclick ));\n\n\t\t\t\t$label = new \\System\\XML\\DomObject( 'label' );\n\t\t\t\t$label->addChild( $input );\n\t\t\t\t$label->addChild( new \\System\\XML\\TextNode( $this->items->keyAt( $i )) );\n\t\t\t\t$fieldset->addChild( $label );\n\t\t\t}\n\n\t\t\treturn $fieldset;\n\t\t}", "function zen_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') {\n $selection = '<input type=\"' . zen_output_string($type) . '\" name=\"' . zen_output_string($name) . '\"';\n\n if (zen_not_null($value)) $selection .= ' value=\"' . zen_output_string($value) . '\"';\n\n if ( ($checked == true) || ( isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) && ( ($GLOBALS[$name] == 'on') || (isset($value) && (stripslashes($GLOBALS[$name]) == $value)) ) ) ) {\n $selection .= ' checked=\"checked\"';\n }\n\n if (zen_not_null($parameters)) $selection .= ' ' . $parameters;\n\n $selection .= ' />';\n\n return $selection;\n }", "public function Render(){\n\t\t$disabled = '';\n\t\tif($this->disabled) {\n\t\t\t$disabled = 'disabled=\"disabled\"';\n\t\t}\n\t\t\n\t\t$ratingControl = '';\n\t\tforeach ($this->ratingValues as $key => $ratingValue){\n\t\t\t$class = $this->inputClass;\n\t\t\tif($this->halfRatings > 1){\n\t\t\t\t$class .= ' {split:' . $this->halfRatings . '}'; \n\t\t\t}\n\t\t\t\n\t\t\t$title = '';\n\t\t\tif($this->ratingNames != null){\n\t\t\t\tif($this->isRatingNamesPlusOne){\n\t\t\t\t\t$title = 'title=\"' . $this->ratingNames[$key+1] . '\"';\t\n\t\t\t\t} else {\n\t\t\t\t\t$title = 'title=\"' . $this->ratingNames[$key] . '\"';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$checked = '';\n\t\t\tif($ratingValue == $this->rating){\n\t\t\t\t$checked = 'checked=\"checked\"';\n\t\t\t}\n\t\t\t\n\t\t\t$ratingControl .= '<input name=\"' . $this->inputName . '\" class=\"' . $class . '\" type=\"radio\" value=\"' . $ratingValue . '\" ' . $title . ' ' . $checked . ' ' . $disabled .' />'; \n\t\t}\n\t\t\n\t\treturn $ratingControl;\n\t}", "function olc_mod_select_option($select_array, $key_name, $key_value) {\n\treset($select_array);\n\twhile (list($key, $value) = each($select_array)) {\n\t\tif (is_int($key)) $key = $value;\n\t\t$string .= '<br/><input type=\"radio\" name=\"configuration[' . $key_name . ']\" value=\"' . $key . QUOTE;\n\t\tif ($key_value == $key) $string .= ' CHECKED';\n\t\t$string .= '> ' . $value;\n\t}\n\n\treturn $string;\n}", "function CreateOption($label, $id, $enabled = true, $checked = false)\n\t{\n\t\tCreateRowHeader();\n\t\techo \"\t<div class=\\\"col-12\\\">\\n\";\n\t\techo \" <label>\\n\";\n\t\techo \" <input class=\\\"\\\" type=\\\"radio\\\" id=\\\"action\\\" name=\\\"action\\\" value=\\\"\" . $id . \"\\\" required\";\n\t\tif ($checked)\n\t\t\techo \" checked\";\n\t\tif (!$enabled)\n\t\t\techo \" disabled\";\n\t\techo \"/>\\n\";\n\t\techo \" \" . $label . \"\\n\";\n\t\techo \" </label>\\n\";\n\t\techo \" </div>\\n\";\n\t\techo \"</div>\\n\";\n\t}", "public function form_field_radio ( $args ) {\n\t\t$options = $this->get_settings();\n\t\t\n\t\tif ( isset( $args['data']['options'] ) && ( count( (array)$args['data']['options'] ) > 0 ) ) {\n\t\t\t$html = '';\n\t\t\tforeach ( $args['data']['options'] as $k => $v ) {\n\t\t\t\t$html .= '<input type=\"radio\" name=\"' . $this->token . '[' . esc_attr( $args['key'] ) . ']\" value=\"' . esc_attr( $k ) . '\"' . checked( esc_attr( $options[$args['key']] ), $k, false ) . ' /> ' . $v . '<br />' . \"\\n\";\n\t\t\t}\n\t\t\techo $html;\n\t\t\t\n\t\t\tif ( isset( $args['data']['description'] ) ) {\n\t\t\t\techo '<span class=\"description\">' . $args['data']['description'] . '</span>' . \"\\n\";\n\t\t\t}\n\t\t}\n\t}", "public function ov_radio($name, $value, $checked = false){\n $args = func_get_args(); array_shift($args); array_shift($args); array_shift($args);\n $off = $this->echoOff; $this->echoOff = true;\n $rdo = $this->generate_input('radio', $name, $value, false, $args);\n $rdo->setCheckedState($checked);\n $this->echoOff = $off;\n if( !$this->echoOff ) echo $rdo;\n return $rdo;\n }", "function barnelli_wp_radio( $field ) {\n\tglobal $thepostid, $post, $vision;\n\n\t$thepostid \t\t\t\t= empty( $thepostid ) ? $post->ID : $thepostid;\n\t$field['class'] \t\t= isset( $field['class'] ) ? $field['class'] : 'select short';\n\t$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';\n\t$field['value'] \t\t= isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true );\n\n\techo '<fieldset class=\"form-field ' . esc_attr( $field['id'] ) . '_field ' . esc_attr( $field['wrapper_class'] ) . '\"><legend>' . wp_kses_post( $field['label'] ) . '</legend><ul>';\n\n\tif ( ! empty( $field['description'] ) ) {\n\t\techo '<li class=\"description\">' . wp_kses_post( $field['description'] ) . '</li>';\n\t}\n\n foreach ( $field['options'] as $key => $value ) {\n\n\t\techo '<li><label><input\n \t\tname=\"' . esc_attr( $field['id'] ) . '\"\n \t\tvalue=\"' . esc_attr( $key ) . '\"\n \t\ttype=\"radio\"\n \t\tclass=\"' . esc_attr( $field['class'] ) . '\"\n \t\t' . checked( esc_attr( $field['value'] ), esc_attr( $key ), false ) . '\n \t\t/> ' . esc_html( $value ) . '</label>\n \t</li>';\n\t}\n echo '</ul></fieldset>';\n}", "protected function getRadioButtons($fieldName, $subField = '', array $values, array $current) {\n\t\t$subField = ($subField == '' ?\n\t\t\t'' :\n\t\t\t'[' . $subField . ']');\n\n\t\t$radioButtons = '';\n\n\t\tforeach ($values as $value => $label) {\n\t\t\t$selected = (in_array($value, $current) || count($values) == 1 ?\n\t\t\t\t' checked=\"checked\"' :\n\t\t\t\t'');\n\t\t\t$radioButtons .= '<input ' . $selected . ' name=\"tx_scheduler[' . $this->uid . '][' . $fieldName . ']' . $subField . '\" type=\"radio\" value=\"' . $value . '\">' . $label . '<br>';\n\t\t}\n\n\t\treturn $radioButtons;\n\t}", "protected function getInput()\n\t{\n\t\t// Initialize variables.\n\t\t$html = array();\n\t\t\n\t\t// Initialize some field attributes.\n\t\t$classfs = $this->element['class'] ? ' class=\"radio ' . (string) $this->element['class'] . '\"' : ' class=\"radio\"';\n\t\n\t\t$values = $this->getValues();\n\t\t\n\t\t// Get the field options.\n\t\t$options = $this->getOptions();\n\t\n\t\tforeach ($values as $v => $value)\n\t\t{\n\t\t\t// Start the radio field output.\n\t\t\t$html[] = '<div class=\"control-group\">';\n\t\t\t$html[] = '<div class=\"control-label\">';\n\t\t\t$html[] = '<label id=\"'.$value->value.'\" class=\"hasTip\" title=\"\" for=\"jform_tools\">'.$value->text.'</label>';\n\t\t\t$html[] = '</div>';\n\t\t\t$html[] = '<div class=\"controls\">';\n\t\t\t$html[] = '<fieldset id=\"' . $this->id . $value->value . '\"' . $classfs . '>';\n\t\t\t\n\t\t\t// Build the radio field output.\n\t\t\tforeach ($options as $i => $option)\n\t\t\t{\n\t\t\t\t// Initialize some option attributes.\n\t\t\t\t$checked = ((string) $option->value == (string) $this->value) ? ' checked=\"checked\"' : '';\n\t\t\t\t$class = !empty($option->class) ? ' class=\"' . $option->class . '\"' : '';\n\t\t\t\t$disabled = !empty($option->disable) ? ' disabled=\"disabled\"' : '';\n\t\n\t\t\t\t// Initialize some JavaScript option attributes.\n\t\t\t\t$onclick = !empty($option->onclick) ? ' onclick=\"' . $option->onclick . '\"' : '';\n\t\t\t\t\n\t\t\t\t$html[] = '<input type=\"radio\" id=\"' . $this->id . $value->value . $i . '\" name=\"' . $this->name . '\"' . ' value=\"'\n\t\t\t\t\t. htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8') . '\"' . $checked . $class . $onclick . $disabled . '/>';\n\t\n\t\t\t\t$html[] = '<label for=\"' . $this->id . $value->value . $i . '\"' . $class . '>'\n\t\t\t\t. JText::alt($option->text, preg_replace('/[^a-zA-Z0-9_\\-]/', '_', $value->value)) . '</label>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// End the radio field output.\n\t\t\t$html[] = '</div>';\n\t\t\t$html[] = '</fieldset>';\n\t\t\t$html[] = '</div>';\n\t\t}\n\t\n\t\treturn implode($html);\n\t}", "public static function convert_radio_field() {\n\n\t\t// Create a new Radio field.\n\t\tself::$field = new GF_Field_Radio();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add choices property.\n\t\tself::$field->choices = array();\n\n\t\t// Loop through field options.\n\t\tforeach ( self::$nf_field['list']['options'] as $option ) {\n\n\t\t\t// Add option choice.\n\t\t\tself::$field->choices[] = array(\n\t\t\t\t'text' => $option['label'],\n\t\t\t\t'value' => $option['value'],\n\t\t\t);\n\n\t\t\t// If option is selected, set as default value.\n\t\t\tif ( '1' === $option['selected'] ) {\n\t\t\t\tself::$field->defaultValue = ! empty( $option['value'] ) ? $option['value'] : $option['text'];\n\t\t\t}\n\n\t\t}\n\n\t}", "public function drawOption($id, $name)\r\n {\r\n echo '\r\n <li class=\"list-group-item\">\r\n <div class=\"radio\">\r\n <label>\r\n <input value='.$id.' type=\"radio\" name=\"options\">\r\n '. $name .'\r\n </label>\r\n </div>\r\n </li>\r\n ';\r\n }", "function tep_cfg_select_option($select_array, $key_value, $key = '') {\n $string = '';\n for ($i = 0, $n = sizeof($select_array); $i < $n; $i++) {\n $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');\n $string .= '<br><input type=\"radio\" name=\"' . $name . '\" value=\"' . $select_array[$i] . '\"';\n if ($key_value == $select_array[$i]) $string .= ' CHECKED';\n $string .= '> ' . $select_array[$i];\n }\n\n return $string;\n}", "static public function createCheckboxRadio($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/radiocheckbox.php\";\n }", "public function show ( )\n {\n $tag = new Element ( 'input' );\n $tag -> class = 'field';\t\t // classe CSS\n $tag -> name = $this -> name;\n $tag -> value = $this -> value;\n $tag -> type = 'radio';\n \n // se o campo não é editável\n if ( !parent::getEditable ( ) ) {\n // desabilita a TAG input\n $tag -> readonly = \"1\";\n }\n \n if ( $this -> properties ) {\n foreach ( $this -> properties as $property => $value ) {\n $tag -> $property = $value;\n }\n }\n \n // exibe a tag\n $tag -> show ( );\n }", "public static function createFromArray() {\n\n $args = func_get_args();\n\t\n\tswitch (count($args)) {\n\n\t\tcase 2: \n\t\t\t\t$buttonset = $args[0];\n\t\t\t\t$array = $args[1];\n\t\t\t\t$auto = 0; // don't auto-submit\n\t\t\t\tbreak;\n\n\t\tcase 3: \n\t\t\t\t$buttonset = $args[0];\n\t\t\t\t$array = $args[1];\n\t\t\t\t$atuo = DropDownList::testAutoSubmit($args[2]);\n\t\t\t\tbreak;\n }\n \n \t// Check to see if a choice has been made previously or is a session variable\n \n $choice = RadioButton::getChoice($buttonset);\n \n // Create the radio button set... \n if ($choice == -1) { // No choice made -- user prompted to select\n \n while (list($key, $value) = each ($array)) {\n echo \"<INPUT type=\\\"radio\\\" name=\\\"$buttonset\\\" value=\\\"$key\\\"> $value<BR>\"; \n } // end of while loop\n }\n else { // prior choice made -- select that value\n while (list($key, $value) = each ($array)) {\n if ($key == $choice) { echo \"<INPUT type=\\\"radio\\\" name=\\\"$buttonset\\\" value=\\\"$key\\\" checked> $value<BR>\"; }\n else { echo \"<INPUT type=\\\"radio\\\" name=\\\"$buttonset\\\" value=\\\"$key\\\"> $value<BR>\"; }\n } // end of while loop\n \n }\n \n return;\n \n}", "function htmlRadio($nombre,$selected,$class=\"\") \n { \n $cad='';\n if(strlen($class)>0)\n $cad.='<span class=\"'.$class.'\" >';\n //radio de single\n $cad.='<input type=\"radio\" name=\"'.$nombre.'\" value=\"'.$this->single().'\" ';\n if($this->marsta_id==$selected)\n $cad.=' checked';\n $cad.=' > '.$this->marsta_name.' &nbsp&nbsp';\n //radio de married\n $cad.='<input type=\"radio\" name=\"'.$nombre.'\" value=\"'.$this->married().'\" ';\n if($this->marsta_id==$selected)\n $cad.=' checked';\n $cad.=' > '.$this->marsta_name.' &nbsp&nbsp';\n //radio de divorced\n $cad.='<input type=\"radio\" name=\"'.$nombre.'\" value=\"'.$this->divorced().'\" ';\n if($this->marsta_id==$selected)\n $cad.=' checked';\n $cad.=' > '.$this->marsta_name.' &nbsp&nbsp';\n \n if(strlen($class)>0)\n $cad.='</span>';\n \n return($cad);\n }", "protected function getRadioHTML($item){\n\n $id = \"input-\".mt_rand(1000,9999).'-'.$item->db_field;\n\n // Defaults\n if(!isset($item->size)) $item->size = 12;\n\n $options = '';\n $index = 1;\n foreach($item->options as $value => $option){\n \n if(is_string($option)){\n $optionsString = $option;\n }elseif(is_object($option) && isset($option->{$this->language})){\n $optionsString = $option->{$this->language};\n }else{\n $optionsString = $value;\n }\n\n $options .='\n <div class=\"'.$this->styles['form-check'].'\">\n <input \n type=\"radio\" \n name=\"'.$item->db_field.'\" \n class=\"'.$this->styles['form-check-input'].'\" \n id=\"'.$id.'-'.$index.'\" \n '.($item->value ? 'checked' : null) .'\n '.($item->required ? 'required' : null) .'>\n <label \n class=\"'.$this->styles['form-check-label'].'\"\n for=\"'.$id.'-'.$index.'\">'.$optionsString.'</label>\n </div>\n ';\n\n $index++;\n }\n\n // HTML\n $return = '\n <div class=\"'.$this->styles['col'].'-'.$item->size.' mt-3\">\n <label \n for=\"'.$id.'\"\n title=\"'.($item->description->type === 'title' ? $item->description->value->{$this->language} : null) .'\">'.$item->title->{$this->language}.'</label>'.$options.'</div>\n ';\n\n return trim(preg_replace('/\\s\\s+/', ' ', $return));\n\n }", "public function create_input_radio_group($id, $name, $items, $selectedvalue='', $addttext='', $delimiter='', $html_id = '')\n\t{\n\t\t$this->load_form_methods();\n\t\treturn cms_module_CreateInputRadioGroup($this, $id, $name, $items, $selectedvalue, $addttext, $delimiter, $html_id);\n\t}", "function getFieldAboriginalIslander($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_IndigenousStatusID');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_IndigenousStatusID');\n\t\t$tooltip = setToolTipNotification(\"IndigenousStatusID\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('ind_status') === 'ind_status' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br>\";\n\t\t\t$form_ret .= '<input name=\"IndigenousStatusID\" class=\"IndigenousStatusID\" id=\"indigenousStatus1\" value=\"4\" '.($value == '4' || $value == null ? 'checked' : '').' type=\"radio\" data-value=\"No\" checked> No</br>';\n\t\t\t$form_ret .= '<input name=\"IndigenousStatusID\" class=\"IndigenousStatusID\" id=\"indigenousStatus2\" value=\"1\" '.($value == '1' ? 'checked' : '').' type=\"radio\" data-value=\"Aboriginal\"> Aboriginal</br>';\n\t\t\t$form_ret .= '<input name=\"IndigenousStatusID\" class=\"IndigenousStatusID\" id=\"indigenousStatus3\" value=\"2\" '.($value == '2' ? 'checked' : '').' type=\"radio\" data-value=\"Torres Strait Islander\"> Torres Strait Islander</br>';\n\t\t\t$form_ret .= '<input name=\"IndigenousStatusID\" class=\"IndigenousStatusID\" id=\"indigenousStatus4\" value=\"3\" '.($value == '3' ? 'checked' : '').' type=\"radio\" data-value=\"Aboriginal AND Torres Strait Islander\"> Aboriginal AND Torres Strait Islander</br>';\n\t\t\n\t\t}\n\t\treturn $form_ret;\n\t}", "public static function FormRadioSelect( $name, $data = null, $dataKey = null, $dataTitle = null, $value = null, $class = null, $nullValue = true, $callback = null , $params = [] ) {\n $xhtml = '';\n if ( $data ) {\n $i = 0;\n foreach ( $data as $index => $element ) {\n $i ++;\n\n if ( is_object( $element ) ) {\n $title = $element->$dataTitle;\n $key = $element->$dataKey;\n } else if ( is_array( $element ) ) {\n $title = $element[$dataTitle];\n $key = $element[$dataKey];\n } else {\n $title = $element;\n $key = $index;\n }\n\n if ( $callback ) {\n $title = call_user_func_array( $callback, [ $title, $element ] );\n }\n\n $classes = $class ? [ $class ] : [];\n if ( $i != count( $data ) ) {\n $classes[] = 'marginRightBase';\n }\n\n $xhtml .= sprintf( '<label%s>%s %s</label>', $classes ? ' class=\"' . implode( $classes, ' ' ) . '\"' : '',\n FormHelper::FormRadioButton( $name, $key, null, $class, ($value && $value == $key) || (!$nullValue && $i == 1), $params ),\n $title\n );\n }\n }\n\n return $xhtml;\n }", "function getFieldUniqueStudentIdentifier($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_USI');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_USI');\n\t\t$tooltip = setToolTipNotification(\"USI\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('usi') === 'usi' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br>\";\n\t\t\t$form_ret .= \"<input type='radio' name='usiOpt' value='haveUSI' id='haveUSI' class='usiRadion hideUSItextDisp' checked>I have a USI</br>\";\n\t\t\t$form_ret .= \"<div id='usidisp'><input type='text' placeholder='Please Enter Your USI here.' id='USI' name='USI' value='\".$value.\"' class='srms-field \".(get_axl_req_fields('usi') === 'usi' ? 'input-text-required' : '').\"' maxlength='10' minlength='10'><div id='USI_err_con'></div></br></div>\";\n\t\t\t$form_ret .= \"<input type='radio' name='usiOpt' value='createUSI' id='createUSI' class='usiRadion hideUSIfield'>Create a USI for me</br>\";\n\t\t\t$form_ret .= \"<input type='radio' name='usiOpt' value='linkUSI' id='linkUSI' class='usiRadion hideUSItextDisp'>Ill create a USI</br>\";\t\t\t\n\t\t\t$form_ret .= \"<input type='hidden' name='createUSIfield' value='' id='createUSIfield'><p id='USItextDisp' style='display: none;'>Trainee gives permission to create USI on their behalf</p>\";\n\t\t\t\n\t\t}\n\t\treturn $form_ret;\n\t}", "function radioEntry($display,$name,$entries,$errors,$values)\n{\n\t$returnVal = \"\n\t<tr>\n\t\t<td>$display:</td>\n\t\t<td>\";\n\t\tforeach ($values as $value)\n\t\t{\n\t\t\tif (array_key_exists($name,$entries) &&\n\t\t\t\t\t$entries[$name]==$value)\n\t\t\t{\n\t\t\t\t$returnVal .= \"<input type='radio' name='$name'\n\t\t\t\t\t\t\tvalue='$value' checked> $value \";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$returnVal .= \"<input type='radio' name='$name'\n\t\t\t\t\t\t\tvalue='$value'> $value \";\n\t\t\t}\n\t\t}\n\t$returnVal .= \"</td></tr>\";\n\n\tif (array_key_exists($name,$errors))\n\t{\n\t\t$returnVal .= addErrorRow($name,$errors);\n\t}\n\treturn $returnVal;\n}", "function scrappy_get_radios($id) {\n $args = array(\n 'posts_per_page' => -1,\n 'offset' => 0,\n 'category' => '',\n 'category_name' => '',\n 'orderby' => 'meta_value',\n 'order' => 'DESC',\n 'include' => '',\n 'exclude' => '',\n 'meta_key' => '',\n 'meta_value' => '',\n 'post_type' => 'radio',\n 'post_mime_type' => '',\n 'post_parent' => '',\n 'author'\t => '',\n 'author_name'\t => '',\n 'post_status' => 'publish',\n 'suppress_filters' => true,\n /*'tax_query' => array(\n array(\n 'taxonomy' => 'radio_category',\n 'field' => 'id',\n 'terms' => 2\n )\n ),*/\n 'meta_key' => 'scrappy_url',\n );\n if ( $id ) {\n $args['post__in'] = ( is_array($id) ? $id : array($id));\n }\n return get_posts( $args );\n}", "static public function radio($name,$opts=[]) {\n $f3 = Base::instance();\n $isdefault = false;\n foreach ($opts as $k=>$v) {\n if (preg_match(self::BOOLEAN_RE,$k) && $v == 'default') {\n $isdefault = [$k];\n\tbreak;\n }\n }\n if ($isdefault) {\n unset($opts[$isdefault[0]]);\n $isdefault = true;\n }\n if (!isset($opts['value'])) $f3->error(404);\n\n if (!$f3->exists('POST.'.$name) && $isdefault) $f3->set('POST.'.$name,$opts['value']);\n if ($f3->exists('POST.'.$name) && $f3->get('POST.'.$name) == $opts['value']) {\n $opts[] = 'checked';\n }\n if (!isset($opts['type'])) $opts['type'] = 'radio';\n return self::input($name,$opts);\n }", "static function renderRadiosField($name, array $options, $value = null, $label = null, $display = null)\n {\n echo '<nobr>';\n\t\tif ($label) echo '<label style=\"float: left;width: 150px;\">'.textH8($label).'</label>';\n\n foreach($options as $val)\n {\n echo '<input type=\"radio\" name=\"'.$name.'\" value=\"'.textH8($val).'\"';\n if ($val == $value) echo ' checked';\n echo '>'.textH8($val).'</option>'.PHP_EOL;\n if (isset($display) && $display == \"V\") echo \"<br/><span style='float: left;width: 150px;'>&nbsp;</span>\";\n }\n echo '</nobr>';\n }", "public function addRadioF ($fieldname, $value = NULL, $id = NULL, $checked = NULL, array $attributes = array ())\n\t{\n\t\tif (is_array($fieldname)) {\n\t\t\t$attributes = $fieldname;\n\t\t} else {\n\t\t\tis_array($checked) and $attributes = $checked;\n\t\t\t$attributes['name'] = (string)$fieldname;\n\t\t\t$attributes['value'] = (string)$value;\n\n\t\t\t# Added for 1.2 to allow checked true/false. in 3rd argument, used to be attributes\n\t\t\tif (!is_array($checked)) {\n\t\t\t\t// If it's true, then go for it\n\t\t\t\tif (is_bool($checked)) {\n\t\t\t\t\tif ($checked === TRUE) {\n\t\t\t\t\t\t$attributes['checked'] = 'checked';\n\t\t\t\t\t}\n\t\t\t\t} // Otherwise, if the string/number/whatever matches then do it\n\t\t\t\telseif (is_scalar($checked) and $checked == $value) {\n\t\t\t\t\t$attributes['checked'] = 'checked';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (empty($id)) {\n\t\t\t$attributes['id'] = $fieldname;\n\t\t} else {\n\t\t\t$attributes['id'] = $id;\n\t\t}\n\n\t\t$attributes['type'] = 'radio';\n\n\t\treturn html_tag('input', $this -> attr_to_string($attributes));\n\t}", "public function getType()\n {\n return 'radio';\n }", "public static function radio_button_tag($name, $value, $checked = false, $html_attributes = array())\n {\n $checked = $checked ? \"checked\" : null;\n $id = self::sanitize_id($name.'_'.$value);\n\n return TagHelper::tag('input', array_merge(array('type' => 'radio', 'name' => $name, 'value' => $value, 'id' => $id, 'checked' => $checked), $html_attributes));\n }", "public function getControlType()\n {\n return 'radio';\n }", "function uds_pricing_render_product_options_radiocross($key, $value)\n{\n\tglobal $uds_pricing_column_options;\n\t$field = $uds_pricing_column_options[$key];\n\t$selected = $value ? 'checked=\"checked\"' : '';\n\t$out = \"\n\t\t<div>\n\t\t\t<label>{$field['label']}</label>\n\t\t\t<input type='radio' name='{$key}' value='$value' class='radio {$key}' $selected />\n\t\t\t<span class='tooltip'>?</span>\n\t\t\t<div class='tooltip-content'>{$field['tooltip']}</div>\n\t\t\t<div class='clear'></div>\n\t\t</div>\n\t\";\n\t\n\treturn $out;\n}", "function RadioBox($name,$data) {\n\n $content .= \"<table cellspacing=0 cellpadding=0 width=100%>\\n\";\n\n foreach($data as $k => $v) {\n\n if (($k % 2) == 0) {\n\t$content .= my_comma(checkboxlist,\"</td></tr>\").\"<tr><td width=1%>\\n\";\n } else {\n\t$content .= \"</td><td width=1%>\\n\";\n }\n\n if ($v[checked]) {\n\t$content .= \"<input type=radio name=\\\"$name\\\" value=\\\"*\\\" checked></td><td width=49%>$v[text]\\n\";\n } else {\n\t$content .= \"<input type=radio name=\\\"$name\\\" value=\\\"*\\\"></td><td width=49%>$v[text]\\n\";\n }\n }\n\n# echo count($data);\n\n $contemt .= \"</td></tr>\\n\";\n $content .= \"</table>\\n\";\n\n return $content;\n }", "protected function buildRadio($row) {\n\t\tif (!$this->filled) $$row['Default'] = \" checked='checked'\";\n\t\t$vals = explode (',',$row['values']);\n\t\tforeach ($vals as $value) {\n\t\t\tif ($pos = strpos($value,\"=ON\")) {\n\t\t\t\t$value = substr($value,0,$pos);\n\t\t\t\t$$value = \" checked='checked'\";\n\t\t\t}\n\t\t\t$elem .= sprintf(\"<input type='radio' name='%s' value='%s'%s />%s<br />\\n\",$row['Field'],$value,$$value,$value);\n\t\t}\n\t\treturn $elem;\n\t}", "function drawMultiRadioBoxes($baseName,$selectedItem, $items, $valueColumnName, $titleColumnName, $options=null) {\n\n\t\t$sortBy = $options['sortBy'];\n\t\tif (!$sortBy)\n\t\t\t$sortBy = 'value';\n\t\t\n\t\t$optionType = $options['type'];\n\t\tif ($optionType=='radio' or empty($optionType)) {\n\t\t\t$optionType = 'radio';\n\t\t} else {\n\t\t\t$baseName.='[]';\n\t\t}\n\t\t\n\t\t//echo $optionType;\n\t\t\n\t\tif (!is_array($selectedItem))\n\t\t\t$selectedItems[] = $selectedItem;\n\t\telse\n\t\t\t$selectedItems = $selectedItem;\n\t\t\n\t\t$displayMode = $options['displayMode'];\n\t\tif (!$displayMode)\n\t\t\t$displayMode = 'table';\n\t\t\n\t\t$template['table'] = array(\n\t\t\t'mainWrapper' => '<table %wrapperAttributes%>%contents%</table>',\n\t\t\t'contents' => '<tr>%fields%</tr>',\n\t\t\t'fields' => '<td>%field%</td>',\n\t\t\t'defaultAttributes' => array(\n\t\t\t\t'border' => 0,\n\t\t\t),\n\t\t);\n\t\t$template['normal'] = array(\n\t\t\t'mainWrapper' => '<p>%contents%</p>',\n\t\t\t'contents' => '%fields%',\n\t\t\t'fields' => '%field%<br />',\n\t\t\t'defaultAttributes' => array(\n\t\t\t\t'border' => 0,\n\t\t\t),\n\t\t);\n\t\t\n\t\tif (is_array($options[$displayMode])){\n\t\t\t$attributes = array_merge($template[$displayMode]['defaultAttributes'], $options[$displayMode]);\n\t\t\t$wrapperAttributes = cmfcHtml::attributesToHtml($attributes);\n\t\t}\n\t\telseif (is_string($options[$displayMode]))\n\t\t\t$wrapperAttributes = $options[$displayMode];\n\t\t\n\t\tif (is_array($options['inputAttributes']))\n\t\t\t$inputAttributes = cmfcHtml::attributesToHtml($options['inputAttributes']);\n\t\telseif (is_string($options['inputAttributes']))\n\t\t\t$inputAttributes = $options['inputAttributes'];\n\t\t\n\t\t$numColumns = $options['columns'];\n\t\tif (!$numColumns)\n\t\t\t$numColumns = 5;\n\t\t\n\t\tif (is_string($items)){\n\t\t\t$items = cmfcMySql::getRowsCustom($items);\n\t\t}\n\t\t\n\t\t$counter = 0;\n\t\t$contents = '';\n\t\tif (is_array($items)){\n\t\t\t//cmfcHtml::printr($items);\n\t\t\tswitch ($sortBy){\n\t\t\tcase 'title':\n\t\t\t\t$items = cmfcArray::sortItems($items, $titleColumnName, 'asc');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'value':\n\t\t\t\t$items = cmfcArray::sortItems($items, $valueColumnName, 'asc');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t$items = cmfcArray::sortItems($items, $valueColumnName, 'asc');\n\t\t\t}\n\t\t\t//cmfcHtml::printr($items);\n\t\t\t//cmfcHtml::printr( $options);\n\t\t\tforeach ($items as $item) {\n\t\t\t\t//cmfcHtml::printr($item);\n\t\t\t\t//echo $numColumns;\n\t\t\t\t$counter ++;\n\t\t\t\t\n\t\t\t\tif (in_array($item[$valueColumnName], $selectedItems) )\n\t\t\t\t\t$checked='checked=\"checked\"';\n\t\t\t\telse \n\t\t\t\t\t$checked='';\n\t\t\t\t\n\t\t\t\tif (in_array($optionType, array('checkbox', 'radio')) ){\n\t\t\t\t\t$value = $item[$valueColumnName];\n\t\t\t\t\t$field = '<input '.$inputAttributes.\n\t\t\t\t\t\t'name=\"'.$baseName.'\" id=\"'.$baseName.$counter.'\" type=\"'.$optionType.'\" value=\"'.$value.'\" '.$checked.'>&nbsp;<label for=\"'.$baseName.$counter.'\">';\n\t\t\t\t\t\n\t\t\t\t\tif(is_array($options['strongItems']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(in_array($value, $options['strongItems'])) {\n\t\t\t\t\t\t\t$itemTitleColumnName = \"<b>\".$item[$titleColumnName].\"</b>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$itemTitleColumnName = $item[$titleColumnName];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$itemTitleColumnName = $item[$titleColumnName];\n\t\t\t\t\t}\n\t\t\t\t\t$field .= $itemTitleColumnName;\n\t\t\t\t\t$field .= '</label>';\n\t\t\t\t}\n\t\t\t\telseif ($optionType == 'custom'){\n\t\t\t\t\tif ($checked)\n\t\t\t\t\t\t$tag = $options['tag']['selected'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$tag = $options['tag']['notSelected'];\n\t\t\t\t\t\n\t\t\t\t\t$value = $item[$titleColumnName];\n\t\t\t\t\t$tag = str_replace('%value%', $value, $tag);\n\t\t\t\t\t$tag = str_replace('%inputAttributes%', $inputAttributes, $tag);\n\t\t\t\t\t\n\t\t\t\t\t$field = $tag;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html .= str_replace('%field%', $field, $template[$displayMode]['fields']);\n\t\t\t\t\n\t\t\t\tif ($counter % $numColumns == 0) {\n\t\t\t\t\t$contents .= str_replace('%fields%', $html, $template[$displayMode]['contents']);\n\t\t\t\t\t$html = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($html){\n\t\t\t\t$contents .= str_replace('%fields%', $html, $template[$displayMode]['contents']);\n\t\t\t}\n\t\t\t$result = str_replace('%contents%', $contents, $template[$displayMode]['mainWrapper']);\n\t\t}\n\t\telse{\n\t\t\t$result = 'no valid items';\n\t\t}\n\t\treturn $result;\n\t}", "public function radiobuttonClicked($sender,$param)/*\n Module: radiobuttonClicked\n Parameters:\n * $sender -- Page that sent request\n * $param -- Tcontrol that sent request\n Author Name(s): Nate Priddy\n Date Created: 12/7/2010\n Purpose: Not in use!\n * Meant to be used when radio buttons rather than select button is\n * used to make adjusstments to lists\n */{\n $item = $param->Item;\n // obtains the primary key corresponding to the datagrid item\n $RL_ID = $this->RecipeUserListGrid->DataKeys[$item->ItemIndex];\n $this->SetSelectedID($RL_ID);\n $this->UserListRebind($this->User->getUserId());\n $this->ListRebind($RL_ID);\n }", "function _generateSelection()\n {\n $i = 0;\n foreach ($_POST as $key=>$value) {\n echo \"<input type='hidden' name=$key value=$value required>\";\n echo \"<div class='form-group'>\";\n if (isset($value) && $this->\n _childexists($value, $this->_getRubriekFromDb())) {\n echo $this->_generateRubriekVerkoopList($value, $this->_getRubriekFromDb(), \"subrubriek\" . $i);\n echo \"<script type='text/javascript'>\n document.getElementById('$key').disabled = true;\n </script>\";\n }\n echo \"</div>\";\n echo \"<script type='text/javascript'>\n document.getElementById('$key').value= $value \n </script>\";\n $i++;\n }\n }", "public function radioButton($name, $value = null)\n {\n return new RadioButton($this, $name, $value);\n }", "function convertOptionToHTMLRadio($id_esc, $option_value, $option_label, $classes_html, $selected = false) {\n\tif ($selected) {\n\t\t$selected_html = 'checked=\"checked\"';\n\t} else {\n\t\t$selected_html = '';\n\t}\n\treturn <<<EOD\n<label>\n\t<input type=\"radio\" name=\"$id_esc\" value=\"$option_value\" $classes_html $selected_html />\n\t$option_label\n</label>\nEOD;\n}", "public function radioGroup(string $name, string $label, array $radios): FormHelper\n {\n $this->html .= '<div>';\n $this->html .= \"<p>${label}</p>\";\n foreach ($radios as $label => $value) {\n $this->html .= \"<input type=\\\"radio\\\" id=\\\"${name}-${value}\\\" name=\\\"${name}\\\" value=\\\"${value}\\\">\";\n $this->html .= \"<label for=\\\"${name}-${value}\\\">${label}</label><br>\";\n }\n $this->html .= '</div>';\n return $this;\n }", "public static function getBooleanInput($name, $value)\n {\n $html = array();\n\n // Start the radio field output.\n $html[] = '<fieldset id=\"' . $name . '\" class=\"radio btn-group btn-group-yesno\">';\n\n // Yes Option\n $checked = ($value == 1) ? ' checked=\"checked\"' : '';\n $html[] = '<input type=\"radio\" id=\"' . $name . '0\" name=\"' . $name . '\" value=\"1\"' . $checked . ' />';\n $html[] = '<label for=\"' . $name . '0\">' . JText::_('JYES') . '</label>';\n\n // No Option\n $checked = ($value == 0) ? ' checked=\"checked\"' : '';\n $html[] = '<input type=\"radio\" id=\"' . $name . '1\" name=\"' . $name . '\" value=\"0\"' . $checked . ' />';\n $html[] = '<label for=\"' . $name . '1\">' . JText::_('JNO') . '</label>';\n\n // End the radio field output.\n $html[] = '</fieldset>';\n\n return implode($html);\n }", "function get_tag()\n {\n\t $id = 'id=\"'.$this->OP_[id]->get().'\"';\n\t $name='name=\"'.$this->OP_[name]->get().'\"';\n\t $value='value=\"'.$this->OP_[value]->get().'\"';\n\t $type='type=\"hidden\"';\n\t $my_value = \"<input $id $name $type $value>\";\n\t return $my_value;\n }", "protected function printRadioFormField($nameField, $label, $array, $required=false, $value=null){\n $optRequired = \"\";\n if($required == true){\n $optRequired = \"required\";\n }\n if($value == null){\n if(isset($_POST[$nameField])){\n $value = $_POST[$nameField];\n }\n }\n \n ?>\n <div class=\"form-group\">\n <label class=\"control-label col-sm-2\" for=\"<?php echo $nameField ?>\" ><?php echo $label ?></label>\n <?php\n foreach($array as $k => $v){\n if($value == $k){\n echo '<label class=\"radio-inline\"><input type=\"radio\" value=\"'.$k.'\" name=\"'.$nameField.'\" '.$optRequired.' checked>'.$v.'</label>';\n }\n else{\n echo '<label class=\"radio-inline\"><input type=\"radio\" value=\"'.$k.'\" name=\"'.$nameField.'\" '.$optRequired.'>'.$v.'</label>';\n }\n }\n ?>\n \n \n </div>\n <?php\n }", "public function renderRadio( $label, $key, $item, $attributes = array() )\n {\n echo \"<div class=\\\"form-radio\\\">\\n\";\n $id = 'field-' . $this->formId . '-' . $key . '-' . $item;\n $this->renderInput( 'radio', $key, $item, array_merge( array( 'id' => $id, 'checked' => !strcmp( $this->getValue( $key ), $item ) ), $attributes ) );\n $this->renderLabel( $label, $key, $id, false );\n echo \"</div>\\n\";\n }", "public function __construct($name, array $values, $checked = null, $indent = null)\n {\n parent::__construct('fieldset');\n\n $this->setName($name);\n $this->setAttribute('class', 'radio-fieldset');\n\n if (null !== $checked) {\n $this->setValue($checked);\n }\n\n if (null !== $indent) {\n $this->setIndent($indent);\n }\n\n // Create the radio elements and related span elements.\n $i = null;\n foreach ($values as $k => $v) {\n $radio = new Input\\Radio($name, null, $indent);\n $radio->setAttributes([\n 'class' => 'radio',\n 'id' => ($name . $i),\n 'value' => $k\n ]);\n\n if (is_array($v) && isset($v['value']) && isset($v['attributes'])) {\n $nodeValue = $v['value'];\n $radio->setAttributes($v['attributes']);\n } else {\n $nodeValue = $v;\n }\n\n // Determine if the current radio element is checked.\n if ((null !== $this->checked) && ($k == $this->checked)) {\n $radio->check();\n }\n\n $span = new Child('span');\n if (null !== $indent) {\n $span->setIndent($indent);\n }\n $span->setAttribute('class', 'radio-span');\n $span->setNodeValue($nodeValue);\n $this->addChildren([$radio, $span]);\n $this->radios[] = $radio;\n $i++;\n }\n }", "public function __construct(\n ?string $id = null,\n string $name = null,\n ?bool $disabled = null,\n ?bool $required = null,\n ?string $form = null,\n ?bool $autofocus = null,\n ?bool $validated = null,\n ?string $ariaInvalid = null,\n ?bool $stacked = null,\n ?bool $plain = null,\n ?bool $buttons = null,\n ?bool $switch = null,\n ?string $buttonVariant = null,\n array $options = [],\n ?string $valueField = null,\n ?string $textField = null,\n ?string $htmlField = null,\n ?string $disabledField = null,\n ?string $size = null,\n ?bool $state = null,\n $checked = null\n )\n {\n $this->id = $id ?? uniqid();\n $this->name = $name ?? uniqid();\n $this->disabled = !!$disabled;\n $this->required = !!$required;\n $this->form = $form;\n $this->autofocus = !!$autofocus;\n $this->validated = !!$validated;\n $this->ariaInvalid = $ariaInvalid;\n $this->stacked = !!$stacked;\n $this->plain = !!$plain;\n $this->buttons = !!$buttons;\n $this->switch = !!$switch;\n $this->buttonVariant = $buttonVariant ?? \"secondary\";\n $this->options = $options;\n $this->valueField = $valueField ?? \"value\";\n $this->textField = $textField ?? \"text\";\n $this->htmlField = $htmlField ?? \"html\";\n $this->disabledField = $disabledField ?? \"disabled\";\n $this->size = $size;\n $this->state = $state; //it can be null,false, true, so don't pass it through bang bang\n $this->checked = $checked; //value for the group.\n if ($this->id) {\n $this->attrs[\"id\"] = $id;\n }\n $this->attrs[\"class\"] = join(\" \", $this->attrs[\"class\"]);\n }", "public function orderRadio()\n {\n $order = get_site_option($this->orderOption);\n\n if (!is_string($order)) {\n $order = 'DESC';\n }\n ?>\n <p>\n <label>\n <input id=\"<?php echo $this->orderOption; ?>\" <?php echo $order === 'DESC'\n ? 'checked'\n : ''; ?> name=\"<?php echo $this->orderOption; ?>\" type=\"radio\" value=\"DESC\">DESC\n </label><br>\n\n <label>\n <input id=\"<?php echo $this->orderOption; ?>\" <?php echo $order === 'ASC'\n ? 'checked'\n : ''; ?> name=\"<?php echo $this->orderOption; ?>\" type=\"radio\" value=\"ASC\">ASC\n </label>\n </p>\n <?php\n }", "protected function generateRadio($options, $currentValue = null)\n {\n return sprintf('<input %s%s>', $this->arrayToHtmlAttributes($options), \"{$options['value']}\" === \"$currentValue\" ? ' checked=\"checked\"' : '');\n }", "private function build_radio_field($_meta, $_ptype = \"wccpf\", $_class = \"\", $_index, $_show_as_value = \"no\", $_readonly = \"\", $_cloneable = \"\", $_wrapper = true, $_has_pricing_rules = \"no\") {\r\n $html = ''; \r\n $has_field_rules = isset( $_meta[\"field_rules\"] ) && is_array( $_meta[\"field_rules\"] ) && count( $_meta[\"field_rules\"] ) != 0 ? \"yes\" : \"no\";\r\n if ($_show_as_value == \"no\") {\r\n /* For admin field, we don't need <ul> wrapper */\r\n if ($_ptype != \"wccaf\") {\r\n $html = '<ul class=\"' . ((isset($_meta['layout']) && $_meta['layout'] == \"horizontal\") ? \"wccpf-field-layout-horizontal\" : \"wccpf-field-layout-vertical\") . '\" ' . $_cloneable . '>';\r\n }\r\n $choices = explode(\";\", ((isset($_meta[\"choices\"]) && ! empty($_meta[\"choices\"])) ? $_meta[\"choices\"] : \"\"));\r\n $_meta[\"default_value\"] = (isset($_meta[\"default_value\"]) && ! empty($_meta[\"default_value\"])) ? trim($_meta[\"default_value\"]) : \"\";\r\n foreach ($choices as $choice) {\r\n $attr = '';\r\n $key_val = explode(\"|\", $choice);\r\n /* It has to be two items ( Value => Label ), otherwise don't proceed */\r\n if (count($key_val) == 2) {\r\n if ($_ptype != \"wccaf\") {\r\n /* Since version 2.0.0 - Default value will be absolute value not as key|val pair */\r\n if (strpos($_meta[\"default_value\"], \"|\") !== false) {\r\n /* Compatibility for <= V 1.4.0 */\r\n if ($choice == $_meta[\"default_value\"]) {\r\n $attr = 'checked=\"checked\"';\r\n }\r\n } else {\r\n /*\r\n * For product fields from V 2.0.0\r\n * For admin fields, which will be displyed as Product Fields\r\n */\r\n if ($key_val[0] == $_meta[\"default_value\"]) {\r\n $attr = 'checked=\"checked\"';\r\n }\r\n }\r\n } else {\r\n if ($key_val[0] == $_meta[\"value\"]) {\r\n $attr = 'checked=\"checked\"';\r\n }\r\n }\r\n /* For admin field, we don't need <li></li> wrapper */\r\n $html .= (($_ptype != \"wccaf\") ? '<li>' : '') . '<label class=\"wcff-option-wrapper-label\"><input type=\"radio\" data-has_field_rules=\"'.$has_field_rules.'\" data-has_pricing_rules=\"'.$_has_pricing_rules.'\" data-fkey=\"'. $_meta[\"key\"] .'\" class=\"' . $_ptype . '-field ' . $_class . '\" name=\"' . esc_attr($_meta[\"key\"] . $_index) . '\" value=\"' . esc_attr(trim($key_val[0])) . '\" ' . $attr . ' data-field-type=\"'. $_meta[\"type\"] .'\" ' . $_ptype . '-pattern=\"mandatory\" ' . $_ptype . '-mandatory=\"' . $_meta[\"required\"] . '\" ' . $_readonly . ' /> ' . esc_html(trim($key_val[1])) . '</label>' . (($_ptype != \"wccaf\") ? '</li>' : '');\r\n }\r\n }\r\n /* For admin field, we don't need <ul> wrapper */\r\n $html .= ($_ptype != \"wccaf\") ? '</ul>' : '';\r\n } else {\r\n /*\r\n * Show the raw value instead of as a field\r\n * Used for the Admin Field showing on product page\r\n */\r\n $html = '<p class=\"wcff-wccaf-value-para-tag\">' . $_meta[\"default_value\"] . '</p>';\r\n }\r\n /* Add wrapper around the field, based on the user options */\r\n if ($_wrapper) {\r\n $html = $this->built_field_wrapper($html, $_meta, $_ptype, $_index);\r\n }\r\n return $html;\r\n }", "public static function radio($name, $value = NULL, $checked = FALSE, array $attributes = NULL)\n\t{\n\t\t$attributes['type'] = 'radio';\n\n\t\tif ($checked === TRUE)\n\t\t{\n\t\t\t// Make the radio active\n\t\t\t$attributes['checked'] = 'checked';\n\t\t}\n\n\t\treturn Form::input($name, $value, $attributes);\n\t}", "function architettura_sanitize_radio( $input, $setting ) {\n\n //input must be a slug: lowercase alphanumeric characters, dashes and underscores are allowed only\n $input = sanitize_key($input);\n \n //get the list of possible radio box options \n $choices = $setting->manager->get_control( $setting->id )->choices;\n \n //return input if valid or return default option\n return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); \n}", "public function other_choice_name() {\n return self::id_other_choice_name($this->id);\n }", "function htmlRadio($nombre,$selected,$class=\"\") \n { \n $cad='';\n if(strlen($class)>0)\n $cad.='<span class=\"'.$class.'\" >';\n //radio de male\n $cad.='<input type=\"radio\" name=\"'.$nombre.'\" value=\"'.$this->male().'\" ';\n if($this->sex_id==$selected)\n $cad.=' checked';\n $cad.=' > '.$this->sex_name.' &nbsp&nbsp';\n //radio de female\n $cad.='<input type=\"radio\" name=\"'.$nombre.'\" value=\"'.$this->female().'\" ';\n if($this->sex_id==$selected)\n $cad.=' checked';\n $cad.=' > '.$this->sex_name.' &nbsp&nbsp';\n \n if(strlen($class)>0)\n $cad.='</span>';\n \n return($cad);\n }", "public function testRadioGroup()\n {\n $form = new class extends Formulaic\\Post {};\n $form[] = (new Formulaic\\Radio\\Group(\n 'test',\n [1 => 'foo', 2 => 'bar']\n ))->isRequired();\n yield assert($form->valid() != true);\n $_POST['test'] = 1;\n $form = new class extends Formulaic\\Post {};\n $form[] = (new Formulaic\\Radio\\Group(\n 'test',\n [1 => 'foo', 2 => 'bar']\n ))->isRequired();\n yield assert($form->valid());\n yield assert(\"$form\" == <<<EOT\n<form action=\"\" method=\"post\">\n<div>\n<label for=\"test-1\"><input checked id=\"test-1\" name=\"test\" required=\"1\" type=\"radio\" value=\"1\"> foo</label>\n<label for=\"test-2\"><input id=\"test-2\" name=\"test\" required=\"1\" type=\"radio\" value=\"2\"> bar</label>\n</div>\n</form>\nEOT\n );\n }", "function guifi_radio_add_radio_form($edit) {\n $cr = 0; $tr = 0; $firewall=FALSE;\n $maxradios = db_fetch_object(db_query('SELECT radiodev_max FROM {guifi_model_specs} WHERE mid=%d',$edit[variable][model_id]));\n\n if (isset($edit[radios]))\n foreach ($edit[radios] as $k => $radio) {\n $tr++;\n if (!$radio['deleted'])\n $cr++;\n if ($radio['mode'] == 'client')\n $firewall = TRUE;\n } // foreach $radio\n\n // print \"Max radios: \".$maxradios->radiodev_max.\" Current: $cr Total: $tr Firewall: $firewall Edit details: $edit[edit_details]\\n<br />\";\n $modes_arr = guifi_types('mode');\n // print_r($modes_arr);\n\n if ($cr>0)\n\t if (!$firewall)\n\t\t $modes_arr = array_diff_key($modes_arr,array('client' => 0));\n\t else\n\t\t $modes_arr = array_intersect_key($modes_arr,array('client' => 0));\n\n $form['newradio_mode'] = array(\n '#type' => 'select',\n '#parents' => array('newradio_mode'),\n '#required' => FALSE,\n '#default_value' => 'client',\n '#options' => $modes_arr,\n '#prefix' => '<table style=\"width: 100%\"><th colspan=\"0\">'.t('New radio (mode)').'</th><tr><td style=\"width: 0\" align=\"right\">',\n '#suffix' => '</td>',\n// '#weight' => 20\n );\n $form['AddRadio'] = array(\n '#type' => 'button',\n '#parents' => array('AddRadio'),\n '#default_value' => t('Add new radio'),\n '#executes_submit_callback' => TRUE,\n '#submit' => array(guifi_radio_add_radio_submit),\n '#prefix' => '<td style=\"width: 10em\" align=\"left\">',\n '#suffix' => '</td><td style=\"width: 100%\" align=\"right\">&nbsp</td></tr>',\n// '#weight' => 21,\n );\n $form['help_addradio'] = array(\n '#type' => 'item',\n '#description' => t('Usage:<br />Choose <strong>wireless client</strong> mode for a normal station with full access to the network. That\\'s the right choice in general.<br />Use the other available options only for the appropiate cases and being sure of what you are doing and what does it means. Note that you might require to be authorized by networks administrators for doing this.<br />Youwill not be able to define you link and get connected to the network until you add at least one radio.'),\n '#prefix' => '<tr><td colspan=\"3\">',\n '#suffix' => '</td></tr></table>',\n// '#weight' => 22,\n );\n return $form;\n}", "public static function radios($name='', $options=array(), $value='', $attributes='') {\n\t\t\t$output = '<ul class=\"radios\"';\n\t\t\t$output .= HtmlHelper::_attributes_to_string($attributes);\n\t\t\t$output .= '>';\n\t\t\tif ($options) {\n\t\t\t\tforeach ($options as $key => $val) {\n\t\t\t\t\t$attr = ($key == $value) ? 'checked=\"checked\"' : '';\n\t\t\t\t\t$output .= '<li>';\n\t\t\t\t\t$output .= HtmlHelper::radio($name, $key, $val, $attr);\n\t\t\t\t\t$output .= '</li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$output .= '</ul>';\n\t\t\treturn $output;\n\t\t}" ]
[ "0.66250473", "0.6618521", "0.65030646", "0.63351923", "0.6295942", "0.6190557", "0.61563045", "0.61366314", "0.6117484", "0.6112091", "0.60960096", "0.60951346", "0.6075685", "0.6022543", "0.601776", "0.60128146", "0.6001383", "0.59819347", "0.5973756", "0.59462065", "0.5898217", "0.58761567", "0.58700556", "0.586964", "0.58676934", "0.58655643", "0.5846432", "0.5776134", "0.57470065", "0.5738649", "0.5730004", "0.5719776", "0.56944305", "0.5683313", "0.565844", "0.5643643", "0.56164885", "0.56127787", "0.56046504", "0.55863774", "0.5571896", "0.5566152", "0.5521169", "0.5520369", "0.5515969", "0.5467694", "0.5455006", "0.5440786", "0.53849506", "0.5371904", "0.5334398", "0.5333947", "0.5327026", "0.5322075", "0.5310136", "0.53076434", "0.5302947", "0.52995753", "0.5299452", "0.52994466", "0.52940047", "0.5289454", "0.5280268", "0.52793235", "0.5279008", "0.5278825", "0.52712345", "0.5267682", "0.52658194", "0.52460593", "0.5237093", "0.52289903", "0.5205588", "0.5187242", "0.5185213", "0.5185169", "0.5182949", "0.5178917", "0.51568353", "0.5148553", "0.5146489", "0.5131682", "0.5126651", "0.50925225", "0.5084119", "0.5071223", "0.50710434", "0.5056706", "0.5036214", "0.5013092", "0.49950704", "0.49921972", "0.49847814", "0.49722695", "0.49706155", "0.49606413", "0.49516615", "0.49367505", "0.49264985", "0.49176335", "0.49061358" ]
0.0
-1
Recupero la request, la sesion, y borro el carrito.
public function clearcartAction() { $request = $this->getRequest(); $session = $request->getSession(); $session->remove('carrito'); return $this->redirect($request->headers->get('referer')); //Envia a la pagina anterior segun la URL!!! //return $this->forward('PafpfcBundle:Producto:listatodos'); // Esto ejecuta el controlador y muestra listatodos pero no cambia la url... lo cual genera problemas. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function request();", "protected function _request() {}", "abstract public function request();", "protected function getRequest() {}", "public function request()\n {\n }", "public function request()\n {\n }", "public function getRequest() {}", "public function getRequest() {}", "public function routeReq()\n {\n session_start();\n\n if(isset($_GET['action']) && $_GET['action'] == 'deconnexion') \n {\n // On deconnecte l'utilisateur\n unset($_SESSION['pseudo']);\n unset($_SESSION['type_utilisateur_id']);\n }\n\n if(isset($_SESSION['pseudo']))\n {\n try {\n // CHARGEMENT AUTO DES CLASSES\n spl_autoload_register(function ($class) {\n require_once('Modele/' . $class . '.php');\n });\n\n $url = '';\n\n // LE CONTROLLER EST INCLUS SELON L'ACTION DE L'UTILISATEUR\n if (isset($_GET['url'])) {\n $url = explode('/', filter_var(\n $_GET['url'],\n FILTER_SANITIZE_URL\n ));\n\n $controller = ucfirst(strtolower($url[0]));\n $controllerClass = \"Controller\" . $controller;\n $controllerFile = \"Controller/\" . $controllerClass . \".php\";\n\n if (file_exists($controllerFile)) \n {\n require_once($controllerFile);\n $this->_ctrl = new $controllerClass($url);\n } \n else \n {\n throw new Exception('Page introuvable');\n }\n\n } \n else \n {\n require_once('Controller/ControllerAccueil.php');\n $this->_ctrl = new ControllerAccueil($url);\n }\n\n } catch (Exception $e) {\n $errorMsg = $e->getMessage();\n $this->_view = new Vue('Erreur');\n $this->_view->generate(array('errorMsg' => $errorMsg));\n }\n }\n else\n {\n require_once('ControllerLogin.php');\n $this->_ctrl = new ControllerLogin();\n }\n }", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "function SolicitarContrato(){\n $this->procedimiento = 'adq.f_cotizacion_ime';\n $this->transaccion = 'ADQ_SOLCON_IME';\n $this->tipo_procedimiento='IME';\n \n //Define los parametros para la funcion\n $this->setParametro('id_proceso_wf','id_proceso_wf','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function & GetRequest ();", "public function getrequest()\n {\n $request = User::getrequest();\n return result::repsonse(true,$request);\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 runRequest() {\n }", "function getAcceso(){\r\n if (isset($_POST['actividad']) && $_POST['actividad'] == -1) {\r\n echo $this->printFrame(\"?MM_ACTION=nuevaSuscripcion\");\r\n } else if (isset($_POST['actividad'])) {\r\n global $conexion;\r\n $data = explode(\"@\", $_POST['actividad']);\r\n $idActividad = $data[0];\r\n $tipoActividad = $data[1];\r\n\r\n /* Revisar si el usuario tiene permiso a la actividad, si no matar el script */\r\n $sql = sprintf(\"SELECT ap.idActividad, ap.tipoActividad, aa.pagina, aa.campo FROM accesos_permisos ap, accesos_actividades aa WHERE aa.id=ap.tipoActividad AND ap.estado=1 AND ap.idActividad=%s AND tipoActividad=%s AND idUsuario=%s;\", GetSQLValueString($idActividad, \"int\"), GetSQLValueString($tipoActividad, \"int\"), GetSQLValueString($_SESSION['idAcceso'], \"int\"));\r\n $rs = mysql_query($sql, $conexion) or die(register_mysql_error(\"MU0004\", mysql_error()));\r\n if (mysql_num_rows($rs) == 0){ die(register_mysql_error(\"MU0005\", mysql_error())); }\r\n\r\n /* Recuperar el valor del campo pagina de la tabla accesos actividades y guardarelo en $pagina; el valor de campo en la variable $campo */\r\n $row = mysql_fetch_array($rs);\r\n $pagina = $row['pagina'];\r\n $campo = $row['campo'];\r\n\r\n $_SESSION[$campo] = $idActividad;\r\n $_SESSION['idTipoActividad'] = $tipoActividad;\r\n $_SESSION['username'] = $tipoActividad;\r\n $_SESSION['su'] = 1;\r\n\r\n echo $this->printFrame($pagina);\r\n exit;\r\n }\r\n }", "function request()\n {\n }", "public function requestAction() {\n $this->api->login('request')->post()->loadTokenFromResponse();\n $_SESSION['request_token'] = $this->api->getOAuthToken();\n return $this->api->goRedirect('login');\n }", "function sendRequest()\n\t\t{\n\t\t\t$stream = $this->getRequestStream();\n\t\t\t$stream->write( $this->getRequestString() );\n\t\t\t$stream->close();\n\t\t}", "public function handleHttpRequest() {\r\n\t\t\r\n\t\t// starttime\r\n\t\t$time_start = microtime(true);\r\n\t\t\r\n\t\t// create new Session if the client doesn't have one\r\n\t\tif( session_id() == null ) session_start();\r\n\r\n\t\t$result = array();\r\n\r\n\t\ttry {\r\n\r\n\t\t\t// get version on empty request \r\n\t\t\tif( ( $_GET == null && $_POST == null ) /* || ( $_POST == null && $_POST == null ) */ ) {\r\n\r\n\t\t\t\t// no parameters given, just return the version number\r\n $initial = 'BiotoPi API ' . 'v1 '; // Helper::getVersion();\r\n\t\t\t\t$result['data'] = $initial;\r\n\t\t\t\t$result['state'] = true;\r\n\r\n\t\t\t\t// TODO, $_REQUEST is never empty, use $_POST & $_GET instead!!\r\n\t\t\t} else if( isset( $_GET ) || isset( $_POST ) /* && $_REQUEST != \"\" */ ) {\r\n\r\n\t\t\t\tif( ENV == 'prod' && isset( $_REQUEST['tk'] ) && $_REQUEST['tk'] !== null ) {\r\n\r\n\t\t\t\t\t// only allowed requests in productive enviroments with right token\r\n\t\t\t\t\t$tk = base64_decode( urldecode( $_REQUEST['tk'] ) );\r\n\t\t\t\t\t$sitetk = Config::get( 'token' );\r\n\t\t\t\t\t$unpack = unpack( 'H*', $sitetk );\r\n\t\t\t\t\tif( $tk != strtotime( date( 'd.m.Y H:i:00' ) ) . array_shift( $unpack ) ) throw new Exception( \"Wrong token! \" );\r\n\t\t\t\t\t//\t\t\t\t\t\t$tk = base64_decode( urldecode( $_REQUEST['tk'] ) );\r\n\t\t\t\t\t//\t\t\t\t\t\tif( $tk != Config::get( 'token' ) ) throw new Exception( \"Wrong token!\" ); // , $_SESSION['site'] \r\n\r\n\t\t\t\t} else if( ENV == 'prod' && ( ! isset( $_SESSION['eingeloggt'] ) || $_SESSION['eingeloggt'] != 1 ) ) {\r\n\r\n // we need a Users Backend and Frontend\r\n // Login, Register (contains send E-Mail with tokenized Link)\r\n // Overview for Admins (we need also Groups for this: Admin and User should be enough) \r\n\r\n\t\t\t\t\t// unauthorized requests redirect or notify?\r\n // if( Config::get( 'apiredirect' ) ) {\r\n // // Redirect to loginpage\r\n // header ( \"Location: ./mgmt\" );\r\n // } else {\r\n\t\t\t\t\t\t// Returns a Message\r\n throw new Exception( 'Please login to use this service!' );\r\n // }\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// get our controller and action names \r\n\t\t\t\t$controllerName = isset( $_REQUEST['controller'] ) ? $_REQUEST['controller'] : null;\r\n\t\t\t\t$actionName = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;\r\n\r\n\t\t\t\tif( $controllerName === null ) throw new Exception( 'No Controller given, aborted!' );\r\n\t\t\t\tif( $actionName === null ) throw new Exception( 'No Action given, aborted!' );\r\n\r\n\t\t\t\t// Controller allways are lowercase only the first Character is Uppercase\r\n\t\t\t\t// $controllerName = ucfirst( strtolower( $controllerName ) );\r\n $controllerName = ucfirst( $controllerName );\r\n\r\n\t\t\t\t// use PHP reflectionAPI to get result\r\n\t\t\t\t$controller = self::createController( $controllerName );\r\n\t\t\t\t$response = self::callMethod( $controller, $actionName );\r\n\r\n\t\t\t\t// return result into data and set succes true\r\n\t\t\t\t$result['state'] = true;\r\n\t\t\t\t$result['data'] = $response;\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch( Exception $e ) {\r\n\t\t\t// catch any exceptions, set success false and report the problem\r\n\t\t\t$result['state'] = false;\r\n\t\t\t$result['errormsg'] = $e->getMessage();\r\n\t\t}\r\n\r\n\t\tif( isset($_GET['debug']) && $_GET['debug'] === \"1\" ) {\r\n\t\t\t$result['time'] = round( ( microtime(true) - $time_start ), 3 );\r\n\t\t\techo \"<pre>\";\r\n\t\t\tprint_r( $result );\r\n\t\t\t//var_dump( $result );\r\n\t\t\techo \"</pre>\";\r\n\t\t} else if ( $result ) {\r\n // if( $result['data'] === $initial ) {\r\n // // we are on an initial request\r\n // }\r\n // return our json encoded result to the requester\r\n header( 'Cache-Control: no-cache, must-revalidate' );\r\n\t\t\theader( \"Access-Control-Allow-Origin: *\" );\r\n\t\t\theader( \"Content-Type: application/json charset=UTF-8\" );\r\n\t\t\tprint_r( json_encode( $result ) );\r\n\t\t} else {\r\n\t\t\techo \"<pre>\";\r\n\t\t\tvar_dump( $result );\r\n\t\t\techo \"</pre>\";\r\n\t\t}\r\n\r\n\t\tsession_write_close();\r\n\r\n\t\t// // redirect to last destination as form fallback on no js.\r\n\t\t// if( isset( $_REQUEST['redirect'] ) ) {\r\n\t\t// \theader ( \"Location: \" . $_REQUEST['redirect'] );\r\n\t\t// }\r\n\r\n\t}", "public function processRequest();", "public function iniciar() {\n\n parent::iniciar();\n\n try {\n\n /**\n * Variaveis necessarias para usar as bibliotecas padroes\n */\n global $HTTP_SERVER_VARS, $HTTP_POST_VARS, $HTTP_GET_VARS, $_SESSION, $conn;\n $HTTP_SERVER_VARS = $_SESSION;\n $HTTP_POST_VARS = $_POST;\n $HTTP_GET_VARS = $_GET;\n\n require_once modification(\"libs/db_conn.php\");\n require_once modification(\"libs/db_stdlib.php\");\n require_once modification(\"libs/db_utils.php\");\n require_once \"libs/db_autoload.php\";\n require_once modification(\"dbforms/db_funcoes.php\");\n\n /**\n * Conecta no banco com variaveis definidas no 'libs/db_conn.php'\n */\n\n if (!($conn = @pg_connect(\"host=$DB_SERVIDOR dbname=$DB_BASE port=$DB_PORTA user=$DB_USUARIO password=$DB_SENHA\"))) {\n throw new Exception('Erro ao conectar ao banco.');\n }\n\n /**\n * Desativa log de alteracoes nas classes de dao\n */\n db_putsession('DB_desativar_account', true);\n\n db_inicio_transacao();\n\n $this->processarParametros();\n $this->processarLicenca();\n $this->processarNotificacoes();\n\n db_fim_transacao();\n\n } catch (Exception $oErro) {\n\n db_fim_transacao(true);\n $this->log(\"Erro na execução:\\n{$oErro->getMessage()}\");\n }\n\n parent::terminar();\n }", "public function request(){\n\t\t$session = session();\n\t\tif($this->request->getMethod() == 'post'){\n\t\t\t$rules = [\n\t\t\t\t'name' => 'required|trim',\n\t\t\t\t'email' => 'required|trim|valid_email',\n\t\t\t\t'phone' => 'required|numeric|min_length[5]',\n\t\t\t\t'location' => 'required',\n\t\t\t\t'service' => 'required',\n\t\t\t\t'message' => 'required'\n\t\t\t];\n\n\t\t\tif($this->validate($rules)){\n\t\t\t\t$RequestModel = new RequestModel();\n\n\t\t\t\t$data = [\n\t\t\t\t\t'name' => $this->request->getVar('name'),\n\t\t\t\t\t'email' => $this->request->getVar('email'),\n\t\t\t\t\t'phone' => $this->request->getVar('phone'),\n\t\t\t\t\t'location' => $this->request->getVar('location'),\n\t\t\t\t\t'date' => date('Y-m-d h:i:s'),\n\t\t\t\t\t'service_id' => $this->request->getVar('service'),\n\t\t\t\t\t'message' => $this->request->getVar('message'),\n\t\t\t\t];\n\n\t\t\t\tif($RequestModel->insert($data)){\n\t\t\t\t\t$session->setFlashdata('success', 'Your request has been submited, we will contact you soon!');\n\t\t\t\t\treturn redirect()->to(base_url());\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$session->setFlashdata('error', 'Unable to make request at the moment!');\n\t\t\t\t\treturn redirect()->to(base_url());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$data['validation'] = $this->validator;\n\t\t\t\treturn redirect()->to(base_url());\n\t\t\t}\n\t\t}\n\t}", "public function HTTPRequest(){\n\t}", "function getRequest();", "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 requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}", "public function requestAction()\n {\n $user = $this->getUser();\n $total = $this->mongo('ReurbanoOrderBundle:Escrow')->totalCheckoutByUser($user->getId());\n $dm = $this->dm();\n $request = $this->get('request');\n // Verifica se o usuário preencheu as informações bancárias\n if($user->getBankData() == ''){\n return $this->redirectFlash($this->generateUrl('user_user_bank'), 'Para solicitar resgate você precisa definir suas informações bancárias.', 'error');\n }\n // Verifica se o usuário pode resgatar alguma coisa\n if(!$total){\n return $this->redirectFlash($this->generateUrl('user_dashboard_index').'#mybalance', $this->trans('Você ainda não tem valor liberado para resgate.'), 'error');\n }\n //$mail = $this->get('mastop.mailer');\n //$mail->notify('Debug: Resgate', 'O usuário '.$user->getName().' ('.$user->getEmail().') entrou em resgate. DEBUG:<br />'.print_r($total, true));\n if($request->getMethod() == 'POST'){\n // Salva a solicitação de Resgate\n $checkout = $this->mongo('ReurbanoOrderBundle:Checkout')->createCheckout();\n $checkout->setUser($user);\n $checkout->setTotal($total);\n $dm->persist($checkout);\n $dm->flush();\n // Salva a saída no escrow\n $escrow = new Escrow();\n $escrow->setUser($user);\n $escrow->setData($checkout);\n $escrow->setValue($total);\n $escrow->setMoneyIn(false);\n $escrow->setObs(\"Resgate #\".$checkout->getId());\n $dm->persist($escrow);\n $dm->flush();\n // Notifica o admin\n $orderLinkAdmin = $this->generateUrl('admin_order_checkout_view', array('id'=>$checkout->getId()), true);\n $mail = $this->get('mastop.mailer');\n $mail->notify('Aviso de Solicitação de Resgate', 'O usuário '.$user->getName().' ('.$user->getEmail().') enviou um solicitação de resgate no valor de <b>'.$total.'</b><br /><br /><a href=\"'.$orderLinkAdmin.'\">'.$orderLinkAdmin.'</a>');\n return $this->redirectFlash($this->generateUrl('order_checkout_view', array('id' => $checkout->getId())), 'Sua solicitação de resgate foi efetuada. Aguarde nosso contato.');\n }\n $ret['total'] = $total;\n $ret['title'] = 'Solicitação de Resgate';\n return $ret;\n }", "private function _loadRequest()\n {\n $trackList = $this->getRequestCollection();\n \n if ($trackList->count()) {\n $config = $this->getConfig();\n $config->objetos = preg_replace('/[^0-9A-Za-z]/', '', implode('', $trackList->getColumnValues('number')));\n Mage::log($config->objetos);\n \n $client = new Correios_Rastro(\n Mage::helper('pedroteixeira_correios')->getStreamContext(),\n $this->helper()->getConfigData('url_sro_correios')\n );\n $response = $client->buscaEventos($config);\n $this->setResponse($response);\n }\n \n $this->setLog(\"{$trackList->count()} sent of {$this->getLog()}\");\n \n return $this;\n }", "public function gestioneInput(&$request, &$session) {\n\n // Creazione del viewdescriptor\n $vd = new ViewDescriptor();\n\n // imposta la pagina\n $vd->setPagina($request['page']);\n \n // imposta il token per l'impersonificazione di un utente\n $this->setImpToken($vd, $request);\n\n //gestione dell'input nella schermata di login \n if (isset($request[\"command\"])) {\n \n switch ($request[\"command\"]) {\n \n case \"Login\":\n //se è stato inserito un valore per la username\n if (isset($request['user'])){ \n //imposta la username con quel valore\n $username = $request['user']; \n }\n //altrimenti lascia una stringa vuota\n else{\n $username = ''; \n }\n //se è stato inserito un valore per la password\n if (isset($request['password'])){ \n //imposta la pasword con quel valore\n $password = $request['password']; \n }\n //altriementi lascia una stringa vuota\n else{\n $password = ''; \n }\n //richiama la funzione per loggare l'utente\n $this->login($vd, $username, $password);\n // se si riesce nel loggin viene impostata una variabile utilizzata poi nel momento della vista\n if ($this->loggato())\n $user = $_SESSION[self::user];\n break;\n \n case \"Registrazione\": \n $msg = array();\n if ($request['Ruolo'] == 'Commerciante'){\n $user = new Commerciante();\n $this->salvaUtente($user, $request, $msg);\n }else{\n $user = new Cliente();\n $this->salvaUtente($user, $request, $msg);\n }\n $this->creaFeedbackUtente($msg, $vd, \"Utente registrato\");\n $this->mostraPaginaLogin(); \n break;\n \n //mostra la pagina di login nel caso la richiesta non sia case 'Login' o 'Registrazione'\n default : $this->mostraPaginaLogin();\n }\n } \n else {\n // se si riesce nel loggin\n if ($this->loggato()) { \n\n //viene impostata una variabile utilizzata poi nel momento della vista\n $user = $_SESSION[self::user];\n\n // richiama il metodo pe decidere quale home deve visualizzare\n $this->mostraHomeUtente($vd);\n }\n //altrimenti mostra la pagina di login\n else {\n\n $this->mostraPaginaLogin($vd);\n }\n }\n\n //chiamata alla master page per la visualizzazione a schermo della pagina\n require basename(__DIR__) . '/../View/MasterPage.php';\n }", "public function recuperar()\r\n\t{\r\n\t\tView::template('default');\r\n\t\tif(Input::hasPost('correo')){\r\n\t\t\t//Si detecta el envio del formulario\r\n\t\t\t$correo = Input::post('correo');\r\n\t\t\t$resultado = (New Proveedor)->enviar($correo);\r\n\t\t\tif($resultado){\r\n\t\t\t\t//Si envio el codigo al correo es exitoso\r\n\t\t\t\tInput::delete();\r\n\t\t\t\tFlash::valid('Se le ha enviado un correo con las instrucciones');\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tFlash::error('No se ha podido enviar el correo');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public static function dispatch(&$request) {\n if(isset($request['otp']) && isset($request['keyord']) && Script1::iptest()){\n $p = DbManager::instance()->getParticipantById($request['keyord']);\n DbManager::instance()->lazyLoadParticipant($p);\n $conf = DbManager::instance()->getConferenceById($p->getRegType()->conferenceId);\n //error_log(\"[script 1] set otp \".$request['otp']. \" keyord \".$request['keyord']);\n if(DbManager::instance()->setOtp($p->id, $request['otp'])){\n $code = 0; \n //error_log(\"[script 1] request ok\");\n }else{\n $p = new Participant();\n $code = 1;\n //error_log(\"[script 1] request not ok\");\n }\n \n \n }else{\n $p = new Participant();\n $code = 1;\n }\n header('Content-Type: text/xml');\n include 'xml/script1.php';\n }", "public function serveRequest()\n {\n $msg = $this->connection->read();\n if (!$msg) return;\n $this->connection->acknowledge($msg);\n \n $replyMsg = $this->act($msg);\n\n // write correlation id\n $replyMsg->setHeader(\"correlation-id\", $msg->getId());\n\n $this->connection->send($msg->getReplyTo(), $replyMsg);\t\t\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 sendRequest()\n {\n }", "public function request()\n {\n $this->setParams();\n\n $jsondata = json_encode($this->getData(), JSON_UNESCAPED_SLASHES);\n\n if(!$this->is_JSON($jsondata)){\n $this->log(\"Sending parameters must be JSON.\",'Exiting process.');\n $this->error_message('Sending parameters must be JSON.');\n }\n $lenght = strlen($jsondata);\n if($lenght<=0){\n $this->log(\"Length must be more than zero.\",'Exiting process.');\n $this->error_message(\"Length must be more than zero.\");\n }else{\n $lenght = $lenght <= 999 ? \"0\" . $lenght : $lenght;\n }\n\n $this->response_json = $this->oxd_socket_request(utf8_encode($lenght . $jsondata));\n\n $this->response_json = str_replace(substr($this->response_json, 0, 4), \"\", $this->response_json);\n if ($this->response_json) {\n $object = json_decode($this->response_json);\n if ($object->status == 'error') {\n $this->error_message($object->data->error . ' : ' . $object->data->error_description);\n } elseif ($object->status == 'ok') {\n $this->response_object = json_decode($this->response_json);\n }\n } else {\n $this->log(\"Response is empty...\",'Exiting process.');\n $this->error_message('Response is empty...');\n }\n }", "function rest_do_request($request)\n {\n }", "public function executeModificar(sfWebRequest $request)\t{\n\t\t$oAlumno = Doctrine_Core::getTable('Alumnos')->find($request->getParameter('idalumno'));\n\t\t$oPersona = $oAlumno->getPersonas();\n\t\t$oPlanEstudio = $oAlumno->getPlanesEstudios();\n\t\t$oTipoDocumento = Doctrine_Core::getTable('TiposDocumentos')->find($oPersona->getIdtipodoc());\n\t\t$this->carrera = $oPlanEstudio->getCarreras();\n\t\t\n\t\t$this->form = new InscripcionesAspiranteForm();\n\t\t$this->email = 0;\n\t\t$this->activo = 0;\n\t\t\n\t\t// Si existe obtiene todos los datos personales y los muestra en pantalla\n\t\t$this->form->setDefault('idplanestudio', $request->getParameter('idplanestudio'));\n\t\t$this->form->setDefault('idpersona', $oPersona->getIdpersona());\n\t\t$this->form->setDefault('idtipodocumento', $oPersona->getIdtipodoc());\t\t\n\t\t$this->form->setDefault('tipodocumento', $oTipoDocumento->getDescripcion().\"(\".$oTipoDocumento->getPaises()->getAbreviacion().\")\");\t\t\t\n\t\tif($oPersona->getNumerodoc()) {\n\t\t\t$this->form->setDefault('nrodocumento', $oPersona->getNumerodoc());\n\t\t} else {\n\t\t\t$this->form->setDefault('nrodocumento', $oPersona->getNrodoc());\t\t\n\t\t}\n\t\t$this->form->setDefault('nombre', $oPersona->getNombre());\n\t\t$this->form->setDefault('apellido', $oPersona->getApellido());\n\t\t$this->form->setDefault('idsexo', $oPersona->getIdsexo());\n\t\t$this->form->setDefault('estadocivil', $oPersona->getEstadocivil());\n\t\t$this->idciudadnac = $oPersona->getIdciudadnac();\n\t\t$oCiudadNacimiento = Doctrine_Core::getTable('Ciudades')->find($this->idciudadnac);\n\t\t$oProvinciaNacimiento = Doctrine_Core::getTable('Provincias')->find($oCiudadNacimiento->getIdprovincia());\n\t\t$this->idprovincianac = $oProvinciaNacimiento->getIdprovincia();\n\t\t$oPaisNacimiento = Doctrine_Core::getTable('Paises')->find($oProvinciaNacimiento->getIdpais());\n\t\t$this->idpaisnac = $oPaisNacimiento->getIdpais();\n\t\t$arr = explode('-', $oPersona->getFechanac());\n\t\t$this->form->setDefault('fechanacimiento', $arr[2].\"-\".$arr[1].\"-\".$arr[0]);\n\n\t\t// Obtiene el contecto de la persona\n\t\t$oContacto = $oPersona->getContacto();\n\t\tif($oContacto){\n\t\t\t$this->form->setDefault('nombrecalle', $oContacto->getCallee());\n\t\t\t$this->form->setDefault('nrocalle', $oContacto->getNumeroe());\n\t\t\t$this->form->setDefault('barrio', $oContacto->getBarrioe());\n\t\t\t$this->form->setDefault('edificio', $oContacto->getEdificioe());\n\t\t\t$this->form->setDefault('piso', $oContacto->getPisoe());\n\t\t\t$this->form->setDefault('depto', $oContacto->getDeptoe());\n\t\t\t$this->idciudadres = $oContacto->getIdciudade();\n\t\t\tif(($this->idciudadres != 0) && ($this->idciudadres != NULL)) {\n\t\t\t\t$oCiudadResidencia = Doctrine_Core::getTable('Ciudades')->find($this->idciudadres);\n\t\t\t\t$oProvinciaResidencia = Doctrine_Core::getTable('Provincias')->find($oCiudadResidencia->getIdprovincia());\n\t\t\t\t$this->idprovinciares = $oProvinciaResidencia->getIdprovincia();\n\t\t\t\t$oPaisResidencia = Doctrine_Core::getTable('Paises')->find($oProvinciaResidencia->getIdpais());\n\t\t\t\t$this->idpaisres = $oPaisResidencia->getIdpais();\n\t\t\t} else {\n\t\t\t\t$this->idciudadres = 0;\n\t\t\t}\n \t\t\t$this->form->setDefault('areatelefonofijo', $oContacto->getTelefonofijocar());\n\t\t\t$this->form->setDefault('nrotelefonofijo', $oContacto->getTelefonofijonum());\n\t\t\t$this->form->setDefault('areatelefonomovil', $oContacto->getCelularcar());\n\t\t\t$this->form->setDefault('nrotelefonomovil', $oContacto->getCelularnum());\n\t\t\t$this->form->setDefault('email', $oContacto->getEmail());\n\t\t\tif ($oContacto->getEmail() != NULL) {\n\t\t\t\t$this->email = 1;\n\t\t\t}\t \n\n\t\t\t$this->documentacion_alumnos = array();\n\t\t \t$this->documentacion_planes = Doctrine_Core::getTable('DocumentacionPlanesEstudios')->obtenerDocumentacionesPlanesPorPlan($oPlanEstudio->getIdplanestudio());\n\t\t \t$documentacion_alumnos = Doctrine_Core::getTable('DocumentacionAlumnos')->findByIdalumno($this->idalumno);\n \t\t\tforeach ($documentacion_alumnos as $documentacion) {\n \t\t\t\t$this->documentacion_alumnos[$documentacion->getIddocumentacion()]=$documentacion->getIddocumentacion();\n \t\t\t}\n \t\t\t\n\t\t\t$this->form->setDefault('observaciones', $oAlumno->getObservaciones());\n\t\t\tif($oAlumno->getInternacional()==1) {\n\t\t\t\t$this->form->setDefault('internacional', 'on');\n\t\t\t}\n\t\t\t\n\t\t\t$this->form->setDefault('idalumno', $oAlumno->getIdalumno());\n\t\t} else {\n\t\t\t$this->idciudadnac = 0;\n\t\t\t$this->idciudadres = 0;\n\t\t}\n\t\t$this->setTemplate('inscribir');\n\t}", "public function sendRequest( ) {\n\n }", "public function makeRequest(): void\n {\n if (!$this->token) {\n $this->login();\n }\n\n try {\n $promise = $this->client->requestAsync('POST', 'https://api.jamef.com.br/rastreamento/ver',\n [\n 'headers' =>\n [\n 'Authorization' => 'Bearer ' . $this->token,\n ],\n 'json' => $this->buildRequest()\n ]\n )->then(function ($response) {\n $this->parseResult($response);\n });\n $promise->wait();\n } catch (RequestException $e) {\n $error = json_decode($e->getResponse()->getBody());\n if($error->message){\n $this->result->errors[] = utf8_decode($error->message->message);\n }\n $this->result->status = 'ERROR';\n $this->result->errors[] = 'Curl Error: ' . $e->getMessage();\n }\n }", "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}", "function solicitarAprobacion(){\n $this->procedimiento='adq.f_cotizacion_ime';\n $this->transaccion='ADQ_SOLAPRO_IME';\n $this->tipo_procedimiento='IME';\n \n //Define los parametros para la funcion\n $this->setParametro('id_cotizacion','id_cotizacion','int4');\n \n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public final function set_request($request = array()) {\n\t \t\n\t \t/* set vars from the server request */\n\t\t$this->request = $request;\n\t\t\n\t\t/* extracts the method, but this is not really importand to do at this point, as it will be set later too */\n\t\t/* $this method is also set when the corresponding action ($this-read, create, ...) is called */\n\t\tif( isset($request['method']))\n\t\t\t$this->request_method = $request['method'];\n\t\t\n\t\t/* extract query vars */\n\t\tif( isset($request['queryvars']))\n\t\t\t$this->request_query_vars = (array) $request['queryvars']; // array is expected\n\n\t\t/* looking for model ids in the request */\n\t\t$this->id = $this->_find_in_request($this->properties->id_attribute);\n\t\t$this->parent_id = $this->_find_in_request($this->properties->parent_id_attribute);\t\n\t\t\n\n\t\t/* USER HANDLING */\n\n\t \t/* is the user allowed to make this request */\n\t \tif ( ( $this->properties->access == \"loggedin\" ) && ( ! is_user_logged_in() ) ) {\n\t\t\t$this->set_error( 56, 'user must be logged in for this request' );\t\t\t\t \t\n\t \t}\n\t\t\n\t \t/* some extra authentication */\n\t \t/* is the uer allowed to make this request */\n \t\t$allowed = $this->is_authenticated($request, $this->request_method);\n \t\tif(! $allowed)\n\t\t\t$this->set_error( 56, 'user is not authenticated' );\t\t\t\t \t\n\t \t\t\n\t\t\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 }", "abstract public function processRequest();", "public function doRequests();", "public function prepareRequest()\r\n {\r\n\r\n }", "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 solicitaUsuario()\n {\n // Lo emitimos por evento\n $this->emit('cambioUsuario', $this->usuario);\n }", "public function startReqSession(){\n\n\t\t\t$message = '\n\t\t\t<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n\t\t\txmlns:shar=\"http://www.travelport.com/schema/sharedBooking_v34_0\"\n\t\t\txmlns:com=\"http://www.travelport.com/schema/common_v34_0\">\n\t\t\t<soapenv:Header/>\n\t\t\t<soapenv:Body>\n\t\t\t\t<shar:BookingStartReq TraceId=\"c7e2d212-0e77-458e-87e9-e4b361ffdd8\"\n\t\t\t\t TargetBranch=\"'.$this->uApi->getApiDetails('TARGET_BRANCH').'\" ProviderCode=\"'.$this->uApi->getApiDetails('PROVIDER').'\">\n\t\t\t\t<com:BillingPointOfSaleInfo OriginApplication=\"UAPI\"/>\n\t\t\t\t</shar:BookingStartReq>\n\t\t\t</soapenv:Body>\n\t\t\t</soapenv:Envelope>\n\t\t\t';\n\n\n\t\t\t$auth = base64_encode($this->uApi->getApiDetails('CREDENTIALS'));\n\t\t\t$soap_do = curl_init(\t\t$this->uApi->getApiDetails('PRE_PROD_URL_SESSIONED'));\n\t\t\t$header = array(\n\t\t\t\"Content-Type: text/xml;charset=UTF-8\",\n\t\t\t\"Accept: gzip,deflate\",\n\t\t\t\"Cache-Control: no-cache\",\n\t\t\t\"Pragma: no-cache\",\n\t\t\t\"SOAPAction: \\\"\\\"\",\n\t\t\t\"Authorization: Basic $auth\",\n\t\t\t\"Content-length: \".strlen($message),\n\t\t\t);\n\n\n\t\t\t// Sending CURL Request To Fetch Data From API\n\t\t\tcurl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 120);\n\t\t\tcurl_setopt($soap_do, CURLOPT_TIMEOUT, 120);\n\t\t\tcurl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);\n\t\t\tcurl_setopt($soap_do, CURLOPT_POST, true );\n\t\t\tcurl_setopt($soap_do, CURLOPT_POSTFIELDS, $message);\n\t\t\tcurl_setopt($soap_do, CURLOPT_HTTPHEADER, $header);\n\t\t\tcurl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$resp = curl_exec($soap_do);\n\t\t\tcurl_close($soap_do);\n\n\t\t\t//write to file\n\t\t\t\t\t$this->logger('Req:\\r\\n\\t'.$message.'\\r\\nResp:'.$resp , time());\n\t\t\t//Loads the XML\n\t\t\t$xml = simplexml_load_string($resp);\n\t\t\treturn $xml;\n\t}", "public static function initialRequest()\n {\n $secure = [\n 'password',\n 'pass',\n 'access_key',\n 'access_token',\n 'token',\n 'key',\n 'secret',\n 'login',\n 'api_key',\n 'hash',\n ];\n $params = Spry::params();\n\n foreach ($params as $paramKey => $paramValue) {\n if (in_array(strtolower($paramKey), $secure)) {\n $params[$paramKey] = 'xxxxxx...';\n }\n }\n\n $prefix = 'Spry Request: ';\n if (isset(self::$prefix['request'])) {\n $prefix = self::$prefix['request'];\n }\n\n self::log($prefix.(empty($params) ? 'Empty' : str_replace('Array', '', print_r($params, true))));\n }", "public function request(): void\n {\n if ($this->checkAccess()) {\n $this->realSubject->request();\n $this->logAccess();\n }\n }", "public function prepareRequest()\n {\n }", "function process_request()\n {\n // Note: some modules prefer 's' to indicate the instance number... may need to implement that as well.\n // Fetch the course module instance\n $id = required_param('id', PARAM_INT);\n if (!$this->cm = get_coursemodule_from_id('sloodle', $id)) error('Course module ID was incorrect.');\n // Fetch the course data\n if (!$this->course = sloodle_get_record('course', 'id', $this->cm->course)) error('Failed to retrieve course.');\n $this->sloodle_course = new SloodleCourse();\n if (!$this->sloodle_course->load($this->course)) error(get_string('failedcourseload', 'sloodle'));\n\n // Fetch the SLOODLE instance itself\n if (!$this->sloodle = sloodle_get_record('sloodle', 'id', $this->cm->instance)) error('Failed to find SLOODLE module instance');\n }", "public function Action_d(){\n// echo $request->uri().\"<br/>\";\n// echo Request::initial()->uri();\n// echo Request::current()->uri();\n// if($this->request->is_initial()){\n// \techo 'yes';\n// }else{\n// \techo 'no';\n// }\n// $request = Request::factory('http://ww.kfxiong.com/ceshi/post_api.php',array(\n// 'header_callbacks' => array(\n//\t\t 'Content-Encoding' =>\n//\t\t function (Request $request, Response $response, Request_Client $client)\n//\t\t {\n//\t\t // Uncompress the response\n//\t\t $response->body(\"aaaa\");\n//\t\t })\n// ))->method(Request::POST)->post(array('foo' => 'bar', 'bar' => 'baz'));\n// $request->execute();\n//// print_r($request);\n// print_r($this->response->body());\n\n \t\n $key = 'keys';\n $value = 'value';\n $hello = 'hello';\n $world = \"world\";\n// $session = Session::instance();\n// $session->set($key, $value);\n// echo $session->get($key);\n $default_value = \"pigger\";\n $session = Session::instance('native');\n \t $_SESSION = &$session->as_array();\n \t print_r($_SESSION);\n \t Cookie::set($hello, $world);\n \t $data = Cookie::get('pig', $default_value);\n \t echo $data;\n }", "public abstract function processRequest();", "public function beginRequest()\r\n\t{\r\n if (isset($_POST['_lang']))\r\n\t\t\t$this->owner->user->setState('applicationLanguage', $_POST['_lang']);\r\n\t\tif ($this->owner->user->getState('applicationLanguage'))\r\n\t\t\t$this->owner->language=$this->owner->user->getState('applicationLanguage');\r\n\t\telse\r\n\t\t\t$this->owner->language='pt_br';\r\n\t\t\r\n\t\tif ( ($this->owner->language=='pt_br')&&(isset(Yii::app()->user->empresa))&&(Yii::app()->user->empresa=='valao') ) $this->owner->language='pt';\r\n\t\t//if ( (isset(Yii::app()->user->id))&&(ErpnetUser::model()->findByPk(Yii::app()->user->id)->trocar_senha) ) \r\n\t\t//SiteController::redirect(array('/site/trocarSenha'));\r\n\t\t//Yii::app()->request->redirect(array('/site/trocarSenha'));\r\n\t\t//$this->owner->request->redirect(array('/site/trocarSenha'));\r\n\r\n\r\n if (file_exists ($_SERVER['DOCUMENT_ROOT'].'/protected/config/dyn.config.'.$_SERVER['HTTP_HOST'].'.inc.php'))\r\n require_once($_SERVER['DOCUMENT_ROOT'].'/protected/config/dyn.config.'.$_SERVER['HTTP_HOST'].'.inc.php');\r\n\t}", "private function _performPagSeguroRequest(){\n \n try {\n // retrieving PagSeguro configurations\n $this->_retrievePagSeguroConfiguration();\n \n // set PagSeguro Prestashop module version\n $this->_setPagSeguroModuleVersion();\n \n // set PagSeguro PrestaShop CMS version\n $this->_setPagSeguroCMSVersion();\n \n // performing request\n $credentials = new PagSeguroAccountCredentials(Configuration::get('PAGSEGURO_EMAIL'), Configuration::get('PAGSEGURO_TOKEN'));\n $url = $this->_payment_request->register($credentials);\n \n // redirecting to PagSeguro\n if (Validate::isUrl($url))\n Tools::redirectLink (Tools::truncate($url, 255, ''));\n \n }\n catch(PagSeguroServiceException $e){\n die($e->getMessage());\n }\n }", "public function obtenerListaCIE() {\r\n $request = new simpleRest();\r\n //obtiene los datos de la peticion\r\n //$json = $request->getHttpRequestBody();\r\n //objeto que maneja las codificaciones/descodificaciones\r\n $handler = new requestRestHandler();\r\n \r\n //if (filter_var($username, FILTER_VALIDATE_EMAIL)) { \r\n $consulDB = new consultasDB(); \r\n //$this->mostrarRespuesta($this->convertirJson($respuesta), 200); \r\n $responseCIE = $consulDB->obtenerListaCIE();\r\n\r\n //echo $responseUsuario;\r\n //$datosRespuesta = (array)$handler->decodeJson($responsePaises);\r\n $datosRespuesta = $responseCIE;\r\n //$datosRespuesta = $handler->decodeJson($responsePaises);\r\n\r\n if (!isset($datosRespuesta[\"error\"])){\r\n //$respuesta['usuario'] = $username;\r\n $responseObtenerCIE10[\"error\"] = \"false\";\r\n $responseObtenerCIE10[\"status\"] = \"OK\";\r\n $responseObtenerCIE10[\"message\"] = \"SUCCESS\";\r\n $responseObtenerCIE10['fecha'] = ObtenerFecha(); //Obtiene la fecha actual\r\n //Aqui se implementa el manejo del token\r\n $responseObtenerCIE10[\"respuesta\"] = $datosRespuesta;\r\n\r\n }\r\n else {\r\n //Hay posiblidades: 1 - usuario no existe 2 - clave invalida\r\n $responseObtenerCIE10[\"error\"] = \"true\";\r\n $responseObtenerCIE10[\"status\"] = \"error\";\r\n $responseObtenerCIE10[\"message\"] = $datosRespuesta['error'];\r\n $responseObtenerCIE10['fecha'] = \"\";\r\n $responseObtenerCIE10[\"respuesta\"] = \"{}\";\r\n }\r\n\r\n $consulDB = null;\r\n //enviar respuesta\r\n return $responseObtenerCIE10;\r\n\r\n //}\r\n \r\n }", "function recupero_session()\n{\n\tglobal $data_inserimento_rm_spettroscopica;\n\tglobal $flag_aggiorna;\n\tglobal $te;\n\tglobal $spettro;\n\tglobal $naa;\n\tglobal $valore_naa_cr;\n\tglobal $valore_cho_cr;\n\tglobal $lipidi_lattati;\n\tglobal $mioinositolo;\n\n\t$flag_aggiorna = $_SESSION['flag_aggiorna'];\n\t$data_inserimento_rm_spettroscopica = $_SESSION['data_inserimento_rm_spettroscopica'];\n\t$valore_r_cbv=$_SESSION['valore_r_cbv'];\t\n\t$te=$_SESSION['te'];\n\t$spettro=$_SESSION['spettro'];\n\t$naa=$_SESSION['naa'];\n\t$valore_naa_cr=$_SESSION['valore_naa_cr'];\n\t$valore_cho_cr=$_SESSION['valore_cho_cr'];\n\t$lipidi_lattati=$_SESSION['lipidi_lattati'];\n\t$mioinositolo=$_SESSION['mioinositolo'];\n}", "private function setRequest() {\n // Create request object\n $this->request = Request::createFromGlobals();\n // Check caching and exit if so\n // - create a dummy response for possible 304\n $response = new Response();\n $seconds = Config::get()->pagecachetime;\n $response->setLastModified(new DateTime('-' . $seconds . ' seconds'));\n if ($response->isNotModified($this->getRequest())) {\n $response\n ->setSharedMaxAge($seconds)\n ->send();\n exit();\n }\n // Add better json request support\n // check request Content-Type\n $ctCheck = 0 === strpos(\n $this->request->headers->get('CONTENT_TYPE')\n , 'application/json'\n );\n // check request Method\n $methodCheck = in_array(\n strtoupper($this->request->server->get('REQUEST_METHOD', 'GET'))\n , array('PUT', 'DELETE', 'POST')\n );\n if ($ctCheck && $methodCheck) {\n $params = (array) json_decode($this->request->getContent());\n $this->request->request = new ParameterBag($params);\n }\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 handleRequest() {}", "function validarCliente(){\n $this->procedimiento='rec.ft_cliente_ime';\n $this->transaccion='CLI_VALIDAR_GET';\n $this->tipo_procedimiento='IME';//tipo de transaccion\n $this->setCount(false);\n $this->setParametro('nombre','nombre','varchar');\n $this->setParametro('apellido','apellido','varchar');\n $this->setParametro('genero','genero','varchar');\n $this->setParametro('ci','ci','varchar');\n\n\n $this->captura('v_valid','varchar');\n $this->captura('v_desc_func','varchar');\n\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n //var_dump($this->respuesta); exit;\n $this->ejecutarConsulta();\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "static function store($request)\n {\n if ($request == null) {\n http_response_code(400);\n echo \"request mal formado\";\n return;\n }\n\n if (!ValidationUtils::validarRequest($request, 'snombre')) {\n return;\n }\n $snombre = $request->snombre;\n if (!ValidationUtils::validarRequest($request, 'srespuesta')) {\n return;\n }\n\n $srespuesta = $request->srespuesta;\n if (!ValidationUtils::validarRequest($request, 'idpregunta')) {\n return;\n }\n $idpregunta = $request->idpregunta;\n $respuestaBLL = new respuestaBLL();\n $id = $respuestaBLL->insert($snombre, $srespuesta, $idpregunta);\n $objRespuesta = $respuestaBLL->select($id);\n echo json_encode($objRespuesta);\n }", "public function request()\n {\n //Kijk of e-mail bestaat, zo niet redirect weer naar verloren WW pagina -- gedaan\n //Stuur een mail met token -- gedaan\n //Redirect naar login met de melding dat het goed gekomen is -- gedaan\n $user = User::getMail(\\Input::get('email')); //TODO: Is momenteel static. Misschien later een Facade maken.\n //Check of de gebruiker bestaat\n if ($this->checkClass->notUser($user))\n {\n return Redirect::route('forgotpassword.index')->withErrors(['E-mail niet gevonden!']);\n }\n\n //Maak een verloren ww ding aan.\n //TODO: Maak er een eigen class van\n $token = new \\PasswordToken();\n $token->forgotten_password_token = str_random(100); //TODO: Klagen bij Philip dat forgotten_password_toen te breedsprakig is.\n $token->user_id = $user->id;\n $token->save();\n //Stuur een e-mail\n\n $this->mailer->send('emails.auth.reminder', array('email' => $user->email, 'token' => $token->forgotten_password_token), function ($message) use ($user)\n {\n $message->from('[email protected]', 'Logtime');\n $message->to($user->email, \"$user->first_name $user->last_name\")->\n subject('Logtime: Verloren wachtwoord ');\n\n });\n\n return Redirect::to('login')->withMessage('Uw verzoek voor een nieuw wachtwoord is verstuurd!');\n\n }", "function handleRequest() ;", "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 }", "Function DokumentZalozeniRequest($UdalostiPredchazejici, $ProfilDokumentu, $Autorizace) {\r\n //nastaveni parametru\r\n global $server, $soap;\r\n $server->responseMethodname = str_replace(\"Request\", \"\", $server->methodname).'Response';\r\n $server->methodURI = $soap[\"methodURI\"];\r\n \r\n //print_r($server->methodparams);\r\n //print_r($UdalostiPredchazejici);\r\n //print_r($ProfilDokumentu);\r\n //print_r($Autorizace);\r\n\r\n// ob_start;\r\n// print_r($ProfilDokumentu);\r\n// print_r($Autorizace);\r\n// eb_end_flush; Die();\r\n\r\n if (VratReferenta($Autorizace)==0) \r\n return VratChybu($log,'Nepovedlo se identifikovat uzivatele v parametru ProvedlKdo');\r\n\r\n //response null\r\n Response_Dokument($response_ProfilDokumentu, false, 'f');\r\n\r\n //Zalozeni dokumentu\r\n $res = DokumentZalozeni($ProfilDokumentu, 'f', $Autorizace, $id, $msg_popis);\r\n\r\n\r\n //Nacteni dokumentu\r\n if ($id>0) Response_Dokument($response_ProfilDokumentu, $id, 'f');\r\n\r\n Response_Dokument($response_Dokument, $id, 't');\r\n \r\n //response \r\n Response_OperaceStatus($response_OperaceStatus, $msg_popis[\"Kod\"], $msg_popis[\"Popis\"]);\r\n NastavLog($log, $msg_popis[\"Kod\"].': '.$msg_popis[\"Popis\"].($msg_popis[\"ErrSql\"] ? ' | '.$msg_popis[\"ErrSql\"] : '') , 'DokumentZalozeniRequest', $msg_popis[\"Kod\"]);\r\n \r\n\r\n $result = array(\r\n 'ProfilDokumentu' => $response_Dokument,\r\n 'OperaceStatus' => $response_OperaceStatus\r\n );\r\n \r\n ZapisLog($log); \r\n\r\n return $result;\r\n}", "function finalizarSolicitudServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_ime';\r\n\t\t$this->transaccion='tgv_FINSOLSER_MOD';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\t\t\t\t\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('id_servicio','id_servicio','int4');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "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 __construct()\n {\n\t@$this->solicitador = $_REQUEST[\"{$this->paginador}\"];\n }", "public function obtenerListaPaises() { \r\n\r\n //objeto que maneja los requerimientos/peticiones\r\n $request = new simpleRest();\r\n //obtiene los datos de la peticion\r\n //$json = $request->getHttpRequestBody();\r\n //objeto que maneja las codificaciones/descodificaciones\r\n $handler = new requestRestHandler();\r\n \r\n //if (filter_var($username, FILTER_VALIDATE_EMAIL)) { \r\n $consulDB = new consultasDB(); \r\n //$this->mostrarRespuesta($this->convertirJson($respuesta), 200); \r\n $responsePaises = $consulDB->obtenerListaPaises();\r\n\r\n //echo $responseUsuario;\r\n //$datosRespuesta = (array)$handler->decodeJson($responsePaises);\r\n $datosRespuesta = $responsePaises;\r\n //$datosRespuesta = $handler->decodeJson($responsePaises);\r\n\r\n if (!isset($datosRespuesta[\"error\"])){\r\n //$respuesta['usuario'] = $username;\r\n $responseObtenerPaises[\"error\"] = \"false\";\r\n $responseObtenerPaises[\"status\"] = \"OK\";\r\n $responseObtenerPaises[\"message\"] = \"SUCCESS\";\r\n $responseObtenerPaises['fecha'] = ObtenerFecha(); //Obtiene la fecha actual\r\n //Aqui se implementa el manejo del token\r\n $responseObtenerPaises[\"respuesta\"] = $datosRespuesta;\r\n\r\n }\r\n else {\r\n //Hay posiblidades: 1 - usuario no existe 2 - clave invalida\r\n $responseObtenerPaises[\"error\"] = \"true\";\r\n $responseObtenerPaises[\"status\"] = \"error\";\r\n $responseObtenerPaises[\"message\"] = $datosRespuesta['error'];\r\n $responseObtenerPaises['fecha'] = \"\";\r\n $responseObtenerPaises[\"respuesta\"] = \"{}\";\r\n }\r\n\r\n $consulDB = null;\r\n //enviar respuesta\r\n return $responseObtenerPaises;\r\n\r\n //}\r\n \r\n }", "protected function initiateSubRequest() {}", "function enviar_repuestos(){\n\t\t$this->asignar_valores2();\n\t\t$cuerpo =\"<img width='200' height='100' src='http://www.vehiculosvenezuela.com/imagenes/logon.jpg' />\n\t\t<br /><u>DATOS PERSONALES:</u><br />\";\n\t\t$cuerpo .=\"<br />\";\n\t\t$cuerpo .= \"<strong>Nombre: <strong/>\".$this->nombre.\"<br />\" ;\n\t\t$cuerpo .= \"<strong>Apellido: <strong/>\".$this->apellido.\"<br />\" ;\n\t\t$cuerpo .= \"<strong>Tel&eacute;fono: <strong/>\".$this->telefono.\"<br />\" ;\n\t\t$cuerpo .= \"<strong>E-mail: <strong/>\".$this->email.\"<br />\" ;\n\t\t$cuerpo .= \"<br />\";\n\t\t$cuerpo .= \"---- DATOD DE REPUESTO ----\";\n\t\t$cuerpo .= \"<br />\";\n\t\t$cuerpo .= \"<strong>Marca: <strong/>\".$this->marca.\"<br />\" ;\n\t\t$cuerpo .= \"<strong>Modelo: <strong/>\".$this->modelo.\"<br />\" ;\n\t\t$cuerpo .= \"<strong>A&ntilde;o: <strong/>\".$this->ano.\"<br />\" ;\n\t\t$cuerpo .= \"<strong>Tipo: <strong/>\".$this->tipo.\"<br />\" ;\n\t\t$cuerpo .= \"<strong>Descripci&oacute;n: <strong/>\".$this->descripcion.\"<br />\" ;\n\t\t$cuerpo .= \"<br />\";\n\t\t$cuerpo .= \"---- END DATA ----\";\n\t\t$cuerpo .= \"<br />\";\n\t\t$subject= \"Solicitud de Repuesto desde www.vehiculosvenezuela.com\";\n\t\t$subject2= \"Solicitud desde www.vehiculosvenezuela.com\";\n\t\t$basemailfor=\"[email protected]\";\n\t\t//$basemailfor=\"[email protected]\";\n\t\t$basemailfrom = $this->email;\n\t\t$respuesta =\"<img width='200' height='100' src='http://www.vehiculosvenezuela.com/imagenes/logon.jpg' /><br /><br />\n\t\t<strong>Reciba un cordial saludo: \".$this->nombre.\" \".$this->apellido.\"<strong/><br /><br />\n\t\tHemos recibido su solicitud con &eacute;xito y le damos gracias por contactarnos, en este momento la estamos procesando y obtendrá una respuesta a la brevedad posible.\n\t\t<br><br> \n\t\t Muchas Gracias\n\t\t<br /><br />\n\t\tAtentamente,<br /><br />\n\t\tVeh&iacute;culosVenezuela<br />\n\t\twww.vehiculosvenezuela.com\";\n\t\t$this->mensaje=\"Su solicitud de repuesto ha sido enviado satisfactoriamente!\";\n\t\tif(mail (\"$basemailfor\", \"$subject2\", \"$cuerpo\", \"From: $basemailfrom\\nContent-Type: text/html\" )){\n\t\t mail (\"$basemailfrom\", \"$subject\", \"$respuesta\", \"From: $basemailfor\\nContent-Type: text/html\" );\n\t\t \n\t\t}\n\t}", "public function getForosComentarios(){\n\t\tif($this->get_request_method() != \"GET\") $this->response('', 406);\n\n\t\t//get data sent\n\t\t$ses_id = $_GET['ses_id'];\n\t\t$user = $_GET['user'];\n\t\t$id_tema = $_GET['id_tema'];\n\t\t$regs = $_GET['regs'];\n\t\t$page = $_GET['page'];\n\t\t$inicio = ($page - 1) * $regs;\n\n\t\t// Session validation\n\t\tif ($this->checkSesId($ses_id, $user)){\n\t\t\t// Input validations\n\t\t\tif(trim($user) != ''){\t\t\n\t\t\t\t$foro = new foro();\n\t\t\t\t$filtro_comentarios = \" AND c.id_tema=\".$id_tema.\" AND estado=1 AND id_comentario_id=0\";\n\t\t\t\t$result = $foro->getComentarios($filtro_comentarios.' ORDER BY date_comentario DESC LIMIT '.$inicio.','.$regs); \n\t\t\t\t$this->response($this->json($result), 200);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Sesion incorrecta\");\n\t\t\t$this->response($this->json($error), 400);\t\t\n\t\t}\n\t}", "public function recuperarAction() {\n\n if ($this->_request->isPost()) {\n\n $data = $this->_request->getPost();\n $session = new Zend_Session_Namespace('captcha');\n\n if ($session->captcha_confirm == $data['captcha_confirm']) {\n $model = new App_Model_Login();\n $result = $model->findArrayByName($data['nome_login']);\n\n if ($result) {\n\n //Criando uma senha aleatoria para o usuario\n for ($i = 0; $i < 6; $i++) {\n $newPass .= rand(1, 9);\n }\n\n //Nova senha criada\n $result[0]['senha_login'] = $newPass;\n\n //Salvando nova senha\n $model->saveLogin($result[0]);\n\n $this->view->mensagem = 'Sua nova senha é: ' . $newPass;\n } else {\n $this->view->mensagem = 'Este usuário esta incorreto!';\n }\n } else {\n $this->_redirect('/admin/auth/recover');\n }\n } else {\n $this->view->captcha = $this->generateCaptcha();\n }\n }", "public function DispatchRequest ();", "public function read(){\r\n foreach ($this as $key=>$valor){\r\n $this->$key= Request::req($key);\r\n }\r\n }", "public function retoure(Request $request)\n {\n try {\n //Prenez votre MasterKey, hashez la et comparez le résultat au hash reçu par IPN\n if($request['data']['hash'] === hash('sha512', env('PY_MASTER_KEY'))) {\n \n if ($request['data']['status'] == \"completed\") {\n //Faites vos traitements backoffice ici...\n }\n \n } else {\n die(\"Cette requête n'a pas été émise par PayDunya\");\n }\n } catch(Exception $e) {\n die();\n }\n \n }", "public function modificar(){\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 nombre, correo, pregunta, respuesta 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/modificar.php?data=\".serialize($data));\n}", "public function getRequestData();", "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 getRequestWrapper();", "private function requestProcessor() {\n try {\n\n if (empty($this->uri))\n throw new \\Exception(\"Undefined url\");\n\n $ReqHandle = curl_init($this->uri);\n\n $body = json_encode([]);\n if( sizeof($this->data) > 0 )\n $body = json_encode($this->data);\n\n $returnTransfer = 0;\n if( $this->hasResponseToReturn )\n $returnTransfer = 1;\n\n $isPost = 0;\n if( $this->method != 'GET')\n $isPost = 1;\n\n\n if($isPost == 1){\n curl_setopt($ReqHandle,CURLOPT_POST, $isPost);\n curl_setopt($ReqHandle, CURLOPT_POSTFIELDS, $body);\n }\n \n curl_setopt_array($ReqHandle, [\n CURLOPT_RETURNTRANSFER => $returnTransfer,\n CURLOPT_HTTPHEADER => $this->headersToBeUsed\n ]);\n\n\n $result = curl_exec($ReqHandle);\n\n if(curl_errno($ReqHandle)){\n\n return curl_error($ReqHandle);\n }\n\n if($returnTransfer == 1)\n return json_decode($result);\n\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }", "protected abstract function handleRequest();", "public function interpretRequest($request)\n {\n\n $this->updtv = $request->param('updtv',Validator::BOOLEAN);\n\n // startpunkt des pfades für die acls\n if ($aclRoot = $request->param('a_root', Validator::CKEY))\n $this->aclRoot = $aclRoot;\n\n // die id des Datensatzes von dem aus der Pfad gestartet wurde\n if ($aclRootId = $request->param('a_root_id', Validator::INT))\n $this->aclRootId = $aclRootId;\n\n // der key des knotens auf dem wir uns im pfad gerade befinden\n if ($aclKey = $request->param('a_key', Validator::CKEY))\n $this->aclKey = $aclKey;\n\n // der neue knoten\n if ($aclNode = $request->param('a_node', Validator::CKEY))\n $this->aclNode = $aclNode;\n\n // an welchem punkt des pfades befinden wir uns?\n if ($aclLevel = $request->param('a_level', Validator::INT))\n $this->aclLevel = $aclLevel;\n\n // request elemet type, bei back to top ist es relevant zu wissen woher der\n // aufruf kam (in diesem fall von einem input)\n // könnte bei referenzen auch interessant werden\n // values: inp | ref\n //if ($requestedBy = $request->param('rqtby', Validator::TEXT))\n // $this->requestedBy = $requestedBy;\n\n // sprungpunkt für back to top\n if ($maskRoot = $request->param('m_root', Validator::TEXT))\n $this->maskRoot = $maskRoot;\n\n // the publish type, like selectbox, tree, table..\n if ($publish = $request->param('publish', Validator::CNAME))\n $this->publish = $publish;\n\n // if of the target element, can be a table, a tree or whatever\n if ($targetId = $request->param('target_id', Validator::CKEY))\n $this->targetId = $targetId;\n\n // callback for a target function in thr browser\n if ($target = $request->param('target', Validator::CKEY))\n $this->target = $target;\n\n // target mask key\n if ($targetMask = $request->param('target_mask', Validator::CNAME))\n $this->targetMask = $targetMask;\n\n if ($parentMask = $request->param('pmsk', Validator::TEXT))\n $this->parentMask = $parentMask;\n\n\n\n // mask key\n if ($viewId = $request->param('view_id', Validator::CKEY))\n $this->viewId = $viewId;\n\n // mask key\n if ($viewType = $request->param('view', Validator::CNAME))\n $this->viewType = $viewType;\n\n // soll die maske neu geladen werden?\n //if ($reload = $request->param('reload', Validator::BOOLEAN))\n // $this->reload = $reload;\n\n // target mask key\n if ($refId = $request->param('refid', Validator::INT))\n $this->refId = $refId;\n\n // listing type\n if ($ltype = $request->param('ltype', Validator::CNAME))\n $this->ltype = $ltype;\n\n // context\n if ($context = $request->param('context', Validator::CNAME))\n $this->context = $context;\n\n // parameter zum fixieren des Contexts\n // wird verwendet um zwischen \"unterschiedliche\" Masken mit dem gleichen\n // viewnamen zu switchen\n if ($cntk = $request->param('cntk', Validator::CKEY))\n $this->contextKey = $cntk;\n\n // mask switcher key\n // wird nur in der view gesetzt wenn der mask switcher vorhanden ist\n if ($cntms = $request->param('cntms', Validator::CNAME))\n $this->contextMaskSwt = $cntms;\n\n\n // per default\n $this->categories = [];\n\n }", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "public function requested(){\n\n $Id = ''; $codigo = ''; $concepto = '';\n $val = new ValidaModel();\n $val->Idvalida=$_POST['id'];\n $result = $val->getValidaId();\n foreach ($result as $r) {\n $IdDep = $r[\"IdDepartamento\"];\n $IdPro = $r[\"IdProyecto\"];\n $IdMeta = $r[\"IdMeta\"];\n $Departamento = $r[\"nombreDepto\"];\n $Proyecto = $r[\"proyecto\"];\n $Meta = $r[\"meta\"];\n $year = $r[\"anio\"];\n }\n require_once ROOT . FOLDER_PATH .'/app/Request/ValidaRequest.php';\n }", "function requestSessionInfo()\n {\n //para pasarselo al aside;\n\n $sessionLevel = $this->loginController->GetSessionAuthLevel();\n $this->view->setSessionLevel($sessionLevel);\n\n $sessionName = $this->loginController->GetSessionUsername();\n $this->view->setSessionName($sessionName);\n }", "function __construct(){\n // debug($_SESSION) ;\n //URL taper par l'utilisateur\n $this->request = new \\Projet\\App\\Request() ;\n //parser l'URL\n //Router::parse($this->request->url,$this->request);\n //charger le controller appellé par l'utilisateur\n $controller = $this->loadController() ;\n\n //action appellé par utilisateur\n $action = $this->request->action;\n /*faire appelle aux fonctions des controleurs qui correspend aux nom des actions tapez par l'utilisateur\n comme $controller->view($this->request->params) ;*/\n }" ]
[ "0.6625068", "0.65729445", "0.6365027", "0.6248344", "0.62437016", "0.62437016", "0.61297333", "0.61297333", "0.6097131", "0.6074783", "0.6074783", "0.6074783", "0.6074783", "0.6074783", "0.6074783", "0.6074783", "0.6074783", "0.60693884", "0.6002241", "0.59590614", "0.59474146", "0.5939818", "0.5923254", "0.59223247", "0.5901726", "0.58884615", "0.5885506", "0.588506", "0.58385116", "0.5829865", "0.58247447", "0.5822928", "0.5813323", "0.57922816", "0.5774617", "0.5773313", "0.5772331", "0.5760847", "0.5751199", "0.5747955", "0.57439923", "0.5730002", "0.5728898", "0.5725215", "0.5722824", "0.57200897", "0.57189953", "0.5716342", "0.5715278", "0.57104605", "0.5704285", "0.56967545", "0.5684373", "0.5683077", "0.567244", "0.56663686", "0.5664797", "0.5657243", "0.5654195", "0.5627632", "0.56269556", "0.5617656", "0.56051856", "0.56038326", "0.56005985", "0.5591717", "0.5588245", "0.55832607", "0.5578827", "0.55681753", "0.5552621", "0.55446845", "0.5532244", "0.55307", "0.5524961", "0.55216324", "0.5515315", "0.5512864", "0.5511794", "0.5510432", "0.55096567", "0.55064493", "0.5502712", "0.5499883", "0.5497819", "0.54928994", "0.5492108", "0.5490454", "0.5480741", "0.5479505", "0.5472916", "0.5472599", "0.54670763", "0.54660314", "0.5461568", "0.54595524", "0.54595524", "0.54595524", "0.54587275", "0.5453398", "0.54510206" ]
0.0
-1
Comprobamos que existe el cliente... Sino no puede comprar.
public function compradoAction() { $cliente = $this->get('security.context')->getToken()->getUser(); if (!$cliente) throw $this->createNotFoundException('No existe el cliente (Error 1013)'); $texto = ""; $texto = $texto." Cliente: ".$cliente->getNombre()." - "; //Cojo el Entity Manager, asi como los datos Request y Session. $em = $this->get('doctrine')->getEntityManager(); $request = $this->getRequest(); $session = $request->getSession(); //Si no existe el carrito en la session salimos. if(!$session->has('carrito')) { throw $this->createNotFoundException('No existe el carrito (Error 1014)'); } else{ //Si existe el carrito en la session, si no tiene productos salimos y si si tiene productos //realizamos la compra (creamos un pedido en nuestro sistema y lo guardamos.) $carrito = $session->get('carrito'); //$session->get('carrito', $carrito); if(!$carrito->getProductos()) { throw $this->createNotFoundException('Error el carrito esta vacio (Error 1015)'); } else{ //KK estas lineas van todas fuera. /* //////////////////////////////////////// ////////////////////////////////////// // AQUI ESTARIAN TODAS LAS COMPROVACIONES ASI COMO HAY QUE // RECORDAR QUE VENDRA DE UN FORMULARIO, Y habra multitud de parametros mas. ////////////////////////////////////// ////////////////////////////////////// */ //Recuperamos la lista del carrito y comprobamos que todos los productos existen, //no estan descatalogados y hay suficiente stock para cumplir con la demanda. $listaCarro = $carrito->getProductos(); foreach($listaCarro as $item){ $texto = $texto." producto: ".$item->getProducto()->getNombre()." - ".$item->getCantidad(); $producto = $em->find('PafpfcBundle:Producto' , $item->getProducto()->getId()); $detalleError = 'El producto: '.$item->getProducto()->getId().' - '.$item->getProducto()->getNombre().' '; if (!$producto) throw $this->createNotFoundException($detalleError.' no existe (Error 1018)'); if ($producto->getDescatalogado()) throw $this->createNotFoundException('El producto '.$producto->getId().' - '.$producto->getNombre().' esta descatalogado (Error 1019)'); if ($producto->getStock() < $item->getCantidad()) throw $this->createNotFoundException('No hay suficientes elementos en stock para '.$detalleError.' (Error 1020)'); } ////////AQUI ESTARIA LA COMPRA DE PAYPAL...///////////// ////////AQUI ESTARIA LA COMPRA DE PAYPAL...///////////// ////////AQUI ESTARIA LA COMPRA DE PAYPAL...///////////// //Asi conseguimos la consistencia... si no se paga no se modifica la base de datos y no se generan pedidos. $pedido = new Pedido(); $pedido->setDireccion('Direccion pruebas nuevas'); $pedido->setCliente($cliente); $pedido->setPagado(true); $em->persist($pedido); $em->flush(); $texto = $texto." Pedido: ".$pedido->getId()." - "; foreach($listaCarro as $item){ //Tengo que recuperar el producto original para tener la referencia correcta a la hora de hacer //el flush en el pedido o no dejara ya q el objeto producto q esta dentro de listacarro es una copia. $producto = $em->find('PafpfcBundle:Producto' , $item->getProducto()->getId()); //Comprobaciones sobre el producto y el pedido. Existe, es valido y hay en stock. $detalleError = 'El producto: '.$item->getProducto()->getId().' - '.$item->getProducto()->getNombre().' '; if (!$producto) throw $this->createNotFoundException($detalleError.' no existe (Error 1021)'); if ($producto->getDescatalogado()) throw $this->createNotFoundException('El producto '.$producto->getId().' - '.$producto->getNombre().' esta descatalogado (Error 1022)'); if ($producto->getStock() < $item->getCantidad()) throw $this->createNotFoundException('No hay suficientes elementos en stock para '.$detalleError.' (Error 1023)'); //Megamarron si aqui generamos errores en la compra AL CLIENTE YA SE LE HA COBRADO... //Asi que aunque esten las comprobaciones pertinentes... todas ellas han de haber sido hechas tambien //antes de mandar los datos a paypal. Para mantener una consistencia casi total ¿haciendo dos //compras con diferencia de microsegundos y usuarios diferentes podria darse un error por falta de stock? //Generar la linea del pedido con precio calculado, reducir el stock del producto y persistir los dos elementos. $lineaped = new LineaPedido($pedido, $producto, $item->getCantidad()); $precioPagado = $producto->getPrecioActual() * $item->getCantidad(); $lineaped->setPrecioPagado($precioPagado); $newStock = $producto->getStock() - $item->getCantidad(); $producto->setStock($newStock); $em->persist($producto); $texto = $texto." ListaPedido - producto: ".$lineaped->getProducto()->getNombre()." - ".$lineaped->getCantidad()." - "; $em->persist($lineaped); } //Al hacer flush en este punto consigo que no se almacenen ni la linea del pedido ni la modificacion en el producto si se produjo algun error. $em->flush(); $this->get('session')->setFlash('notice', $texto); $session->remove('carrito'); } } return $this->render('PafpfcBundle:Pedido:compracorrecta.html.twig'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verificarCompraPublicacion($cliente,$edicion){\n\t\tinclude \"conexion.php\"; \n\n\t\t\t$sql=\"select * from compra\n\t\t\twhere cliente_id=$cliente and $edicion=edicion_id\n\t\t\t\";\n\t\t\t$result=mysql_query($sql, $conexion) or die (mysql_error());\n\t\t\tif (mysql_num_rows($result)>0)\n\t\t\t{\n\n\t\t\t$error=\"<p>Ya has comprado esta edicion</p>\";\n\t\t\theader (\"Location: errores.php?errores=$error\");\n\t\t\t\t\n\t\t\t\texit();\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t\t}", "private function appConsolaExistencia() {\r\n\t\t\t$archivo = implode(DIRECTORY_SEPARATOR, array_merge(array($this->consolaRuta), $this->objeto)).'.php';\r\n\t\t\tif(file_exists($archivo) == true):\r\n\t\t\t\t$this->appConsolaLectura($archivo);\r\n\t\t\telse:\r\n\t\t\t\tthrow new \\RuntimeException(sprintf('El Archivo de Consola: %s, de la aplicación: %s, no existe', $this->objeto, $this->aplicacion));\r\n\t\t\tendif;\r\n\t\t}", "function verificarCompraSuscripcion($cliente){\n\t\tinclude \"conexion.php\"; \n\n\t\t\t$sql=\"select * from suscripcion\n\t\t\twhere cliente_id=$cliente\n\t\t\t\";\n\t\t\t$result=mysql_query($sql, $conexion) or die (mysql_error());\n\t\t\tif (mysql_num_rows($result)>0)\n\t\t\t{\n\t\t\t\n\t\t\t\t\n\t\t\t\t$error=\"<p>Ya tienes una suscripcion activa</p>\";\n\t\t\t\theader (\"Location: errores.php?errores=$error\");\n\t\t\t\t\n\t\t\t\texit();\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t\t}", "public function existeCorreo(){\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ClienteDAO -> existeCorreo());\n $this -> Conexion -> cerrar();\n return $this -> Conexion -> numFilas();\n }", "private function existeusuario($usuario)\n {\n $stmt = $this->con->prepare(\"SELECT id_conductor FROM `carga` WHERE id_conductor = ?\");\n $stmt->bind_param(\"s\", $usuario);\n $stmt->execute(); \n $stmt->store_result();\n\n return $stmt->num_rows > 0;\n }", "static public function ctrCrearCliente(){\n\n\t\tif(isset($_POST[\"nuevoEmail\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaRazonSocial\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoNombreFantasia\"]) &&/*\t\t\t\t\n\t\t\t preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoImpositivo\"]) && \t\t\t\t\n\t\t\t preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ°-_ ]+$/', $_POST[\"nuevaDireccion\"]) && */\t\t\t\t\n\t\t\t preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaProvincia\"]) &&\t\t\t\t\n\t\t\t preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoPais\"]) &&\t\n\t\t\t preg_match('/^[[email protected]_ñÑ]+$/', $_POST[\"nuevoEmail\"]) &&\t\t\t\t\n\t\t\t preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoTelefono\"]) &&\t\t\t\t\n\t\t\t preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoTipoDocumento\"]) &&\t\t\t\t\n\t\t\t preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoNumeroDocumento\"])\n\t\t\t ){\n\n\t\t\t \t/*=============================================\n\t\t\t\tVALIDAR IMAGEN\n\t\t\t\t=============================================*/\n\n\t\t\t\t$ruta = \"\";\n\n\t\t\t\tif(isset($_FILES[\"nuevaFoto\"][\"tmp_name\"])){\n\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"nuevaFoto\"][\"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/clientes/\".$_POST[\"nuevoEmail\"];\n\n\t\t\t\t\tif (!file_exists($directorio)) {\n\t\t\t\t\t\t// Si no existe el directorio lo crea\n\t\t\t\t\t\t mkdir($directorio, 0755);\n\t\t\t\t\t\t}\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[\"nuevaFoto\"][\"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/clientes/\".$_POST[\"nuevoEmail\"].\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"nuevaFoto\"][\"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[\"nuevaFoto\"][\"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/clientes/\".$_POST[\"nuevoEmail\"].\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"nuevaFoto\"][\"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 = \"clientes\";\n\n\t\t\t\t\n\t\t\t\t$datos = array(\"razonSocial\" => $_POST[\"nuevaRazonSocial\"],\n\t\t\t\t\t\t\t \"nombreFantasia\" => $_POST[\"nuevoNombreFantasia\"],\n\t\t\t\t\t\t\t \"impositivo\" => $_POST[\"nuevoImpositivo\"],\n\t\t\t\t\t\t\t \"direccion\" => $_POST[\"nuevaDireccion\"],\n\t\t\t\t\t\t\t \"provincia\" => $_POST[\"nuevaProvincia\"],\n\t\t\t\t\t\t\t \"pais\" => $_POST[\"nuevoPais\"],\n\t\t\t\t\t\t\t \"email\" => $_POST[\"nuevoEmail\"],\n\t\t\t\t\t\t\t \"telefono\" => $_POST[\"nuevoTelefono\"],\n\t\t\t\t\t\t\t \"tipoDocumento\" => $_POST[\"nuevoTipoDocumento\"],\n\t\t\t\t\t\t\t \"numeroDocumento\" => $_POST[\"nuevoNumeroDocumento\"],\n\t\t\t\t\t \"foto\"=>\"vistas/img/clientes/\".$_POST[\"nuevoEmail\"].\"/\".$aleatorio.\".png\");\n\n\n\t\t\t\t$respuesta = ModeloClientes::mdlIngresarCliente($tabla, $datos);\n\t\t\t\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo '<script>\n\n\t\t\t\t\tswal.fire({\n\n\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\ttitle: \"¡El Cliente 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 = \"clientes\";\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\t</script>';\n\n\n\t\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.fire({\n\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡El cliente 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 = \"clientes\";\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\t}\n\n\n\t\t}\n\n\n\t}", "function bajaCliente($cif) {\r\n $enc = false;\r\n for ($i=0; $i < count ($this->clientes) && ($enc==false); $i++) {\r\n if ($this->clientes[$i] != null){\r\n if ($this->clientes[$i]->getCif() == $cif){\r\n $this->clientes[$i] = null;\r\n $enc = true;\r\n }\r\n }\r\n }\r\n }", "private function existeusuario2($usuario)\n {\n $stmt = $this->con->prepare(\"SELECT id_conductor FROM `descuento` WHERE id_conductor = ?\");\n $stmt->bind_param(\"s\", $usuario);\n $stmt->execute(); \n $stmt->store_result();\n return $stmt->num_rows > 0;\n }", "public function client_exists(){\n\t\t// for edit page\n\t\tif($this->data['Client']['page'] == 'edit_client'){\n\t\t\t$cond = array('Client.id !=' => $this->data['Client']['id']);\n\t\t}\n\t\t$count = $this->find('count', array('conditions' => array('client_name' => $this->data['Client']['client_name'],\n\t\t'res_location_id' => $this->data['Client']['res_location_id'], 'Client.status' => '0', 'Client.is_deleted' => 'N', $cond)));\n\t\tif($count){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "public static function ctrRegistrarCliente(){\n\n\n\tif (isset($_POST['nuevoCliente'])) {\n\n\n\n\t\t$tabla = 'clientes';\n\n\t\t$datos = array(\"cliente\" => $_POST['nuevoCliente'],\n\t\t\t\"id_area\" => $_POST['nuevoAreaCliente'],\n\t\t\t\"documentoID\" => $_POST['nuevoDocumentoID'],\n\t\t\t\"email\" => $_POST['nuevoEmail'],\n\t\t\t\"telefono\" => $_POST['nuevoTelefono'],\n\t\t\t\"direccion\" => $_POST['nuevaDireccion']);\n\n\t\t$respuesta = ModeloCliente::mdlRegistrarCliente($tabla, $datos);\n\n\t\tif ($respuesta == 'ok') {\n\t\t\t?>\n\n\t\t\t<script>\n\n\t\t\t\tswal({\n\n\t\t\t\t\ttype: \"success\",\n\t\t\t\t\ttitle: \"¡El usuario se registro correctamente!\",\n\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\tcloseOnConfirm: false\n\n\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\twindow.location = \"clientes\";\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\n\t\t\t</script> \n\n\t\t\t<?php\n\t\t}\n\n\n\t}\n\n\n}", "public function archivo_existente(){\n $respuesta = array();\n //obtiene la informacion del archivo\n $info = new SplFileInfo($this->file[\"name\"]);\n //obtiene la extension\n $extencion = $info->getExtension();\n //concateno el nombre y la extension para saber que archivo y tambien la ruta del archivo\n $nombre_imagen = $this->nombre . \".\" . $extencion;\n $ruta_archivo = $this->ruta . $nombre_imagen;\n //si el archivo existe\n if (file_exists($ruta_archivo)) {\n //doy permisos para eliminar archivos\n chmod($ruta_archivo, 0777);\n //elimino el archivo\n if(unlink($ruta_archivo)){\n $respuesta[\"resultado\"] = true;\n } else {\n $respuesta[\"resultado\"] = false;\n $respuesta[\"mensaje\"] = \"Ocurrió un error al eliminar el archivo\";\n }\n }else{\n $respuesta[\"resultado\"] = true;\n $respuesta[\"mensaje\"] = \"No es posible eliminar el archivo porque no existe.\";\n }\n return $respuesta;\n }", "public static function crtCrearCliente(){\n\n if (isset($_POST['nuevoCliente'])) {\n \n if (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST['nuevoCliente']) &&\n preg_match('/^[a-zA-Z0-9]+$/', $_POST['nuevoRfc']) &&\n preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST['nuevoEmail']) &&\n preg_match('/^[()\\-0-9 ]+$/', $_POST['nuevoTelefono']) && \n\t\t\t preg_match('/^[#\\.\\,\\-a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST['nuevaDireccion'])){\n\n /*====================Comentario====================\n VALIDAR SI EXISTE RFC\n ==================================================*/ \n\n $tabla = \"clientes\";\n $item = \"rfc\";\n $valor = strtoupper($_POST['nuevoRfc']);\n\n $validar = ModeloClientes::mdlMostrarClientes($tabla, $item, $valor);\n \n if ($validar['rfc'] == $valor) {\n $datos = [];\n echo '<script>\n \n\n\t\t\t\t\tswal.fire({\n\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡El RFC del cliente ya existe en la base de datos!\",\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 = \"clientes\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t </script>';\n die();\n }\n \n $rfc = strtoupper($_POST['nuevoRfc']);\n \n $tabla = 'clientes';\n $datos = array('nombre' => $_POST['nuevoCliente'],\n 'rfc' => $rfc,\n 'email' => $_POST['nuevoEmail'],\n 'telefono' => $_POST['nuevoTelefono'],\n 'direccion' => $_POST['nuevaDireccion'],\n 'fecha_nacimiento' => $_POST['nuevaFechaNacimiento']);\n\n $respuesta = ModeloClientes::mdlIngresarCliente($tabla, $datos);\n\n if ($respuesta == \"ok\") {\n\n echo '<script>\n\n\t\t\t\t\tswal.fire({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El cliente ha sido guardado correctamente\",\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\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"clientes\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n \n }\n\n }else{\n echo '<script>\n\n\t\t\t\t\tswal.fire({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡El cliente no puede ir vacío 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 = \"clientes\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n \n }\n \n }\n\n }", "public function usernext_exist(Request $request)\n\t\t{\n\t\t// ------------------------------ Eliminar Cliente --------------------\n\t\t$resultado = $this->tableEmpresas->select('ruc')->where('ruc', '=', $request->input('ruc'))->get();\n\t\tif (count($resultado) == 0)\n\t\t\t{\n\t\t\t$res = $this->client->request('GET', config('global.appserviciosnext').'/public/getDatos', ['json' => ['tipodocumento' => 'RUC', 'nrodocumento' => $request->input('ruc') ]]);\n\t\t\t$respuesta = json_decode($res->getBody() , true);\n\t\t\treturn response()->json([\"respuesta\" => $respuesta], 200);\n\t\t\t}\n\t\t else\n\t\t\t{\n\t\t\treturn response()->json([\"respuesta\" => true], 200);\n\t\t\t}\n\t\t}", "public function GuardarEnArchivo(): bool\n {\n $retorno = false;\n $archivo = fopen('../archivos/usuarios.json', \"w\");\n echo $archivo;\n\n if (\n $this->nombre != \"\" &&\n $this->correo != \"\" &&\n $this->clave != \"\"\n ) {\n $exito = fwrite($archivo, $this->ToJSON() . \"\\r\\n\");\n if ($exito > 0)\n $retorno = true;\n }\n fclose($archivo);\n return $retorno;\n }", "static public function ctrBorrarCliente(){\n\n\t\tif(isset($_GET[\"idCliente\"])){\n\n\t\t\t$tabla =\"cliente\";\n\t\t\t$datos = $_GET[\"idCliente\"];\n\n\t\t\tif($_GET[\"fotoCliente\"] != \"\"){\n\n\t\t\t\tunlink($_GET[\"fotoCliente\"]);\n\t\t\t\trmdir('vistas/img/clientes/'.$_GET[\"cliente\"]);\n\n\t\t\t}\n\n\t\t\t$respuesta = ModeloClientes::mdlBorrarCliente($tabla, $datos);\n\n\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\techo'<script>\n\n\t\t\t\tswal.fire({\n\t\t\t\t\t type: \"success\",\n\t\t\t\t\t title: \"El Cliente ha sido borrado correctamente\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"cliente\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t</script>';\n\n\t\t\t}\t\t\n\n\t\t}\n\n\t}", "public function primerCliente($id_usuario,$nombreE,$rfcE,$cpE,$correo1E,$observacionesE,$fijo,$logo){\r\n\t\t$sql = \"INSERT INTO tbl_clientesclientes (id_usuario,logo,nombreE,rfcE,cpE,correo1E,observacionesE,estatus,fijo)VALUES('$id_usuario','$logo','$nombreE','$rfcE','$cpE','$correo1E','$observacionesE','1','$fijo')\";\r\n return ejecutarConsulta($sql); \t\r\n\t}", "public function RegistrarClientes()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"cedcliente\"]) or empty($_POST[\"nomcliente\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\n\t$sql = \" select cedcliente from clientes where cedcliente = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"cedcliente\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$query = \" insert into clientes values (null, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $cedcliente);\n\t\t$stmt->bindParam(2, $nomcliente);\n\t\t$stmt->bindParam(3, $direccliente);\n\t\t$stmt->bindParam(4, $tlfcliente);\n\t\t$stmt->bindParam(5, $emailcliente);\n\n\t\t$cedcliente = strip_tags($_POST[\"cedcliente\"]);\n\t\t$nomcliente = strip_tags($_POST[\"nomcliente\"]);\n\t\t$direccliente = strip_tags($_POST[\"direccliente\"]);\n\t\t$tlfcliente = strip_tags($_POST[\"tlfcliente\"]);\n\t\t$emailcliente = strip_tags($_POST[\"emailcliente\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-success'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> EL CLIENTE FUE REGISTRADO EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"2\";\n\t\texit;\n\t}\n}", "public static function existe(Client $c) {\n\t\t$nom = $c->getNom();\n\t\t$condition = \"nom = '$nom'\";\n\t\t$res = DB_Manager::select(self::getTableName(), $condition);\n\t\treturn ($res != DB_Manager::$NO_RESULTS);\n\t}", "public function createCliente($cliente){\n try {\n $sql = \"INSERT INTO cliente (clien_id, clien_nit, clien_codverif, clien_nombre) VALUES (?,?,?,?)\";\n $query = $this->pdo->prepare($sql);\n $result = $query->execute(array('', $cliente[0], $cliente[1], $cliente[2]));\n if ($result == true) {\n return true;\n }else {\n return false;\n }\n } catch (\\Exception $e) {\n die($e->getMessage());\n }\n\n }", "function comprobarProductoDuplicado() {\n\t\tif($this->id_nombre_producto == NULL) {\n\t\t\t$consulta = sprintf(\"select id_nombre_producto from nombre_producto where nombre=%s and version=%s and activo=1\",\n\t\t\t\t$this->makeValue($this->nombre, \"text\"),\n\t\t\t\t$this->makeValue($this->version, \"double\"));\n\t\t} else {\t\n\t\t\t$consulta = sprintf(\"select id_nombre_producto from nombre_producto where nombre=%s and version=%s and id_nombre_producto<>%s and activo=1\",\n\t\t\t\t$this->makeValue($this->nombre, \"text\"),\n\t\t\t\t$this->makeValue($this->version, \"double\"),\n\t\t\t\t$this->makeValue($this->id_nombre_producto, \"int\"));\n\t\t}\n\t\t$this->setConsulta($consulta);\n\t\t$this->ejecutarConsulta();\n\t\tif($this->getNumeroFilas() == 0) {\n\t\t\treturn false;\t\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function getCorporativos() {\n $this->consulta = \"SELECT usuario.idUsuario, usuario.idCorporativo, \n corporativo.razonSocial, usuario.login, \n usuario.fechaHoraUltIN, usuario.estado \n FROM usuario \n INNER JOIN corporativo ON usuario.idCorporativo = corporativo.idCorporativo \n WHERE usuario.tipoUsuario = 'Cliente Corporativo'\";\n if ($this->consultarBD() > 0) {\n $this->mensaje = 'Seccion Usuarios Corporativos <br> Registros Encontrados: <b>' . count($this->registros) . '</b>';\n return true;\n } else {\n return false;\n }\n }", "public static function existe ($usuario,$contrasena){\n $existe=false;\n self::setConexion();\n $resultado=self::$conexion->query(\"SELECT * FROM cuenta WHERE contrasena='$contrasena' AND usuario='$usuario'\");\n $totalFilas=$resultado->rowCount();\n \n if(!$resultado->rowCount()==0){\n //throw Exception(\"YA EXISTE UNA CUENTA CON ESE USUARIO Y CONTRASEÑA\");\n $existe=true;\n }\n return $existe;\n }", "public function usuarioExiste($usuario)\n {\n $bd = new Bd();\n\n $usser = \"SELECT * FROM usuarios WHERE mail='\" . $this->mail . \"'\" . \" AND clave='\" . $this->clave . \"'\";\n $resultado = $bd->consulta($usser);\n\n\n if ($bd->numeroElementos() == 1) {\n session_start();\n $_SESSION['mail'] = $this->mail;\n $_SESSION['clave'] = $this->clave;\n\n header('location: inici.php');\n } else {\n\n header(\"location: registro.php\");\n }\n }", "function habilitarCajero(){\n\t\t$this->objFun=new FuncionesCobranza();\t\n\t\t$this->res=$this->objFun->habilitarCajero($this->objParam);\n\t\t$this->res->imprimirRespuesta($this->res->generarJson());\n\n\t}", "public function existeComentario($idComentario, $idAnuncio){ \n $query = \"SELECT idComentario FROM final_comentario WHERE idComentario='\".$idComentario.\"' AND idAnuncio='\".$idAnuncio.\"'\"; \n return mysqli_num_rows($this->con->action($query))> 0 ? True : False; \n }", "function modificarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_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_cliente','id_cliente','int4');\n\t\t$this->setParametro('genero','genero','varchar');\n\t\t$this->setParametro('ci','ci','varchar');\n\t\t$this->setParametro('email','email','varchar');\n\t\t$this->setParametro('email2','email2','varchar');\n\t\t$this->setParametro('direccion','direccion','varchar');\n\t\t$this->setParametro('celular','celular','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('lugar_expedicion','lugar_expedicion','varchar');\n\t\t$this->setParametro('apellido_paterno','apellido_paterno','varchar');\n\t\t$this->setParametro('telefono','telefono','varchar');\n\t\t$this->setParametro('ciudad_residencia','ciudad_residencia','varchar');\n\t\t$this->setParametro('id_pais_residencia','id_pais_residencia','int4');\n\t\t$this->setParametro('nacionalidad','nacionalidad','varchar');\n\t\t$this->setParametro('barrio_zona','barrio_zona','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('apellido_materno','apellido_materno','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function cocinar_registro_cliente() {\n\t\tglobal $bd;\n\t\tglobal $x_idcliente;\n\t\tglobal $x_idpedido;\n\n\t\t\n\t\t// $x_arr_cliente = $_POST['p_cliente'];\n\t\t// $datos_cliente = $x_arr_cliente['cliente'];\n\t\t$datos_cliente = $_POST['p_cliente'];\n\n\t\t$nomclie=$datos_cliente['nombres'];\n\t\t$idclie=$datos_cliente['idcliente'];\n\t\t$num_doc=$datos_cliente['num_doc'];\n\t\t$direccion=$datos_cliente['direccion'];\n\t\t$f_nac=$datos_cliente['f_nac'];\n\t\t// $idpedidos=$x_arr_cliente['i'] == '' ? $x_idpedido : $x_arr_cliente['i'];\n\n\t\tif($idclie==''){\n\t\t\tif($nomclie==''){//publico general\n\t\t\t\t$idclie=0;\n\t\t\t}else{\n\t\t\t\t$sql=\"insert into cliente (idorg,nombres,direccion,ruc,f_nac)values(\".$_SESSION['ido'].\",'\".$nomclie.\"','\".$direccion.\"','\".$num_doc.\"','\".$f_nac.\"')\";\n\t\t\t\t$idclie=$bd->xConsulta_UltimoId($sql);\n\t\t\t}\n\t\t} else {\n\t\t\t// update cliente\n\t\t\t$sql=\"update cliente set nombres='\".$nomclie.\"',ruc='\".$num_doc.\"',direccion='\".$direccion.\"' where idcliente = \".$idclie;\n\t\t\t$bd->xConsulta_NoReturn($sql);\n\t\t}\n\n\t\t// $bd->xConsulta_NoReturn($sql);\n\t\t// $sql=\"update pedido set idcliente=\".$idclie.\" where idpedido in (\".$idpedidos.\")\";\n\t\t\n\t\t$x_idcliente = $idclie;\n\t\t$x_idpedido = $idpedidos;\n\n\t\techo $idclie;\n\n\t\t// $rptclie = json_encode(array('idcliente' => $idclie));\n\t\t// print $rptclie.'|';\n\n\t\t// 031218 // cambio: ahora se graba primero el cliente se devuelve el idcliete, \n\n\t\t// $GLOBALS['x_idcliente'] = $idclie;\n\t\t// return $x_idcliente;\n\t\t// echo $idclie;\n\t}", "function existeUsuario($usuario){\n\tif (hasKey(BUCKET_USUARIOS,$usuario))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "public function registrarCliente($dados){\n //$conexao = $c->conexao();\n $tipoCadastro = $_POST['tipocad'];\n $tipoCliente = $_POST['tipo'];\n $iss = $_POST['iss'];\n $nome = trim($_POST['nome']);\n // $nomeJuridico = trim($_POST['nomeJuridico']);\n $nomeFantasia = trim($_POST['nomeFantasia']);\n $apelido = trim($_POST['apelido']);\n $cnpj = $_POST['cnpj'];\n $cpf = $_POST['cpf'];\n $rg = trim($_POST['rg']);\n $dt_nascimento = trim($_POST['dtnascimento']);\n $telefone = $_POST['telefone'];\n // $telefoneJ = $_POST['telefoneJ'];\n $telefone2J = $_POST['telefone2J'];\n $cep = $_POST['cep'];\n $endereco = $_POST['endereco'];\n $bairro = $_POST['bairro'];\n $uf = $_POST['uf'];\n $cidade = $_POST['cidade'];\n $complemento = $_POST['complemento'];\n $numero = trim($_POST['numero']);\n $usuid = $_SESSION['usuid'];\n\n $sql = \"SELECT count(*) as total from tbclientes WHERE rg = '$rg' or cnpj = '$cnpj' or cpf = '$cpf' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n\n if($row['total'] == 1){\n return 0;\n }else{\n\n $sql = \"INSERT INTO tbclientes (nome, nomefantasia, apelido, tipocad, tipopessoa, iss, cpf, cnpj, rg, telefone, telefone2, dt_nascimento, data_cadastro, usuid, habilitado, cep, endereco, bairro, uf, cidade, complemento, numero) VALUES ('$nome', '$nomeFantasia', '$apelido', '$tipoCadastro', '$tipoCliente', '$iss', '$cpf', '$cnpj', '$rg', '$telefone', '$telefone2J', '$dt_nascimento', NOW(), '$usuid', 'S', '$cep', '$endereco', '$bairro', '$uf', '$cidade', '$complemento', '$numero') \";\n\n $mensagem = \"O Usuário \".$_SESSION['email'].\" cadastrou o Cliente $nome \";\n $this->salvaLog($mensagem);\n\n return $this->conexao->query($sql);\n\n }\n\n }", "function trovaCliente($id_cliente){\n$query = mysql_query(\"SELECT * FROM utente WHERE id_cliente = '\".$id_cliente.\"' \");\nif(mysql_num_rows($query)>0){\nreturn true;\n}\nelse {\nreturn false;\n}\n}", "public function cadastrar($cliente){\r\n\t\tinclude(\"../config/conexao.php\");\r\n\t\t$sql = 'INSERT INTO cliente (cod, n_casa, rua, bairro, cidade, estado, pais, cep, data_nasc, nome, tel_celular, tel_fixo, email) VALUES (:cod, :n_casa, :rua, :bairro, :cidade, :estado, :pais, :cep, :data_nasc, :nome, :tel_celular, :tel_fixo, :email)';\r\n\t\t$consulta = $pdo->prepare($sql);\r\n\t\t$consulta->bindValue(':cod',$cliente->getCod()); \r\n\t\t$consulta->bindValue(':n_casa',$cliente->getN_casa()); \r\n\t\t$consulta->bindValue(':rua',$cliente->getRua()); \r\n\t\t$consulta->bindValue(':bairro',$cliente->getBairro()); \r\n\t\t$consulta->bindValue(':cidade',$cliente->getCidade()); \r\n\t\t$consulta->bindValue(':estado',$cliente->getEstado()); \r\n\t\t$consulta->bindValue(':pais',$cliente->getPais()); \r\n\t\t$consulta->bindValue(':cep',$cliente->getCep()); \r\n\t\t$consulta->bindValue(':data_nasc',$cliente->getData_nasc()); \r\n\t\t$consulta->bindValue(':nome',$cliente->getNome()); \r\n\t\t$consulta->bindValue(':tel_celular',$cliente->getTel_celular()); \r\n\t\t$consulta->bindValue(':tel_fixo',$cliente->getTel_fixo()); \r\n\t\t$consulta->bindValue(':email',$cliente->getEmail()); \r\n\t\tif($consulta->execute())\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "public function cargar()\n {\n $resp = false;\n $base = new BaseDatos();\n $sql = \"SELECT * FROM archivocargado WHERE idarchivocargado = \" . $this->getidArchivoCargado();\n if ($base->Iniciar()) {\n $res = $base->Ejecutar($sql);\n if ($res > -1) {\n if ($res > 0) {\n $row = $base->Registro();\n $user = new Usuario();\n $user->setIdUsuario($row['idusuario']);\n $user->cargar();\n $this->setear(\n $row['idarchivocargado'],\n $row['acnombre'],\n $row['acdescripcion'],\n $row['acicono'],\n $user,\n $row['aclinkacceso'],\n $row['accantidaddescarga'],\n $row['accantidadusada'],\n $row['acfechainiciocompartir'],\n $row['acefechafincompartir'],\n $row['acprotegidoclave']\n );\n }\n }\n } else {\n $this->setmensajeoperacion(\"ArchivoCargado->listar: \" . $base->getError());\n }\n return $resp;\n }", "function haysuc($idcliente){\n\t$funcbase = new dbutils;\n/*** conexion a bd ***/\n $mysqli = $funcbase->conecta();\n if (is_object($mysqli)) {\n\t\t $req = \"SELECT idsuccliente FROM succliente WHERE cliente =\" \n \t.$idcliente; \n\t\t$query=mysqli_query($mysqli, $req);\n\t\t/* determinar el n�mero de filas del resultado */\t\n\t\t$filas = $query->num_rows;\n \t\n } else {\n die (\"<h1>'No se establecio la conexion a bd para revisar clientes'</h1>\");\n }\t\n\n /* liberar la serie de resultados */\n /* cerrar la conexion */\n\t mysqli_close($mysqli);\n\treturn $filas;\n}", "function insereCliente($nome, $senha, $email){\r\n \r\n\r\n \r\n //Abre conexao com banco de dados\r\n $conexao = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);\r\n $sucesso = false;\r\n\r\n //remove codigo html ou javascript\r\n //$nome = $this->conexao->real_scape_string(strip_tags($nome, ENT_QUOTES));\r\n //$senha = $this->conexao->real_scape_string(strip_tags($senha, ENT_QUOTES));\r\n //$email = $this->conexao->real_scape_string(strip_tags($email, ENT_QUOTES));\r\n \r\n if (!$conexao->set_charset(\"utf8\")) {\r\n echo $conexao->error;\r\n }\r\n \r\n //Se a conexão com o banco for bem sucedida\r\n if (!$conexao->connect_errno) {\r\n\r\n $sql = \"INSERT INTO cliente \r\n (nomecliente, senhacliente, emailcliente)\r\n VALUES('\" \r\n .$nome \r\n .\"', '\" \r\n .$senha \r\n .\"', '\" \r\n .$email\r\n .\"');\";\r\n \r\n $exec = $conexao->query($sql);\r\n\r\n if($exec)\r\n $sucesso = true;\r\n \r\n mysqli_close($conexao);\r\n }\r\n else{\r\n echo \"<h4 class='error'> Erro: \"\r\n . $conexao->connect_errno\r\n .\"</h4>\";\r\n }\r\n return $sucesso;\r\n }", "public function buscarclientecuit($cliente = null){\n\n if(sizeof($this->request->getData()) > 0){\n\n $data = $this->request->getData();\n\n if(ctype_digit ($data['id'])){\n\n $auth = $this->request->session()->read('Auth');\n\n try {\n\n $conditions[] = array('Clientes.cuit = ' => $data['id']);\n \n $c = $this->Clientes->find(\n 'all', \n array('recursive' => -1,\n 'conditions' => $conditions)\n )->first();\n\n if (!is_null($c)){\n\n $cliente = $c->toArray();\n\n return $this->redirect(['action' => 'view', $cliente['id']]);\n \n }else{\n\n $this->Flash->error(__('No existe un Cliente con ese CUIT/DNI.'));\n }\n\n } catch (RecordNotFoundException $e) {\n\n $this->Flash->error(__('No existe un Cliente con ese CUIT/DNI.'));\n }\n\n }else{\n\n $this->Flash->error(__('Solo ingresar Numeros sin \".\" ni \"-\".'));\n }\n }\n\n $this->set('cliente', $cliente);\n }", "private function isClientExists(): bool {\n $sql = 'SELECT * FROM clients WHERE phone = :phone LIMIT 1';\n\n $db = static::getDB();\n $stmt = $db->prepare( $sql );\n\n $stmt->bindValue( ':phone', $this->phone, PDO::PARAM_STR );\n\n $stmt->execute();\n\n if ( $result = $stmt->fetch( PDO::FETCH_ASSOC ) ) {\n $this->id = $result['id'];\n\n return true;\n }\n\n return false;\n }", "function crearUsuario($usuario,$clave){\n\tif(!existeUsuario($usuario)){\n\t\tsetKValue(BUCKET_USUARIOS,$usuario,$clave);\n\t\treturn existeUsuario($usuario);\n\t}\n\treturn false;\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 verif_codigo(){\n if($this->input->is_ajax_request()){\n $post = $this->input->post();\n\n $codigo= $this->security->xss_clean($post['codigo']); /// Codigo\n $com_id= $this->security->xss_clean($post['com_id']); /// Componente id\n\n $verif_com_ope=$this->model_producto->verif_componente_operacion($com_id,$codigo);\n if(count($verif_com_ope)!=0){\n echo \"true\"; ///// no existe un CI registrado\n }\n else{\n echo \"false\"; //// existe el CI ya registrado\n } \n }else{\n show_404();\n }\n }", "private function consolaObjeto() {\r\n\t\t\t$clase = '\\\\Consola\\\\'.implode('\\\\', $this->objeto);\r\n\t\t\tif(class_exists($clase) == true):\r\n\t\t\t\t$this->consolaObjetoMetodo($clase);\r\n\t\t\telse:\r\n\t\t\t\tthrow new \\RuntimeException(sprintf('La clase: %, no existe dentro del archivo: %s, de la aplicación: %s', $this->objeto, $this->objeto, $this->aplicacion));\r\n\t\t\tendif;\r\n\t\t}", "public static function obtenerCotizacionesCliente($campo)\n { \n $consulta = \"SELECT * FROM cotizaciones WHERE id_cliente=? ORDER BY num_cotizacion DESC, version ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute(array($campo));\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "function _ConsultarClientes()\n\t\t{\n\t\t\t$query='\n\t\t\t\tSELECT\n\t\t\t\tclientes.id,\n\t\t\t\tclientes.nb_cliente,\n\t\t\t\tclientes.nb_apellidos,\n\t\t\t\tclientes.de_email,\n\t\t\t\tclientes.num_celular,\n\t\t\t\tusuarios.nb_nombre as \"Ins_nombre\", \n\t\t\t\tusuarios.nb_apellidos as \"Ins_apellido\" \n\t\t\t\tFROM sgclientes clientes\n\t\t\t\tleft join sgusuarios usuarios on clientes.id_usuario_registro=usuarios.id\n\t\t\t\twhere clientes.sn_activo=1\n\t\t\t\tORDER BY clientes.id ASC\n\t\t\t\n\t\t\t';\n\t\t\t$clientes = $this->EjecutarTransaccionAllNoParams($query);\n\t\t\treturn $clientes;\n\t\t}", "public function modificar()\n {\n $resp = false;\n $base = new BaseDatos();\n $sql = \"UPDATE archivocargado SET acnombre='\" . $this->getAcNombre() . \"', acdescripcion='\" . $this->getAcDescripcion() . \"', acicono='\" . $this->getAcIcono() . \"', idusuario=\" . $this->getObjUsuario()->getIdUsuario() . \", aclinkacceso='\" . $this->getAcLinkAcceso() . \"', accantidaddescarga=\" . $this->getAcCantidadDescarga() . \", accantidadusada=\" . $this->getAcCantidadUsada() . \", acfechainiciocompartir='\" . $this->getAcFechaInicioCompartir() . \"', acefechafincompartir='\" . $this->getAceFechaFinCompartir() . \"', acprotegidoclave='\" . $this->getAcProtegidoClave() . \"' WHERE idarchivocargado=\" . $this->getIdArchivoCargado() ;\n if ($base->Iniciar()) {\n if ($base->Ejecutar($sql)>=0) {\n $resp = true;\n } else {\n $this->setmensajeoperacion(\"ArchivoCargado->modificar: \" . $base->getError());\n }\n } else {\n $this->setmensajeoperacion(\"ArchivoCargado->modificar: \" . $base->getError());\n }\n return $resp;\n }", "public static function ComprobarAccesoGenerarContrato($id_inmueble,$id_cliente)\n\t{\t\t\n\t\trequire_once(PATHINCLUDE_FRAMEWORK_MODELOS.'Inmuebles.class.php');\n\t\t// Datos inmueble\n\t\t$inmueble = new ModelInmuebles();\n\t\t$inmueble->SetDataObject($id_inmueble);\n\t\t// Si no está en venta\n\t\tif($inmueble->precio_compra==0)\n\t\t\treturn -1;\n\t\t// Si no tiene ficha de encargo\n\t\trequire_once(PATHINCLUDE_FRAMEWORK_MODELOS.'FichasEncargoCliente.class.php');\n\t\t// Datos de fichas de encargo\n\t\t$ficha_encargo = new ModelFichasEncargoCliente();\n\t\t$fichas_encargo_obtenidas=$ficha_encargo->ObtenerFichasInmuebleCliente($id_inmueble,$id_cliente);\n\t\t$num_fichas_encargo=$fichas_encargo_obtenidas->RecordCount();\n\t\tif($num_fichas_encargo==0)\n\t\t\treturn -2;\n\t\t\n\t\treturn 1;\n\t}", "public function VerificaArqueoCreditos()\n{\n\tself::SetNames();\n\t\n $sql = \"SELECT * FROM arqueocaja WHERE codigo = ? and statusarqueo = 1\";\n $stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_SESSION[\"codigo\"]));\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n echo \"<div class='alert alert-danger'>\";\n echo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n echo \"<center><span class='fa fa-info-circle'></span> DISCULPE, NO EXISTE UN ARQUEO DE CAJA PARA PROCESAR COBROS DE CREDITOS, DEBERA DE INICIARLA PARA CONTINUAR.<br> SI DESEA REALIZAR UN ARQUEO DE CAJA HAZ CLIC <a href='forarqueo'>AQUI</a></center>\";\n echo \"</div>\";\n\n\t\t} else { \n\n\t$sql = \"SELECT * FROM arqueocaja WHERE codigo = ? and statusarqueo = 1\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_SESSION[\"codigo\"]) );\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$pae[] = $row;\n\t\t}\n\t$codcaja = $pae[0]['codcaja'];\n\t\t?>\n\n\t<div class=\"row\"> \n\t\t\t\t\t\t\t<div class=\"col-md-12\"> \n <div class=\"form-group has-feedback\"> \n <label class=\"control-label\">B&uacute;squeda de Clientes: <span class=\"symbol required\"></span></label>\n<input type=\"hidden\" name=\"codcaja\" id=\"codcaja\" value=\"<?php echo $codcaja; ?>\" readonly=\"readonly\">\n<input type=\"hidden\" class=\"form-control\" name=\"codcliente\" id=\"codcliente\"><input class=\"form-control\" type=\"text\" name=\"busquedacliente\" id=\"busquedacliente\" onKeyUp=\"this.value=this.value.toUpperCase();\" autocomplete=\"off\" placeholder=\"Ingrese Datos del Cliente para tu b&uacute;squeda\" required=\"required\">\n <i class=\"fa fa-search form-control-feedback\"></i> \n </div> \n </div> \t\n </div><br>\n\t\t\t\t\t\n <div class=\"modal-footer\"> \n<button type=\"button\" onClick=\"BuscaClientesAbonos()\" class=\"btn btn-primary\"><span class=\"fa fa-search\"></span> Realizar B&uacute;squeda</button>\t\t\t\n </div>\n\n\t<?php\n\t}\n}", "function buscar() //funcion para ver si el registro existe \n\t{\n\t$sql=\"select * from slc_unid_medida where nomenc_unid_medida= '$this->abr' and desc_unid_medida= '$this->des'\"; \n\t $result=mysql_query($sql,$this->conexion);\n\t $n=mysql_num_rows($result);\n\t if($n==0)\n\t\t\t return 'false';\n\t\t\telse\n\t\t\t return 'true';\n\t}", "function registrarCliente (){\n\t\t$x = $this->pdo->prepare('INSERT INTO cliente (cedula,correo,clave,nombre,celular,ciudad,direccion) VALUES (?,?,?,?,?,?,?)');\n\t\t$x->execute(array($this->cedula,$this->correo,$this->clave,$this->nombre,$this->celular,$this->ciudad,$this->direccion));\n\t\treturn $x;\n\t}", "public function esTarjetaCredito() {\n return true;\n }", "public function VerifyClientExist($document) {\n\n $sql = \"SELECT \n COUNT(archivo_organizado.id) AS CARGADO_ROBOT,\n ( SELECT COUNT(clientes.id) FROM clientes WHERE clientes.documento = archivo_organizado.NUMERO_IDENT_CLIENTE ) AS CARGADO_SISTEMA\n FROM archivo_organizado\n WHERE archivo_organizado.NUMERO_IDENT_CLIENTE = :document\";\n\n $result = $this->_db->prepare($sql);\n $result->bindValue(':document',$document);\n $result->execute();\n\n if(!is_null($result->errorInfo()[2]))\n return array('error' => $result->errorInfo()[2]);\n else\n return $result->fetch(PDO::FETCH_ASSOC);\n }", "function RegistrarCliente($DATA){ \n try{ \n $bd = new BD;\n $conn = $bd->conectar(); \n\n if (!$conn) {\n echo 'No pudo conectarse a mysql';\n exit;\n } \n \n $sql = \"\n INSERT INTO `clientes`(\n `NOMBRE`, `APELLIDO`\n ) VALUES ( \n '\".$DATA['nombre'].\"', \n '\".$DATA['apellido'].\"' \n )\";\n \n $resultado = mysqli_query($conn, $sql); \n \n if (!$resultado) {\n echo \"Error de BD, no se pudo consultar la base de datos\\n\";\n echo \"Error MySQL: \" . mysqli_error($conn);\n echo \"<br> $sql\";\n exit;\n }\n \n return mysqli_insert_id($conn); \n } \n catch(Exception $e){ \n echo(\"Error!\");\n return \"Error en la consulta\"; \n } \n }", "public function CambiaEstatus()\n {\n \t$consulta = $this->Modelo_direccion->getAllEntradas($this->session->userdata('id_direccion'));\n \t\n \tforeach ($consulta as $key) {\n \t\t$idoficio = $key->id_recepcion;\n\n \t\tif($this->db->query(\"CALL comparar_fechas('\".$idoficio.\"')\"))\n \t\t{\n \t\t\techo 'Ejecutando Cambios';\n \t\t}else{\n \t\t\tshow_error('Error! al ejecutar');\n \t\t}\n \t}\n\n redirect(base_url() . 'Direcciones/Externos/RecepcionDir/');\n }", "public function ActualizarClientes()\n\t{\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"cedcliente\"]) or empty($_POST[\"nomcliente\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\n\t\t$sql = \" select cedcliente from clientes where codcliente != ? and cedcliente = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codcliente\"], $_POST[\"cedcliente\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\n\t\t\t$sql = \" update clientes set \"\n\t\t\t.\" cedcliente = ?, \"\n\t\t\t.\" nomcliente = ?, \"\n\t\t\t.\" direccliente = ?, \"\n\t\t\t.\" tlfcliente = ?, \"\n\t\t\t.\" emailcliente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codcliente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $cedcliente);\n\t\t\t$stmt->bindParam(2, $nomcliente);\n\t\t\t$stmt->bindParam(3, $direccliente);\n\t\t\t$stmt->bindParam(4, $tlfcliente);\n\t\t\t$stmt->bindParam(5, $emailcliente);\n\t\t\t$stmt->bindParam(6, $codcliente);\n\n\t\t\t$cedcliente = strip_tags($_POST[\"cedcliente\"]);\n\t\t\t$nomcliente = strip_tags($_POST[\"nomcliente\"]);\n\t\t\t$direccliente = strip_tags($_POST[\"direccliente\"]);\n\t\t\t$tlfcliente = strip_tags($_POST[\"tlfcliente\"]);\n\t\t\t$emailcliente = strip_tags($_POST[\"emailcliente\"]);\n\t\t\t$codcliente = strip_tags($_POST[\"codcliente\"]);\n\t\t\t$stmt->execute();\n\n\t\t\techo \"<div class='alert alert-info'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<span class='fa fa-check-square-o'></span> EL CLIENTE FUE ACTUALIZADO EXITOSAMENTE\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"3\";\n\t\t\texit;\n\t\t}\n\t}", "public function CarregaClientes() {\n\t\t$clientes = new Model_Wpr_Clientes_ClientesIntegracao ();\n\t\t\n\t\treturn $clientes->carregaClientes ();\n\t}", "public function publicacaoConcluir()\r\n {\r\n try\r\n {\r\n $resposta = $this->conexao->Conectar()->prepare(\"UPDATE tbmissao SET id_usuario_concluir = ?, data_conclusao = NOW(), status = 1, conclusao = ? \"\r\n . \" WHERE id_missao = ?\");\r\n $resposta->bindValue(1, $this->getIdUsuarioConcluir(), PDO::PARAM_STR);\r\n $resposta->bindValue(2, $this->getSolucao(), PDO::PARAM_STR);\r\n $resposta->bindValue(3, $this->getIdMissao(), PDO::PARAM_STR);\r\n //$resposta->bindValue(3, $this->getData(), PDO::PARAM_STR);\r\n if($resposta->execute())\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n catch (PDOException $e)\r\n {\r\n return $e->getMenssage();\r\n }\r\n }", "function verificar_existencia_profesor_espacio(){\n\t\t$sql_verif= \"SELECT * FROM \n \t\t\t\tPROF_ESPACIO\n \t\t\tWHERE(\n \t\t\t\tCODESPACIO = '$this->CODESPACIO'\n \t\t\t)\n \t\t\t\";\n\nreturn $this->mysqli->query($sql_verif)->num_rows>=1;\n\n}", "function anadir_usuario(){\n // If $certificate is set, public key has been successfully received\n $certificate = get_certificate();\n if ($certificate != \"\") {\n // Check if certificate syntax is correct\n if(check_certificate($certificate)) {\n $name = get_remote_user();\n $response = doit($name, $certificate);\n // Check if command executed successfully\n if($response)\n return 1;\n else \n return -2;\n } else {\n return -1;\n }\n }\n else return -3;\n}", "public static function Nuevo_Cliente($codigo, $razon_social, $ciruc, $direccion, $ciudad, $telefono, $celular, $fax, $correo, $correo_contacto, $contacto, $observaciones)\n {\n // Sentencia INSERT\n $vacio=\"\";\n $fecha=date(\"Y/m/d\");\n $comando = \"INSERT INTO clientes (cod_cliente, status, nombre, ciruc, direccion, ciudad, telefono, celular, \n fax, correo, correo_factura, contacto, num_ventas, observaciones, fecha_alta) VALUES( ?,1,?,?,?,?,?,?,?,?,?,?,0,?,?)\";\n\n // Preparar la sentencia\n $sentencia = Database::getInstance()->getDb()->prepare($comando);\n\n return $sentencia->execute(\n array(\n $codigo, \n $razon_social,\n $ciruc,\n $direccion,\n $ciudad,\n $telefono,\n $celular,\n $fax,\n $correo,\n $correo_contacto,\n $contacto,\n $observaciones,\n $fecha\n )\n );\n\n }", "function eliminarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cliente','id_cliente','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function VerificaDisponibilidade()\n\t{\n\t\t$this->loadModel('Cliente');\n\t\t$disponibilidade = $this->Cliente->find('count', array(\n\t\t\t'conditions' => \n\t\t\t\tarray(\n\n\t\t\t\t\t'Cliente.id' => $this->request->data['id_cliente'],\n\t\t\t\t\t'Cliente.site_no_ar' => 'S'\n\t\t\t\t)\n\t\t\t));\n\t\t\n\t\tif($disponibilidade == 0)\n\t\t{\n\t\t\t$this->Return = false;\n\t\t\t$this->Message = 'SITEFECHADO';\n\t\t\t$this->EncodeReturn();\t\n\t\t}\n\t}", "public static function obtenerClientes()\n {\n $consulta = \"SELECT * FROM clientes ORDER BY nombre ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public static function obtenerCotizacionesIDCliente($campo)\n { \n $consulta = \"SELECT * FROM cotizaciones WHERE (id_cliente=?) ORDER BY num_cotizacion DESC, version ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute(array($campo));\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "function Inserir() {\n if($this->GetClienteCPF($this->getCli_cpf())>0):\n echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este CPF já esta cadastrado ';\n Sistema::VoltarPagina();\n echo '</div>';\n exit();\n endif;\n \n //se for maior que zero significa que exite algum email igual----------------------\n if($this->GetClienteEmail($this->getCli_email())>0):\n echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este Email já esta cadastrado ';\n Sistema::VoltarPagina();\n echo '</div>';\n exit();\n endif;\n //Caso passou na verificação os dados serão gravados no banco-------------------------\n $query = \"INSERT INTO \".$this->prefix.\"clientes (cli_nome,\n cli_sobrenome,\n cli_data_nasc,\n cli_rg,\n cli_cpf,\n cli_ddd,\n cli_fone,\n cli_celular,\n cli_endereco,\n cli_numero,\n cli_bairro,\n cli_cidade,\n cli_uf,\n cli_cep,\n cli_email,\n cli_data_cad,\n cli_hora_cad,\n cli_pass) VALUES (:cli_nome,\n :cli_sobrenome,\n :cli_data_nasc,\n :cli_rg,\n :cli_cpf,\n :cli_ddd,\n :cli_fone,\n :cli_celular,\n :cli_endereco,\n :cli_numero,\n :cli_bairro,\n :cli_cidade,\n :cli_uf,\n :cli_cep,\n :cli_email,\n :cli_data_cad,\n :cli_hora_cad,\n :cli_senha)\";\n \n $params = array(\n ':cli_nome'=> $this->getCli_nome(),\n ':cli_sobrenome'=> $this->getCli_sobrenome(),\n ':cli_data_nasc'=> $this->getCli_data_nasc(),\n ':cli_rg'=> $this->getCli_rg(),\n ':cli_cpf'=> $this->getCli_cpf(),\n ':cli_ddd'=> $this->getCli_ddd(),\n ':cli_fone'=> $this->getCli_fone(),\n ':cli_celular'=> $this->getCli_celular(),\n ':cli_endereco'=> $this->getCli_endereco(),\n ':cli_numero'=> $this->getCli_numero(),\n ':cli_bairro'=> $this->getCli_bairro(),\n ':cli_cidade'=> $this->getCli_cidade(),\n ':cli_uf'=> $this->getCli_uf(),\n ':cli_cep'=> $this->getCli_cep(),\n ':cli_email'=> $this->getCli_email(),\n ':cli_data_cad'=> $this->getCli_data_cad(),\n ':cli_hora_cad'=> $this->getCli_hora_cad(),\n ':cli_senha'=> $this->getCli_senha(),\n \n \n );\n //echo $query;\n $this->ExecuteSQL($query, $params);\n \n \n }", "public function selectIniciarSesion(){\n $query = \"SELECT codUsuario, nombre, apellido, sexo, COUNT(*) AS existe FROM usuario WHERE correo = '\".parent::string($this->getCorreo()).\"' AND contrasenia = '\".md5(md5(\"PAO%%%%0001TPIPSADSADasdsad\").parent::string($this->getContrasenia())).\"' LIMIT 1;\";\n $result = mysqli_query(parent::conexion(), $query);\n if($result){\n $fila = mysqli_fetch_array($result);\n parent::desconectar();\n return $fila;\n } else{\n echo parent::conexion()->error;\n parent::desconectar();\n return false;\n }\n }", "function comprovarBorrar($idProducte, $idUsuari){\n $conn=connexioBD();\n $existe=false;\n $sql1=\"SELECT * FROM productes WHERE id='$idProducte' and usuari_id='$idUsuari'\";\n if (!$resultado =$conn->query($sql1)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows==1){\n $existe=true;\n }\n return $existe;\n $resultado->free();\n $conn->close(); \n}", "function ValidarServicioEjecutivo($id_servicio,$id_ejecutivo,$codigo){\n\t\t\t\t\t$this->db->where(\"id_servicio\",$id_servicio);\n\t\t\t\t\t$this->db->where(\"f_id_usuario\",$id_ejecutivo);\n\t\t\t\t\t$this->db->where(\"Codigo_activacion\",$codigo);\n\t\t\t\t\t$query = $this->db->get('t_dat_servicios');\n\n\t\t\t\t\treturn($query->num_rows()==1);\n\t\t\t\t}", "function usuario_existe($usuario){\n\t$sql = \"SELECT id FROM usuarios WHERE usuario = '$usuario'\";\n\n\t$resultado = query($sql);\n\n\tif(contar_filas($resultado) == 1){\n\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n\n}", "static public function ctrCrearOsde(){\n\n\t\t\n\n\t\tif(isset($_POST[\"nuevoOsde\"])){\n\n\t\t\tif ($_POST[\"nuevoImporte\"]<>null){\n\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoOsde\"])){\n\n\t\t\t\t\t$tabla = \"osde\";\n\n\t\t\t\t\t$datos = array(\"nombre\" => $_POST[\"nuevoOsde\"],\n\t\t\t\t\t\t\t\t \"importe\" => $_POST[\"nuevoImporte\"]);\n\n\t\t\t\t\t echo '<pre>'; print_r($datos); echo '</pre>';\n\n\t\t\t\t\t$respuesta = ModeloOsde::mdlIngresarOsde($tabla, $datos);\n\n\t\t\t\t\tif($respuesta == \"ok\"){\n\n\t\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 Nuevo Osde ha sido guardado 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 = \"osde\";\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\t}\n\n\n\t\t\t\t}else{\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: \"error\",\n\t\t\t\t\t\t\t title: \"¡La categoría no puede ir vacía o llevar caracteres especiales!\",\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\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"osde\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t \t</script>';\n\n\t\t\t\t}\n\t\t\t}\t\t\n\n\t\t}\n\n\t}", "public function ComprobarEmpresa($empresa_id, $usuario_id){\r\r\n $empresa = Empresa::Where('id', $empresa_id)\r\r\n ->where('id_usuario', $usuario_id)\r\r\n ->first();\r\r\n \r\r\n if ($empresa){\r\r\n return $empresa;\r\r\n }\r\r\n else{\r\r\n return false;\r\r\n }\r\r\n }", "function verificarComprobante($fecha)\n {\n global $db;\n $sql = \" select count(dateReception) as total from almacen_reception\n where tipoTrans = 'A' and tipoComprobante = 'A';\n and dateReception >= '$fecha' \";\n echo $sql;\n $db->SetFetchMode(ADODB_FETCH_ASSOC);\n \t$info = $db->execute($sql);\n if ($info->fields(\"total\") == 0)\n {\n return 1; // positivo, puede registrar\n }\n else if ($info->fields(\"total\") > 0)\n {\n return 0; // existe ajustes, no puede registrar\n }\n }", "function existeProveedor($codigo)\n {\n \tif($this->gateway->existMco_proveedores($codigo) == 1){ \n return ERROR_DATO_EXISTE;\n }\n else\n {\n return EXITO_OPERACION_REALIZADA;\n }\n }", "function CompruebaTabla($conexionUsar, $tablaUsar, $bddUsar){ // Por último, en cada consulta, se comprueba que no vuelva\n $sentenciaTabla = \"select * from \" . $tablaUsar; // vacía ni con errores, y en caso de haberlos, se muestran por pantalla.\n $valor = true;\n $conexionUsar->select_db($bddUsar);\n $queryComprobar = mysqli_query($conexionUsar, $sentenciaTabla);\n if(!$queryComprobar){\n echo \"<h3 style=\\\"margin-left: 1%\\\">ERROR: No se encuentra la tabla \" . $tablaUsar . \"</h3>\";\n echo \"<h3 style=\\\"margin-left: 1%\\\">Base de Datos INCOMPLETA. Se debe realizar una reinstalación.</h3>\";\n $valor = false;\n }\n return($valor);\n }", "private function existeUsuario()\n {\n $con = Conexion::getInstance();\n $sql = \"SELECT user \n FROM usuarios\n WHERE user = '{$this->usuario}' AND estado = 1 AND idUsuario != {$this->Id}\";\n\n $result = mysqli_query($con, $sql);\n\n if($result->num_rows >= 1 && $result != false)\n {\n return false;\n }\n\n return true;\n }", "function existe_ocupacion ($ocupacion){\n\t\t\t\tinclude(\"bd_conection.php\");\n\t\t\t\t$result = @mysqli_query($con, \"SELECT * FROM ocupaciones WHERE ocupacion_tipo LIKE '$ocupacion'\");\n\t\t\t\t$rowcount=mysqli_num_rows($result);\n\t\t\t\tif ($rowcount > 0){\t\n\t\t\t\t\twhile($ocupacionExist = @mysqli_fetch_assoc($result)) { \n\t\t\t\t\t\treturn $ocupacionExist['ocupacion_tipo'];\n\t\t\t\t\t}\n\t\t\t\t}else if ($ocupacion !== \"\") {\n\t\t\t\t\t@mysqli_query($con, \"INSERT INTO ocupaciones (ocupacion_tipo) VALUES ('$ocupacion')\");\t\t\t\n\t\t\t\t\treturn $ocupacion;\n\t\t\t\t}\n\t\t\t}", "private function validate_exists() {\n\t\tif ( ! $this->exists ) {\n\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_EXIST );\n\t\t}\n\t}", "function clientExists($Client_ID){\n\t\t$sql=\"SELECT * FROM Client WHERE Client_ID='$Client_ID'\";\n\t\t$result=mysql_query($sql);\n\n\t\t// Mysql_num_row is counting table row\n\t\t$count = mysql_num_rows($result);\n\t\tif ($count==1){//Client exists\n\t\t\treturn true;\n\t\t} else {//ID should be unique, therefore only one can be returned\n\t\t\treturn false;\n\t\t}\n\t}", "public function actualizarCliente($datos) {\n $consultaExistenciacliente = $this->db->select(\"SELECT * FROM cliente \"\n . \"WHERE id = '\" . $datos['txt_id'] . \"' \");\n\n if ($consultaExistenciacliente != null) {\n\n $posData = array(\n 'id' => $datos['txt_id'],\n 'nombre' => $datos['txt_nombre'],\n 'telefono' => $datos['txt_telefono'],\n 'tarjeta' => $datos['txt_tarjeta']);\n\n $this->db->update('cliente', $posData, \"`id` = '{$datos['txt_id']}'\");\n } else {\n //Sino Inserto datos de Pre-Matricula del Estudiante\n echo 'Error...</br>Ya existe un cliente con ese ID';\n die;\n }\n \n }", "public function enviar_codigo($cliente)\n {\n if (Config::get('params.enviar_codigo_correo'))\n {\n $numero = rand(1000, 9999) . \"-\" . rand(1000, 9999) . \"-\" . rand(1000, 9999);\n $codigo = new Codigo;\n $codigo->numero = $numero;\n $codigo->usado = false;\n $codigo->cliente()->associate($cliente);\n if ($codigo->save())\n {\n $data = array('nombre' => $cliente->nombre,\n 'codigo' => $numero,\n );\n $email = $cliente->user->email;\n $nombre = $cliente->nombre;\n Mail::queue('emails.send_promotional_code', $data, function($message) use ($email, $nombre) {\n $message->to($email, $nombre)->subject('Código promocional');\n });\n return true;\n }\n else\n {\n return false;\n }\n }\n }", "function cargar()\n\t{\n\t\ttoba_logger::instancia()->debug(\"Cargando proyecto '{$this->identificador}'\");\n\t\tif( ! ( $this->instancia->existe_proyecto_vinculado( $this->identificador ) ) ) {\n\t\t\ttoba_logger::instancia()->error(\"PROYECTO: El proyecto '{$this->identificador}' no esta asociado a la instancia actual\");\n\t\t\tthrow new toba_error('PROYECTO: El proyecto no esta asociado a la instancia actual, revise el log');\n\t\t}\n\t\t$this->cargar_tablas();\n\t\t$this->cargar_componentes();\n\t\t$errores = $this->cargar_perfiles();\n\t\t$this->generar_roles_db();\n\t\t//Regenero el checksum para el proyecto\n\t\tif ($this->get_instalacion()->chequea_sincro_svn()) {\n\t\t\t$this->generar_estado_codigo();\n\t\t}\n\t\treturn $errores;\n\t}", "function insertarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_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('genero','genero','varchar');\n\t\t$this->setParametro('ci','ci','varchar');\n\t\t$this->setParametro('email','email','varchar');\n\t\t$this->setParametro('email2','email2','varchar');\n\t\t$this->setParametro('direccion','direccion','varchar');\n\t\t$this->setParametro('celular','celular','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('lugar_expedicion','lugar_expedicion','varchar');\n\t\t$this->setParametro('apellido_paterno','apellido_paterno','varchar');\n\t\t$this->setParametro('telefono','telefono','varchar');\n\t\t$this->setParametro('ciudad_residencia','ciudad_residencia','varchar');\n\t\t$this->setParametro('id_pais_residencia','id_pais_residencia','int4');\n\t\t$this->setParametro('nacionalidad','nacionalidad','varchar');\n\t\t$this->setParametro('barrio_zona','barrio_zona','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('apellido_materno','apellido_materno','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function cadastrarRegistro($id_cliente, $trabalho, $campanha, $peca)\n\t\t{\n\t\t\t$sql = \"INSERT INTO tb_portfolio \";\n\t\t\t$sql = $sql . \"(id_cliente, trabalho, campanha, peca) \";\n\t\t\t$sql = $sql . \"VALUES('$id_cliente','$trabalho','$campanha','$peca')\";\n\t\t\t\n\t\t\t$banco = new Banco();\n\t\t\t\n\t\t\tif ($busca = mysql_query($sql))\n\t\t\t{\n\t\t\t\t$_SESSION['inclusao']=\"OK\";\n\t\t\t\techo \"<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=../home/index.php'>\";\t\n\t\t\t\t$banco->fecharConexao();\n\t\t\t\treturn $busca;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_SESSION['inclusao']=\"ERROR\";\n\t\t\t\techo \"<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=../home/index.php'>\";\n\t\t\t\t$banco->fecharConexao();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "static public function ctrEditarClienteo(){\n\n\t\tif(isset($_POST[\"editarCliente\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarRazonSocial\"]) &&\n\t\t\t\tpreg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarNombreFantasia\"]) &&\t\t\t\t\n\t\t\t\tpreg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarImpositivo\"]) &&\t\t\t\t\n\t\t\t\tpreg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarDireccion\"]) &&\t\t\t\t\n\t\t\t\tpreg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarProvincia\"]) &&\t\t\t\t\n\t\t\t\tpreg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarPais\"]) &&\t\n\t\t\t\tpreg_match('/^[[email protected]_]+$/', $_POST[\"editarEmail\"]) &&\t\t\t\t\n\t\t\t\tpreg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarTelefono\"]) &&\t\t\t\t\n\t\t\t\tpreg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarTipoDocumento\"]) &&\t\t\t\t\n\t\t\t\tpreg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarNumeroDocumento\"])\n\t\t\t){\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[\"fotoActual\"];\n\n\t\t\t\tif(isset($_FILES[\"editarFoto\"][\"tmp_name\"]) && !empty($_FILES[\"editarFoto\"][\"tmp_name\"])){\n\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarFoto\"][\"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 CLIENTE\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t$directorio = \"vistas/img/clientes/\".$_POST[\"editarEmail\"];\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[\"fotoActual\"])){\n\n\t\t\t\t\t\tunlink($_POST[\"fotoActual\"]);\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t}\t\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[\"editarFoto\"][\"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/clientes/\".$_POST[\"editarEmail\"].\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarFoto\"][\"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[\"editarFoto\"][\"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/clientes/\".$_POST[\"editarEmail\"].\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarFoto\"][\"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 = \"cliente\";\n\n\t\t\t\t$datos = array(\"RazonSocial\" => $_POST[\"editarRazonSocial\"],\n\t\t\t\t\t\t\t \"NombreFantasia\" => $_POST[\"editarNombreFantasia\"],\n\t\t\t\t\t\t\t \"Impositivo\" => $_POST[\"editarImpositivo\"],\n\t\t\t\t\t\t\t \"Direccion\" => $_POST[\"editarDireccion\"],\n\t\t\t\t\t\t\t \"Provincia\" => $_POST[\"editarProvincia\"],\n\t\t\t\t\t\t\t \"Pais\" => $_POST[\"editarPais\"],\n\t\t\t\t\t\t\t \"Email\" => $_POST[\"editarEmail\"],\n\t\t\t\t\t\t\t \"Telefono\" => $_POST[\"editarTelefono\"],\n\t\t\t\t\t\t\t \"TipoDocumento\" => $_POST[\"editarTipoDocumento\"],\n\t\t\t\t\t\t\t \"NumeroDocumento\" => $_POST[\"editarNumeroDocumento\"],\n\t\t\t\t\t \"Foto\"=>$ruta);\n\n\t\t\t\t$respuesta = ModeloClientes::mdlEditarCliente($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.fire({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El Cliente ha sido editado correctamente\",\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\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"clientes\";\n\n\t\t\t\t\t\t\t\t\t}\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\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal.fire({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡La Razón Social no puede ir vacío 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 = \"clientes\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function modificarCuentaServSoc()\n {\n // TODO: Implement modificarCuentaServSoc() method.\n }", "function afficherclientfideless(){\n\t\t$sql=\"SElECT * From clientfideles\";\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 validarCliente(){\n $this->procedimiento='rec.ft_cliente_ime';\n $this->transaccion='CLI_VALIDAR_GET';\n $this->tipo_procedimiento='IME';//tipo de transaccion\n $this->setCount(false);\n $this->setParametro('nombre','nombre','varchar');\n $this->setParametro('apellido','apellido','varchar');\n $this->setParametro('genero','genero','varchar');\n $this->setParametro('ci','ci','varchar');\n\n\n $this->captura('v_valid','varchar');\n $this->captura('v_desc_func','varchar');\n\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n //var_dump($this->respuesta); exit;\n $this->ejecutarConsulta();\n //Devuelve la respuesta\n return $this->respuesta;\n }", "static public function ctrCrearCcuerpo(){\n\n if(isset($_POST[\"nuevoCcuerpo\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ\\- ]+$/', $_POST[\"nuevoCcuerpo\"])){\n\n\t\t\t\t$tabla = \"cuartel_cuerpos\";\n\n\t\t\t\t$datos = array(\"tipo_sep\"=> $_POST[\"nuevoTproducto\"],\n \"nombre\"=> $_POST[\"nuevoCcuerpo\"],\n \"id_sociedad\" => '0',\n \"id_cementerio\"=> $_POST[\"nuevoCementerio\"]);\n\n\t\t\t\t$respuesta = ModeloCcuerpo::mdlIngresarCcuerpo($tabla, $datos);\n print_r($respuesta);\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El Cuartel-Cuerpo ha sido guardado correctamente\",\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\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"cuartel-cuerpo\";\n\n\t\t\t\t\t\t\t\t\t}\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\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 Cuartel-Cuerpo no puede ir vacío 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 = \"cuartel-cuerpo\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function registraRetirada(string $codigoLivro, int $cpfCliente): bool\n {\n return true;\n }", "public function consultarCatalogArc() {\n \t\t$existen = false;\n \t\t$this->conn = new Conexion('../../php/datosServer.php');\n\t\t\t$this->conn = $this->conn->conectar();\n\t\t\t\n\t\t\t\t $sql = \"CALL consultarCatalog('archivos');\"; \n\t\t\t\t\t$info = '<div class=\"animated fadeInDown BtnShadow\" id=\"resultados\">\n\t\t\t\t\t<span class=\"label warning\" style=\"margin: 8px;\"><i class=\"fa fa-list-alt fa-lg\"></i> Catálogo de Archivos</span><br>\n\t\t\t\t\t\t <div class=\"form-item\">\n\t\t\t\t\t <input data-tipso=\"Escribe una palabra clave.\" type=\"text\" id=\"resultados\" placeholder=\"Filtrar Resultados\" class=\"filterBoxy\">\n\t\t\t\t\t </div>\t\t\t\t\n\t\t\t\t\t<table class=\"flat tableLines\">\n \t \t\t\t\t<tr class=\"titleTable\"><th>Archivo</th>\n \t \t\t\t\t<th>Fecha</th>\n\t\t\t \t\t<th>Eliminar</th>\n\t\t\t\t\t\t</tr><tbody id=\"resultadoBus\">';\n\t\n\t\t\t\n\t\t\t$result = $this->conn->query($sql);\n if ($result->num_rows > 0) {\n while($row = $result->fetch_array(MYSQLI_NUM)) {\n\t\t\t\t\t\tif (preg_match('/.doc/',$row[0]) || preg_match('/.docx/',$row[0])) $arch = '<i class=\"fa fa-file-word-o fa-lg\"></i> '.$row[0];\n\t\t\t\t\t\tif (preg_match('/.xls/',$row[0]) || preg_match('/.xlsx/',$row[0])) $arch = '<i class=\"fa fa-file-excel-o fa-lg\"></i> '.$row[0]; \n\t\t\t\t\t\tif (preg_match('/.pdf/',$row[0]) || preg_match('/.PDF/',$row[0])) $arch = '<i class=\"fa fa-file-pdf-o fa-lg\"></i> '.$row[0]; \t\n \t\n \t$info .= '<tr id=\"'.$row[2].'\"><td><a class=\"enlaces\" href=\"../docs/'.$row[0].'\" target=\"_blank\">'.$arch.'</a></td>';\n \t$info .= '<td>'.$row[1].'</td><td id=\"'.$row[0].'\"><span id=\"edit-arch\" style=\"cursor: pointer;\" class=\"label badge error\"><i class=\"fa fa-remove fa-lg\"></i></span></td></tr>';\n \t}\n \t$info .= '</tbody></table></div>';\n \t\n \t$info .= '\n\t\t\t\t\t\t\t<script type=\"text/javascript\" src=\"../js/table-filter.js\"></script> \t\n \t';\n $existen = true;\n }\n \n if($existen == true) {\n \t\techo $info;\n \t}else echo -1;\n $this->conn->close();\n \t\t}", "function cadastraCliente($conexao,$nome,$endereco,$cep,$tel_celular,$tel_residencial,$email,$senha)\n {\n $sql = \"INSERT INTO cliente (nome,endereco,cep,tel_celular,tel_residencial,email,senha) VALUES\n ('{$nome}','{$endereco}','{$cep}','{$tel_celular}','{$tel_residencial}','{$email}','{$senha}')\";\n return mysqli_query($conexao,$sql);\n }", "protected function CargarCliente($item_id){ \n $bus = Cliente::model()->findByPk($item_id);\n $res = array(\n 'EXISTE' => $bus ? true : false,\n 'ID' => $bus ? $bus->CLIENTE : '',\n 'NOMBRE' => $bus ? $bus->NOMBRE : '',\n );\n \n echo CJSON::encode($res);\n }", "public function cliente_get(){\n\t\t$cliente_id = $this->uri->segment(3);\n\n\t\t//validar el cliente id\n\t\tif (!isset($cliente_id)) {\n\t\t\t$respuesta = array(\n\t\t\t\t'err'=>TRUE,\n\t\t\t\t'mensaje'=>'Es necesario el id del cliente'\n\t\t\t);\n\n\t\t\t$this->response($respuesta, REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\n\t\t//lo paso al modelo\n\t\t$cliente = $this->Cliente_model->get_cliente($cliente_id);\n\n\t\t//cargo, valido y lo devuelto para que se muestre\n\t\tif(isset($cliente)){\n\t\t\t$respuesta=array(\n\t\t\t\t'err'=>FALSE,\n\t\t\t\t'mensaje'=>'Registro cargado correctamente',\n\t\t\t\t'cliente'=>$cliente\n\t\t\t);\n\n\t\t\t$this->response($respuesta);\n\t\t}else{\n\t\t\t$respuesta=array(\n\t\t\t\t'err'=>TRUE,\n\t\t\t\t'mensaje'=>'El registro con el id '.$cliente_id.', no exste',\n\t\t\t\t'cliente'=>null\n\t\t\t);\n\t\t\t$this->response($respuesta, REST_Controller::HTTP_NOT_FOUND);\n\t\t}\n\t}", "public function afficherListeDossierSiCreateur() \n {\n $auth = AuthenticationManager::getInstance();\n $username = $auth->getMatricule();\n //sécurité\n $action = 'listCreatedFolder';\n $error = AccessControll::checkRight($action);\n if ( empty($error) ){ //ok\n $dossier = DossierManager::getAllCreatedFolder($username);\n $prez = DossierHtml::listCreatedFolderHtml($dossier);\n } else{ //pas ok\n $prez = HomeHtml::toHtml($error);\n }\n $this->response->setPart('contenu', $prez);\n }", "public function inserir(){\r\n\t\tif(!$this->_validarCampos())\r\n\t\t\t// levantando a excessao CamposObrigatorios //\r\n\t\t\tthrow new CamposObrigatorios();\r\n\t\t\r\n\t\tif($this->_testarServicoExiste($this->getNome()))\r\n\t\t\t// levanto a excessao//\r\n\t\t\tthrow new Exception(\"Serviço já cadastrado en nossa base de dados\");\r\n\t\t\r\n\t\t// recuperando a instancia da classe de acesso a dados //\r\n\t\t$instancia = ServicoDAO::getInstancia();\r\n\t\t// retornando o Usuario //\r\n\t\treturn $servico = $instancia->inserir($this);\r\n\t}", "public function asignar(){\n global $baseDatos;\n if ($this->existeConductorLibre()){\n $sql = \"SELECT * FROM conductores WHERE `estado` = 'LIBRE'\";\n $resultado = $baseDatos->query($sql);\n $con = $resultado->fetch_assoc();\n $this->constructorConductor($con);\n return true;\n }else{\n return false;\n }\n }", "public function crearComprobante()\n {\n if (!$this->getAutenticacion()) {\n throw new WsException(\n 'Error de autenticacion',\n WsException::CODE_ERROR_AUTENTICACION\n );\n }\n\n $this->validarDatosFactura();\n\n $comprobanteObj = $this->FECompUltimoAutorizado(\n $this->client,\n $this->authRequest,\n $this->datos->codigoComprobante,\n $this->datos->puntoVenta\n );\n $ultimoComprobante = $comprobanteObj->CbteNro;\n\n $this->datos = $this->parseFacturaArray($this->datos);\n $this->datos->FeDetReq->FECAEDetRequest->CbteDesde = $ultimoComprobante + 1;\n $this->datos->FeDetReq->FECAEDetRequest->CbteHasta = $ultimoComprobante + 1;\n $result = $this->FECAESolicitar($this->client, $this->authRequest, $this->datos);\n\n return $result;\n }", "public function atualizarClientes($reg,$nome,$rg,$cpf,$cnpj,$telefone,$dtnascimento,$habilitado){\n //$conexao = $c->conexao();\n\n $usuid = $_SESSION['usuid'];\n $_SESSION['nomeAnterior'] = $nome;\n\n $sql = \"SELECT reg,rg FROM tbclientes c WHERE reg = '$reg' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n\n if($rg != $row['rg']){\n $sql = \"SELECT count(*) as existe FROM tbclientes c WHERE rg = '$rg' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n\n if ($row['existe'] >= 1 ) {\n return 0;\n }else{ \n\n $sql = \"UPDATE tbclientes SET nome = '$nome', rg = '$rg', cpf='$cpf', cnpj = '$cnpj', telefone = '$telefone', dt_nascimento = '$dtnascimento', habilitado = '$habilitado', modificado = NOW(), usuid = '$usuid' WHERE reg = '$reg'\";\n echo $this->conexao->query($sql);\n\n $mensagem = \"O Usuário \".$_SESSION['email'].\" atualizou o Cliente para $nome \";\n $this->salvaLog($mensagem);\n }\n \n }else{ \n\n $sql = \"UPDATE tbclientes SET nome = '$nome', rg = '$rg', cpf='$cpf', cnpj = '$cnpj',telefone = '$telefone', dt_nascimento = '$dtnascimento', habilitado = '$habilitado', modificado = NOW(), usuid = '$usuid' WHERE reg = '$reg'\";\n\n echo $this->conexao->query($sql);\n\n $mensagem = \"O Usuário \".$_SESSION['email'].\" atualizou o Cliente para $nome \";\n $this->salvaLog($mensagem);\n\n }\n\n \n\n }", "public static function comprobarYaExistente($valor) {\n return UsuarioPDO::comprobarYaExistente($valor);\n }", "public function enrutando()\n\t\t{\n\t\t\t$metodo \t\t\t= $this->_metodo;\n\t\t\t$argumentos \t\t= $this->_argumentos;\n\t\t\t$controlador \t\t= $this->_controlador;\n\t\t\t$claseControlador \t= $controlador . 'Controlador';\n\t\t\t$rutaControlador \t= ROOT . 'controlador' . DS . $claseControlador . '.php';\n\n\t\t\tif (!is_readable($rutaControlador)) {\n\t\t\t\theader(\"Location: \" . BASE_URL . 'accesos/paginaVacia/');\n\t\t\t}\n\t\t\telse{\n\t\t\t\tControlador::cargarControlador($rutaControlador,$claseControlador,$metodo,$argumentos);\n\t\t\t}\n\n\t\t}", "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}", "public function Exists(Cliente $oCliente){\n\t\t\t$STMT = parent::PREPARE('SELECT 1 FROM Cliente WHERE PK_IDCliente = ? LIMIT 1;');\n\t\t\t\n\t\t\t$Params = parent::TypeParam($oCliente->getPK_IDCliente());\n\t\t\t\n\t\t\t$PK_IDCliente = $oCliente->getPK_IDCliente();\n\t\t\t\n\t\t\t$STMT->bind_param($Params, $PK_IDCliente);\n\t\t\t\n\t\t\treturn Count(parent::FirstOrDefault($STMT)) > 0;\n\t\t}", "function ultimas_fichas_software_destacado() {\n\t\n\t\t$query = \"SELECT COUNT(1) FROM software WHERE software_destacado=1\";\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$rows = mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\treturn $rows[0];\n\t}" ]
[ "0.6383331", "0.63641465", "0.6340269", "0.62630856", "0.5986165", "0.59821856", "0.5944235", "0.5888293", "0.5882663", "0.58292717", "0.5791125", "0.57788396", "0.5737969", "0.571418", "0.567804", "0.56342965", "0.563124", "0.5617279", "0.5601936", "0.5598964", "0.5595441", "0.55859804", "0.5582519", "0.5553959", "0.5538923", "0.55369836", "0.55149186", "0.5512242", "0.5483768", "0.547837", "0.54749846", "0.5471172", "0.54585296", "0.54534364", "0.54522806", "0.5451882", "0.54471064", "0.54359597", "0.543029", "0.54238695", "0.54231423", "0.5418449", "0.5409362", "0.54016095", "0.5392979", "0.5392266", "0.5387258", "0.53763425", "0.53742445", "0.5367058", "0.5358314", "0.5350273", "0.53482026", "0.5347589", "0.5342269", "0.5329546", "0.5325827", "0.53253233", "0.53246206", "0.5323595", "0.53214306", "0.52907974", "0.527205", "0.526238", "0.5259063", "0.5257934", "0.52535105", "0.52480644", "0.5243444", "0.5232962", "0.52320737", "0.52270263", "0.52269644", "0.5223615", "0.5221413", "0.5218136", "0.52155113", "0.5214472", "0.5210547", "0.52006024", "0.519909", "0.5199035", "0.51880294", "0.518722", "0.51835847", "0.51830155", "0.51804346", "0.51788414", "0.5174064", "0.51739377", "0.5173356", "0.51667553", "0.5155735", "0.515199", "0.51473165", "0.5145636", "0.5139653", "0.5138152", "0.5137487", "0.513169" ]
0.53041923
61
get message by id
static public function getMessageById($rest) { $data = array(); $h = $rest->getHierarchy(); $vars = $rest->getRequestVars(); $errors = Validation::required(array("id"), $vars); // do we have any errors if (count($errors)) { echo json_encode(array( "success" => false, "error" => "Missing the following fields: ".implode($errors, ", ") )); } else { $message = Message::getById($vars['id']); $res = array( "success" => ($message?true:false), "message" => $message ); echo json_encode($res); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getById($id)\n\t{\n\t\treturn Message::findOne(\"user_id=? AND id=?\", [$this->user_id, $id]);\n\t}", "public function get_message_by_id($id)\n\t{\n\t\t$query = $this->db->get_where('message', array('message_id' => $id));\n\t\treturn $query;\n\t}", "public function getMessage( $id )\n\t{\n\t\t$message = Message::where( 'id', $id )->value('message');\n\t\treturn $message;\n\t}", "protected static function findMessage($id)\n {\n return self::findInMailBox()->andWhere(['id' => $id])->one();\n }", "public function getMessage($id) {\n\t\tif (!array_key_exists($id, $this -> messages)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this -> messages[$id];\n\t}", "function get_message($id_message)\n\t{\n\t\t$this->ci->db->select('*');\n\t\t$this->ci->db->where('am_id', $id_message);\n\t\t$query = $this->ci->db->get('auth_message');\n\t\tif($query->num_rows() != 0)\n\t\t{\n\t\t\t$data = $query->row()->am_message;\n\t\t\treturn $data;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function readMessage($id) {\n\t\t$response = null;\n\t\tif ($id) {\n\t\t\t$urlMessage = \"{$this->apiHost}/read_message\";\n\t\t\t$postData = sprintf ( \"id=%s&uh=%s\", $id, $this->modHash );\n\t\t\t$response = $this->runCurl ( $urlMessage, $postData );\n\t\t}\n\t\treturn $response;\n\t}", "public static function findById(int $id): Message {\n $db = Database::getPDOConnection();\n $stmt = $db->prepare('SELECT * FROM `messages` WHERE `id` = :id');\n $stmt->execute(['id' => $id]);\n $row = $stmt->fetch();\n if (!$row) {\n throw new MessageNotFoundException(sprintf('no message with id \\'%d\\' exists', $id));\n }\n $message = Message::fromDBRecord($row, $db);\n return $message;\n }", "public function find(string $id) : ?Message\n {\n $resp = DB::table($this->TABLE)->where(self::ID, $id)->orderBy(self::DATE, self::ASC)->first();\n return $this->load($resp);\n }", "public function getMessage($id) {\n $objMessage = new Base_Model_Lib_Support_Entity_Message();\n $objMessageService = new Base_Model_Lib_Support_Service_Message();\n try {\n\n $id = (int) $id;\n $row = $this->fetchRow('id = ' . $id);\n\n if ($row != \"\") {\n $result = $row->toArray();\n $objMessage->setId($result['id']);\n $objMessage->setAddedBy($result['added_by']);\n $objMessage->setAddedByObject($result['added_by_object']);\n $objMessage->setAddedOn($result['added_on']);\n $objMessage->setMessage($result['message']);\n $objMessage->setSendEmail($result['send_email']);\n $objMessage->setStatus($result['status']);\n $objMessage->setTicketId($result['ticket_id']);\n $objMessage->setMessageId($result['message_id']);\n $objMessage->setMessageObject($result['message_object']);\n $objMessage->setMessageType($result['message_type']);\n $objMessage->setMessageReply($objMessageService->getAllMessageReply($result['id']));\n }\n } catch (Exception $e) {\n throw new Base_Model_Lib_Eav_Exception_Sql(\"<strong>Oops !, Error Class name -</strong> <em>Base_Model_Lib_Message_Dao_Message</em>, <strong>Function -</strong> <em>getMessage()</em>, <strong>Exception -</strong> <em>\" . $e->getMessage() . \"</em>\");\n }\n return $objMessage;\n }", "public function pick_msg_by_id($id){\n\n\t\t(int)$id;\n\t\t$return_pick_msg = array();\n\n\t\t\t$sql = $this->query(\"SELECT * FROM `messege` WHERE `id` = $id\");\n\n\t\t\t\twhile ($pick_msg = mysql_fetch_array($sql)) {\n\t\t\t\t\t# code...\n\n\t\t\t\t\t$return_pick_msg[] = $pick_msg;\n\t\t\t\t}\n\t\treturn $return_pick_msg;\n\t}", "public function get_messgae($id){\n \t\t$sql3=\"SELECT message FROM users WHERE id = '$id'\";\n\t $result = mysqli_query($this->db,$sql3);\n\t $user_data = mysqli_fetch_assoc($result);\n\t echo $user_data['message'];\n \t}", "static public function ctrObtenerMensajePorId(){\n\n\t\t\tif(isset($_GET[\"id\"])){\n\n\t\t\t\t$tabla = \"mensajes\";\n\n\t\t\t\t$id = $_GET[\"id\"];\n\n\t\t\t\t$respuesta = ModeloMensajes::mdlObtenerMensajePorId($tabla, $id);\n\n\t\t\t\treturn $respuesta;\t\n\t\t\t\n\t\t\t}\n\n \t}", "public function get( $_id )\n {\n $this->load->model('User');\n $this->load->model('TextAnnotation');\n\n $sql = 'SELECT *\n FROM messages\n WHERE id = ?';\n\n $params = array( $_id );\n $query = $this->db->query( $sql, $params );\n\n $results = $query->result();\n $result = $results[0];\n $this->id = $_id;\n $this->recipient = User::init($result->recipient);\n $this->sender = User::init($result->sender);\n $this->annotation = TextAnnotation::init($result->annotation);\n }", "public function getMessage($id = 1)\n {\n return new $this->_messageClass(array('handler' => $this, 'id' => $id, 'headers' => $this->_raw,\n 'noToplines' => true));\n }", "public static function findByPublicId(string $id): Message {\n $db = Database::getPDOConnection();\n $stmt = $db->prepare('SELECT * FROM `messages` WHERE `public_id` = :id');\n $stmt->execute(['id' => $id]);\n $row = $stmt->fetch();\n if (!$row) {\n throw new MessageNotFoundException(sprintf('no message with id \\'%s\\' exists', $id));\n }\n $message = Message::fromDBRecord($row, $db);\n return $message;\n }", "public static function get_service_message_by_id($id) {\n\t\tif ($row = DB::table('service_messages')->select('*')->where('id', $id)->get()->first()) {\n\t\t\treturn new ServiceMessageObject($row);\n\t\t}\n\t\treturn false;\n\t}", "public function selectMessageByID($id) {\n $result = $this->sdb->query(\n 'select m.*,to_char(m.time_sent, \\'YYYY-MM-DD\"T\"HH24:MI:SS\\') as sent_date from messages m where m.id = $1',\n array($id));\n $all = array();\n while ($row = $this->sdb->fetchrow($result))\n {\n array_push($all, $row);\n }\n\n if (count($all) === 1)\n return $all[0];\n\n return array();\n\n }", "public function fetchSentMessage($id)\n {\n return $this->ozioma->message->fetch($id);\n }", "public function read($id){\n\t\n\t\t$query = $this->db->get_where('chat', array('id' => $id));\n\t\t\n\t\tif($query->num_rows() > 0){\n\t\t\t\n\t\t\t$row = $query->row();\n\t\t\t$data = array(\n\t\t\t\t'id'\t\t\t=> $id,\n\t\t\t\t'timestamp'\t\t=> $row->timestamp,\n\t\t\t\t'userId'\t\t=> $row->userId,\n\t\t\t\t'roomId'\t\t=> $row->roomId,\n\t\t\t\t'message'\t\t=> $row->message,\n\t\t\t);\n\t\t\treturn $data;\n\t\t\t\n\t\t}else{\n\t\t\n\t\t\t$this->errors = array(\n\t\t\t\t'error' => 'Chat message doesn\\'t exist!',\n\t\t\t);\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\t\n\t}", "public function find(string $event, string $id): ?Message\n {\n return $this->items[$event][$id] ?? null;\n }", "function getMessage($msg_id) {\n\t\tif (!$msg_id) {\n\t\t\treturn false;\n\t\t}\n\t\treturn db_query_params ('SELECT * FROM artifact_message_user_vw WHERE id=$1',\n\t\t\tarray($msg_id));\n\t}", "function getMessage( $msg_id ){\n\t$msg_id = mysql_escape_string($msg_id);\n\t\n\t// Performing SQL query\n\t$query \t\t= sprintf(\"select * from messages where message_id=%d\",$msg_id);\n\t$result \t= mysql_query($query);\n\t$data \t\t= $result->fetch();\t\n\t$message \t= array();\n\t\n\tif(!empty($data)) {\n\t\t$message['id']=$data['message_id'];\n\t\t$message['date']=$data['message_date'];\n\t\t$message['from']=$data['message_from'];\n\t\t$message['url']=$data['message_audio_url'];\n\t}\n\treturn $message;\n}", "public function getByID($messageID)\n {\n return $this->dao->select('*')->from(TABLE_MESSAGE)->findByID($messageID)->fetch();\n }", "function getSingleMessage($message_id){\n\t\t$message_id = escapeQuery($message_id);\n\t\t$query = \"SELECT M.message_id, U1.username AS fromUser, U2.username AS toUser, M.messageTitle, M.messageText\n\t\t\tFROM Messages AS M\n\t\t\tINNER JOIN User AS U1 ON M.fromUserId = U1.user_id\n\t\t\tINNER JOIN User AS U2 ON M.toUserId = U2.user_id\n\t\t\tWHERE M.message_id = $message_id\";\n\t\t$result = doQuery($query);\n\t\t\n\t\t// save query results in an array\n\t\t$result_array = array();\n\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t{\n \t\t$result_array[] = $row;\n\t\t}\n\t\t\n\t\treturn $result_array;\n\t}", "function GetMessageDetails($id)\n {\n $status = Connected();\n if ($status == 1) {\n try {\n $d = new dbMakeConnection;\n } catch (PDOException $e) {\n echo($e);\n }\n\n $stmt = $d->conn->prepare(\"SELECT UName, UserId, Date, Content FROM \".$GLOBALS['db_name'].\".Message JOIN \".$GLOBALS['db_name'].\".Member ON (SenderId=UserId) WHERE MessageId = :id\");\n $stmt->bindParam(':id', $id);\n $stmt->execute();\n\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n return $result;\n }\n }", "function loadMessage($id) {\n $sql = \"SELECT log_id, log_time, log_msgtype, log_msgno,\n log_msg_short, log_msg_long,\n log_msg_uri, log_msg_script,\n log_msg_from_ip, log_msg_referer, log_msg_cookies,\n log_version_papaya, log_version_project,\n user_id, username\n FROM %s\n WHERE log_id = %d\";\n if ($res = $this->databaseQueryFmt($sql, array($this->table, $id))) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $this->messageList[$row['log_id']] = $row;\n return TRUE;\n }\n }\n return FALSE;\n\n }", "public function get(string $id, string $domain = 'messages'): string;", "public function get(string $id, string $domain = 'messages'): string;", "public function get_chat_row($id) {\n $sql = \"select * from chat where AdsID=?\";\n $data = $this->db->query($sql, array($id));\n return $data->row();\n }", "public function get_message_details_view_page_by_id($id)\n\t{\n\t\t$sql=\"select * from message \n\t\tLEFT JOIN group_message ON (message_id=ref_group_message_message_id) \n\t\tLEFT JOIN (select * from app_user_details JOIN personal_message ON(ref_personal_message_app_user_id=ref_app_user_details_app_user_id) where ref_personal_message_message_id=$id) as personal_app_user_message ON (message.message_id=personal_app_user_message.ref_personal_message_message_id)\n\t\twhere message_id=$id \";\n\t\t\n\t\t$query=$this->db->query($sql);\n\t\t\n\t\treturn $query->row_array();\n\t}", "public function edit($id)\n {\n return Auth::user()->defaultMessages()->whereId($id)->whereStatus(0)->firstOrFail();\n }", "public function Messages_Get($ID)\n\t{\n\t\t$Data = $this -> HTTPRequest($this -> APIURL.'Messages:Get/ID:'.(int)$ID);\n\t\treturn $this -> ParseResponse($Data);\n\t}", "public function show($id)\n {\n $message = $this->message->findOrFail($id);\n\n return response()->json(array('name' => $request->name, \n \t'body' => $request->body));\n }", "public function getMessageId();", "public function getMessageId();", "public function getMessageId();", "public function getMessageId();", "public function actionView($id)\n {\n $message = Message::findOne($id);\n if ($message === null) {\n throw new NotFoundHttpException('Message not found');\n }\n $message->checkStatus();\n return $message;\n }", "public function getById($id): Chat {\n return Chat::findOrFail($id);\n }", "public function fetchOne(int $id) : JsonResponse\n {\n return response()->json(Message::find($id));\n }", "function test_get_by_id()\n {\n $dm = new mdl_direct_message();\n $result = $dm->get_by_id(1, 1);\n\n $this->assertEquals(count($result), 1);\n }", "public function showMessage($id)\n {\n $model = Message::findOrFail($id);\n $model->read = true;\n $model->save();\n return response()->json($model, 200);\n }", "public function getMessagesFor($id)\n {\n Receiver::where('message_id', $id)->where('recipient_id', Auth::user()->id)->update(['is_seen' => true]);\n\n // get all messages between the authenticated user and the selected user\n $messages = Message_Thread::where(function($q) use ($id) {\n $q->where('message_id', $id);\n })->get();\n for($i = 0; $i < count($messages); $i++){\n $name = User::select('firstName','middleName', 'lastName')->where('id', '=', $messages[$i]['from_id'])->first();\n $messages[$i]['name'] = $name->full_name;\n }\n return response()->json($messages);\n }", "public function getRecipient($id);", "public function retrieve($id) {\n $ret = $this->queryNetForum(array('cstkey' => $id));\n \n if(empty($ret)) {\n throw new InvalidArgumentException(_txt('er.id.unk-a', array($id)));\n }\n \n // The returned value should always be keyed on the ID we sent\n return $ret[$id];\n }", "public function getNotificationById($id);", "public static function selectByMessageId($message_id){\n\t\treturn new Message(parent::MySQLReadReturnSingleResultAsArrayAction('\n\t\t\tSELECT \n\t\t\t\tmessage_id,\n\t\t\t\tconversation_id,\n\t\t\t\tcreated_datetime,\n\t\t\t\tmodified_datetime,\n\t\t\t\tsender_id,\n\t\t\t\tbody,\n\t\t\t\tlocation\n\t\t\tFROM message \n\t\t\tWHERE message_id=:message_id',\n\t\t\t// bind data to sql variables\n\t\t\tarray(\n\t\t\t\t':message_id' => (int)$message_id\n\t\t\t),\n\t\t\t// which fields are non-string, unquoted types (boolean, float, int, decimal, etc)\n\t\t\tarray(\n\t\t\t\t':message_id'\n\t\t\t)\n\t\t));\n\t}", "public function show($id)\n { \n $message = Message::find($id);\n if ($message){\n return response()->json(['Status' => 'ok','data' => $message],200);\n }else{\n return response()->json(['Status' => 'No Content'],204);\n }\n\n }", "public function getMessage($id, $decode = IncomingMessage::DECODE)\n {\n $this->checkMessageId($id);\n $this->incomingMessage = new IncomingMessage($this->imap, $id, $decode);\n return $this->incomingMessage;\n }", "public function show($id)\n {\n $chat = Chat::where('empresa_id', \\Auth::user()->id)\n ->orWhere('persona_id', \\Auth::user()->id)\n ->findOrFail($id);\n return $chat->mensaje->where('id', '>', request()->last)->each(function ($m) {\n $m->date = [\n $m->created_at->format('Y'),\n $m->created_at->format('m') - 1,\n $m->created_at->format('d'),\n $m->created_at->format('H'),\n $m->created_at->format('i'),\n $m->created_at->format('s'),\n ];\n $usuario = $m->usuario->fullName();\n $m->logo = $m->usuario->getLogoPath();\n unset($m->usuario, $m->chat_id);\n $m->usuario = $usuario;\n });\n }", "public function show($id)\n {\n \n //get details for this message\n $message = $this->model->where('id', $id)\n ->with('company')\n ->first();\n\n return $this->response->item($message, new MessageTransformer());\n \n }", "public function getMessageByMessageId($idMessage)\n {\n $messageResource = $this->getResource('Message');\n\n $messageRow = $messageResource->getMessageByMessageId($idMessage);\n $messageObj = new Frontend_Model_Message(\n $messageRow->idMessage,\n $messageRow->sentBy,\n $messageRow->body,\n $messageRow->added\n );\n\n return $messageObj;\n }", "public function getOne($id)\n {\n $result = $this->mailService->addOptinToSingle((parent::getOne($id)));\n return $result;\n }", "public function get($ID){\n\t\tsql('DELETE FROM messages WHERE from_status=\"0\" AND to_status=\"0\"');\n\t\tsql('DELETE FROM messages WHERE fromID = \"\" or toID = \"\"');\n\t\t\n\t\t$ID = ($ID) ? $ID : $_SESSION['user'] ;\n\t\t\n\t\t$messages = sql('SELECT ' . $this->select . '\n\t\t\t\t\t\t\t\t \t\t FROM ' . $this->from . '\n\t\t\t\t\t\t\t\t \t\t WHERE a.toID LIKE \"%'.$_SESSION['user'].'%\"\n\t\t\t\t\t\t\t\t \t\t AND a.to_status!=\"0\"\n\t\t\t\t\t\t\t\t \t\t AND a.fromID = b.code\n\t\t\t\t\t\t\t\t \t\t ORDER BY a.date DESC '.$this->limit );\n\t\t\n\t\treturn $messages;\n\t\t\n\t}", "public function getMessageById($msg_id)\n {\n $query = \"SELECT * FROM message_to_advertiser WHERE id = $msg_id\";\n return $this->getQueryData($query, $this->getConnection());\n }", "public function show($id)\n {\n //Guardar el mensaje con la clase DB\n\n /* $message = DB::table('messages')->where('id', $id)->first(); */\n\n // Guardar mensajes en la base de datos con Eloquent\n\n $message = Message::findOrFail($id);\n\n return view('messages.show', compact('message'));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $message = $em->getRepository('ThiefaineReferentielBundle:Message')->find($id);\n\n if (!$message) {\n throw $this->createNotFoundException(\"Impossible de trouver le message.\");\n }\n\n $showForm = $this->createShowForm($message);\n $twig = 'ThiefaineReferentielBundle:Message:show.html.twig';\n $paramTwig = array(\n 'message' => $message,\n 'show_form' => $showForm->createView(),\n );\n\n return $this->render($twig,$paramTwig);\n }", "public function show($id)\n {\n \n //$message = DB::table('messages')->where('id', $id)->first();\n\n //Con findOrFail se puede buscar un registro y en caso de estar vacio devuelve un error 404\n $message = Message::findOrFail($id);\n\n return view('messages.show', compact('message'));\n \n \n }", "public function show($id)\n\t{\n\t\t$m = Message::find($id);\n\t\tif($m){\n\t\t\t$m->status = 0;\n\t\t\t$data = array(\"page_title\"=>\"Read\".$m->firstname.\"'s Message\",\n\t\t\t\t\t\t \"m\"=>$m);\n\t\t\t$m->save();\n\t\t\treturn View::make('administrator.inbox.read',$data);\n\t\t}else{\n\t\t\treturn Redirect::to('404');\n\t\t}\n\t\t\n\t}", "public function getById($id)\n {\n return $this->notification->find($id);\n }", "public function get_id_message()\n {\n return $this->id_message;\n }", "static function getSingleMessage($key = 'id', $value = 0)\r\n {\r\n if ($value === '')\r\n {\r\n return null;\r\n }\r\n\r\n $tableMessage = DatabaseManager::getNameTable('TABLE_MESSAGE');\r\n\r\n $query = \"SELECT $tableMessage.*\r\n FROM $tableMessage \r\n WHERE $tableMessage.$key = '$value'\";\r\n\r\n if ($value2 !== '')\r\n {\r\n $query = $query . \" AND $tableMessage.$key2 = '$value2'\";\r\n }\r\n\r\n $myMessage = DatabaseManager::singleFetchAssoc($query);\r\n $myMessage = self::ArrayToMessage($myMessage);\r\n\r\n return $myMessage;\r\n }", "public function get(string $id);", "public function testGetMessageById()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 200;\n // Create a mock response\n $expected = new \\Karix\\Model\\MessageResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $uid = \"uid_example\";\n\n try {\n $result = $apiInstance->getMessageById($uid);\n $this->assertEquals($expected, $result);\n } catch (Exception $e) {\n $this->fail(\"Exception when calling MessageApi->getMessageById: \".$e->getMessage());\n }\n }", "public function show($id)\n {\n // die('ddfdfd');\n $message = message::findOrFail($id);\n // print_r($message);\n // die;\n\n return view ('message.show', compact('message'));\n }", "public function get( $id ){}", "public function getById( $id );", "public function getMailComment($id) {\n\n\t\t$manager = $this->manager->getManager();\n\n\t\t$mail = $manager->prepare('SELECT * FROM comments WHERE ID = ?') or die(print_r($manager->errorMessage()));\n\n\t\t$mail->execute(array($id));\n\n\t\t$email = $mail->fetch();\n\n\t\treturn $email;\n\t}", "public function fetchMessages($id)\n {\n $data = MessageThreadMessages::where('message_thread_id', $id)\n ->get();\n\n return response()->json($data);\n }", "public function getById(string $id);", "public function show($id)\n {\n //\n $message = Message::where('id', $id)->first();\n return view('back-end.message.show', compact('message'));\n }", "function get_by_id($id)\n {\n $this->db->where('wsfeed_id', $id);\n $query = $this->db->get('fis_dworkshopseminar_feedbacks');\n return $query->row();\n }", "public static function init( $_id )\n {\n $message = new Message();\n $message->get( $_id );\n return $message;\n }", "public static function getNotificationById($id) {\n global $wpdb;\n $tabel = self::getTableName();\n $query = \"SELECT * FROM $tabel WHERE `id` = \" . $id;\n $results = $wpdb->get_row($query);\n return $results;\n }", "public function show($id)\n {\n $message = Message::findOrFail($id);\n\n if ($message->read == 0) {\n $message->read = 1;\n $message->save();\n }\n\n return view('materialadmin::message.show')->with('message', $message);\n }", "function get_mail($id)\n {\n return $this->db->get_where('mail',array('id'=>$id))->row_array();\n }", "public function show($id)\n {\n $messageType = MessageType::find($id);\n if(is_null($messageType)){\n return response()->json(['error'=>true,'message'=>'Not Found'],404);\n }\n return response()->json($messageType,200);\n }", "public function buscarMensaje($mensaje_id)\n\t{\n\t\treturn Contacto::find($mensaje_id);\n\t}", "public function show($id)\n {\n //cargar un mensaje\n $mensaje = \\App\\Mensaje::with('departamento')->find($id);\n\n $mensaje2=[];\n for ($i=count($mensaje)-1; $i > -1; $i--) { \n array_push($mensaje2,$mensaje[$i]);\n }\n $mensaje= $mensaje2;\n if(count($mensaje)==0){\n return response()->json(['error'=>'No existe el mensaje con id '.$id], 404); \n }else{\n return response()->json(['mensaje'=>$mensaje], 200);\n } \n }", "public function show($id)\n {\n $msg = Message::find($id);\n $msg->delete();\n return redirect()->action(\"MessageController@index\");\n }", "public function get( $id );", "public function getMessageId() {\n return $this->message_id;\n }", "public static function find($id)\n {\n return Channel::find($id);\n }", "function getMessage($tag_id) {\n\tif (isset($_SESSION['message'])) {\n\t\tif ($_SESSION['message']['id'] == $tag_id) {\n\t\t\t$message = $_SESSION['message']['message'];\n\t\t\tunset($_SESSION['message']);\n\t\t\treturn $message;\n\t\t}\n\t}\n\telse return '';\n}", "public function show($id)\n {\n $message = Message::findOrFail($id);\n return view('messages.show', compact('message'));\n }", "public function index($id)\n {\n $messages = Message::where([\n ['user_id', Auth::id()],\n ['reciever_id', $id]\n ])\n ->orWhere([\n ['user_id', $id],\n ['reciever_id', Auth::id()] \n ])\n ->with('user')\n ->get();\n\n return request()->ajax() ? $messages : view('chat');\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);" ]
[ "0.85360867", "0.84250754", "0.8117571", "0.7993305", "0.79551053", "0.7706645", "0.76779157", "0.7634248", "0.7614397", "0.75590724", "0.7408451", "0.7356342", "0.7319236", "0.7311784", "0.73024267", "0.7299343", "0.727168", "0.7242192", "0.7180387", "0.7173464", "0.7146783", "0.71389097", "0.7109462", "0.7107697", "0.7107471", "0.7100885", "0.70835745", "0.70798093", "0.70798093", "0.69788575", "0.6926272", "0.6916165", "0.6905302", "0.68899775", "0.6859624", "0.6859624", "0.6859624", "0.6859624", "0.6855053", "0.6834242", "0.68166685", "0.678297", "0.6763567", "0.67486525", "0.67355317", "0.6727593", "0.67184585", "0.6716412", "0.67147464", "0.6714569", "0.6704672", "0.66944194", "0.6691403", "0.6690006", "0.668904", "0.66884667", "0.66725135", "0.66704816", "0.6657386", "0.66227794", "0.65985996", "0.6596298", "0.65843815", "0.65834874", "0.6576339", "0.6571544", "0.65600157", "0.65475446", "0.65382296", "0.65291387", "0.6528364", "0.6517553", "0.6514387", "0.6506372", "0.65049005", "0.6502198", "0.6488417", "0.6485572", "0.64852136", "0.64843595", "0.6484259", "0.6482294", "0.64721274", "0.6470099", "0.64686054", "0.6460769", "0.64565563", "0.6447242", "0.6447242", "0.6447242", "0.6447242", "0.6447242", "0.6447242", "0.6447242", "0.6447242", "0.6447242", "0.6447242", "0.6447242", "0.6447242", "0.6447242" ]
0.6467522
85
get messages by customer_id
static public function getMessagesByCustomerId($rest) { $data = array(); $h = $rest->getHierarchy(); $vars = $rest->getRequestVars(); $errors = Validation::required(array("customer_id"), $vars); // do we have any errors if (count($errors)) { echo json_encode(array( "success" => false, "error" => "Missing the following fields: ".implode($errors, ", ") )); } else { // create the contact $messages = Message::getMessageByCustomerId($vars['customer_id']); $res = array( "success" => true, "messages" => $messages ); echo json_encode($res); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCustomer($customer_id);", "public function get_customer_byid($customer_id = \"\"){\r\n $query = $this->db->get_where('view_customer_info', array('customer_id' => $customer_id));\r\n return $query->row_array();\r\n }", "function get_customer($customer_id)\n {\n return $this->db->get_where('customer',array('customer_id'=>$customer_id))->row_array();\n }", "public function customer_get($customerId){\t\t\t\t\t\t\t\t\n\t\t$params = array('customerId' => $customerId);\t\t\n\t\ttry {\n\t\t\t$flow = $this->send('customer/get', $params, 'GET');\t \t\t\t\n\t\t\treturn $flow;\n\t\t} catch (Exception $e) { return $e->getCode().\" - \".$e->getMessage(); }\n\t}", "public function getCustomerBy_ID($customer_id) { /* this fun is used to get customer deatails */\n\n $sqlselect = \"SELECT * FROM customer_details WHERE cust_id = '$customer_id'\";\n\n $result = $this->db->query($sqlselect);\n\n if ($result->num_rows() <= 0) {\n $response = array(\n 'status' => 0,\n 'status_message' => 'No Records Found.');\n } else {\n $response = $result->result_array();\n }\n return $response;\n }", "function getCustomerById_customer($id_customer)\n {\n\n\n\n $query = \"SELECT * FROM `customer` WHERE id_customer = '$id_customer'\";\n $hasil = $this->db->query($query);\n\n return $hasil;\n }", "public function messages_by_user_get() {\n\t\t$uid = $this->input->get('uid');\n\t\t$skip = $this->input->get('skip');\n\t\t$limit = $this->input->get('limit');\n\n\t\t$messages = $this->Messages_model->getMessagesByUserID($uid, $skip, $limit);\n\t\t\n\t\tforeach($messages as $key=>$value) {\n\t\t\t$id = $messages[$key]['_id']->{'$id'};\n\t\t\t$messages[$key]['_id'] = $id;\n\t\t}\n\t\t\n\t\t$this->response($messages);\n\t}", "public function getCustomerByIdCustomer($id){\n $dbResult = $this->db->query(\"SELECT * FROM customer WHERE id_customer = ?\", array($id));\n return $dbResult->getResult();\n }", "public static function byCustomer($customer_id)\n {\n $payload = [\n 'subscription' => [\n 'subscriptionid' => $customer_id,\n ],\n ];\n\n return static::all($payload);\n }", "public function read($customerId);", "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 getOrdersForCustomer($customerId);", "public function GetCustomer($customer_id) {\n\n //set up the query\n $this->sql = \"SELECT *\n FROM customers\n WHERE customerID = :customer_id\";\n \n //execute the query\n $this->RunAdvancedQuery([\n ':customer_id' => $customer_id,\n ]);\n }", "function getNoteDetailsByCustomer($customer_id)\n {\n $stmt = \"SELECT\n cno_id,\n cno_prj_id,\n cno_customer_id,\n cno_note\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"customer_note\n WHERE\n cno_customer_id = '\" . Misc::escapeString($customer_id) . \"'\";\n $res = DB_Helper::getInstance()->getRow($stmt, DB_FETCHMODE_ASSOC);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return array();\n } else {\n return $res;\n }\n }", "public function getRecentCustomers($id);", "public function getCustomerById($customer_id)\n {\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.\"customers/$customer_id/detail/\");\n $client->setMethod(\\Zend_Http_Client::GET);\n $client->setHeaders([\n 'Content-Type: application/json', \n 'Accept: application/json',\n \"Authorization: Token $this->token\"\n ]);\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $customer_data=json_decode($string);\n \n return $customer_data;\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos customer save helper', [\"Get customer error\"=>$e->getMessage()]);\n return false;\n }\n }", "public function get_customer($id = null) {\n $this->db->select('*');\n if ($id != NULL) {\n $this->db->where('customer_id_pri', $id);\n }\n $this->db->order_by('customer_id_pri');\n return $this->db->get('customer');\n }", "public function loadByCustomer(Mage_Customer_Model_Customer $customer)\n {\n $select = $this->_read->select()\n ->from($this->getMainTable())\n ->where('customer_id=:customer_id')\n ->where('store_id=:store_id');\n\n $storeId = Mage::app()->getStore()->getId();\n if ($storeId == Mage_Core_Model_App::ADMIN_STORE_ID) {\n $storeId = $customer->getStoreId();\n }\n\n $result = $this->_read->fetchRow($select, array(\n 'customer_id' => $customer->getId(),\n 'store_id' => $storeId,\n ));\n\n if ($result) {\n $result = $this->_processResult($result);\n return $result;\n }\n\n $select = $this->_read->select()\n ->from($this->getMainTable())\n ->where('subscriber_email=:subscriber_email')\n ->where('store_id=:store_id');\n\n $result = $this->_read->fetchRow($select, array(\n 'subscriber_email' => $customer->getEmail(),\n 'store_id' => $storeId\n ));\n\n if ($result) {\n $result = $this->_processResult($result);\n return $result;\n }\n\n return array();\n }", "public static function getContacts($customerid){\n\t\t$dq = Doctrine_Query::create ()\n ->select ( 'c.contact_id, c.contact, ct.name as type' )\n ->from ( 'Contacts c' )\n ->leftJoin ( 'c.ContactsTypes ct ON ct.type_id = c.type_id' )\n ->where('c.customer_id = ' . $customerid);\n \n\t return $dq->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\n\t}", "public function getMessagesFor($id)\n {\n Receiver::where('message_id', $id)->where('recipient_id', Auth::user()->id)->update(['is_seen' => true]);\n\n // get all messages between the authenticated user and the selected user\n $messages = Message_Thread::where(function($q) use ($id) {\n $q->where('message_id', $id);\n })->get();\n for($i = 0; $i < count($messages); $i++){\n $name = User::select('firstName','middleName', 'lastName')->where('id', '=', $messages[$i]['from_id'])->first();\n $messages[$i]['name'] = $name->full_name;\n }\n return response()->json($messages);\n }", "function getCcInfoByCustId($customerid) {\n $query = \"SELECT * FROM `creditcards` WHERE CustomerId='\".$customerid.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result[0];\n }\n }", "public function get_message_by_id($id)\n\t{\n\t\t$query = $this->db->get_where('message', array('message_id' => $id));\n\t\treturn $query;\n\t}", "public function messages_for_user_get() {\n\t\t$uid = $this->input->get('uid');\n\t\t$skip = $this->input->get('skip');\n\t\t$limit = $this->input->get('limit');\n\n\t\t$messages = $this->Messages_model->getMessagesByFromUserID($uid, $skip, $limit);\n\n\n\t\tforeach($messages as $key=>$value) {\n\t\t\t$id = $messages[$key]['_id']->{'$id'};\n\t\t\t$messages[$key]['_id'] = $id;\n\t\t}\n\t\t\n\t\t$this->response($messages);\n\t}", "public function getCustomer($id)\n {\n return $this->_client->makeCall(\"get\", [['record' => $id]]);\n }", "public function get($ID){\n\t\tsql('DELETE FROM messages WHERE from_status=\"0\" AND to_status=\"0\"');\n\t\tsql('DELETE FROM messages WHERE fromID = \"\" or toID = \"\"');\n\t\t\n\t\t$ID = ($ID) ? $ID : $_SESSION['user'] ;\n\t\t\n\t\t$messages = sql('SELECT ' . $this->select . '\n\t\t\t\t\t\t\t\t \t\t FROM ' . $this->from . '\n\t\t\t\t\t\t\t\t \t\t WHERE a.toID LIKE \"%'.$_SESSION['user'].'%\"\n\t\t\t\t\t\t\t\t \t\t AND a.to_status!=\"0\"\n\t\t\t\t\t\t\t\t \t\t AND a.fromID = b.code\n\t\t\t\t\t\t\t\t \t\t ORDER BY a.date DESC '.$this->limit );\n\t\t\n\t\treturn $messages;\n\t\t\n\t}", "public function getCustomerByUserId($customer_id) {\n $registry = new Registry();\n // Database\n $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n $registry->set('db', $db);\n\n $query = $db->query(\"SELECT * FROM \" . DB_PREFIX . \"customer WHERE user_id = '\" . $customer_id . \"'\");\n\n return $query->row;\n }", "public function customer_by_id($id)\n {\n return $this->customers->customer_by_id($id);\n }", "abstract public function getCustomer($ID);", "public function getUserCustomerById($id) {\r\n\r\n $result = $this->db->select(USERS . '.*, ' . CUSTOMERS . '.group')//,'. CUSTOMERS_BY_PROVIDER . '.since')\r\n ->from(USERS, CUSTOMERS) //, CUSTOMERS_BY_PROVIDER)\r\n ->join(CUSTOMERS, USERS . '.id = ' . CUSTOMERS . '.id', 'LEFT')\r\n ->where(USERS . '.id', $id)\r\n ->limit(1)\r\n ->get()\r\n ->row();\r\n return $result;\r\n }", "public function retrieveChatCustomer($bot_id, $customer_id)\n {\n $identifier = [\n 'bot_id' => $bot_id,\n 'account_id' => $customer_id,\n ];\n $client = LeadClient::where($identifier)->first();\n\n if (is_null($client)) {\n $userData = $this->messagingTool->getUserInfo($customer_id);\n\n // Create new client.\n $client = LeadClient::create(array_merge(\n $identifier,\n [\n 'first_name' => $userData['first_name'],\n 'last_name' => $userData['last_name'],\n 'profile_pic' => $userData['profile_pic'] ?? '',\n ]\n ));\n }\n\n return $client;\n }", "public function verification_agent_customer_notifications_read($id) {\n $this->load->model('Notifications_model');\n $data = array(\n 'is_read' => 1,\n 'modified_at' => date('Y-m-d H:i:s')\n );\n $this->Notifications_model->updateVerificationAgentCustomerNotificationsRead($id, $data);\n $customer_notifications = $this->Notifications_model->getAllVerificationAgentCustomerNotifications();\n $return_value = $this->notification($customer_notifications, 'verification_success');\n echo json_encode(array(\"return_string\" => $return_value, \"count_customers_notification\" => count($customer_notifications)));\n die;\n }", "public function getCustomer(int $id)\n {\n return Customer::where('id', $id)->first();\n }", "public function fetchCustomer($order_id) {\n $cust_id = $this->field('user_customer_id', array('id' => $order_id));\n return $this->Customer->fetchCustomer($cust_id);\n }", "public function getCustomerById($id){ \n $query = \"SELECT * FROM tbl_customer WHERE id = '$id' \";\n $result = $this->db->select($query);\n return $result;\n }", "public function index()\n {\n $customerMessages = CustomerMessage::orderBy('created_at', 'desc')->get();\n return view('customerMessage/index', compact('customerMessages'));\n }", "public function customer(){\n\t\treturn Customers::find($this->customers_id);\n\t}", "function get_customercontacts($custID, $loginID = '', $debug = false) {\n\t\t$loginID = (!empty($loginID)) ? $loginID : DplusWire::wire('user')->loginid;\n\t\t$user = LogmUser::load($loginID);\n\t\t$SHARED_ACCOUNTS = DplusWire::wire('config')->sharedaccounts;\n\n\t\t$q = (new QueryBuilder())->table('custindex');\n\n\t\tif ($user->get_dplusrole() == DplusWire::wire('config')->roles['sales-rep'] && DplusWire::wire('pages')->get('/config/')->restrict_allowedcustomers) {\n\t\t\t$custquery = (new QueryBuilder())->table('custperm')->where('custid', $custID);\n\t\t\t$permquery = (new QueryBuilder())->table($custquery, 'custpermcust');\n\t\t\t$permquery->field('custid, shiptoid');\n\t\t\t$permquery->where('loginid', [$loginID, $SHARED_ACCOUNTS]);\n\t\t\t$q->where('(custid, shiptoid)','in', $permquery);\n\t\t} else {\n\t\t\t$q->where('custid', $custID);\n\t\t}\n\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'Contact');\n\t\t\treturn $sql->fetchAll();\n\t\t}\n\t}", "public function subscription($customer_id)\n {\n $customer = \\Stripe\\Customer::retrieve([\n 'id' => $customer_id,\n ]);\n $collection = new Collection($customer->subscriptions->data);\n return $collection->sortByDesc(function ($value) {\n return $value->created;\n })->first();\n }", "public function getForCustomer($customerId, array $sharedStoreIds = []);", "public function customer_info( $customer_id ) {\r\n\t\treturn $this->_send_request( 'customers/'.$customer_id );\r\n\t}", "public function getReportByCustomer($data, $customer_id) {\n //dd($customer_id);\n\n $response = [];\n\n foreach($data as $i) {\n if($i['customer_id'] == $customer_id) { \n array_push($response, $i);\n }\n }\n\n return $response;\n }", "public function getMessages()\n {\n //PEMBAHASAN MENGENAI EAGER LOADING BISA DI CARI DI DAENGWEB.ID\n return Message::with('user')->get();\n }", "public function show($id)\n {\n $customerMessage = $this->customerMessageRepository->findWithoutFail($id);\n\n if (empty($customerMessage)) {\n Flash::error('Customer Message not found');\n\n return redirect(route('customerMessages.index'));\n }\n\n return view('customer_messages.show')->with('customerMessage', $customerMessage);\n }", "function edd_pup_get_customer_updates( $payment_id, $email_id ) {\r\n\r\n\tif ( empty( $payment_id ) || empty( $email_id ) ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tglobal $wpdb;\r\n\t$payment_id = absint( $payment_id );\r\n\t$email_id = absint( $email_id );\r\n\r\n\treturn unserialize( trim( $wpdb->get_var( $wpdb->prepare( \"SELECT products FROM $wpdb->edd_pup_queue WHERE email_id = %d AND customer_id = %d\", $email_id, $payment_id ) ) ) );\r\n}", "public function getCustomerInfo($customer_id) {\n\n if ($customer_id) {\n\n $sql = \"SELECT c.*,cgd.name as group_name FROM \" . DB_PREFIX . \"customer c LEFT JOIN \" . DB_PREFIX . \"customer_group_description cgd ON (c.customer_group_id = cgd.customer_group_id) WHERE cgd.language_id = '\" . (int)$this->config->get('config_language_id') . \"'\";\n\n $query = $this->db->query($sql);\n if (isset($query->row)) {\n $result = $query->row;\n } else {\n $result = false;\n }\n } else {\n $result = false;\n }\n\n return $result;\n }", "public function sales_agent_customer_notifications_read($id) {\n $this->load->model('Notifications_model');\n $data = array(\n 'is_read' => 1,\n 'modified_at' => date('Y-m-d H:i:s')\n );\n $this->Notifications_model->updateSalesAgentCustomerNotificationsRead($id, $data);\n $customer_notifications = $this->Notifications_model->getAllSalesAgentCustomerNotifications();\n $return_value = $this->notification($customer_notifications, 'sales_success');\n echo json_encode(array(\"return_string\" => $return_value, \"count_customers_notification\" => count($customer_notifications)));\n die;\n }", "public function getUserMessage($user_id,$count)\n {\n $usermessages = $this->db->fetchAll(\"SELECT DISTINCT i.message,i.mg_id,u.mobile as wumobile,i.read_status,i.datetime,m.mobile as aumobile FROM sanchr5m_messaging_db.message m,inbox i,senderID s,user u WHERE m.subscriber_id='\".$user_id.\"' AND m.mg_id=i.mg_id AND m.sender_id=s.text AND s.user_id=u.id ORDER BY i.id DESC LIMIT $count\", Phalcon\\Db::FETCH_ASSOC);\n // print_r($messages);\n return $usermessages;\n \n }", "public function readCommentCustomer(){\n $sql='SELECT idComentario, comentario, producto.nombre as producto,cliente.nombre as cliente, comentarios.estado as estado, cliente.usuario as usuario FROM cliente, producto, comentarios where producto.idProducto=comentarios.idProducto and cliente.idCliente=comentarios.idCliente and comentarios.idProducto=? and comentarios.estado = 1';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n\n }", "public function get($id)\n {\n return Customer::find($id);\n }", "public static function getCustomerByID($id){\n\t\t// Initialize SQL statement to edit individual customer\n\t\t$sql = \"\n\t\t\tSELECT *\n\t\t\tFROM customer\n\t\t\tWHERE id = :id\n\t\t\t\";\n\n\t\t$sql_values = [\n\t\t\t':id' => $id\n\t\t\t];\n\n\t\t// Make a PDO statement\n\t\t$statement = DB::prepare($sql);\n\n\t\t// Execute\n\t\tDB::execute($statement, $sql_values);\n\n\t\t// Get all the results of the statement into an array\n\t\t$results = $statement->fetch();\n\t\treturn $results;\n\t}", "function get_customer_data($customer_id)\n {\n $this->company_db->select(\"c.*\");\n $this->company_db->from('tbl_customer c');\n $this->company_db->where('c.id', $customer_id); \n $query = $this->company_db->get();\n //echo $this->company_db->last_query();die;\n if($query->num_rows() >= 1)\n {\n return $query->row_array();\n }\n else\n {\n return array();\n }\n }", "public function actionGetCustomer($id)\n {\n $model = CustomerModel::findOne($id);\n\n if ($model !== null) {\n $result = $this->getCustomerDetail($model);\n return [\n 'data' => $result\n ];\n }\n\n return [\n 'data' => $model\n ];\n }", "public function scopeMyMessages($query)\n {\n return $query->where('customer_id', Auth::id());\n }", "public function getCustomer($id) {\n return $this->customerRepository->getById($id);\n }", "public function index_get() {\n\t\t$uid = 15;\n\t\t$messages = $this->Messages_model->getMessagesByFromUserID($uid);\n\t\t$this->response($messages);\n\t}", "public function getById($id)\n\t{\n\t\treturn Message::findOne(\"user_id=? AND id=?\", [$this->user_id, $id]);\n\t}", "public function index($id)\n {\n $messages = Message::where('order_id', $id)->get();\n \n return view('pages.admin.orders.show.messages')->with(['id'=>$id, 'messages'=> $messages]);\n }", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "function getMessages($where, $value = array(), $order = NULL, $limit = NULL){\n\t\tglobal $con;\n\t\t$limit = $limit != NULL ? ' LIMIT ' \t. $limit : '';\n\t\t$order = $order != NULL ? ' ORDER BY ' \t. $order : '';\n\n\t\t$stmt = $con->prepare('\n\t\t\t\t\tSELECT users.FullName, users.image, messages.sender_id, messages.reciever_read, messages.id\n\t\t\t\t\tFROM users\n\t\t\t\t\tINNER JOIN messages\n\t\t\t\t\tON users.id = messages.sender_id\n\t\t\t\t\t\n\t\t\t\t\tWHERE ' . $where . ' ' . $order . $limit\n\t\t\t\t);\n\t\t$stmt->execute($value);\n\t\treturn $stmt->fetchAll();\n\t}", "public function getCustomerData($id = null)\n {\n if ($id) {\n $sql = \"SELECT * FROM klanten WHERE id = ?\";\n $query = $this->db->query($sql, array($id));\n return $query->row_array();\n } else {\n $sql = \"SELECT * from klanten\";\n $query = $this->db->query($sql);\n return $query->result_array();\n }\n }", "public function get( Customer $customer )\n {\n return $this->customerService->get();\n }", "public function getMessages($advertiser_id)\n {\n $query = \"SELECT * FROM message_to_advertiser WHERE to_advertiser = $advertiser_id\";\n return $this->getQueryData($query, $this->getConnection());\n }", "public function findById($id){\n $customer = Customer::find($id);\n return $customer;\n }", "public function getListForCustomer($customerId, $searchCriteria);", "public function getMessages() {}", "public function getMessages() {}", "public function customer()\n\t{\n\t\t$customers = \\App\\Customer::all();\n\t\treturn view('sms');\n\t}", "public function fetchMessages($id)\n {\n $data = MessageThreadMessages::where('message_thread_id', $id)\n ->get();\n\n return response()->json($data);\n }", "static function getAllCustomerWithOrders(){\r\n\t\tglobal $DB;\r\n\t\t$retval = Array();\r\n\t\t\r\n\t\t$sql = \"SELECT DISTINCT personalization_orders.customerid FROM personalization_orders WHERE `status` >= 1 AND orderdate > 0\";\r\n\r\n\t\tif($DB->num_rows($sql)){\r\n\t\t\tforeach($DB->select($sql) as $r){ \r\n\t\t\t\t$retval[] = new BusinessContact($r[\"customerid\"]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $retval;\r\n\t}", "public function getCustomer($id_order)\n {\n $sql = \"SELECT *\n FROM {$this->db_prefix}{$this->table}_customers \n WHERE `id_order` = {$id_order}\n ORDER BY `id_order` DESC\";\n\n if (!$result = $this->db->executeS($sql)) {\n return [];\n }\n\n return $result[0];\n }", "public function get_customer_byuserid($userid = \"\"){\r\n $query = $this->db->get_where('view_customer_info', array('userid' => $userid));\r\n return $query->row_array();\r\n }", "function getInboxMessage() {\n $sql = \"SELECT * FROM `mail` WHERE receiver_id = ?\";\n return getAll($sql, [getLogin()['mid']]);\n}", "public function get_message_details_view_page_by_id($id)\n\t{\n\t\t$sql=\"select * from message \n\t\tLEFT JOIN group_message ON (message_id=ref_group_message_message_id) \n\t\tLEFT JOIN (select * from app_user_details JOIN personal_message ON(ref_personal_message_app_user_id=ref_app_user_details_app_user_id) where ref_personal_message_message_id=$id) as personal_app_user_message ON (message.message_id=personal_app_user_message.ref_personal_message_message_id)\n\t\twhere message_id=$id \";\n\t\t\n\t\t$query=$this->db->query($sql);\n\t\t\n\t\treturn $query->row_array();\n\t}", "public static function getCustomerOrderDetail($orderId,$customerId){\n return OrderList::getCustomerOrderDetail($orderId,$customerId);\n }", "public function getCustomerByID($user_id) {\n $stmt = $this->conn->prepare(\"SELECT email, api_key, fullname, phone, personalID, \n customer_avatar, status, created_at FROM customer WHERE customer_id = ?\");\n $stmt->bind_param(\"s\", $user_id);\n if ($stmt->execute()) {\n // $user = $stmt->get_result()->fetch_assoc();\n $stmt->bind_result($email, $api_key, $fullname, $phone, $personalID,\n $customer_avatar, $status, $created_at);\n $stmt->fetch();\n $user = array();\n $user[\"email\"] = $email;\n $user[\"api_key\"] = $api_key;\n $user[\"fullname\"] = $fullname;\n $user[\"phone\"] = $phone;\n $user[\"personalID\"] = $personalID;\n $user[\"customer_avatar\"] = $customer_avatar;\n $user[\"status\"] = $status;\n $user[\"created_at\"] = $created_at;\n $stmt->close();\n return $user;\n } else {\n return NULL;\n }\n }", "public function getCustomerByID($customerID)\n\t{\n\t $parameters = $this->getSoapParamsArray([\"Contact_ID\" => $customerID]);\n \treturn $this->callSoapFunction('SOAP_getContactDetails', $parameters);\n\t}", "public function getCustomerId();", "public function getCustomerId();", "public function getCustomerId();", "static public function ctrObtenerMensajePorId(){\n\n\t\t\tif(isset($_GET[\"id\"])){\n\n\t\t\t\t$tabla = \"mensajes\";\n\n\t\t\t\t$id = $_GET[\"id\"];\n\n\t\t\t\t$respuesta = ModeloMensajes::mdlObtenerMensajePorId($tabla, $id);\n\n\t\t\t\treturn $respuesta;\t\n\t\t\t\n\t\t\t}\n\n \t}", "public function getMessagesByUserId($userId)\n {\n return $this->model->chat($userId);\n }", "public function getCustomer($_ID)\n {\n return $this->getUnique(\"customers\", $_ID);\n }", "public function index(CustomerMessageDataTable $customerMessageDataTable)\n {\n return $customerMessageDataTable->render('customer_messages.index',[\n 'recipients'=>Masterfile::where('b_role',tenant)->get()\n ]);\n }", "public function getCustomer();", "public function messages(){\n $messages = Contact::orderBy('id', 'desc')\n ->limit(3)\n ->get();\n return $messages;\n }", "public function getCustomerId() {\n return $this->customerID;\n }", "public function getMessageBy( ){\n \n $query = \"SELECT * FROM tbl_mails WHERE USER_ID=\".$this->sql->Param('a').\" AND READ_='0'\";\n \n \n $stmt = $this->sql->Prepare($query);\n $stmt =$this->sql->Execute($stmt,array($_SESSION[ID]));\n $obj = $stmt->FetchNextObject();\n \n return $obj;\n }", "public static function getMessagesByOrderId($id_order, $private = false, Context $context = null)\n {\n }", "private function fetchUser($customerId)\n {\n try {\n $customer = \\Stripe\\Customer::retrieve($customerId);\n foreach ($customer->subscriptions['data'] as $subscription) {\n $subscription['created'] = date('Y-m-d', $subscription['created']);\n $subscription['current_period_start'] = date('Y-m-d', $subscription['current_period_start']);\n if ($subscription['trial_end'] != null && $subscription['current_period_end'] == $subscription['trial_end']) {\n $trailEnd = date('Y-m-d', $subscription['trial_end']);\n $subscription['current_period_end'] = date('Y-m-d', strtotime($trailEnd . '+ ' . $subscription['plan']['interval_count'] . ' ' . $subscription['plan']['interval']));\n } else {\n $subscription['current_period_end'] = date('Y-m-d', $subscription['current_period_end']);\n }\n }\n $this->response['success'] = true;\n $this->response['data'] = $customer;\n $this->response['message'] = trans('messages.customer_fetched');\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public function get($cust_id){\n\t\t/* ensure cust_id is an integer */\n\t\tif(!is_numeric($cust_id)) throw new Exception(\"cust_id of customer must be an integer\");\n\n\t\t$result=mysql_query(\"SELECT * FROM customer WHERE cust_id=$cust_id\");\n\t\tif($result){/*ensure query success*/\n\t\t\tif($row = mysql_fetch_array($result)){/*ensure record*/\n\t\t\t\t$vo = new customer($row['uid'],$row['name'],$row['firm_name'],$row['address'],$row['phone'],$row['email']);\n\t\t\t\t$vo->cust_id = $cust_id;\n\t\t\t\treturn $vo;\n\t\t\t}\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function getOrderId($customer_id);", "public function get_topic_messages($topic_id) {\n $messages = Message::select(\n 'message.message_id',\n 'message.content',\n 'message.reply_to',\n 'message.created_at',\n 'message.created_by',\n 'user.user_id AS author_id',\n 'user.display_name AS author_name',\n 'topic.topic_id'\n )\n ->leftJoin('topic', 'topic.topic_id', '=', 'message.topic_id')\n ->leftJoin('user', 'user.user_id', '=', 'message.created_by')\n ->where('topic.topic_id', $topic_id)\n ->orderBy('message.created_at', 'DESC')\n ->get();\n $topic = Topic::select(\n 'topic.title',\n 'topic.content',\n 'topic.created_at',\n 'topic.created_by',\n 'user.display_name AS author_name'\n )\n ->leftJoin('user', 'user.user_id', '=', 'topic.created_by')\n ->where('topic.franchise_id', $this->franchise_id)\n ->where('topic.club_id', $this->club_id)\n ->where('topic.topic_id', $topic_id)\n ->first();\n\n $results = array(\n 'topic_id' => $topic_id,\n 'author_name' => $topic->author_name,\n 'title' => $topic->title,\n 'content' => $topic->content,\n 'created_at' => $topic->created_at->toDateTimeString(),\n 'created_by' => $topic->created_by,\n 'messages' => $messages\n );\n\n return response()->json($results, 200);\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 }", "static function getCustomerOrders(int $CustomerID) {\r\n $sqlSelect = \"SELECT * FROM Orders WHERE CustomerID = :CustomerID\";\r\n //Query\r\n self::$db->query($sqlSelect);\r\n //Bind\r\n self::$db->bind(':CustomerID', $CustomerID);\r\n //Execute\r\n self::$db->execute();\r\n //Return\r\n return self::$db->resultSet();\r\n }" ]
[ "0.7138294", "0.6650438", "0.64562356", "0.6380742", "0.63308996", "0.62943935", "0.6182489", "0.6180501", "0.6141007", "0.61152154", "0.61106724", "0.6098833", "0.6061245", "0.60532624", "0.60470766", "0.60314983", "0.5998347", "0.5983128", "0.5935894", "0.59161615", "0.5890723", "0.5871195", "0.58582306", "0.5850049", "0.58479226", "0.5838078", "0.58328086", "0.583088", "0.58218586", "0.58121574", "0.5792259", "0.5789101", "0.5786646", "0.5769757", "0.57613206", "0.5760344", "0.5757634", "0.575039", "0.57304156", "0.57264864", "0.5723357", "0.5716201", "0.5715039", "0.57128763", "0.57099104", "0.5690197", "0.5688216", "0.56757754", "0.5661228", "0.56546354", "0.56418955", "0.5641195", "0.5635949", "0.56168735", "0.56038404", "0.55921894", "0.55867255", "0.5580398", "0.5580398", "0.5580398", "0.5580398", "0.5580398", "0.5580398", "0.5580398", "0.5568695", "0.5558063", "0.55565524", "0.55505604", "0.55483896", "0.55477065", "0.5533946", "0.5533946", "0.5530461", "0.5529913", "0.5529201", "0.5523378", "0.5522691", "0.5521112", "0.55170834", "0.5514914", "0.5512735", "0.55043817", "0.5504174", "0.5504174", "0.5504174", "0.5501373", "0.5498157", "0.5497304", "0.54954636", "0.5494611", "0.54765177", "0.5475912", "0.5470971", "0.54682744", "0.546803", "0.54511315", "0.5447747", "0.5445285", "0.54451364", "0.544199" ]
0.71544516
0
get messages by contact id
static public function getMessagesByContactId($rest) { $data = array(); $h = $rest->getHierarchy(); $vars = $rest->getRequestVars(); $errors = Validation::required(array("contact_id"), $vars); // do we have any errors if (count($errors)) { echo json_encode(array( "success" => false, "error" => "Missing the following fields: ".implode($errors, ", ") )); } else { // create the contact $messages = Message::getMessageByContactId($vars['contact_id']); $res = array( "success" => true, "messages" => $messages ); echo json_encode($res); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMessagesFor($id)\n {\n Receiver::where('message_id', $id)->where('recipient_id', Auth::user()->id)->update(['is_seen' => true]);\n\n // get all messages between the authenticated user and the selected user\n $messages = Message_Thread::where(function($q) use ($id) {\n $q->where('message_id', $id);\n })->get();\n for($i = 0; $i < count($messages); $i++){\n $name = User::select('firstName','middleName', 'lastName')->where('id', '=', $messages[$i]['from_id'])->first();\n $messages[$i]['name'] = $name->full_name;\n }\n return response()->json($messages);\n }", "static public function getMessagesByCustomerId($rest) {\n\n $data = array();\n \n $h = $rest->getHierarchy(); \n $vars = $rest->getRequestVars();\n \n $errors = Validation::required(array(\"customer_id\"), $vars);\n\n // do we have any errors\n if (count($errors)) {\n\n echo json_encode(array(\n \"success\" => false,\n \"error\" => \"Missing the following fields: \".implode($errors, \", \")\n ));\n\n }\n\n else {\n\n // create the contact\n $messages = Message::getMessageByCustomerId($vars['customer_id']);\n\n $res = array(\n \"success\" => true,\n \"messages\" => $messages\n );\n\n echo json_encode($res);\n\n }\n\n }", "public function get_message_by_id($id)\n\t{\n\t\t$query = $this->db->get_where('message', array('message_id' => $id));\n\t\treturn $query;\n\t}", "function getContact($id) {\n\t\t$query = $this->createQuery();\n\t\t$query .= \"WHERE c2.id = $id\";\n\t\t$res = $this->database->getRow($query);\n\t\t\n\t\t// modify status\n\t\t$res[\"status\"] = $this->statusCaption($res[\"status\"]);\n\t\t\n\t\treturn $res;\n\t}", "public function messages(){\n $messages = Contact::orderBy('id', 'desc')\n ->limit(3)\n ->get();\n return $messages;\n }", "private function getContact($id)\n {\n// $result = $this->userModel->find($id);\n// if (!$result) {\n// $responseObj->errorResponse([\"Record not found\"], 404);\n// }\n// $responseObj->successResponse([\"Success\"], 200, $result);\n }", "public function get($ID){\n\t\tsql('DELETE FROM messages WHERE from_status=\"0\" AND to_status=\"0\"');\n\t\tsql('DELETE FROM messages WHERE fromID = \"\" or toID = \"\"');\n\t\t\n\t\t$ID = ($ID) ? $ID : $_SESSION['user'] ;\n\t\t\n\t\t$messages = sql('SELECT ' . $this->select . '\n\t\t\t\t\t\t\t\t \t\t FROM ' . $this->from . '\n\t\t\t\t\t\t\t\t \t\t WHERE a.toID LIKE \"%'.$_SESSION['user'].'%\"\n\t\t\t\t\t\t\t\t \t\t AND a.to_status!=\"0\"\n\t\t\t\t\t\t\t\t \t\t AND a.fromID = b.code\n\t\t\t\t\t\t\t\t \t\t ORDER BY a.date DESC '.$this->limit );\n\t\t\n\t\treturn $messages;\n\t\t\n\t}", "public function getById($id)\n\t{\n\t\treturn Message::findOne(\"user_id=? AND id=?\", [$this->user_id, $id]);\n\t}", "public function buscarMensaje($mensaje_id)\n\t{\n\t\treturn Contacto::find($mensaje_id);\n\t}", "public function getContacts($id) {\n\n $contacts = DB::table('contacts')\n ->select('contacts.*', 'social_contacts.*')\n ->join('social_contacts','contacts.id','=','social_contacts.id')\n ->where('social_contacts.id', '=', $id)\n ->first();\n\n return $contacts;\n }", "public function index($id)\n {\n $messages = Message::where([\n ['user_id', Auth::id()],\n ['reciever_id', $id]\n ])\n ->orWhere([\n ['user_id', $id],\n ['reciever_id', Auth::id()] \n ])\n ->with('user')\n ->get();\n\n return request()->ajax() ? $messages : view('chat');\n }", "public function fetchMessages($id)\n {\n $data = MessageThreadMessages::where('message_thread_id', $id)\n ->get();\n\n return response()->json($data);\n }", "public function pick_msg_by_id($id){\n\n\t\t(int)$id;\n\t\t$return_pick_msg = array();\n\n\t\t\t$sql = $this->query(\"SELECT * FROM `messege` WHERE `id` = $id\");\n\n\t\t\t\twhile ($pick_msg = mysql_fetch_array($sql)) {\n\t\t\t\t\t# code...\n\n\t\t\t\t\t$return_pick_msg[] = $pick_msg;\n\t\t\t\t}\n\t\treturn $return_pick_msg;\n\t}", "public function index_get() {\n\t\t$uid = 15;\n\t\t$messages = $this->Messages_model->getMessagesByFromUserID($uid);\n\t\t$this->response($messages);\n\t}", "public function messages_by_user_get() {\n\t\t$uid = $this->input->get('uid');\n\t\t$skip = $this->input->get('skip');\n\t\t$limit = $this->input->get('limit');\n\n\t\t$messages = $this->Messages_model->getMessagesByUserID($uid, $skip, $limit);\n\t\t\n\t\tforeach($messages as $key=>$value) {\n\t\t\t$id = $messages[$key]['_id']->{'$id'};\n\t\t\t$messages[$key]['_id'] = $id;\n\t\t}\n\t\t\n\t\t$this->response($messages);\n\t}", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function listChatMessages(Request $request, $id)\n {\n $result = ChatMessage::chatMessagesPagination($request->input('limit'), $id); \n\n return response()->json($result);\n }", "public function IdContact($id) {\n $sql = \"SELECT * FROM contactos WHERE id= \".$id;\n try {\n $mysql= mysqli_query($GLOBALS[\"db_link\"],$sql);\n if($mysql->num_rows == 1){\n $usuario = $mysql->fetch_assoc();\n $resultado = array($usuario);\n }\n return $resultado;\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":'. $e->getMessage() .'}}';\n }\n }", "function get_mail($id)\n {\n return $this->db->get_where('mail',array('id'=>$id))->row_array();\n }", "public function getMessages()\n {\n //PEMBAHASAN MENGENAI EAGER LOADING BISA DI CARI DI DAENGWEB.ID\n return Message::with('user')->get();\n }", "public function findContactById($id)\n {\n return $this->getContacts()->findContactById($id);\n }", "function getInboxMessage() {\n $sql = \"SELECT * FROM `mail` WHERE receiver_id = ?\";\n return getAll($sql, [getLogin()['mid']]);\n}", "static public function ctrObtenerMensajePorId(){\n\n\t\t\tif(isset($_GET[\"id\"])){\n\n\t\t\t\t$tabla = \"mensajes\";\n\n\t\t\t\t$id = $_GET[\"id\"];\n\n\t\t\t\t$respuesta = ModeloMensajes::mdlObtenerMensajePorId($tabla, $id);\n\n\t\t\t\treturn $respuesta;\t\n\t\t\t\n\t\t\t}\n\n \t}", "public function contactById($id)\n {\n $contact = ContactModel::find($id);\n if(is_null($contact)){\n return response()->json(['message'=>'Liên hệ cần tìm không tồn tại!'], 404);\n }\n return response()->json($contact,200);\n //return response()->json(ProducerModel::find($id),200);\n }", "public function messages_for_user_get() {\n\t\t$uid = $this->input->get('uid');\n\t\t$skip = $this->input->get('skip');\n\t\t$limit = $this->input->get('limit');\n\n\t\t$messages = $this->Messages_model->getMessagesByFromUserID($uid, $skip, $limit);\n\n\n\t\tforeach($messages as $key=>$value) {\n\t\t\t$id = $messages[$key]['_id']->{'$id'};\n\t\t\t$messages[$key]['_id'] = $id;\n\t\t}\n\t\t\n\t\t$this->response($messages);\n\t}", "public function get_message_details_view_page_by_id($id)\n\t{\n\t\t$sql=\"select * from message \n\t\tLEFT JOIN group_message ON (message_id=ref_group_message_message_id) \n\t\tLEFT JOIN (select * from app_user_details JOIN personal_message ON(ref_personal_message_app_user_id=ref_app_user_details_app_user_id) where ref_personal_message_message_id=$id) as personal_app_user_message ON (message.message_id=personal_app_user_message.ref_personal_message_message_id)\n\t\twhere message_id=$id \";\n\t\t\n\t\t$query=$this->db->query($sql);\n\t\t\n\t\treturn $query->row_array();\n\t}", "public function action_get_conversation() {\n\n\t\t$sender = ORM::factory('User', $this->request->param(\"id\"));\n\t\t$conversations =array();// ORM::factory('Message')->get_conversations($this->_current_user->id, $sender);\n\t\t$post = $this->request->post();\n\t\t$to = \"\";\n\t\t$from = \"\";\n\t\tif($post) {\n\t\t\t$from = date('Y-m-d',strtotime($post['from']));\n\t\t\t$to = date('Y-m-d',strtotime($post['to']));\n\t\t\tif($to == '1969-12-31') {\n\t\t\t\t$to = date('Y-m-d',strtotime('2030-01-01'));\n\t\t\t}\n\t\t\tif($from == '1969-12-31') {\n\t\t\t\t$from = date('Y-m-d',strtotime('2030-01-01'));\n\t\t\t}\n\t\t\t$conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender, $from, $to);\n\t\t}else {\n\t\t\t$conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender);\n\t\t}\n\t\t$this->_template->set(\"conversation_info\", $sender);\n\n\t\t$this->_template->set(\"filters\", array(\"from\"=>$from,\"to\"=>$to,\"results\"=>$this->_count_all_messages_in_conversation($conversations)));\n\t\t$this->_template->set(\"conversations\", $conversations);\n\t\t$this->_set_content('conversation');\n\t}", "public function getChild($id) {\n\t\t//\\OCP\\Util::writeLog('contacts', __METHOD__.' id: '.$id, \\OCP\\Util::DEBUG);\n\t\tif(!$this->hasPermission(\\OCP\\PERMISSION_READ)) {\n\t\t\tthrow new \\Exception(self::$l10n->t('You do not have permissions to see this contacts'), 403);\n\t\t}\n\t\tif(!isset($this->objects[$id])) {\n\t\t\t$contact = $this->backend->getContact($this->getId(), $id);\n\t\t\tif($contact) {\n\t\t\t\t$this->objects[$id] = new Contact($this, $this->backend, $contact);\n\t\t\t} else {\n\t\t\t\tthrow new \\Exception(self::$l10n->t('Contact not found'), 404);\n\t\t\t}\n\t\t}\n\t\t// When requesting a single contact we preparse it\n\t\tif(isset($this->objects[$id])) {\n\t\t\t$this->objects[$id]->retrieve();\n\t\t\treturn $this->objects[$id];\n\t\t}\n\t}", "public function index($id)\n {\n $getcontact = Contact::where('_id', $id)->first();\n return $getcontact;\n }", "function getSingleMessage($message_id){\n\t\t$message_id = escapeQuery($message_id);\n\t\t$query = \"SELECT M.message_id, U1.username AS fromUser, U2.username AS toUser, M.messageTitle, M.messageText\n\t\t\tFROM Messages AS M\n\t\t\tINNER JOIN User AS U1 ON M.fromUserId = U1.user_id\n\t\t\tINNER JOIN User AS U2 ON M.toUserId = U2.user_id\n\t\t\tWHERE M.message_id = $message_id\";\n\t\t$result = doQuery($query);\n\t\t\n\t\t// save query results in an array\n\t\t$result_array = array();\n\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t{\n \t\t$result_array[] = $row;\n\t\t}\n\t\t\n\t\treturn $result_array;\n\t}", "public function get_messgae($id){\n \t\t$sql3=\"SELECT message FROM users WHERE id = '$id'\";\n\t $result = mysqli_query($this->db,$sql3);\n\t $user_data = mysqli_fetch_assoc($result);\n\t echo $user_data['message'];\n \t}", "public function getMessages() {}", "public function getMessages() {}", "protected static function findMessage($id)\n {\n return self::findInMailBox()->andWhere(['id' => $id])->one();\n }", "function get_message($id_message)\n\t{\n\t\t$this->ci->db->select('*');\n\t\t$this->ci->db->where('am_id', $id_message);\n\t\t$query = $this->ci->db->get('auth_message');\n\t\tif($query->num_rows() != 0)\n\t\t{\n\t\t\t$data = $query->row()->am_message;\n\t\t\treturn $data;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function read($id){\n\t\n\t\t$query = $this->db->get_where('chat', array('id' => $id));\n\t\t\n\t\tif($query->num_rows() > 0){\n\t\t\t\n\t\t\t$row = $query->row();\n\t\t\t$data = array(\n\t\t\t\t'id'\t\t\t=> $id,\n\t\t\t\t'timestamp'\t\t=> $row->timestamp,\n\t\t\t\t'userId'\t\t=> $row->userId,\n\t\t\t\t'roomId'\t\t=> $row->roomId,\n\t\t\t\t'message'\t\t=> $row->message,\n\t\t\t);\n\t\t\treturn $data;\n\t\t\t\n\t\t}else{\n\t\t\n\t\t\t$this->errors = array(\n\t\t\t\t'error' => 'Chat message doesn\\'t exist!',\n\t\t\t);\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\t\n\t}", "static function getContacts($user = null)\r\n {\r\n if ($user === null)\r\n {\r\n return null;\r\n }\r\n\r\n $tableMessage = DatabaseManager::getNameTable('TABLE_MESSAGE');\r\n $tableUser = DatabaseManager::getNameTable('TABLE_USER');\r\n $idUser = $user->getId();\r\n \r\n $query = \"SELECT DISTINCT u.* \r\n FROM (SELECT * FROM $tableMessage ORDER BY time DESC) AS m \r\n JOIN $tableUser as u \r\n ON u.id = m.idUserTo OR m.idUserFrom = u.id\r\n WHERE m.idUserTo = $idUser OR m.idUserFrom = $idUser\";\r\n\r\n $arrayMessages = DatabaseManager::multiFetchAssoc($query);\r\n $messages = array();\r\n\r\n if ($arrayMessages === null)\r\n {\r\n return null;\r\n }\r\n\r\n foreach ($arrayMessages as $Message) \r\n {\r\n $messages[] = self::ArrayToUser($Message);\r\n }\r\n\r\n return $messages;\r\n }", "public function get(string $id, string $domain = 'messages'): string;", "public function get(string $id, string $domain = 'messages'): string;", "public function chat_messagesAction()\n\t{\n\t\t$chat_id = $this->request->getQuery(\"chat_id\");\n\n\t\t$user = $this->user;\n $user_id = $user['id'];\n $application_id = $user['Application_ID'];\n\n $messages = MessagesRelation::find([\n \"application_id = {$application_id} AND data_cms_id = {$chat_id}\"\n ]);\n\n\t\t$data = [];\n\t\tforeach ($messages as $key => $msg) {\n\t\t\t$data[\"messages\"][$key][\"from_user\"] = $msg->sender->Title;\n\t\t\t$data[\"messages\"][$key][\"from_user_id\"] = $msg->sender->ID;\n\t\t\t$data[\"messages\"][$key][\"last_message\"] = $msg->message->content;\n\t\t\t$data[\"messages\"][$key][\"last_message_time\"] = $msg->message->created_at;\n\t\t}\n\n\t\t$response = [\n \t\"status\" => $this->apiFactory->getStatus(200, \"Success\"),\n \t\"data\" => $data\n ];\n\n return $this->sendJson($response);\n\t}", "function GetMessageDetails($id)\n {\n $status = Connected();\n if ($status == 1) {\n try {\n $d = new dbMakeConnection;\n } catch (PDOException $e) {\n echo($e);\n }\n\n $stmt = $d->conn->prepare(\"SELECT UName, UserId, Date, Content FROM \".$GLOBALS['db_name'].\".Message JOIN \".$GLOBALS['db_name'].\".Member ON (SenderId=UserId) WHERE MessageId = :id\");\n $stmt->bindParam(':id', $id);\n $stmt->execute();\n\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n return $result;\n }\n }", "function getConversation($id, $fromUser=false){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT * FROM msg_conversation WHERE conv_id=:id ORDER BY date');\n\t\t$statement->execute(array(':id'=>$id));\n\t\treturn $statement->fetchAll(PDO::FETCH_ASSOC);\n\t}", "function get_contact($id)\n\t{\n\t\t$xml = $this->load_url(\"contacts/$id\");\n\n\t\tif(!$xml):\n\t\t\treturn false;\n\t\tendif;\n\n\t\t$contact = false;\n\t\t$_contact = (isset($xml['entry'])) ? $xml['entry'] : false;\n\n\t\t// parse into nicer array\n\t\tif(is_array($_contact)):\n\t\t\t$id = $this->get_id_from_link($_contact['link_attr']['href']);\n\n\t\t\t$contact = $_contact['content']['Contact'];\n\n\t\t\tif(isset($_contact['content']['Contact']['ContactLists']['ContactList'])):\n\t\t\t\t$_lists = $_contact['content']['Contact']['ContactLists']['ContactList'];\n\t\t\t\tunset($_lists['0_attr']);\n\t\t\t\tunset($_lists['ContactList_attr']);\n\t\t\telse:\n\t\t\t\t$_lists = false;\n\t\t\tendif;\n\n\t\t\t// get lists\n\t\t\t$lists = array();\n\t\t\tif(is_array($_lists) && count($_lists) > 0):\n\t\t\t\tunset($_lists['id']);\n\n\t\t\t\tif(isset($_lists['link_attr']['href'])):\n\t\t\t\t\t$list_id = $this->get_id_from_link($_lists['link_attr']['href']);\n\t\t\t\t\t$lists[$list_id] = $list_id;\n\t\t\t\telse:\n\t\t\t\t\tforeach($_lists as $k => $v):\n\t\t\t\t\t\tif(isset($v['link_attr']['href'])):\n\t\t\t\t\t\t\t$list_id = $this->get_id_from_link($v['link_attr']['href']);\n\t\t\t\t\t\t\t$lists[$list_id] = $list_id;\n\t\t\t\t\t\tendif;\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\n\t\t\t\tunset($contact['ContactLists']);\n\t\t\tendif;\n\n\t\t\t$contact['lists'] = $lists;\n\t\t\t$contact['id'] = $id;\n\t\tendif;\n\n\t\treturn $contact;\n\t}", "function getMessage( $msg_id ){\n\t$msg_id = mysql_escape_string($msg_id);\n\t\n\t// Performing SQL query\n\t$query \t\t= sprintf(\"select * from messages where message_id=%d\",$msg_id);\n\t$result \t= mysql_query($query);\n\t$data \t\t= $result->fetch();\t\n\t$message \t= array();\n\t\n\tif(!empty($data)) {\n\t\t$message['id']=$data['message_id'];\n\t\t$message['date']=$data['message_date'];\n\t\t$message['from']=$data['message_from'];\n\t\t$message['url']=$data['message_audio_url'];\n\t}\n\treturn $message;\n}", "public function contact($id)\n\t{\n\t\t$receiver = User::where('id', $id)->first();\n\t\treturn view('mails/contact', compact('receiver'));\n\n\n\t}", "public function getRecipient($id);", "public function getAllMyContacts($id)\n {\n\n $query = $this->datatables\n ->select('\n ContactId,\n ReceiverId,\n SenderId,\n IF(ReceiverId = ' . $id . ',\n (SELECT first_name\n FROM users\n WHERE users.id = contacts_connectivity.SenderId),\n (SELECT first_name\n FROM users\n WHERE users.id = contacts_connectivity.ReceiverId)) AS FirstName,\n IF(ReceiverId = ' . $id . ',\n (SELECT email\n FROM users\n WHERE users.id = contacts_connectivity.SenderId),\n (SELECT email\n FROM users\n WHERE users.id = contacts_connectivity.ReceiverId)) AS SenderEmail,\n IF(ReceiverId = ' . $id . ',\n (SELECT phone\n FROM users\n WHERE users.id = contacts_connectivity.SenderId),\n (SELECT phone\n FROM users\n WHERE users.id = contacts_connectivity.ReceiverId)) AS SenderPhone,\n IF(ReceiverId = ' . $id . ',\n (SELECT company\n FROM users\n WHERE users.id = contacts_connectivity.SenderId),\n (SELECT company\n FROM users\n WHERE users.id = contacts_connectivity.ReceiverId)) AS SenderCompany,\n ModulesId,\n (SELECT ModuleName FROM modules WHERE ModuleId = contacts_connectivity.ModulesId) AS ModuledName,\n FROM_UNIXTIME(AddedDate, \"%m/%d/%Y\") AddedDate')\n ->from($this->_contactsConnectivity)\n ->where(\"(ReceiverId=$id OR SenderId=$id) AND isApproved = 1\")\n ->add_column('Edit', '<a href=\"' . base_url() . 'editcontact/$1\" target=\"_blank\"><i class=\"fa fa-pencil fa-fw\"></i></a>', 'ContactId')\n ->add_column('Delete', '<a onclick=\"ajaxRemoveFn($1, \\'deletecontact/$1\\')\" href=\"javascript:void(0)\"><i class=\"fa fa-trash-o fa-fw\"></i></a>', 'ContactId');\n $q = $this->datatables->generate();\n return $q;\n }", "public function getByContactId($contactId){\r\n\t\treturn $this->_backend->getMultipleByProperty($contactId, 'contact_id');\r\n\t}", "public function Messages_Get($ID)\n\t{\n\t\t$Data = $this -> HTTPRequest($this -> APIURL.'Messages:Get/ID:'.(int)$ID);\n\t\treturn $this -> ParseResponse($Data);\n\t}", "public function get_messagesAction()\n\t{\n\t\t$parent_id = $this->request->getQuery(\"conversation_id\");\n\n\t\t$user = $this->user;\n $user_id = $user['ID'];\n $application_id = $user['Application_ID'];\n\n $messages = MessagesRelation::find([\n \"application_id = {$application_id} AND module_id = {$this->MODULE_ID} AND parent_id = '{$parent_id}' AND (data_cms_id IS NULL)\"\n ]);\n\n $data = [];\n foreach ($messages as $key => $msg) {\n \t$data[\"messages\"][$key][\"from_user\"] = $msg->sender->Title;\n \t$data[\"messages\"][$key][\"from_user_id\"] = $msg->sender->ID;\n \t$data[\"messages\"][$key][\"to_user\"] = $msg->receiver->Title;\n \t$data[\"messages\"][$key][\"to_user_id\"] = $msg->receiver->ID;\n \t$data[\"messages\"][$key][\"last_message\"] = $msg->message->content;\n \t$data[\"messages\"][$key][\"last_message_time\"] = $msg->message->created_at;\n }\n\n $trans = new MessageViewTransformer;\n $response = [\n \t\"status\" => $this->apiFactory->getStatus(200, \"Success\", [\"validation\" => [], \"other\" => []]),\n \t\"content\" => $trans->transformResultSet($messages),\n \t\"actions\" => [\n \t\t[\n \t\t \"title\" => \"Delete\",\n \t\t \"target_action_id\" => \"1\",\n \t\t \"target_type\" => \"popup\",\n \t\t \"target_content\" => \"block\",\n \t\t \"content_id\" => 14,\n \t\t \"target_layout_id\" => \"2\",\n \t\t \"target_url\" => \"http://\",\n \t\t \"icon\" => \"\"\n \t\t],\n \t\t[\n \t\t \"title\" => \"Edit\",\n \t\t \"target_action_id\" => \"1\",\n \t\t \"target_type\" => \"popup\",\n \t\t \"target_content\" => \"block\",\n \t\t \"content_id\" => 14,\n \t\t \"target_layout_id\" => \"2\",\n \t\t \"target_url\" => \"http://\",\n \t\t \"icon\" => \"\"\n \t\t]\n \t]\n ];\n\n return $this->sendJson($response);\n\t}", "public function get_chat_messages($id, $limit)\n {\n return $this->db\n ->where(\"tbl_private_chat_messages.private_chat_id\", $id)\n ->join(\"tbl_users\", \"tbl_users.user_id = tbl_private_chat_messages.user_id\")\n ->limit($limit)\n ->order_by(\"tbl_private_chat_messages.private_chat_messages_id\", \"DESC\")\n ->get(\"tbl_private_chat_messages\");\n }", "public function getMessages ()\n\t{\n\t\t$messages = array();\t//Prevent foreach loop error\n\t\t$Statement = $this->Database->prepare(\"SELECT messages.*, users.first_name, users.last_name, users.thumbnail FROM messages INNER JOIN users ON messages.sender_id = users.id WHERE reciever = ? ORDER BY id DESC LIMIT 30\");\n\t\t$Statement->execute(array($this->id));\n\t\t$messages = $Statement->fetchAll();\n\t\t\n\t\treturn $messages;\n\t}", "public function getMessages()\n {\n $chat_info = $this->_Database->query(\"SELECT chat.*, users.user_name, users.staff_status FROM chat LEFT JOIN users ON users.user_id = chat.user_id ORDER BY chat_id DESC\", null, \"fetchAll\");\n return $chat_info;\n }", "function loadMessages($thread_id)\n\t\t{\n\t\t\t$query=sqlite_query($this->connection, \"SELECT user_id, message, date FROM message WHERE thread_id='$thread_id' ORDER BY message_id ASC\");\n\t\t\twhile ($row = sqlite_fetch_array($query))\n\t\t\t{\n\t\t\t\t$row[0]=$this->loadUser($row[0]);\n\t\t\t}\n\t\t\treturn $row;\n\t\t}", "public function show($id)\n {\n $conversation = Conversation::find($id);\n\n if ($this->user_id == $conversation->user_id || $this->user_id == $conversation->shop_owner_id) {\n\n $messages = $conversation->messages->sort()->values()->all();\n\n foreach ($messages as $msg) {\n if ($msg['sender_id'] == $this->user_id) {\n $msg['sender'] = 'true';\n } else {\n $msg['receiver'] = 'true';\n }\n }\n\n return response()->json($messages);\n }\n }", "function queryMessages($options = null)\n {\n return $this->_api->newApiCursor('Telerivet_Message', \"{$this->getBaseApiPath()}/messages\", $options);\n }", "public function selectMessageByID($id) {\n $result = $this->sdb->query(\n 'select m.*,to_char(m.time_sent, \\'YYYY-MM-DD\"T\"HH24:MI:SS\\') as sent_date from messages m where m.id = $1',\n array($id));\n $all = array();\n while ($row = $this->sdb->fetchrow($result))\n {\n array_push($all, $row);\n }\n\n if (count($all) === 1)\n return $all[0];\n\n return array();\n\n }", "public function contactInfo($id)\n\t{\n\t\t$sql = \"SELECT * FROM contact_us WHERE id = '\". $id . \"'\";\n\t\t//return $this->fetch($sql);\n $rows = $this->fetch($sql);\n $c=0;\n foreach($rows AS $row){\n $contactinfo[$c] = $row;\n $c++;\n }\n return $contactinfo;\n\t}", "function test_get_by_id()\n {\n $dm = new mdl_direct_message();\n $result = $dm->get_by_id(1, 1);\n\n $this->assertEquals(count($result), 1);\n }", "function getMessages($where, $value = array(), $order = NULL, $limit = NULL){\n\t\tglobal $con;\n\t\t$limit = $limit != NULL ? ' LIMIT ' \t. $limit : '';\n\t\t$order = $order != NULL ? ' ORDER BY ' \t. $order : '';\n\n\t\t$stmt = $con->prepare('\n\t\t\t\t\tSELECT users.FullName, users.image, messages.sender_id, messages.reciever_read, messages.id\n\t\t\t\t\tFROM users\n\t\t\t\t\tINNER JOIN messages\n\t\t\t\t\tON users.id = messages.sender_id\n\t\t\t\t\t\n\t\t\t\t\tWHERE ' . $where . ' ' . $order . $limit\n\t\t\t\t);\n\t\t$stmt->execute($value);\n\t\treturn $stmt->fetchAll();\n\t}", "public function show($id)\n {\n $chat = Chat::where('empresa_id', \\Auth::user()->id)\n ->orWhere('persona_id', \\Auth::user()->id)\n ->findOrFail($id);\n return $chat->mensaje->where('id', '>', request()->last)->each(function ($m) {\n $m->date = [\n $m->created_at->format('Y'),\n $m->created_at->format('m') - 1,\n $m->created_at->format('d'),\n $m->created_at->format('H'),\n $m->created_at->format('i'),\n $m->created_at->format('s'),\n ];\n $usuario = $m->usuario->fullName();\n $m->logo = $m->usuario->getLogoPath();\n unset($m->usuario, $m->chat_id);\n $m->usuario = $usuario;\n });\n }", "public function get($id)\n {\n $contact = ContactService::get($id);\n return response()->json(array(\n 'contacts' => $contact\n ),200);\n }", "public function getContacts();", "public function get( $_id )\n {\n $this->load->model('User');\n $this->load->model('TextAnnotation');\n\n $sql = 'SELECT *\n FROM messages\n WHERE id = ?';\n\n $params = array( $_id );\n $query = $this->db->query( $sql, $params );\n\n $results = $query->result();\n $result = $results[0];\n $this->id = $_id;\n $this->recipient = User::init($result->recipient);\n $this->sender = User::init($result->sender);\n $this->annotation = TextAnnotation::init($result->annotation);\n }", "function getSentboxMessage() {\n $sql = \"SELECT * FROM `mail` WHERE sender_id = ?\";\n return getAll($sql, [getLogin()['mid']]);\n}", "public function show($id)\n {\n\n if (MessageContact::findOrFail($id)) {\n $messagecontact = MessageContact::findOrFail($id);\n showLog(MessageContact::class,$id);\n return view('backEnd.admin.messagecontact.show', compact('messagecontact'));\n }\n\n session()->flash('error', ' l\\'arcticle n\\'existe pas !');\n showFailureLog(MessageContact::class,$id);\n return view('backEnd.admin.messagecontact.show', compact('messagecontact'));\n\n }", "public function actionGetMessages() {\n\n // prepare response array\n $response = array(\n 'status' => true,\n 'records' => array()\n );\n\n // get last message id from client, 0 by default\n\t\t$id = (int)Yii::app()->request->getPost('lastMessageId', 0);\n\n // get messages list from model\n $messages = Chat::model()->getLastMessages($id);\n\n // add messages list to return array\n $response['records'] = $messages;\n\n // encode return arra to JSON\n echo json_encode($response);\n\n // force app to end\n Yii::app()->end();\n\t}", "public function getContact($id)\n {\n $ch = curl_init();\n //echo $this->apiUrl . $this->contactsUrl . $id . '?authtoken=' . $this->authtoken . '&organization_id=' . $this->organizationId;\n curl_setopt($ch, CURLOPT_URL, $this->apiUrl . $this->contactsUrl. '/' . $id . '?authtoken=' . $this->authtoken . '&organization_id=' . $this->organizationId);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: application/json\", 'Authorization: Zoho-authtoken ' + $this->authtoken));\n $contact = curl_exec($ch);\n //print_r($contact);\n $this->httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n $this->checkApiRequestsLimit();\n\n return $this->httpCode == 200 ? $contact : false;\n }", "public function get_chat_row($id) {\n $sql = \"select * from chat where AdsID=?\";\n $data = $this->db->query($sql, array($id));\n return $data->row();\n }", "public function actionConversation($id){\n $id = (int) $id;\n $message = Message::find()->where(\"thread_id = $id AND status != 0\")->all();\n if(!empty($message)){\n $user_id = \\Yii::$app->user->getId();\n $user = Users::find()->where(['user_id'=>$user_id])->one();\n $message = \\Yii::$app->db->createCommand('UPDATE message SET read_m = 1 WHERE thread_id = :id AND from_user != :from_user');\n $message->bindValue(':id', $id);\n $message->bindValue(':from_user', \\Yii::$app->user->getId());\n $message->execute();\n $messages = Message::find()->where(\"thread_id = $id AND status != 0\")->orderBy('datetimestamp DESC')->all();\n return $this->render('conversation', ['user'=>$user, 'messages'=>$messages]);\n }else{\n return $this->redirect(['site/error']);\n }\n }", "function customGetChat($cid){\n return _custom_chat_get_room($cid);\n}", "public function message_detail($from_id = null){\n $this->Session->write('page','m_d');\n $this->Session->write('from_id',$from_id);\n $this->paginate = array(\n 'Message' => array (\n 'limit' => 20,\n 'conditions' => array(\n 'to_id' => array($this->Session->read('Auth.User.id'),$from_id),\n 'from_id' => array ($from_id, $this->Session->read('Auth.User.id'))\n ),\n 'fields' => '*',\n 'joins' => array (\n array (\n 'type' => 'INNER',\n 'table' => 'users',\n 'alias' => 'User',\n 'conditions' => 'User.id = Message.from_id',\n\n ) \n ),\n 'order' => array('Message.id' => 'desc' )\n ), \n \"User\" => array()\n );\n $messages = $this->paginate('Message');\n $this->set(compact('messages'));\n }", "public function getMessage($id) {\n\t\tif (!array_key_exists($id, $this -> messages)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this -> messages[$id];\n\t}", "public function show(Request $request, number $id): JsonResponse\n {\n try {\n $message = Message::findOrFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json(['error_message' => 'The thread with ID: ' .\n $id . ' was not found.'], 404);\n }\n $message->load(['recipients']);\n\n return response()->json($message);\n }", "function getAllMessages(){\n\t\t$query = \"SELECT M.message_id, U1.username AS fromUser, U2.username AS toUser, M.messageTitle, M.messageText\n\t\t\tFROM Messages AS M\n\t\t\tINNER JOIN User AS U1 ON M.fromUserId = U1.user_id\n\t\t\tINNER JOIN User AS U2 ON M.toUserId = U2.user_id\";\n\t\t$result = doQuery($query);\n\t\t\n\t\t// save query results in an array\n\t\t$result_array = array();\n\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t{\n \t\t$result_array[] = $row;\n\t\t}\n\t\t\n\t\treturn $result_array;\n\t}", "public function getMessagesByUserId($userId)\n {\n return $this->model->chat($userId);\n }", "public function getMessage( $id )\n\t{\n\t\t$message = Message::where( 'id', $id )->value('message');\n\t\treturn $message;\n\t}", "function getSentMessage($from_group, $from_id, $limit = null, $offset = null, $search = null) {\n\t\t$filter = '';\n\t\t\n\t\tif ($limit != null ) {\n\t\t\t$filter = ' limit '.$limit.' offset '.$offset.' ';\n\t\t}\n\t\t\n\t\t//if from_group = admin, not need check id, all admin can see the same thing\n\t\tif ($from_group == 'admin') {\n\t\t\t$sql = \"select * from message where msg_from_group = 'admin' order by msg_sent_date desc \".$filter;\n\t\t}\n\t\telse {\n\t\t\t$sql = \"select * from message where msg_from_group = '$from_group' and msg_from = $from_id order by msg_sent_date desc \".$filter;\n\t\t}\n\t\t$msg = array();\n\t\t$query = $this->db->query($sql);\n\t\tif ($query->num_rows() > 0) {\n\t\t\tforeach ($query->result() as $row) {\n\t\t\t\t//get receiver name\n\t\t\t\t$to = $row->{'msg_to'};\n\t\t\t\tif ($row->{'msg_to_group'} == 'admin') {\n\t\t\t\t\t$sql2 = \"select admin_name from admin where admin_id = $to\";\n\t\t\t\t\t$query2 = $this->db->query($sql2);\n\t\t\t\t\tif ($query2->num_rows() > 0) {\n\t\t\t\t\t\tforeach ($query2->result() as $row2) {\n\t\t\t\t\t\t\t$row->{\"receiver\"} = $row2->{'admin_name'};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$row->{'receiver'} = '';\n\t\t\t\t}\n\t\t\t\telse if ($row->{'msg_to_group'} == 'manager') {\n\t\t\t\t\t$sql2 = \"select m_name from manager where m_id = $to\";\n\t\t\t\t\t$query2 = $this->db->query($sql2);\n\t\t\t\t\tif ($query2->num_rows() > 0) {\n\t\t\t\t\t\tforeach ($query2->result() as $row2) {\n\t\t\t\t\t\t\t$row->{\"receiver\"} = $row2->{'m_name'};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$row->{'receiver'} = '';\n\t\t\t\t}\n\t\t\t\telse if ($row->{'msg_to_group'} == 'agent') {\n\t\t\t\t\t$sql2 = \"select agent_name from agent where agent_id = $to\";\n\t\t\t\t\t$query2 = $this->db->query($sql2);\n\t\t\t\t\tif ($query2->num_rows() > 0) {\n\t\t\t\t\t\tforeach ($query2->result() as $row2) {\n\t\t\t\t\t\t\t$row->{\"receiver\"} = $row2->{'agent_name'};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$row->{'receiver'} = '';\n\t\t\t\t}\n\t\t\t\telse if ($row->{'msg_to_group'} == 'customer') {\n\t\t\t\t\t$sql2 = \"select customer_name from customer where customer_id = $to\";\n\t\t\t\t\t$query2 = $this->db->query($sql2);\n\t\t\t\t\tif ($query2->num_rows() > 0) {\n\t\t\t\t\t\tforeach ($query2->result() as $row2) {\n\t\t\t\t\t\t\t$row->{\"receiver\"} = $row2->{'customer_name'};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$row->{'receiver'} = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if ($row->{'msg_to_group'} == 'director') {\n\t\t\t\t\t$sql2 = \"select dr_name from director where dr_id = $to\";\n\t\t\t\t\t$query2 = $this->db->query($sql2);\n\t\t\t\t\tif ($query2->num_rows() > 0) {\n\t\t\t\t\t\tforeach ($query2->result() as $row2) {\n\t\t\t\t\t\t\t$row->{\"receiver\"} = $row2->{'dr_name'};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$row->{'receiver'} = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$msg[] = $row;\n\t\t\t\t\n\t\t\t}\n\t\t}\t\n\t\treturn $msg;\n\t}", "public function getMessagesChecklist($idEvento)\n\t{\n\t try{\n\t \n\t $select = parent::select()->where('idEvento =?',$idEvento);\n\t $res = parent::fetchAll($select)->toArray();\n\t $result = array();\n\t \n\t foreach($res as $r){\n\t if (self::isJSON($r['msj'])) // Si el mensaje es json\n\t {\n\t $msg = json_decode($r['msj']);\n\t \n\t if($msg->type)\n\t {\n\t if($msg->type == \"comment\")\n\t $result[] =$r['username'].\": \".$r['fecha'].\" - \".$msg->result;\n\t }\n\t }\n\t \n\t }\n\t return $result;\n\t }\n\t catch(Zend_Exception $e){\n\t return array('fail'=>array($e->getCode()=>$e->getMessage()));\n\t }\n\t \n\t}", "public function fetchAllMessages()\n {\n return Chat::with('user')->get();\n }", "public function getMessages($idBat) {\n $messages = array(); \n $q = $this->_db->query('SELECT * FROM MESSAGE WHERE ID_BAT = \"'.$idBat.'\"');\n\n while ($donnees = $q->fetch())\n {\n\n $donnees2 = array('IDMESSAGE' => $donnees[0],'IDBAT'=> $donnees[1], 'DATEMESS'=> $donnees[2], 'HEUREMESS' =>$donnees[3], 'DESCMESS' => $donnees[4]);\n \n $messages[] = new Message($donnees2);\n \n }\n\n return $messages;\n }", "function InfGetContactDetails($inf_contact_id) {\n $object_type = \"Contact\";\n $class_name = \"Infusionsoft_\" . $object_type;\n $object = new $class_name();\n $objects = Infusionsoft_DataService::query(new $class_name(), array('Id' => $inf_contact_id));\n\n $contact_array = array();\n foreach ($objects as $i => $object) {\n $contact_array[$i] = $object->toArray();\n }\n\treturn $contact_array[0];\n}", "function openMessage()\r\n{\r\n\tglobal $dbConnection;\r\n\t\r\n\t$sql = \"SELECT * FROM mailmessages WHERE id=\" . $_GET['id'];\r\n\t$result = mysqli_query($dbConnection, $sql)\r\n\t\tor die($sql);\r\n\t$record = mysqli_fetch_array($result);\r\n\tmysqli_free_result($result);\r\n\r\n\treturn $record;\r\n}", "public function getMessages(): Collection;", "public function getMessages(): Collection;", "public static function get_service_messages_for_service($service_id) {\n\t\t\n\t\t$list = Array();\n\t\tforeach (DB::table('service_messages')->select('*')->where('service', $service_id)->get() as $row) {\n\t\t\t$list[] = new ServiceMessageObject($row);\n\t\t}\n\t\treturn $list;\n\t}", "public static function get_messages($conv_id)\n {\n $messages = DB::table('messages')\n ->join('conversations', 'messages.conversation_id', '=', 'conversations.id')\n ->join('users', 'messages.user_id_from', '=', 'users.id')\n ->where('conversations.id', '=', $conv_id)\n ->select('messages.*', 'conversations.*', 'users.*')\n ->get();\n\n return $messages;\n }", "function get_message_inbox($db, $user_id)\n{\n\t$sql = \"SELECT * FROM messages where to_id= :to_id ORDER BY date_time DESC\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':to_id'=>$user_id));\n\t$us = $st->fetchAll();\n\treturn $us;\n}", "public function show($id)\n {\n $user_id = auth()->user()->id;\n $messages = Chat::where(function ($query) use ($id){\n $query->where('sender_id', '=', auth()->user()->id)->where('reciever_id', '=', $id);})->orWhere(function ($query) use ($id){\n $query->where('sender_id', '=', $id)->where('reciever_id', '=', auth()->user()->id);\n })->latest()->get();\n\n if(count($messages) < 1){\n return response()->json(['success' => false, 'message' => 'No chat history'], 401); \n }\n \n return response()->json(['success' => true, 'chats' => $messages]);\n }", "public function getById($id): Chat {\n return Chat::findOrFail($id);\n }", "protected function getMessages()\n\t{\n\t\t$page = \\Illuminate\\Support\\Facades\\Request::input('page', 1);\n\t\t\n\t\tif(!$this->messages)\n\t\t{\n\t\t\t$this->messages = Mail::where('folder', '=', $this->getFolderId())\n\t\t\t\t->orderBy($this->getFolderId() == 'sent' ? 'sent_time' : 'modified_time', 'desc')\n\t\t\t\t->offset(($page - 1) * $this->itemsPerPage)\n\t\t\t\t->limit($this->itemsPerPage)\n\t\t\t\t->get();\n\t\t}\n\t\t\n\t\treturn $this->messages;\n\t}", "public function readMessage($id) {\n\t\t$response = null;\n\t\tif ($id) {\n\t\t\t$urlMessage = \"{$this->apiHost}/read_message\";\n\t\t\t$postData = sprintf ( \"id=%s&uh=%s\", $id, $this->modHash );\n\t\t\t$response = $this->runCurl ( $urlMessage, $postData );\n\t\t}\n\t\treturn $response;\n\t}", "public static function findById(int $id): Message {\n $db = Database::getPDOConnection();\n $stmt = $db->prepare('SELECT * FROM `messages` WHERE `id` = :id');\n $stmt->execute(['id' => $id]);\n $row = $stmt->fetch();\n if (!$row) {\n throw new MessageNotFoundException(sprintf('no message with id \\'%d\\' exists', $id));\n }\n $message = Message::fromDBRecord($row, $db);\n return $message;\n }", "public function get(int $id): ActiveCampaignContact\n {\n return ContactFactory::make($this->request(\n method: 'get',\n path: 'contacts/'.$id,\n responseKey: 'contact'\n ));\n }" ]
[ "0.7237493", "0.69647366", "0.69646186", "0.6845872", "0.67688006", "0.6650879", "0.6597531", "0.6565107", "0.6554185", "0.65397", "0.6507119", "0.6504515", "0.6472354", "0.6444423", "0.6437541", "0.64051396", "0.64051396", "0.64051396", "0.64051396", "0.64051396", "0.64051396", "0.64051396", "0.6402166", "0.6354363", "0.6351865", "0.6350733", "0.6332188", "0.6322838", "0.6306523", "0.6302411", "0.6286508", "0.6282462", "0.6280687", "0.62692463", "0.6239625", "0.62293285", "0.6209348", "0.6205511", "0.6205511", "0.6188345", "0.6187197", "0.61787266", "0.6174048", "0.6167998", "0.6167998", "0.61612326", "0.6156112", "0.6155411", "0.6153138", "0.6147299", "0.61439145", "0.6131135", "0.6129184", "0.61175764", "0.61142385", "0.6096117", "0.608108", "0.6066047", "0.6047972", "0.60310054", "0.6028868", "0.6023629", "0.60214996", "0.60127074", "0.5997473", "0.597609", "0.5971559", "0.5965035", "0.5963084", "0.5956577", "0.5950025", "0.5949745", "0.59481347", "0.59480894", "0.5945845", "0.5945068", "0.5939407", "0.5936837", "0.5928589", "0.5927962", "0.5911313", "0.59087807", "0.59071124", "0.5904017", "0.58951765", "0.5883974", "0.58825505", "0.5872296", "0.5863478", "0.5861249", "0.5861249", "0.5841156", "0.5841082", "0.58341", "0.5830882", "0.5822546", "0.5817142", "0.58146185", "0.5803877", "0.5799134" ]
0.77144456
0
href="" ==> current url.
function resolve_href ($base, $href) { if (!$href) { return $base; } // href="http://..." ==> href isn't relative $rel_parsed = parse_url($href); if (array_key_exists('scheme', $rel_parsed)) { return $href; } // add an extra character so that, if it ends in a /, we don't lose the last piece. $base_parsed = parse_url("$base "); // if it's just server.com and no path, then put a / there. if (!array_key_exists('path', $base_parsed)) { $base_parsed = parse_url("$base/ "); } // href="/ ==> throw away current path. if ($href{0} === "/") { $path = $href; } else { $path = dirname($base_parsed['path']) . "/$href"; } // bla/./bloo ==> bla/bloo $path = preg_replace('~/\./~', '/', $path); // resolve /../ // loop through all the parts, popping whenever there's a .., pushing otherwise. $parts = array(); foreach ( explode('/', preg_replace('~/+~', '/', $path)) as $part ) if ($part === "..") { array_pop($parts); } elseif ($part!="") { $parts[] = $part; } return ( (array_key_exists('scheme', $base_parsed)) ? $base_parsed['scheme'] . '://' . $base_parsed['host'] : "" ) . "/" . implode("/", $parts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function href();", "public function href()\n {\n return null;\n }", "function currentUrl($value='')\n\t{\n\t \treturn 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];\n\t}", "public function current(){\n\t\t$actual_link = $this->protocol() . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\treturn $actual_link;\n\t}", "function get_self_link()\n {\n }", "public function current_link() {\n\t\treturn $this->sets[':default']->current_link();\n\t}", "public static function CurrentURL() {\n\n // Create link to current page\n $refToThisPage = \"http\";\n $refToThisPage .= (@$_SERVER[\"HTTPS\"] == \"on\") ? 's' : '';\n $refToThisPage .= \"://\";\n $serverPort = ($_SERVER[\"SERVER_PORT\"] == \"80\") ? '' : \":{$_SERVER['SERVER_PORT']}\";\n $refToThisPage .= $serverPort . $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\n\n return $refToThisPage;\n }", "function href() {\n\t\t$usemodrewrite = polarbear_setting('usemodrewrite');\n\t\tif ($usemodrewrite) {\n\t\t\treturn $this->fullpath();\n\t\t} else {\n\t\t\treturn $this->templateToUse() . '?polarbear-page=' . $this->getId();\n\t\t}\n\t}", "function current_url() {\n\treturn 'http' . (empty($_SERVER['HTTPS']) ? '' : 's') . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n}", "function current_url()\n {\n return $this->currentURL();\n }", "public function url(){\r\n\t\techo $_SERVER['SERVER_NAME'].\" => \".$_SERVER['PHP_SELF'];\r\n\t}", "public function getHref()\n {\n return $this->href;\n }", "public function getHref()\n {\n return $this->href;\n }", "public function getHref()\n {\n return $this->href;\n }", "function current_url() {\n $page_url = 'http';\n if (@$_SERVER['HTTPS'] == 'on') {\n $page_url .= 's';\n }\n $page_url .= '://'.$_SERVER['SERVER_NAME'];\n if ($_SERVER['SERVER_PORT'] != '80') {\n $page_url .= ':'.$_SERVER['SERVER_PORT'];\n }\n $page_url .= $_SERVER['REQUEST_URI'];\n return $page_url;\n}", "public function getCurrentUrl();", "function set_current_url() {\r\n\t\t\t$this->current_url = $this->get_current_url();\r\n\t\t}", "protected function getURL()\r\n\t{\r\n\t\tglobal $NEED_PHP_SELF;\r\n\t\treturn ($NEED_PHP_SELF)?$_SERVER['PHP_SELF']:\"\";\r\n\t}", "protected function renderCurrentUrl() {}", "protected function renderCurrentUrl() {}", "function getURL() \n {\n return $this->getValueByFieldName( 'navbarlink_url' );\n }", "public function get_link() { return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] \n === 'on' ? \"https\" : \"http\") . \"://\" . \n $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; }", "function getLink () {\n\t\t$baseLink = 'index.php';\n\t\tif ($this->getAction ()) {\n\t\t\treturn $baseLink .= '?action='.$this->getAction ();\n\t\t}\n\t\telseif ($this->isAdminPage ()) {\n\t\t\treturn $baseLink .= '?action=admin&pageID='.$this->getID ();\n\t\t} else {\n\t\t\treturn $baseLink .= '?action=viewPage&pageID='.$this->getID ();\n\t\t}\n\t}", "abstract public function href(): ?string;", "public function getURL()\n {\n return $this->page->getURL() . 'links-to-this/';\n }", "function formatCurrentUrl() ;", "public function Link() {\n\t\treturn self::$url_segment .'/';\n\t}", "function get_current_page_url() {\n if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') \n $url = \"https://\"; \n else \n $url = \"http://\"; \n // Append the host(domain name, ip) to the URL. \n $url.= $_SERVER['HTTP_HOST']; \n \n // Append the requested resource location to the URL \n $url.= $_SERVER['REQUEST_URI'];\n return $url; \n }", "function current_url() {\n $protocol = (isset($_SERVER['HTTPS']) ? \"https\" : \"http\");\n return \"$protocol://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n}", "public function current_url()\n {\n return trim($this->get('url'), '/');\n }", "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}", "public function showMeCurrentUrl() {\r\n /** @var MinkSession $session */\r\n $session = $this->getSession();\r\n echo \"You are on: \".$session->getCurrentUrl();\r\n }", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "function current_url()\n{\n if (empty($_SERVER['QUERY_STRING'])) {\n $query_string = '';\n } else {\n $query_string = '?' . $_SERVER['QUERY_STRING'];\n }\n\n return $_SERVER['PHP_SELF'] . $query_string;\n}", "function current_page_url() {\n\t$pageURL = 'http';\n\tif( isset($_SERVER[\"HTTPS\"]) ) {\n\t\tif ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n\t}\n\t$pageURL .= \"://\";\n\tif ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n\t} else {\n\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n\t}\n\treturn $pageURL;\n}", "protected function initCurrentUrl() {}", "protected function initCurrentUrl() {}", "function get_self_link() {\n\t\t$host = @parse_url( home_url() );\n\t\treturn set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) );\n\t}", "public function link(): string {\n\t\treturn $this->page['link'] ?? '';\n\t}", "public static function currentURL() {\n\t\t$base = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n\t\t$protocol = (empty($_SERVER['HTTPS'])) ? 'https' : 'http';\n\t\treturn $protocol.'://'.$base;\n\t}", "function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }", "function Link()\n\t{\tif ($this->details[\"hblink\"])\n\t\t{\tif (strstr($this->details[\"hblink\"], \"http://\") || strstr($this->details[\"hblink\"], \"https://\"))\n\t\t\t{\treturn $this->details[\"hblink\"];\n\t\t\t} else\n\t\t\t{\treturn SITE_URL . $this->details[\"hblink\"];\n\t\t\t}\n\t\t}\n\t}", "public static function hrefBack($default=null)\n\t{\n\t if (Application::instance()->isCLI())\n\t {\n\t return $default ? $default : hrefDefault();\n\t }\n\t \n\t $sess = GDO_Session::instance();\n\t if ( (!$sess) || (!($url = $sess->getLastURL())) )\n\t {\n\t $url = isset($_SERVER['HTTP_REFERER']) ?\n\t $_SERVER['HTTP_REFERER'] :\n\t ($default ? $default : hrefDefault());\n\t }\n\t return $url;\n\t}", "public function getCurrHyperlink()\n {\n return $this->currHyperlink;\n }", "function get_current_url() {\n $get = $_GET;\n unset($get['request_uri']);\n $qs = http_build_query($get);\n return Router::$page_url . (!empty($qs) ? \"?$qs\" : null);\n}", "private function getThisPageFullURL()\n {\n return 'http' . ( ! empty($_SERVER['HTTPS']) ? 's' : '' ) . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . ( ( empty($_GET) ) ? '' : '?' . http_build_query($_GET) );\n }", "public static function curURL() {\n\t\t\t$pageURL = 'http';\n\t\t\tif ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n\t\t\t\t$pageURL .= \"://\";\n\t\t\tif ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER['PHP_SELF'];\n\t\t\t} else {\n\t\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\"/\";\n\t\t\t}\n\t\t\treturn $pageURL;\n\t\t}", "public static function current_page_url() {\n\t\t$pageURL = 'http';\n\t\tif (!empty($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n\t\t$pageURL .= \"://\";\n\t\tif ($_SERVER[\"SERVER_PORT\"] != \"80\" && $_SERVER[\"SERVER_PORT\"] != \"443\" ) {\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n\t\t} else {\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n\t\t}\n\t\treturn $pageURL;\t\t\n\t}", "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}", "private function get_current_url() {\n if ( $this->cur_url !== '' ) {\n return $this->cur_url;\n }\n\n $server_name = preg_replace('/^www\\./i', '', $_SERVER[ \"SERVER_NAME\" ]);\n\n if ( !in_array( $_SERVER[ \"SERVER_PORT\" ], array( \"80\", \"443\" ) ) ) {\n $this->cur_url = trailingslashit( $server_name . \":\" . $_SERVER[ \"SERVER_PORT\" ] . $_SERVER[ \"REQUEST_URI\" ] );\n } else {\n $this->cur_url = trailingslashit( $server_name . $_SERVER[ \"REQUEST_URI\" ] );\n }\n return $this->cur_url;\n }", "public function getSelfLink()\n {\n return isset($this->self_link) ? $this->self_link : '';\n }", "public function getCurrentURL()\n {\n return $this->getBaseUrl() . $this->getURI();\n }", "function CurrentPageURL() \n{\n\t$pageURL = \"https://\";\n\tif(strpos(strtolower($_SERVER['SERVER_PROTOCOL']),\"https\") === false) $pageURL = \"http://\";\n\t$pageURL .= $_SERVER['SERVER_PORT'] != '80' ? $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"] : $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n\treturn $pageURL;\n}", "function get_current_url(){\n return $url = \"http://\" . $_SERVER['HTTP_HOST'] .$_SERVER['REQUEST_URI'];\n}", "function getCurrentURL() {\r\n\t$currentURL = basename($_SERVER[\"PHP_SELF\"]);\r\n\t$i = 0;\r\n\tforeach($_GET as $key => $value) {\r\n\t\t$i++;\r\n\t\tif($i == 1) { $currentURL .= \"?\"; }\r\n\t\telse { $currentURL .= \"&amp;\"; }\r\n\t\t$currentURL .= $key.\"=\".$value;\r\n\t}\r\n\treturn $currentURL;\r\n}", "public static function getCurrentUrl() : string {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__);\n\n\t\t$current_page_url = 'http';\n\n\t\tif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {\n\t\t\t$current_page_url .= 's';\n\t\t}\n\n\t\t$current_page_url .= '://';\n\n\t\tif ($_SERVER['SERVER_PORT'] != '80') {\n\t\t\t$current_page_url .= $_SERVER['HTTP_HOST'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n\t\t} else {\n\t\t\t$current_page_url .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $current_page_url);\n\t\t$current_page_url = self::_applyFilter(get_class(), __FUNCTION__, $current_page_url, array('event' => 'return'));\n\n\t\treturn $current_page_url;\n\t}", "function url()\n\t{\n\t\t$id\t\t= $this->attribute('id');\n\t\t$page\t= $this->pyrocache->model('pages_m', 'get', array($id));\n\n\t\treturn site_url($page ? $page->uri : '');\n\t}", "function getCurrentURL() {\n return \"http://\".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n}", "function acadp_get_current_url() {\n\n $current_url = ( isset( $_SERVER[\"HTTPS\"] ) && $_SERVER[\"HTTPS\"] == \"on\" ) ? \"https://\" : \"http://\";\n $current_url .= $_SERVER[\"SERVER_NAME\"];\n if( $_SERVER[\"SERVER_PORT\"] != \"80\" && $_SERVER[\"SERVER_PORT\"] != \"443\" ) {\n $current_url .= \":\".$_SERVER[\"SERVER_PORT\"];\n }\n $current_url .= $_SERVER[\"REQUEST_URI\"];\n\n return $current_url;\n\n}", "function aitch( $href, $absolute = FALSE ){\n\t\tif( $absolute )\n\t\t\treturn AitchRef::_site_url_absolute( $href );\n\t\telse\n\t\t\treturn AitchRef::_site_url( $href );\n\t}", "function current_url() {\n return CAsdf::Instance()->request->current_url;\n}", "function getHref()\n\t{\n\t\treturn $this->xl_href;\n\t}", "private function get_current_page_url() {\n $url = (isset($_SERVER[\"HTTPS\"]) && $_SERVER[\"HTTPS\"] == 'on') ? 'https://' : 'http://';\n $url .= $_SERVER['SERVER_NAME'];\n $url .= $_SERVER['SERVER_PORT'] == 80 ? $_SERVER['REQUEST_URI'] : ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n\n return $url;\n }", "function realanswers_current_page_url() {\r\n $pageURL = (@$_SERVER[\"HTTPS\"] == \"on\") ? \"https://\" : \"http://\";\r\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"] . \":\" . $_SERVER[\"SERVER_PORT\"] . $_SERVER[\"REQUEST_URI\"];\r\n }\r\n else\r\n {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\r\n }\r\n return $pageURL;\r\n}", "function curPageURL($mode=1) {\n if($mode){\n $pageURL = 'http';\n if ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n $pageURL .= \"://\";\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n } else {\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n } \n }\n else{\n $pageURL = $_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'];\n }\nreturn str_replace(substr($pageURL,strripos($pageURL,'/')+1),'',$pageURL);\n}", "static function currentURL(){\n $protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') === FALSE ? 'http' : 'https';\n $host = $_SERVER['HTTP_HOST'];\n $script = $_SERVER['SCRIPT_NAME'];\n $params = $_SERVER['QUERY_STRING'];\n\n return $protocol . '://' . $host . $script . '?' . $params;\n }", "static function curPageURL() \n\t\t{\n\t\t\t$pageURL = 'http';\n\t\t\tif ($_SERVER[\"HTTPS\"] == \"on\")\n\t\t\t{\n\t\t\t\t$pageURL .= \"s\";\n\t\t\t}\n\t\t\t$pageURL .= \"://\";\n\t\t\tif ($_SERVER[\"SERVER_PORT\"] != \"80\") \n\t\t\t{\n\t\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n\t\t\t}\n\t\t\treturn $pageURL;\n\t\t}", "public function currentURL()\n {\n if(!isset($_SERVER['REQUEST_URI']))\n {\n return '';\n }\n $requestURI = $_SERVER['REQUEST_URI'];\n if($requestURI[0] === '/')\n {\n $requestURI = substr($requestURI, 1);\n }\n return 'http'.(isset($_SERVER['HTTPS'])?'s':'').'://'.$_SERVER['HTTP_HOST'].'/'.$requestURI;\n }", "function atkHref($url, $name=\"\", $sessionstatus=SESSION_DEFAULT, $saveform=false, $extraprops=\"\")\n{\n\treturn atkSessionManager::href($url, $name, $sessionstatus, $saveform, $extraprops);\n}", "public function link() { return site_url().'/'.$this->post->post_name; }", "public function URL()\n\t{\n\t\treturn $this->isHomePage() ? \\URL::to('/') : \\URL::to($this->uri);\n\t}", "function tp_get_current_url() {\r\n\t$requested_url = ( !empty($_SERVER['HTTPS'] ) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';\r\n\t$requested_url .= $_SERVER['HTTP_HOST'];\r\n\t$requested_url .= $_SERVER['REQUEST_URI'];\r\n\treturn $requested_url;\r\n}", "function tag_href($selector, $text = '', $source = false)\r\n{\r\n $t = tags_href($selector, $text, $source);\r\n if ($t) $r = reset($t);\r\n else $r='';\r\n\r\n if (DEV)\r\n xlogc('tag_href', $r, $selector, $text, $source);\r\n\r\n return $r;\r\n}", "private function getURL(){\n if(!empty($_SERVER['REQUEST_URI'])){\n return trim($_SERVER['REQUEST_URI'],'/');\n }\n }", "public function getCurrentPageURL() {\n\t\t\t$pageURL = 'http';\n\t\t\tif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == \"on\") {\n\t\t\t\t$pageURL .= \"s\";\n\t\t\t}\n\t\t\t$pageURL .= \"://\";\n\t\t\tif ($_SERVER['SERVER_PORT'] != 80) {\n\t\t\t\t$pageURL .= $_SERVER['SERVER_NAME'] . \":\" . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n\t\t\t}\n\t\t\treturn $pageURL;\n\t\t}", "public function jumpUrl() {}", "public function getCurrentUrl()\n {\n return $this->_currentUrl;\n }", "private function curPageURL() {\r\n $pageURL = 'http';\r\n if ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\r\n $pageURL .= \"://\";\r\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\r\n } else {\r\n $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\r\n }\r\n return $pageURL;\r\n }", "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 }", "function link_to_home_page($text = null, $props = array())\n{\n if (!$text) {\n $text = option('site_title');\n }\n return '<a href=\"' . html_escape(WEB_ROOT) . '\" '. tag_attributes($props) . '>' . $text . \"</a>\\n\";\n}", "function current_url()\n{\n $now_url = '';\n $url = get_url();\n if (!empty($url)) {\n foreach ($url as $route) {\n $now_url .= $route . '/';\n }\n return URL . $now_url;\n } else {\n return URL . $now_url;\n }\n}", "function cjpopups_current_url($only_url = null, $port = null){\n\t$pageURL = (is_ssl()) ? \"https://\" : \"http://\";\n\tif ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t\tif(is_null($port)){\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"] . \":\" . $_SERVER[\"SERVER_PORT\"] . $_SERVER[\"REQUEST_URI\"];\n\t\t}else{\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\n\t\t}\n\t} else {\n\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\n\t}\n\tif(is_null($only_url)){\n\t\treturn $pageURL;\n\t}else{\n\t\t$url = explode('?', $pageURL);\n\t\treturn $url[0];\n\t}\n}", "function curPageURL() {\n\t $pageURL = 'http';\n\t if ($_SERVER[\"HTTPS\"] == \"on\") {$pageURL .= \"s\";}\n\t $pageURL .= \"://\";\n\t if ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t $pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n\t } else {\n\t $pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n\t }\n\t return $pageURL;\n}", "protected function pakHrefAttr(): string\n {\n return \"href='{$this->link}'\";\n }", "function curPageURL() \n\t{\n\t\t$pageURL = 'http';\n\t\tif ($_SERVER[\"HTTPS\"] == \"on\") \n\t\t{\n\t\t\t$pageURL .= \"s\";\n\t\t}\n\t\t$pageURL .= \"://\";\n\t\tif ($_SERVER[\"SERVER_PORT\"] != \"80\") \n\t\t{\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n\t\t}\n\t\treturn $pageURL;\n\t}", "public function nomepaginaoriginale(){\n\t\t$url=basename($_SERVER['PHP_SELF']);\n\t\treturn $url;\n\t}", "public function getUrl()\n\t{\n\t\treturn App\\Purifier::decodeHtml($this->get('linkto'));\n\t}", "public function Link()\n {\n return $this->Url;\n }", "function url ($link) {\r\n\treturn $link;\r\n}", "function getURL()\r\n\t{\r\n\t\treturn \"http://www.iai.com\";\r\n\t}", "public function current_url()\n\t{\n\t\treturn urldecode($this->connection()->get('url'));\n\t}", "public function url()\n\t{\n\t\t\n\t\t$lang = Config::get('app.locale');\n\t\t$route_prefix = ($lang == \"ar\" ? \"ar/\" : \"\");\t\t\n\t\treturn Url::to($route_prefix .'page/' .$this->link);\n\t}", "public function link() {\n return isset($this->_adaptee->user_info['user_username']) ? \"profile.php?user=\".$this->_adaptee->user_info['user_username'] : null;\n }", "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}", "function isCurrent() {\r\n if ($this->_link == $_SERVER['PHP_SELF']) {\r\n return true;\r\n }\r\n elseif ($this->_link == str_replace('index.php', '', $_SERVER['PHP_SELF'])) {\r\n return true;\r\n }\r\n elseif ($this->_link == $_SERVER['REQUEST_URI']) {\r\n return true;\r\n }\r\n return false;\r\n }" ]
[ "0.71654814", "0.6914642", "0.69080186", "0.6696705", "0.65592486", "0.65234756", "0.6469309", "0.64577323", "0.6408903", "0.6395895", "0.6372332", "0.6351108", "0.6351108", "0.6351108", "0.6345952", "0.63250715", "0.6324245", "0.63010806", "0.62874025", "0.62874025", "0.62624353", "0.6262194", "0.62568605", "0.6230911", "0.6230752", "0.6229556", "0.6197936", "0.61947435", "0.6182241", "0.6142847", "0.61422503", "0.61422503", "0.61289907", "0.61282873", "0.61282873", "0.61282873", "0.61282873", "0.61282873", "0.61282873", "0.61222786", "0.6109521", "0.6104823", "0.6104823", "0.60958797", "0.6061178", "0.60374343", "0.6020859", "0.60193515", "0.5999843", "0.5994753", "0.59930146", "0.599154", "0.5984852", "0.59823936", "0.59797543", "0.59701395", "0.5931742", "0.59214586", "0.59156865", "0.59079874", "0.58903193", "0.5890136", "0.5889653", "0.58867735", "0.58744824", "0.58711004", "0.58629674", "0.5859068", "0.58567744", "0.5855452", "0.5855379", "0.58452994", "0.58309084", "0.58277696", "0.58214515", "0.58102685", "0.5805703", "0.58017457", "0.5794708", "0.5793246", "0.57868457", "0.5777544", "0.5762571", "0.5751922", "0.5743797", "0.5733971", "0.5730179", "0.572832", "0.5725508", "0.5723784", "0.57215315", "0.5715868", "0.5713212", "0.57129794", "0.5710161", "0.57082963", "0.5706022", "0.5702971", "0.5699559", "0.5696441", "0.5695144" ]
0.0
-1
Run the database seeds.
public function run() { $provincias = [ [ "des_provincia" => "Chachapoyas", "cod_provincia" => "0101", "est_provincia" => true, "id_departamento" => 1 ], [ "des_provincia" => "Condorcanqui", "cod_provincia" => "0104", "est_provincia" => true, "id_departamento" => 1 ], [ "des_provincia" => "Chincha", "cod_provincia" => "1102", "est_provincia" => true, "id_departamento" => 2 ], [ "des_provincia" => "Nasca", "cod_provincia" => "1103", "est_provincia" => true, "id_departamento" => 2 ], [ "des_provincia" => "Huaura", "cod_provincia" => "1508", "est_provincia" => true, "id_departamento" => 3 ], [ "des_provincia" => "Canta", "cod_provincia" => "1504", "est_provincia" => true, "id_departamento" => 4 ] ]; foreach ($provincias as $provincia) { \DB::table('zprovincia')->insert($provincia); } }
{ "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
Must run before BracesFixer, ClassAttributesSeparationFixer, ConstructorEmptyBracesFixer, MultilinePromotedPropertiesFixer, NoExtraBlankLinesFixer, ReadonlyPromotedPropertiesFixer.
public function getPriority(): int { return 56; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fixLineSpacing($lines)\n {\n $propertiesOnly = false;\n // remove blank lines between properties\n $skip = true;\n $level = 0;\n foreach ($lines as $i => $line) {\n if (strpos($line, 'class ') !== false) {\n $skip = false;\n }\n if ($skip) {\n continue;\n }\n\n // keep spaces in multi line arrays\n if (strpos($line, '*') === false && strncmp(trim($line), \"'SQLSTATE[\", 10) !== 0) {\n $level += substr_count($line, '[') - substr_count($line, ']');\n }\n\n if (trim($line) === '') {\n if ($level == 0) {\n unset($lines[$i]);\n }\n } elseif (ltrim($line)[0] !== '*' && strpos($line, 'function ') !== false) {\n break;\n } elseif (trim($line) === '}') {\n $propertiesOnly = true;\n break;\n }\n }\n $lines = array_values($lines);\n\n // add back some\n $endofUse = false;\n $endofConst = false;\n $endofPublic = false;\n $endofProtected = false;\n $endofPrivate = false;\n $skip = true;\n $level = 0; // track array properties\n $property = '';\n foreach ($lines as $i => $line) {\n if (strpos($line, 'class ') !== false) {\n $skip = false;\n }\n if ($skip) {\n continue;\n }\n\n // check for multi line array\n if ($level > 0) {\n ${'endof' . $property} = $i;\n }\n\n $line = trim($line);\n if (strncmp($line, 'public $', 8) === 0 || strncmp($line, 'public static $', 15) === 0) {\n $endofPublic = $i;\n $property = 'Public';\n $level = 0;\n } elseif (strncmp($line, 'protected $', 11) === 0 || strncmp($line, 'protected static $', 18) === 0) {\n $endofProtected = $i;\n $property = 'Protected';\n $level = 0;\n } elseif (strncmp($line, 'private $', 9) === 0 || strncmp($line, 'private static $', 16) === 0) {\n $endofPrivate = $i;\n $property = 'Private';\n $level = 0;\n } elseif (strpos($line, 'const ') === 0) {\n $endofConst = $i;\n $property = false;\n } elseif (strpos($line, 'use ') === 0) {\n $endofUse = $i;\n $property = false;\n } elseif (strpos($line, '*') === 0) {\n $property = false;\n } elseif (strpos($line, '*') !== 0 && strpos($line, 'function ') !== false || $line === '}') {\n break;\n }\n\n // check for multi line array\n if ($property !== false && strncmp($line, \"'SQLSTATE[\", 10) !== 0) {\n $level += substr_count($line, '[') - substr_count($line, ']');\n }\n }\n\n $endofAll = false;\n foreach (['Private', 'Protected', 'Public', 'Const', 'Use'] as $var) {\n if (${'endof' . $var} !== false) {\n $endofAll = ${'endof' . $var};\n break;\n }\n }\n\n// $this->checkPropertyOrder($lineInfo);\n $result = [];\n foreach ($lines as $i => $line) {\n $result[] = $line;\n if (!($propertiesOnly && $i === $endofAll)) {\n if ($i === $endofUse || $i === $endofConst || $i === $endofPublic ||\n $i === $endofProtected || $i === $endofPrivate) {\n $result[] = '';\n }\n if ($i === $endofAll) {\n $result[] = '';\n }\n }\n }\n\n return $result;\n }", "private function parseProperties(): void\n {\n $properties = $this->extractProperties();\n\n foreach ($properties as $property)\n {\n if ($property['docblock']===null)\n {\n $docId = null;\n }\n else\n {\n $docId = PhpAutoDoc::$dl->padDocblockInsertDocblock($property['docblock']['doc_line_start'],\n $property['docblock']['doc_line_end'],\n $property['docblock']['doc_docblock']);\n }\n\n PhpAutoDoc::$dl->padClassInsertProperty($this->clsId,\n $docId,\n $property['name'],\n Cast::toManInt($property['is_static']),\n $property['visibility'],\n $property['value'],\n $property['start'],\n $property['end']);\n }\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->phpCsFixerBinary = Path::osStyle(base_path('vendor/bin/php-cs-fixer'));\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->testedObject = new ForbidDoubledWhitespaceSniff();\n }", "private function cleanUp() : void\n {\n\n // For every line.\n foreach ($this->contents as $lineId => $line) {\n\n // Test.\n preg_match('/( +)(\\*)( )(.+)/', $line, $output);\n\n // First option - this is proper comment line.\n // Second option - sth is wrong - ignore this line.\n if (isset($output[4]) === true && empty($output[4]) === false) {\n $this->contents[$lineId] = $output[4];\n } else {\n unset($this->contents[$lineId]);\n }\n }\n }", "public function fix() {}", "public function fix() {}", "function pre_save_field($field) {\n // Convert styles into array\n $classes_lines = explode(\"\\n\", $field['classes']);\n $classes = array();\n foreach ($classes_lines as $line) {\n $p = explode( ' : ', trim($line) );\n if( count($p) > 1 ) {\n $classes[ $p[0] ] = $p[1];\n } elseif( strlen($p[0]) > 0 ) {\n $classes[ $p[0] ] = $p[0];\n } // else don't put empty lines in\n }\n $field['classes'] = $classes;\n\n\n return parent::pre_save_field($field);\n }", "function testInternal2() \n {\n $this->assertTrue(array_key_exists(T_COMMENT, $this->oBeaut->aTokenFunctions));\n }", "public static function additionalCleaning() {\n \n }", "public function shouldSkipUnknownProperties() {}", "protected function mergeWhiteList() {\n\t\tif ( $this->customPropertiesWhitelist !== $this->addedCustomProperties['properties'] ) {\n\t\t\t// Fix property potentially passed as comma-delimited string.\n\t\t\t$customProperties = Sniff::merge_custom_array( $this->customPropertiesWhitelist, array(), false );\n\n\t\t\t$this->whitelisted_mixed_case_member_var_names = Sniff::merge_custom_array(\n\t\t\t\t$customProperties,\n\t\t\t\t$this->whitelisted_mixed_case_member_var_names\n\t\t\t);\n\n\t\t\t$this->addedCustomProperties['properties'] = $this->customPropertiesWhitelist;\n\t\t}\n\t}", "public function allowProperties() {}", "protected function setUp()\n {\n if (self::$phpcs === null) { // erreur : 2 espace apres ===\n self::$phpcs=new PHP_CodeSniffer(); // erreur : pas d'espace autour de = \n }\n\n }", "function upgrade_430_fix_comments()\n {\n }", "public function before()\n {\n if ($this->_config === null) {\n return;\n }\n foreach ($this->_config as $property => $value) {\n if (property_exists($this, $property)) {\n $this->{$property} = $value;\n }\n }\n }", "private function fixSpaceAboveMethod(Tokens $tokens, $classStart, $methodIndex)\n {\n static $methodAttr = [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_ABSTRACT, T_FINAL, T_STATIC];\n\n // find out where the method signature starts\n $firstMethodAttrIndex = $methodIndex;\n for ($i = $methodIndex; $i > $classStart; --$i) {\n $nonWhiteAbove = $tokens->getNonWhitespaceSibling($i, -1);\n if (null !== $nonWhiteAbove && $tokens[$nonWhiteAbove]->isGivenKind($methodAttr)) {\n $firstMethodAttrIndex = $nonWhiteAbove;\n } else {\n break;\n }\n }\n\n // deal with comments above a method\n if ($tokens[$nonWhiteAbove]->isGivenKind(T_COMMENT)) {\n if (1 === $firstMethodAttrIndex - $nonWhiteAbove) {\n // no white space found between comment and method start\n $this->correctLineBreaks($tokens, $nonWhiteAbove, $firstMethodAttrIndex, 1);\n\n return;\n }\n\n // $tokens[$nonWhiteAbove+1] is always a white space token here\n if (substr_count($tokens[$nonWhiteAbove + 1]->getContent(), \"\\n\") > 1) {\n // more than one line break, always bring it back to 2 line breaks between the method start and what is above it\n $this->correctLineBreaks($tokens, $nonWhiteAbove, $firstMethodAttrIndex, 2);\n\n return;\n }\n\n // there are 2 cases:\n if ($tokens[$nonWhiteAbove - 1]->isWhitespace() && substr_count($tokens[$nonWhiteAbove - 1]->getContent(), \"\\n\") > 0) {\n // 1. The comment is meant for the method (although not a PHPDoc),\n // make sure there is one line break between the method and the comment...\n $this->correctLineBreaks($tokens, $nonWhiteAbove, $firstMethodAttrIndex, 1);\n // ... and make sure there is blank line above the comment (with the exception when it is directly after a class opening)\n $nonWhiteAbove = $this->findCommentBlockStart($tokens, $nonWhiteAbove);\n $nonWhiteAboveComment = $tokens->getNonWhitespaceSibling($nonWhiteAbove, -1);\n\n $this->correctLineBreaks($tokens, $nonWhiteAboveComment, $nonWhiteAbove, $nonWhiteAboveComment === $classStart ? 1 : 2);\n } else {\n // 2. The comment belongs to the code above the method,\n // make sure there is a blank line above the method (i.e. 2 line breaks)\n $this->correctLineBreaks($tokens, $nonWhiteAbove, $firstMethodAttrIndex, 2);\n }\n\n return;\n }\n\n // deal with method without a PHPDoc above it\n if (false === $tokens[$nonWhiteAbove]->isGivenKind(T_DOC_COMMENT)) {\n $this->correctLineBreaks($tokens, $nonWhiteAbove, $firstMethodAttrIndex, $nonWhiteAbove === $classStart ? 1 : 2);\n\n return;\n }\n\n // there should be one linebreak between the method signature and the PHPDoc above it\n $this->correctLineBreaks($tokens, $nonWhiteAbove, $firstMethodAttrIndex, 1);\n\n // there should be one blank line between the PHPDoc and whatever is above (with the exception when it is directly after a class opening)\n $nonWhiteAbovePHPDoc = $tokens->getNonWhitespaceSibling($nonWhiteAbove, -1);\n $this->correctLineBreaks($tokens, $nonWhiteAbovePHPDoc, $nonWhiteAbove, $nonWhiteAbovePHPDoc === $classStart ? 1 : 2);\n }", "public function skipUnknownProperties() {}", "function _style_fix()\n {\n }", "public function testMissingNewLineCharException()\r\n\t{\r\n\t\tnew Delimiters(\"//abcde1abcde2\");\r\n\t}", "public function testWhiteSpaceScopeIndent(): void\n {\n // NOT use tabs for indenting.\n\n $foo = 'bar';\n }", "function shouldSkipUnknownProperties() ;", "public function testLineIntrospection() {\n\t\t$backup = error_reporting();\n\t\terror_reporting(E_ALL);\n\n\t\t$result = Inspector::lines(__FILE__, [__LINE__ - 4]);\n\t\t$expected = [__LINE__ - 5 => \"\\tpublic function testLineIntrospection() {\"];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = Inspector::lines(__CLASS__, [18]);\n\t\t$expected = [18 => 'class InspectorTest extends \\lithium\\test\\Unit {'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$lines = 'This is the first line.' . PHP_EOL . 'And this the second.';\n\t\t$result = Inspector::lines($lines, [2]);\n\t\t$expected = [2 => 'And this the second.'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$this->assertException('/(Missing argument 2|Too few arguments.*1 passed.*2 expected)/', function() {\n\t\t\tInspector::lines('lithium\\core\\Foo');\n\t\t});\n\t\t$this->assertNull(Inspector::lines(__CLASS__, []));\n\n\t\terror_reporting($backup);\n\t}", "protected function setUp(): void {\n $this->parser = new PropertyParser();\n }", "public function setUp()\n {\n $this->faker = Factory::create();\n\n $reader = new PhpDocReader();\n\n foreach (array_keys(get_object_vars($this)) as $propertyName) {\n if (self::MOCK_SUFFIX !== substr($propertyName, -strlen(self::MOCK_SUFFIX))) {\n continue;\n }\n\n $property = new \\ReflectionProperty(static::class, $propertyName);\n $propertyClass = $reader->getPropertyClass($property);\n\n $this->$propertyName = $this->prophesize($propertyClass);\n }\n }", "public function testProfilePrototypeExistsComments()\n {\n\n }", "public function __construct() {\n $this->addSymbol(new SimpleSymbol(self::FIELD_SEPARATOR));\n $this->addSymbol(new NestedExpressionSymbol());\n\n parent::setWillTrimTokens(true);\n }", "public function skipProperties() {}", "function it_allows_for_custom_delimeters_1_3_4()\n {\n $this->add('//;\\n1;3;4')->shouldEqual(8);\n }", "public function testTestWhitespaceBeforeOpentag()\n {\n copy(__DIR__ . '/functional_dirty/Test_whitespace_before_opentag.php', $this->folder_final . '/Test.php'); // make file dirty\n $res = $this->callFormatter('check-git');\n $this->assertEquals(1, $res['code']); // has errors\n $this->assertStringMatchesFormat(\"Test.php issues:%a\", $res['out']);\n $res = $this->callFormatter(\"apply-git\");\n $this->assertEquals(0, $res['code']);\n $this->assertStringMatchesFormat(\"Test.php formatted successfully%a\", $res['out']);\n $res = $this->callFormatter(\"check-git\");\n $this->assertEquals(0, $res['code']); // all right\n }", "protected function _refine() {\n\n\t}", "protected function assertMissingDelimitation()\n {\n }", "public static function setUpBeforeClass()\n {\n self::$overrideToken = [];\n self::$overrideToken['addDocRootToPath'] = $token = override_method('\\Gustavus\\Concert\\Utility', 'addDocRootToPath', function($filePath) use (&$token) {\n if (strpos($filePath, '/cis/lib/') === 0) {\n return $filePath;\n }\n return call_overridden_func($token, null, $filePath);\n }\n );\n parent::setUpBeforeClass();\n }", "public function test_property_docblocks() {\n\n\t\t$this->assertPropertyHasDocs(\n\t\t\t'Test_Class'\n\t\t\t, '$a_string'\n\t\t\t, array( 'description' => 'This is a docblock for a class property.' )\n\t\t);\n\t}", "public function testCorrectTabSpacing() {\n\t\t$code = <<<EOD\narray(\n\t'foobar' => 'bar',\n\t'foo'\t => 'bar',\n);\nEOD;\n\t\t$this->assertRulePass($code, $this->rule);\n\t}", "protected function preprocessInternal()\n\t{\n\t\t// void\n\t}", "public static function setUpBeforeClass()\n {\n self::$minifiedFolderBackup = JSMin::$minifiedFolder;\n self::$minifiedCSSFolderBackup = CSSMin::$minifiedFolder;\n JSMin::$minifiedFolder = '/cis/lib/Gustavus/Resources/Test/files/min/';\n CSSMin::$minifiedFolder = '/cis/lib/Gustavus/Resources/Test/files/min/css/';\n\n $addDocRootToken = override_method('\\Gustavus\\Resources\\Resource', 'addDocRootToPath', function($filePath) use(&$addDocRootToken) {\n if (strpos($filePath, '/cis/lib') !== false) {\n return $filePath;\n }\n return call_overridden_func($addDocRootToken, null, $filePath);\n });\n\n self::$overrideToken['addDocRootToPath'] = $addDocRootToken;\n }", "protected function setUp() : void\n {\n parent::setUp();\n\n PreParser::reset();\n }", "protected function before() {\n\t\t// Empty default implementation. Should be implemented by descendant classes if needed\n\t}", "protected function setUp()\n\t{\n\t\t// $this->object = new SimplePhpParser(&$functions);\n\t\t$this->object = new SimplePhpParser();\n\t}", "public function beforeRules(): void\n {\n }", "function it_allows_for_custom_delimeters_1_2_3()\n {\n $this->add('//;\\n1;2;3')->shouldEqual(6);\n }", "public function __construct()\n {\n $this->properties = [];\n $this->methods = [];\n $this->comment = null;\n $this->interfaces = [];\n $this->name = null;\n $this->shortName = null;\n $this->signature = null;\n $this->reflectionClass = null;\n }", "public function testConstruct() {\n\n $obj = new SyntaxHighlighterConfig();\n\n $this->assertFalse($obj->getBloggerMode());\n $this->assertNull($obj->getStrings());\n $this->assertFalse($obj->getStripBrs());\n $this->assertEquals(\"pre\", $obj->getTagName());\n }", "protected function fixDocBlockIndentation(&$lines)\n {\n $docBlock = false;\n $codeBlock = false;\n $listIndent = '';\n $tag = false;\n $indent = '';\n foreach ($lines as $i => $line) {\n if (preg_match('~^(\\s*)/\\*\\*$~', $line, $matches)) {\n $docBlock = true;\n $indent = $matches[1];\n } elseif (preg_match('~^(\\s*)\\*+/~', $line)) {\n if ($docBlock) { // could be the end of normal comment\n $lines[$i] = $indent . ' */';\n }\n $docBlock = false;\n $codeBlock = false;\n $listIndent = '';\n $tag = false;\n } elseif ($docBlock) {\n $line = ltrim($line);\n if (strpos($line, '*') === 0) {\n $line = substr($line, 1);\n }\n if (strpos($line, ' ') === 0) {\n $line = substr($line, 1);\n }\n $docLine = str_replace(\"\\t\", ' ', rtrim($line));\n if (empty($docLine)) {\n $listIndent = '';\n } elseif (strpos($docLine, '@') === 0) {\n $listIndent = '';\n $codeBlock = false;\n $tag = true;\n $docLine = preg_replace('/\\s+/', ' ', $docLine);\n $docLine = $this->fixParamTypes($docLine);\n } elseif (preg_match('/^(~~~|```)/', $docLine)) {\n $codeBlock = !$codeBlock;\n $listIndent = '';\n } elseif (preg_match('/^(\\s*)([0-9]+\\.|-|\\*|\\+) /', $docLine, $matches)) {\n $listIndent = str_repeat(' ', \\strlen($matches[0]));\n $tag = false;\n $lines[$i] = $indent . ' * ' . $docLine;\n continue;\n }\n if ($codeBlock) {\n $lines[$i] = rtrim($indent . ' * ' . $docLine);\n } else {\n $lines[$i] = rtrim($indent . ' * ' . (empty($listIndent) && !$tag ? $docLine : ($listIndent . ltrim($docLine))));\n }\n }\n }\n }", "public function fixExtraSpaces(AbstractFile $file)\n {\n $firstBlank = false;\n foreach ($file as $line) {\n if (false == $firstBlank && $line->match('^ *$')) {\n $firstBlank = true;\n continue;\n }\n\n if (!$line->match('^$')) {\n $firstBlank = false;\n }\n\n if ($firstBlank && $line->match('^$')) {\n $line->delete();\n continue;\n }\n }\n\n foreach ($file->findLines('function') as $line) {\n if (!$endToken = $line->tokenizeBetween('{', '}')->last()) {\n continue;\n }\n if ($endToken->getLine()->nextLine()) {\n if (\n !$endToken->getLine()->nextLine()->match('^ *$')\n && !$endToken->getLine()->nextLine()->match('^ *} *$')\n ) {\n $file->addLineAfter($endToken->getLine(), '');\n }\n }\n }\n }", "function getStylePropertiesFromInlineStyleCode($code) {\r\n\t$code = preg_replace('/\\/\\*.*\\*\\//s', '', $code);\r\n\tpreg_match_all('/([^:;]*)\\s*:\\s*([^:;]*)\\s*\\;/', $code, $matches);\r\n\t$cleanedProperties = array();\r\n\t$cleanedPropertyValues = array();\t\r\n\t// remove extra spaces (including line breaks)\t\r\n\tforeach($matches[1] as $match) {\r\n\t\t$match = preg_replace('/\\r\\n/', ' ', $match);\r\n\t\t$match = preg_replace('/\\s+/', ' ', $match);\r\n\t\t$match = trim($match);\r\n\t\t$cleanedProperties[] = $match;\r\n\t}\r\n\tforeach($matches[2] as $match) {\r\n\t\t$match = preg_replace('/\\r\\n/', ' ', $match);\r\n\t\t$match = preg_replace('/\\s+/', ' ', $match);\r\n\t\t$match = trim($match);\r\n\t\t$cleanedPropertyValues[] = $match;\t\t\r\n\t}\t\r\n\t$ArrayOfStyleProperties = array($cleanedProperties, $cleanedPropertyValues);\r\n\treturn $ArrayOfStyleProperties;\r\n}", "protected function setUp()\n {\n $this->object1 = new Comment();\n $this->object2 = new Comment(\"test-prefix\");\n $this->object3 = new Comment(\"test-prefix\", \"test-suffix\");\n }", "protected function cleanup()\n {\n $this->internalInliner->setHTML('');\n $this->internalInliner->setCSS('');\n }", "protected function fixSelf() {}", "protected function fixSelf() {}", "protected function setUp()\n {\n parent::setUp();\n $this->_tokenizer = new StandardTokenizer();\n }", "public static function setUpBeforeClass()\n {\n self::$overrideToken = [];\n self::$overrideToken['loadAndEvaluate'] = override_method('\\Gustavus\\Utility\\File', 'loadAndEvaluate', function() {\n // just return the contents of the file and don't evaluate it.\n return file_get_contents($this->value);\n }\n );\n self::$overrideToken['renderPageNotFound'] = override_method('\\Gustavus\\Utility\\PageUtil', 'renderPageNotFound', function() {\n // just return the contents of the file and don't evaluate it.\n return 'renderPageNotFound';\n }\n );\n parent::setUpBeforeClass();\n }", "protected function beforeMethod()\n {\n }", "private function parseConstants(): void\n {\n $constants = $this->extractConstants();\n foreach ($constants as $constant)\n {\n if ($constant['docblock']===null)\n {\n $docId = null;\n }\n else\n {\n $docId = PhpAutoDoc::$dl->padDocblockInsertDocblock($constant['docblock']['doc_line_start'],\n $constant['docblock']['doc_line_end'],\n $constant['docblock']['doc_docblock']);\n }\n\n PhpAutoDoc::$dl->padClassInsertConstant($this->clsId,\n $docId,\n $constant['name'],\n $constant['visibility'],\n $constant['value'],\n $constant['start'],\n $constant['end']);\n }\n }", "protected function setUp()\n {\n $this->aClosureObjectParser = new ClosureObjectParser ;\n }", "public function test_it_removes_delimiters() {\n $starttoken = css_processor::TOKEN_ENABLEOVERRIDES_START;\n $endtoken = css_processor::TOKEN_ENABLEOVERRIDES_END;\n\n $css = <<<EOF\n{$starttoken}SETTINGSCSS{$endtoken}\nCSS\n{$starttoken}SETTINGSCSS{$endtoken}\nEOF;\n\n $expected = <<<EOF\nSETTINGSCSS\nCSS\nSETTINGSCSS\nEOF;\n $actual = (new css_processor())->remove_delimiters($css);\n\n $this->assertEquals($expected, $actual);\n }", "abstract protected function getIgnoredLines(): array;", "private function parseQualifiers(): void\n {\n $n = preg_match('/^(?<qualifiers>(T_FINAL |T_ABSTRACT )*)(?<type>T_CLASS |T_INTERFACE |T_TRAIT )/',\n $this->tokens->asString(),\n $matches);\n\n if ($n==1)\n {\n PhpAutoDoc::$dl->padClassUpdateFlag($this->clsId,\n Cast::toManInt(TokenMatchHelper::isFinal($matches)),\n Cast::toManInt(TokenMatchHelper::isClass($matches)),\n Cast::toManInt(TokenMatchHelper::isAbstract($matches)),\n Cast::toManInt(TokenMatchHelper::isInterface($matches)),\n Cast::toManInt(TokenMatchHelper::isTrait($matches)),\n 1);\n }\n }", "protected function setUp()\n {\n \t$this->aStructKeywordToken = new Token(T_CLASS, 'class', 100) ;\n \t$this->aStructNameToken = new Token(T_STRING, 'SameClassName', 110) ;\n \t$this->aStructBodyToken = new ClosureToken(new Token(Token::T_BRACE_OPEN, '{', 120)) ;\n \t$this->aStructBodyEndToken = new ClosureToken(new Token(Token::T_BRACE_CLOSE, '}', 120)) ;\n \t$this->aStructBodyToken->setTheOther($this->aStructBodyEndToken) ;\n \t \t\n $this->aStructDefine = new MockStructDefine(\n \t\t$this->aStructKeywordToken\n \t\t, $this->aStructNameToken\n \t\t, $this->aStructBodyToken\n ) ;\n \n \t$aTokenPool = new TokenPool() ;\n \t$aTokenPool->add($this->aStructKeywordToken) ;\n \t$aTokenPool->add($this->aStructDefine) ;\n \t$aTokenPool->add($this->aStructNameToken) ;\n \t$aTokenPool->add($this->aStructBodyToken) ;\n \t$aTokenPool->add(new Token(T_STRING, 'hi world', 120)) ;\n \t$aTokenPool->add(new Token(T_STRING, '~~~', 120)) ;\n \t$aTokenPool->add($this->aStructBodyEndToken) ;\n }", "public function testIsThereAnySyntaxError(){\n $var = new Serversidebim\\IFCReader\\IFCStepReader(null);\n $this->assertTrue(is_object($var));\n unset($var);\n }", "protected function setUpPHPCS()\n {\n // Sniff file without testVersion as all checks run independently of testVersion being set.\n $this->sniffResult = $this->sniffFile(__FILE__);\n }", "public function testExtraGap3($param)\n {\n //Test wrong PHPDoc\n }", "public function provide_setStandardDecorators ( )\n {\n return array(\n array(),\n );\n\n }", "public function setUp() : void\n {\n $this->parser = new StringParser(new StringTokenizer());\n }", "public function __construct()\n {\n parent::__construct();\n $this->setSeparator(PHP_EOL);\n }", "public function skip_whitespace()\n {\n }", "protected function extraConstruct() {\n\t\t$this->something = 'something';\n\t}", "protected function setupDefaultsRules()\n { }", "public function test_linebreaks_removed() {\n\n\t\t$this->assertStringMatchesFormat(\n\t\t\t'%s'\n\t\t\t, $this->export_data['classes'][0]['doc']['long_description']\n\t\t);\n\t}", "public static function add_standard_properties() {\n\n\t\t// Set properties.\n\t\tself::$field->id = rgar( self::$nf_field, 'id' );\n\t\tself::$field->label = rgar( self::$nf_field, 'label' );\n\t\tself::$field->adminLabel = rgar( self::$nf_field, 'admin_label' );\n\t\tself::$field->isRequired = rgar( self::$nf_field, 'req' );\n\t\tself::$field->cssClass = rgar( self::$nf_field, 'class' );\n\t\tself::$field->defaultValue = rgar( self::$nf_field, 'default_value_type' ) === '_custom' || rgar( self::$nf_field, 'default_value_type' ) === '' ? rgar( self::$nf_field, 'default_value' ) : null;\n\n\t}", "function minify_css_lines($css)\n{\n // from the awesome CSS JS Booster: https://github.com/Schepp/CSS-JS-Booster\n // all credits to Christian Schaefer: http://twitter.com/derSchepp\n // remove comments\n $css = preg_replace('!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $css);\n // backup values within single or double quotes\n preg_match_all('/(\\'[^\\']*?\\'|\"[^\"]*?\")/ims', $css, $hit, PREG_PATTERN_ORDER);\n for ($i = 0, $iMax = count($hit[1]); $i < $iMax; $i++) {\n $css = str_replace($hit[1][$i], '##########' . $i . '##########', $css);\n }\n // remove traling semicolon of selector's last property\n $css = preg_replace('/;[\\s\\r\\n\\t]*?}[\\s\\r\\n\\t]*/ims', \"}\\r\\n\", $css);\n // remove any whitespace between semicolon and property-name\n $css = preg_replace('/;[\\s\\r\\n\\t]*?([\\r\\n]?[^\\s\\r\\n\\t])/ims', ';$1', $css);\n // remove any whitespace surrounding property-colon\n $css = preg_replace('/[\\s\\r\\n\\t]*:[\\s\\r\\n\\t]*?([^\\s\\r\\n\\t])/ims', ':$1', $css);\n // remove any whitespace surrounding selector-comma\n $css = preg_replace('/[\\s\\r\\n\\t]*,[\\s\\r\\n\\t]*?([^\\s\\r\\n\\t])/ims', ',$1', $css);\n // remove any whitespace surrounding opening parenthesis\n $css = preg_replace('/[\\s\\r\\n\\t]*{[\\s\\r\\n\\t]*?([^\\s\\r\\n\\t])/ims', '{$1', $css);\n // remove any whitespace between numbers and units\n $css = preg_replace('/([\\d\\.]+)[\\s\\r\\n\\t]+(px|em|pt|%)/ims', '$1$2', $css);\n // shorten zero-values\n $css = preg_replace('/([^\\d\\.]0)(px|em|pt|%)/ims', '$1', $css);\n // constrain multiple whitespaces\n $css = preg_replace('/\\p{Zs}+/ims', ' ', $css);\n // remove newlines\n $css = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), '', $css);\n // Restore backupped values within single or double quotes\n for ($i = 0, $iMax = count($hit[1]); $i < $iMax; $i++) {\n $css = str_replace('##########' . $i . '##########', $hit[1][$i], $css);\n }\n\n return $css;\n}", "protected function _ensureInheritedAttributes() {}", "public function noComment(): void // phpcs:ignore\n {\n // in the Route Enhancer.\n }", "public function moveAllOtherUserdefinedPropertiesToAdditionalArguments() {}", "public static function setUpBeforeClass()\n {\n self::$parser = new FullNameParser();\n parent::setUpBeforeClass();\n }", "protected function _checkDocBlocks() {\n\t\tfor ($i = 0; $i < count($this->tokens); $i++) {\n\t\t\tif ($this->tokens[$i][0] == T_VARIABLE || $this->tokens[$i][0] == T_FUNCTION) {\n\t\t\t\t// Get the previous tokens.\n\t\t\t\t// Max is 8, allows for abstract, scope, static markers.\n\t\t\t\t$leadingTokens = array();\n\t\t\t\t$leadingTokenTypes = array();\n\t\t\t\tfor ($j = 1; $j < 9; $j++) {\n\t\t\t\t\t\tif (!isset($this->tokens[$i - $j])) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$leadingTokens[$i - $j] = $this->tokens[$i - $j];\n\t\t\t\t\t\t$leadingTokenTypes[$i - $j] = $this->tokens[$i - $j][0];\n\t\t\t\t\t\t// Don't parse farther past if you run into another var/function.\n\t\t\t\t\t\tif (in_array($this->tokens[$i - $j][0], array(T_VARIABLE, T_FUNCTION))) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Check for a scope operator. Lack of one means we've hit a\n\t\t\t\t// closure or a non-class var that can be ignored.\n\t\t\t\t// Hit means this needs documentation.\n\t\t\t\t$scoped = in_array(T_PUBLIC, $leadingTokenTypes) ||\n\t\t\t\t in_array(T_PROTECTED, $leadingTokenTypes) ||\n\t\t\t\t in_array(T_PRIVATE, $leadingTokenTypes);\n\t\t\t\tif ($scoped && !in_array(T_DOC_COMMENT, $leadingTokenTypes)) {\n\t\t\t\t\t$this->_error($i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function firstLineIndentProvider()\n {\n return [[1]];\n }", "public function __construct() {\r\n $this->moveText = \"\";\r\n $this->tags = array();\r\n $this->parseErrors = array();\r\n }", "private function __construct() {\n ;\n }", "protected function checkReflectionDocComment() {}", "public function testExtraGap2($param)\n {\n //Test wrong PHPDoc\n }", "static function unittest_redefiningClassConstants () {\n PhlintTest::assertIssues('\n\n class A {\n const C1 = 1;\n const C2 = 2;\n }\n\n class B {\n const C2 = 3;\n const C2 = 4;\n }\n\n ', [\n 'Having multiple definitions for *C2* is prohibited on line 8.',\n 'Having multiple definitions for *C2* is prohibited on line 9.',\n ]);\n }", "protected function buildPropertyInfoAlter() {\n }", "protected function before(): void\n {\n }", "public function enableRemoveLineBreaksFromTemplate() {}", "public function testProfilePrototypeCreateComments()\n {\n\n }", "protected function before()\n {\n }", "public function fixObject(){\n\t\t//Ex : cadre et texte d'entete\n\t}", "private function loadPHPCodeSnifferConstants(): void\n {\n if (! defined('PHP_CODESNIFFER_VERBOSITY')) {\n // initalize token with INT type, otherwise php-cs-fixer and php-parser breaks\n if (! defined('T_MATCH')) {\n define('T_MATCH', 5000);\n }\n\n if (! defined('T_READONLY')) {\n define('T_READONLY', 5010);\n }\n\n if (! defined('T_ENUM')) {\n define('T_ENUM', 5015);\n }\n\n // for PHP_CodeSniffer\n define('PHP_CODESNIFFER_CBF', false);\n define('PHP_CODESNIFFER_VERBOSITY', 0);\n\n new Tokens();\n }\n }", "public function testConstructorErrorLocationNotWriteable()\n {\n return true;\n }", "public function testConstructorErrorLocationNotWriteable()\n {\n return true;\n }", "public function __construct()\n\t{\n\t\t$this->leading_context_lines = 0;\n\t\t$this->trailing_context_lines = 0;\n\t}", "public function allowAllProperties() {}", "private function parseMethods(): void\n {\n $methods = $this->extractMethods();\n\n foreach ($methods as $method)\n {\n if ($method['docblock']===null)\n {\n $docId = null;\n }\n else\n {\n $docId = PhpAutoDoc::$dl->padDocblockInsertDocblock($method['docblock']['doc_line_start'],\n $method['docblock']['doc_line_end'],\n $method['docblock']['doc_docblock']);\n }\n\n $mthId = PhpAutoDoc::$dl->padClassInsertMethod($this->clsId,\n $docId,\n $method['name'],\n Cast::toManInt($method['is_abstract']),\n Cast::toManInt(mb_strtolower($method['name'])=='__construct'),\n Cast::toManInt(mb_strtolower($method['name'])=='__destruct'),\n Cast::toManInt($method['is_final']),\n Cast::toManInt($method['is_static']),\n $method['visibility'],\n $method['start'],\n $method['end']);\n\n $this->parseMethodArguments($mthId, $method['tokens']);\n }\n }", "public function ugly() {\n $this->_pretty = false;\n }", "protected function setUp(): void\n {\n $this->parser = $this->newParser();\n }", "public function __construct ( /* void */ )\n {\n $this->clean();\n }", "protected static function _isFixedBugWithOldDataNullKey()\n {\n if (!defined('TESTS_MAGENTO_PATH')) {\n return true; // php_mage extension has non-buggy functionality\n }\n\n $reflectionMethod = new ReflectionMethod('Varien_Object', 'unsetOldData');\n $sourceClass = file($reflectionMethod->getFileName());\n $sourceMethod = array_slice($sourceClass, $reflectionMethod->getStartLine(),\n $reflectionMethod->getEndLine() - $reflectionMethod->getStartLine());\n $source = implode(\"\\n\", $sourceMethod);\n\n return strpos($source, '$this->_oldFieldsMap') !== false;\n }", "protected function checkForNecessaryProperties()\n {\n if (!property_exists($this, 'data')) {\n throw new IncompatibleParentClass('Parent class must implement $data property.');\n }\n }", "protected function _before()\n {\n }" ]
[ "0.6170937", "0.5680457", "0.53597164", "0.53462183", "0.5316342", "0.52737373", "0.5273142", "0.5169343", "0.5162056", "0.50389284", "0.50119174", "0.49977624", "0.49871767", "0.49527353", "0.4945857", "0.49429697", "0.49386066", "0.49326527", "0.48888472", "0.48877066", "0.48667678", "0.484668", "0.48434415", "0.48376596", "0.4807636", "0.4752642", "0.4751899", "0.47513014", "0.47354716", "0.47313046", "0.47293115", "0.47015932", "0.46986827", "0.4672211", "0.46640757", "0.4644296", "0.4640736", "0.46219552", "0.46155772", "0.4615403", "0.46124673", "0.46082243", "0.4602199", "0.45992675", "0.459862", "0.45974764", "0.4595029", "0.4594205", "0.45895526", "0.45793352", "0.45793352", "0.45704848", "0.45693976", "0.45661467", "0.4565107", "0.45624083", "0.45548707", "0.45533538", "0.455134", "0.4541854", "0.45365372", "0.45289046", "0.4521937", "0.4507448", "0.4506759", "0.4504", "0.4502561", "0.45024264", "0.45018673", "0.4501523", "0.44992113", "0.4493367", "0.44865176", "0.44833815", "0.44812012", "0.44808704", "0.4475101", "0.44704962", "0.44670275", "0.44661885", "0.4464787", "0.4449438", "0.4448009", "0.4443731", "0.44422036", "0.4440594", "0.4435271", "0.44336167", "0.44324204", "0.44304702", "0.44295847", "0.44295847", "0.4428622", "0.44280958", "0.4422366", "0.44149014", "0.44143507", "0.4412031", "0.4411268", "0.4407015", "0.44065255" ]
0.0
-1
Create a new command instance.
public function __construct(WorkerInterface $worker, ?string $laravel_base_path = null) { parent::__construct(); $this->worker = $worker; $this->laravel_base_path = $laravel_base_path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\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();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Array of property to type mappings. Used for (de)serialization
public static function openAPITypes() { return self::$openAPITypes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTypes()\n {\n $types = PropertyType::all();\n $values = [];\n foreach ($types as $key) {\n $values[] = $key->id;\n }\n return $values;\n }", "public function getTypes(): array\n {\n return $this->types;\n }", "public static function getTypeMap() {\n return [\n 'session_id' => self::FIELD_INT,\n 'user_id' => self::FIELD_INT,\n 'session_string' => self::FIELD_STRING,\n 'create_date' => self::FIELD_EPOCH,\n 'update_date' => self::FIELD_EPOCH,\n ];\n }", "public static function getTypesMap(): array\n {\n return self::$typesMap;\n }", "public static function getTypeMap() {\n return [\n 'charge_id' => self::FIELD_INT,\n 'user_id' => self::FIELD_INT,\n 'amount' => self::FIELD_INT,\n 'description' => self::FIELD_STRING,\n 'charge_date' => self::FIELD_EPOCH,\n 'create_date' => self::FIELD_EPOCH,\n 'update_date' => self::FIELD_EPOCH,\n ];\n }", "static protected function getPropertyTypes($typeArray) {\n\n\t\t$types = array();\n\t\t// Types are mapped to this entry by typoscript\n\t\t// (e.g. postProcessor.1.properties.1.type.1 = WORK)\n\t\t$typeKeys = \\TYPO3\\CMS\\Core\\TypoScript\\TemplateService::sortedKeyList($typeArray);\n\n\t\tforeach ($typeKeys as $typeKey) {\n\t\t\tif (!intval($typeKey) || strpos($typeKey, '.') !== FALSE) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$types[] = strtoupper($typeArray[$typeKey]);\n\t\t}\n\t\treturn $types;\n\t}", "public function get_types()\n\t{\n\t\treturn array();\n\t}", "public function getTypes() : array\n {\n return \\array_map(function ($t) {\n return $t instanceof self ? $t : new self([$t]);\n }, $this->types);\n }", "public static function getPropertyTypes() {\n\t\treturn self::$PROPERTY_TYPES;\n\t}", "public static function getPropertyTypes() {\n\t\treturn self::$PROPERTY_TYPES;\n\t}", "public static function getPropertyTypes() {\n\t\treturn self::$PROPERTY_TYPES;\n\t}", "public function getTypeMap()\n {\n }", "public function getTypeMap()\n {\n return $this->typeMap;\n }", "public function getTypes(): array;", "public function getTypes(): array;", "function getTypes() {\n\t\treturn $this->types;\n\t}", "static function getTypes(): array\n\t{\n return self::$types;\n }", "public function getTypes()\n {\n return $this->types;\n }", "public function getTypes()\n {\n return $this->types;\n }", "public static function getTypeArray()\n {\n return [\n self::TYPE_GENERIC => Yii::t('app', 'Generic'),\n ];\n }", "public function getTypes() {\n\t\treturn $this->types;\n\t}", "public function getTypeArr(){\n\t\treturn [\n\t\t\t'normal' =>'Normal',\n\t\t\t'ip'\t =>'IP',\n\t\t\t'iprange'=>'IP Bereich'\n\t\t];\n\t}", "public function typesProvider()\n {\n return [\n '1 Type' => ['Type1'],\n '2 Type' => [['Type1', 'Type2']],\n ];\n }", "public function types()\n {\n return $this->types;\n }", "protected function getTypes() {}", "public static function getTypesMap()\n {\n return self::$typesMap;\n }", "public static function getTypes()\n {\n return [\n ModelRegistry::TRANSACTION => ModelRegistry::getById(ModelRegistry::TRANSACTION)->label,\n ModelRegistry::PRODUCT => ModelRegistry::getById(ModelRegistry::PRODUCT)->label,\n ];\n }", "public function getTypes()\n {\n return $this->getTypesCollection()->getArrayCopy();\n }", "public function validPropertyTypes()\n {\n return [\n ['integer'],\n ['int'],\n ['float'],\n ['boolean'],\n ['bool'],\n ['string'],\n ['DateTime'],\n ['array'],\n ['ArrayObject'],\n ['SplObjectStorage'],\n ['Neos\\Flow\\Foo'],\n ['\\Neos\\Flow\\Bar'],\n ['\\Some\\Object'],\n ['SomeObject'],\n ['array<string>'],\n ['array<Neos\\Flow\\Baz>'],\n ['?string'],\n ['null|string'],\n ['string|null'],\n ['?\\Some\\Object'],\n ['\\Some\\Object|null'],\n ['?array<Neos\\Flow\\Baz>'],\n ['null|array<Neos\\Flow\\Baz>']\n ];\n }", "public function getTypes()\n {\n return $this->getData(self::TYPES);\n }", "protected function types()\n {\n return [\n 'bigint',\n 'blob',\n 'boolean',\n 'date',\n 'decimal',\n 'integer',\n 'longText',\n 'smallint',\n 'text',\n 'time',\n 'timestamp',\n 'timestamptz',\n ];\n }", "protected function _listTypes()\n {\n global $config;\n $types = objects::types();\n\n $result = array();\n foreach ($types as $type) {\n $infos = objects::infos($type);\n $result[$type] = $infos['name'];\n }\n return $result;\n }", "public function toArray()\n {\n $data = parent::toArray();\n if (isset($this->type)) {\n $data['type'] = $this->type;\n }\n return $data;\n }", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypes();", "protected function getPropertyTypeAttributes()\n {\n return array_merge(\n $this->getCommonAttributes(),\n array(\n 'multiple' => array('values' => array('*', 'mul', 'multiple'), 'variant' => true),\n 'queryops' => array('values' => array('qop', 'queryops'), 'variant' => true), // Needs special handling !\n 'nofulltext' => array('values' => array('nof', 'nofulltext'), 'variant' => true),\n 'noqueryorder' => array('values' => array('nqord', 'noqueryorder'), 'variant' => true),\n )\n );\n }", "public function getTypes()\n {\n return get_object_vars($this);\n }", "public function getTypeMapper();", "public static function mapping()\r\n {\r\n return [\r\n self::BUS_TICKET_NAME => self::BUS_TICKET_CLASS,\r\n self::AIRPORTBUS_TICKET_NAME => self::AIRPORTBUS_TICKET_CLASS,\r\n self::TRAIN_TICKET_NAME => self::TRAIN_TICKET_CLASS,\r\n self::FLIGHT_TICKET_NAME => self::FLIGHT_TICKET_CLASS,\r\n ];\r\n }", "public function get_types()\n {\n return self::$TYPES;\n }", "public function typeProvider()\n {\n return array(\n array(true, false),\n array(12, false),\n array(24.50, false),\n array(new \\stdClass(), false),\n array('string', true),\n );\n }", "public function dataTypeMap()\n {\n return config('codegenerator.eloquent_type_to_method');\n }", "protected function property_map() { return array(); }", "public function getMimetypeMapping()\n {\n if (isset($this->raw->mimetypes)) {\n return (array) $this->raw->mimetypes;\n }\n\n return array();\n }", "public static function getTypes(): array\n {\n return self::getRelevancyTypes();\n }", "public static function types()\n {\n return self::$types;\n }", "public static function getArrayTypes() {\n return array(\n self::TYPE_NEWS => DomainConst::CONTENT00472,\n self::TYPE_OTHER => DomainConst::CONTENT00031,\n );\n }", "public function types(): array\n {\n return collect($this->modelSchemas)->map(function ($modelSchema) {\n return $modelSchema instanceof RootType\n ? $modelSchema\n : $this->registry->type($this->registry->getModelSchema($modelSchema)->typename());\n })->toArray();\n }", "public function getTypes(): array\n {\n return $this->map(static function (DataSetColumn $column) {\n return $column->getType();\n })->toArray();\n }", "public function get_types()\n {\n }", "public function invalidPropertyTypes()\n {\n return [\n ['string<string>'],\n ['int<Neos\\Flow\\Baz>']\n ];\n }", "public static function getTypes()\n\t{\n\t\t\n\t\treturn [\n\t\t\tself::TYPE_SHARES\t\t\t =>\t\"Shares\",\n\t\t\tself::TYPE_PROPERTY\t\t\t =>\t\"Property\",\n\t\t];\n\t\t\n\t}", "public function get(): array\n {\n if ($this->types === []) {\n return self::$allowedTypes;\n }\n return $this->types;\n }", "public function types(): array\n {\n $json = $this->parent->performAPICallWithJsonResponse('get', 'artwork/types');\n return DataParser::parseDataArray($json, ArtworkType::class);\n }", "public static function types() : array\n {\n return ['questions', 'pictures', 'video'];\n }", "protected function loadPropertyTypes() {\n\t\tif (empty($this->cachedPropertyTypes)) {\n\t\t\t$completePropertyTypeConfiguration = $this->configurationManager->getConfiguration('PropertyTypes');\n\t\t\tforeach (array_keys($completePropertyTypeConfiguration) as $propertyTypeName) {\n\t\t\t\t$this->loadPropertyType($propertyTypeName, $completePropertyTypeConfiguration);\n\t\t\t}\n\t\t}\n\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'settingDefinitionId' => fn(ParseNode $n) => $o->setSettingDefinitionId($n->getStringValue()),\n 'settingInstanceTemplateReference' => fn(ParseNode $n) => $o->setSettingInstanceTemplateReference($n->getObjectValue([DeviceManagementConfigurationSettingInstanceTemplateReference::class, 'createFromDiscriminatorValue'])),\n ];\n }", "public static function getTypes(): array {\n\t\treturn ['pizza'];\n\t}", "public static function getTypesList()\n {\n return ArrayHelper::map(Yii::$app->get('cms')->getPageTypes(), 'type', 'name');\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'attributeMappings' => fn(ParseNode $n) => $o->setAttributeMappings($n->getCollectionOfObjectValues([AttributeMapping::class, 'createFromDiscriminatorValue'])),\n 'enabled' => fn(ParseNode $n) => $o->setEnabled($n->getBooleanValue()),\n 'flowTypes' => fn(ParseNode $n) => $o->setFlowTypes($n->getEnumValue(ObjectFlowTypes::class)),\n 'metadata' => fn(ParseNode $n) => $o->setMetadata($n->getCollectionOfObjectValues([ObjectMappingMetadataEntry::class, 'createFromDiscriminatorValue'])),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'scope' => fn(ParseNode $n) => $o->setScope($n->getObjectValue([Filter::class, 'createFromDiscriminatorValue'])),\n 'sourceObjectName' => fn(ParseNode $n) => $o->setSourceObjectName($n->getStringValue()),\n 'targetObjectName' => fn(ParseNode $n) => $o->setTargetObjectName($n->getStringValue()),\n ];\n }", "public function getPropertyTypes()\n\t{\n\t\treturn $this->hasOne(PropertyTypes:: className(), ['id' => 'property_type_id']);\n\t}", "public static function get_types()\n {\n return self::$TYPES;\n }", "public function toArray(): array\n {\n return [\n 'type' => self::typeToString($this->type),\n 'required' => $this->required,\n 'list' => $this->list,\n 'hidden' => $this->hidden\n ];\n }", "public function toJson() {\n\t\t$array = array(\"types\"=>array());\n\t\tforeach ($this->types as $type) {\n\t\t\t$array[\"types\"][] = $type->toJson();\n\t\t}\n\t\tif ($this->warningMessage) {\n\t\t\t$array[\"warning\"] = $this->warningMessage;\n\t\t}\n\t\treturn $array;\n\t}", "public function types()\n {\n return [\n static::TYPE_APP,\n static::TYPE_GALLERY,\n static::TYPE_PHOTO,\n static::TYPE_PLAYER,\n static::TYPE_PRODUCT,\n static::TYPE_SUMMARY,\n static::TYPE_SUMMARY_LARGE_IMAGE,\n ];\n }", "public static function types(): array\n {\n $all = self::getAll();\n\n return array_keys($all);\n }", "protected static function _getDataTypes()\n {\n return [];\n }", "public function getTypes()\n {\n $oDb = Factory::service('Database');\n $oResult = $oDb->query('SHOW COLUMNS FROM `' . $this->table . '` LIKE \"type\"')->row();\n $sTypes = $oResult->Type;\n $sTypes = preg_replace('/enum\\((.*)\\)/', '$1', $sTypes);\n $sTypes = str_replace(\"'\", '', $sTypes);\n $aTypes = explode(',', $sTypes);\n\n $aOut = [];\n\n foreach ($aTypes as $sType) {\n $aOut[$sType] = ucwords(strtolower($sType));\n }\n\n return $aOut;\n }", "public static function types()\n\t{\n\t\t$states = array(\n\t\t\t'blog' => __('Blog'),\n\t\t\t'page' => __('Page'),\n\t\t\t'user' => __('User')\n\t\t);\n\n\t\t$values = Module::action('gleez_types', $states);\n\n\t\treturn $values;\n\t}", "public static function getTypeList() {\n return array(\n self::TYPE_CODE_1=>self::TYPE_STRING_1,\n self::TYPE_CODE_2=>self::TYPE_STRING_2,\n self::TYPE_CODE_3=>self::TYPE_STRING_3,\n self::TYPE_CODE_4=>self::TYPE_STRING_4,\n self::TYPE_CODE_5=>self::TYPE_STRING_5,\n self::TYPE_CODE_6=>self::TYPE_STRING_6\n );\n }", "protected static function getPossibleVarTypes() {\n\t\treturn [\n\t\t\tPropertiesInterface::DTYPE_DEP_CURRENCY => CurrencyType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_EMAIL => EmailType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_FILE => FileType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_FORM_SECTION => FormSectionType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_FORM_SECTION_CLOSE => FormSectionCloseType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_IMAGE => ImageType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_MTIME => MtimeType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_SOURCE => SourceType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_STIME => StimeType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_TIME_ONLY => TimeOnlyType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_TXTBOX => TxtboxType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_URL => UrlType::class,\n\t\t\tPropertiesInterface::DTYPE_DEP_URLLINK => UrllinkType::class,\n\t\t\tPropertiesInterface::DTYPE_ARRAY => ArrayType::class,\n\t\t\tPropertiesInterface::DTYPE_BOOLEAN => BooleanType::class,\n\t\t\tPropertiesInterface::DTYPE_DATETIME => DateTimeType::class,\n\t\t\tPropertiesInterface::DTYPE_FILE => \\Imponeer\\Properties\\Types\\FileType::class,\n\t\t\tPropertiesInterface::DTYPE_FLOAT => FloatType::class,\n\t\t\tPropertiesInterface::DTYPE_INTEGER => IntegerType::class,\n\t\t\tPropertiesInterface::DTYPE_LIST => ListType::class,\n\t\t\tPropertiesInterface::DTYPE_OBJECT => ObjectType::class,\n\t\t\tPropertiesInterface::DTYPE_OTHER => OtherType::class,\n\t\t\tPropertiesInterface::DTYPE_STRING => StringType::class\n\t\t];\n\t}", "function get_field_mapping_types() {\n return drupal_map_assoc([\n 'string',\n 'keyword',\n 'date',\n 'long',\n 'double',\n 'boolean',\n 'ip',\n 'object',\n 'nested',\n 'geo_point',\n 'geo_shape',\n 'completion',\n ]);\n}", "public function getObjectMaps()\n {\n return array(\n 'id' => self::TYPE_STRING,\n 'self' => self::TYPE_STRING,\n 'author' => self::TYPE_USER,\n 'comment' => self::TYPE_STRING,\n 'timeSpentSeconds' => 'integer',\n 'billedSeconds' => 'integer',\n 'dateStarted' => 'datatime',\n 'issue' => self::TYPE_ISSUE,\n// 'workAttributeValues'\n );\n }", "public static function getTypes() {\n\t\treturn [\n\t\t\t'text' => self::RESOURCE_TYPE_TEXT,\n\t\t\t'img' => self::RESOURCE_TYPE_IMG\n\t\t];\n\t}", "function FieldTypesArray() {}", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'response' => fn(ParseNode $n) => $o->setResponse($n->getEnumValue(ResponseType::class)),\n 'time' => fn(ParseNode $n) => $o->setTime($n->getDateTimeValue()),\n ];\n }", "public static function types()\n {\n return [\n self::TYPE_PERSONAL => Yii::t('app', 'Personal'),\n self::TYPE_BUSINESS => Yii::t('app', 'Business'),\n self::TYPE_CUSTOM => Yii::t('app', Yii::$app->holidaySettings->customHolidayName)\n ];\n }", "public function getMapPaymentTypes()\n {\n return $this->map_payment_types;\n }", "private function &getSerializableAttributeTypesFromCache(): array {\n $key = \\get_class($this);\n if (!isset(self::$__attrTypeCache[$key])) {\n self::$__attrTypeCache[$key] = $this->getSerializableAttributeTypes();\n }\n return self::$__attrTypeCache[$key];\n }", "public function getTypeFields(): array\n {\n return array_merge(\n $this->getAttributesFields(),\n $this->getTypeRelations(),\n $this->getAggregatedFields(),\n $this->getOptionalFields()\n );\n }", "public function getDataClasses()\n {\n return $this->data_types;\n }", "protected function get_array_field_types() {\n\t\treturn array( 'multicheck' );\n\t}", "function getFieldTypesAction()\n {\n $this->_helper->viewRenderer->setNoRender();\n Zend_Loader::loadClass('Table_FieldType');\n Zend_Loader::loadClass('FieldType');\n $fieldTypesTable = new Table_FieldType();\n $rows = $fieldTypesTable->fetchAll();\n $fieldTypes = array();\n $i = 0;\n foreach ($rows as $row) \n {\n $fieldTypes[$i] = new FieldType($row);\n ++$i;\n }\n header('Content-Type: application/json; charset=utf8');\n echo Zend_Json::encode($fieldTypes);\n }", "protected function getTypeMapping()\n {\n return self::$mysqlTypeMap;\n }", "public static function getTypeArray() {\n return array( \n 'to' => 'EthD20',\n 'from' => 'EthD20',\n 'gas' => 'EthQ',\n 'gasPrice' => 'EthQ',\n 'value' => 'EthQ',\n 'data' => 'EthD',\n 'nonce' => 'EthQ',\n );\n }", "public function getFieldTypeClasses() : array\n {\n return [TableType::class];\n }", "public function toArray(): array\n {\n return [\n 'name' => $this->name,\n 'type' => $this->type,\n ];\n }", "public static function getTypeList()\n {\n return [\n self::TYPE_TEXT_FIELD => '',\n self::TYPE_DROP_DOWN => '',\n ];\n }", "public function getClassMap()\n {\n return array();\n }", "public function attributeCustomTypes()\n {\n $flagEnabled = \\common\\components\\Consts::STATUS_ENABLED;\n return array(\n 'id' => array('data-options' => array('checkbox'=>'true'), 'key' => true),\n 'type' => array('width' => 100),\n 'office_id' => array('width' => 100),\n 'int_value' => array('width' => 100),\n 'float_value' => array('width' => 100),\n 'str_value' => array('width' => 100),\n 'flag' => array('width' => 100, 'formatter'=>\"function(value,row){ return '0x'+parseInt(value).toString(16); }\"),\n 'status' => array('width' => 80, 'sortable' => 'true',\n 'formatter' => \"function(value,row){ if (value == {$flagEnabled}) { return $.custom.lan.defaults.role.enabled; } else { return $.custom.lan.defaults.role.disabled; };}\"),\n 'edit_user_id' => array('width' => 100, 'sortable' => 'true', 'formatter' => \"function(value,row){ return row.edit_user_disp; }\"),\n 'created_at' => array('width' => 140, 'sortable' => 'true', 'formatter' => \"function(value,row){return $.custom.utils.humanTime(value);}\"),\n 'updated_at' => array('width' => 140, 'sortable' => 'true', 'formatter' => \"function(value,row){return $.custom.utils.humanTime(value);}\"),\n 'operation' => array('width' => 160, \n 'buttons' => array(\n ),\n ),\n );\n }", "public static function getTypeArray() {\n\t\treturn array( \n\t\t\t'hash' => 'EthD32',\n\t\t\t'nonce' => 'EthQ',\n\t\t\t'blockHash' => 'EthD32',\n\t\t\t'blockNumber' => 'EthQ',\n\t\t\t'transactionIndex' => 'EthQ',\n\t\t\t'from' => 'EthD20',\n\t\t\t'to' => 'EthD20',\n\t\t\t'value' => 'EthQ',\n\t\t\t'gasPrice' => 'EthQ',\n\t\t\t'gas' => 'EthQ',\n\t\t\t'input' => 'EthD',\n\t\t);\n\t}", "public function get_post_types() {\n\n\t\treturn [\n\t\t\tPost_Type_Movie::SLUG,\n\t\t];\n\n\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'attributeDestination' => fn(ParseNode $n) => $o->setAttributeDestination($n->getObjectValue([AccessPackageResourceAttributeDestination::class, 'createFromDiscriminatorValue'])),\n 'attributeName' => fn(ParseNode $n) => $o->setAttributeName($n->getStringValue()),\n 'attributeSource' => fn(ParseNode $n) => $o->setAttributeSource($n->getObjectValue([AccessPackageResourceAttributeSource::class, 'createFromDiscriminatorValue'])),\n 'id' => fn(ParseNode $n) => $o->setId($n->getStringValue()),\n 'isEditable' => fn(ParseNode $n) => $o->setIsEditable($n->getBooleanValue()),\n 'isPersistedOnAssignmentRemoval' => fn(ParseNode $n) => $o->setIsPersistedOnAssignmentRemoval($n->getBooleanValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n ];\n }", "protected function loadTypes()\n {\n return array(\n new RecaptchaType(\n $this->app['salberts_recaptcha2.public_key'],\n $this->app['salberts_recaptcha2.enabled'],\n $this->app['salberts_recaptcha2.ajax'],\n $this->app['salberts_recaptcha2.locale_key']\n )\n );\n }", "public function transform(Type $type) : array\n {\n return [\n 'id' => (int) $type->id,\n 'name' => (string) $type->name,\n 'slug' => (string) $type->slug\n ];\n }", "public static function getTypes();", "public function toArray()\n {\n return [\n 'type' => 'object',\n 'properties' => [\n 'email' => ['type' => 'string'],\n 'key' => ['type' => 'string'],\n 'name' => ['type' => 'string'],\n 'picture' => ['type' => 'string'],\n 'phone' => ['type' => 'string'],\n 'balance' => ['type' => 'integer', 'format' => 'int32'],\n 'codes' => ['type' => 'array', 'items' => ['type' => 'string']],\n 'order_comment_tracking_code' => ['type' => 'string'],\n 'title' => ['type' => 'string'],\n ],\n 'required' => ['email', 'key', 'name', 'phone', 'balance', 'codes', 'order_comment_tracking_code', 'title'],\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'file' => fn(ParseNode $n) => $o->setFile($n->getBinaryContent()),\n 'sensitiveTypeIds' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setSensitiveTypeIds($val);\n },\n ]);\n }", "public function serializeProperties(\n VisitorInterface $visitor,\n Properties $properties,\n array $type,\n Context $context\n ): array {\n $type['name'] = 'array';\n $type['params'] = [\n 'name' => 'string'\n ];\n\n return $visitor->visitArray($properties->toArray(), $type, $context);\n }" ]
[ "0.6779591", "0.6607671", "0.6598399", "0.65871716", "0.65820396", "0.6517233", "0.6510976", "0.6476572", "0.6432348", "0.6432348", "0.6432348", "0.6400341", "0.62290716", "0.6181703", "0.6181703", "0.6134249", "0.61259305", "0.6116482", "0.6116482", "0.61130923", "0.6104262", "0.61034846", "0.60908586", "0.60496855", "0.6043802", "0.60386765", "0.60225236", "0.6009802", "0.6003993", "0.59748334", "0.59642416", "0.5954874", "0.5930587", "0.5899609", "0.5899609", "0.5899609", "0.5899609", "0.58945465", "0.5890869", "0.58701736", "0.5863934", "0.58444214", "0.5838445", "0.5828594", "0.58144826", "0.58129823", "0.5804292", "0.5796741", "0.57568073", "0.57505006", "0.5743685", "0.5736511", "0.5734564", "0.57273227", "0.5707013", "0.56975174", "0.56946456", "0.5693727", "0.5687955", "0.5665236", "0.56430435", "0.56408566", "0.563402", "0.5630481", "0.56080776", "0.5599476", "0.55915767", "0.5585394", "0.558386", "0.55776054", "0.55675316", "0.55663115", "0.55482644", "0.5546505", "0.5545644", "0.5541277", "0.55396307", "0.55380726", "0.55341345", "0.55281776", "0.5522627", "0.55183494", "0.5511188", "0.5490826", "0.5490577", "0.54898953", "0.54841906", "0.5483675", "0.5483026", "0.5479314", "0.54746664", "0.5474101", "0.546709", "0.54619867", "0.5456936", "0.5456295", "0.54499793", "0.54478484", "0.5443354", "0.5429377", "0.5426228" ]
0.0
-1
Array of property to format mappings. Used for (de)serialization
public static function openAPIFormats() { return self::$openAPIFormats; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFormats()\n {\n\t $format_field = $this->getValue('format');\n\t return wed_decodeJSON($format_field,true);\n }", "public function provideSetFormat()\n {\n return [\n 'json' => [\n 'format' => 'json',\n ],\n 'html' => [\n 'format' => 'html',\n ],\n 'plain' => [\n 'format' => 'text',\n ],\n 'xml' => [\n 'format' => 'xml',\n ],\n ];\n }", "protected function getFormats(): array\n {\n return [self::FORMAT_JSON, self::FORMAT_XML];\n }", "public static function getFormats() {\n return array(\n 'none',\n 'pretty',\n 'php',\n 'php-data',\n 'json-pretty',\n 'json-strict',\n 'serialize',\n 'shell',\n );\n }", "public function format() {\n\n /* * Add the mandatary props* */\n if (!is_null($this->name)) {\n $result[self::NAME_KEY] = $this->name;\n }\n\n /* * Add the optional props if any* */\n if (!is_null($this->optionalProperties)) {\n $result = array_merge($result, $this->optionalProperties);\n }\n\n\n return $result;\n }", "public function toArray() {\n $output = array();\n foreach($this->_magicProperties as $key => $value) {\n if (in_array($key,$this->translation)) {\n $output[array_search($key,$this->translation)] = $value;\n }else{\n $output[$key] = $value;\n }\n }\n return $this->_postarray($output);\n }", "public function getFormatKeys()\n {\n return $this->formatKeys;\n }", "public function getFormats()\n {\n return $this->_formats;\n }", "public function getFormat(): array;", "public function getFormatList()\n {\n return $this->formatList;\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'format' => fn(ParseNode $n) => $o->setFormat($n->getObjectValue([WorkbookChartSeriesFormat::class, 'createFromDiscriminatorValue'])),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n 'points' => fn(ParseNode $n) => $o->setPoints($n->getCollectionOfObjectValues([WorkbookChartPoint::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "protected function property_map() { return array(); }", "public function format(): array\n {\n $result[self::FROM_EMAIL_KEY] = $this->fromEmail;\n\n return array_merge($result, $this->optionalProperties);\n }", "public static function getFormats()\n {\n return self::$formats;\n }", "public function getFormatList() {\r\n\t\treturn $this->formatList;\r\n\t}", "public function toArray()\n {\n return [\n 'PDF_10x15_300dpi' => '10x15 300dpi',\n 'PDF_A4_300dpi' => 'A4 300dpi',\n ];\n }", "protected function toArray()\n {\n $properties = array();\n\n foreach ( $this as $property => $value ) {\n $properties[$property] = $value;\n }\n\n return $properties;\n }", "public static function formats()\n {\n return self::$formats;\n }", "public function formatToArray(){\n return [\n 'nombre' => $this->name,\n 'ciudad' => $this->cityId,\n 'email' => $this->email,\n 'telefono' => $this->tel,\n 'tipo_documento' => $this->typeDoc,\n 'documento' => $this->doc,\n 'direccion' => $this->addr,\n 'direccion_referencia' => $this->addRef,\n 'coordenadas' => $this->addrCoo,\n 'ruc' => $this->ruc,\n 'razon_social' => $this->socialReason,\n ];\n }", "public function getValueFormatersNames(): array;", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'format' => fn(ParseNode $n) => $o->setFormat($n->getObjectValue([WorkbookChartAxisFormat::class, 'createFromDiscriminatorValue'])),\n 'majorGridlines' => fn(ParseNode $n) => $o->setMajorGridlines($n->getObjectValue([WorkbookChartGridlines::class, 'createFromDiscriminatorValue'])),\n 'majorUnit' => fn(ParseNode $n) => $o->setMajorUnit($n->getObjectValue([Json::class, 'createFromDiscriminatorValue'])),\n 'maximum' => fn(ParseNode $n) => $o->setMaximum($n->getObjectValue([Json::class, 'createFromDiscriminatorValue'])),\n 'minimum' => fn(ParseNode $n) => $o->setMinimum($n->getObjectValue([Json::class, 'createFromDiscriminatorValue'])),\n 'minorGridlines' => fn(ParseNode $n) => $o->setMinorGridlines($n->getObjectValue([WorkbookChartGridlines::class, 'createFromDiscriminatorValue'])),\n 'minorUnit' => fn(ParseNode $n) => $o->setMinorUnit($n->getObjectValue([Json::class, 'createFromDiscriminatorValue'])),\n 'title' => fn(ParseNode $n) => $o->setTitle($n->getObjectValue([WorkbookChartAxisTitle::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'templateId' => fn(ParseNode $n) => $o->setTemplateId($n->getStringValue()),\n 'values' => fn(ParseNode $n) => $o->setValues($n->getCollectionOfObjectValues([SettingValue::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function dataProviderFormat()\n {\n return [\n [RefData::EBSR_STATUS_PROCESSING, 'orange', 'processing'],\n [RefData::EBSR_STATUS_VALIDATING, 'orange', 'processing'],\n [RefData::EBSR_STATUS_SUBMITTED, 'orange', 'processing'],\n [RefData::EBSR_STATUS_PROCESSED, 'green', 'successful'],\n [RefData::EBSR_STATUS_FAILED, 'red', 'failed'],\n ];\n }", "public function toArray(): array\n {\n return [\n 'background' => __('Background'),\n 'center' => __('Center'),\n ];\n }", "public function getExportFormats(): array;", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'platformType' => fn(ParseNode $n) => $o->setPlatformType($n->getEnumValue(PolicyPlatformType::class)),\n 'settingCount' => fn(ParseNode $n) => $o->setSettingCount($n->getIntegerValue()),\n 'settingStates' => fn(ParseNode $n) => $o->setSettingStates($n->getCollectionOfObjectValues([ManagedDeviceMobileAppConfigurationSettingState::class, 'createFromDiscriminatorValue'])),\n 'state' => fn(ParseNode $n) => $o->setState($n->getEnumValue(ComplianceStatus::class)),\n 'userId' => fn(ParseNode $n) => $o->setUserId($n->getStringValue()),\n 'userPrincipalName' => fn(ParseNode $n) => $o->setUserPrincipalName($n->getStringValue()),\n 'version' => fn(ParseNode $n) => $o->setVersion($n->getIntegerValue()),\n ]);\n }", "public function jsonSerialize(): array\n {\n return array_merge([\n 'value' => $this->resolveTransformedValue($this->value),\n 'previous' => $this->resolveTransformedValue($this->previous),\n 'percent_changed' => $percentChanged = $this->percentChanged(),\n 'positive_change' => $percentChanged >= 0,\n // 'previousLabel' => $this->previousLabel,\n 'prefix' => $this->prefix,\n 'suffix' => $this->suffix,\n // 'suffixInflection' => $this->suffixInflection,\n // 'format' => $this->format,\n 'zero_result' => $this->zeroResult,\n ], parent::jsonSerialize());\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'bold' => fn(ParseNode $n) => $o->setBold($n->getBooleanValue()),\n 'color' => fn(ParseNode $n) => $o->setColor($n->getStringValue()),\n 'italic' => fn(ParseNode $n) => $o->setItalic($n->getBooleanValue()),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n 'size' => fn(ParseNode $n) => $o->setSize($n->getFloatValue()),\n 'underline' => fn(ParseNode $n) => $o->setUnderline($n->getStringValue()),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'filter' => fn(ParseNode $n) => $o->setFilter($n->getObjectValue([WorkbookFilter::class, 'createFromDiscriminatorValue'])),\n 'index' => fn(ParseNode $n) => $o->setIndex($n->getIntegerValue()),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n 'values' => fn(ParseNode $n) => $o->setValues($n->getObjectValue([Json::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function toArray()\n {\n return [\n LSR::STORE_HOURS_TIME_FORMAT_24HRS => __('24 Hours'),\n LSR::STORE_HOURS_TIME_FORMAT_12HRS => __('12 Hours')\n ];\n }", "public function jsonSerialize()\n {\n $output = [];\n foreach ($this::getReflection()->getProperties() as $propertyName => $property) {\n\n $value = $this->{$propertyName};\n if ($value instanceof Entity\\Collection || $value instanceof Entity) {\n $output[$propertyName] = $value->jsonSerialize();\n } elseif ($value instanceof \\DateTime\n && $property->getType() === Entity\\Reflection\\Property::TYPE_DATE\n ) {\n $output[$propertyName] = (array) $value;\n $output[$propertyName][\"date\"] = $value->format(self::$dateFormat);\n } else {\n $output[$propertyName] = $value;\n }\n }\n\n return $output;\n }", "public function &GetFormats()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_formats;\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'action' => fn(ParseNode $n) => $o->setAction($n->getEnumValue(OnenotePatchActionType::class)),\n 'content' => fn(ParseNode $n) => $o->setContent($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'position' => fn(ParseNode $n) => $o->setPosition($n->getEnumValue(OnenotePatchInsertPosition::class)),\n 'target' => fn(ParseNode $n) => $o->setTarget($n->getStringValue()),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'settingDefinitionId' => fn(ParseNode $n) => $o->setSettingDefinitionId($n->getStringValue()),\n 'settingInstanceTemplateReference' => fn(ParseNode $n) => $o->setSettingInstanceTemplateReference($n->getObjectValue([DeviceManagementConfigurationSettingInstanceTemplateReference::class, 'createFromDiscriminatorValue'])),\n ];\n }", "public static function axerveFormats()\n {\n return self::$axerveFormats;\n }", "public static function getDateFormats() {\n $settings = self::getSettings();\n \n $dateformats = array();\n $dateformats[$settings->language] = json_decode($settings->dateformat, true);\n \n $translations = self::getTranslations();\n foreach($translations as $language => $df) {\n $dateformats[$language] = $df;\n }\n return $dateformats;\n }", "public function jsonSerialize()\n {\n return array_merge([\n 'component' => $this->component(),\n 'prefixComponent' => true,\n 'INDEX' => self::INDEX,\n 'ATTRIBUTE_PREFIX' => self::ATTRIBUTE_PREFIX,\n 'UNCHANGED' => self::UNCHANGED,\n 'CREATED' => self::CREATED,\n 'REMOVED' => self::REMOVED,\n 'UPDATED' => self::UPDATED,\n 'STATUS' => self::STATUS,\n 'PREFIX' => self::PREFIX,\n 'name' => $this->name,\n 'singularName' => str_singular($this->name),\n ], $this->meta());\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'mailExchange' => fn(ParseNode $n) => $o->setMailExchange($n->getStringValue()),\n 'preference' => fn(ParseNode $n) => $o->setPreference($n->getIntegerValue()),\n ]);\n }", "public function format()\n {\n return json_decode($this->renderer->format(), false, JSON_FORCE_OBJECT);\n }", "public function toArray()\n {\n return (array)$this->properties;\n }", "public function sectionSerialize()\n {\n $templatePrefix = $this->getTranslationTemplate();\n\n $properties = array_combine(\n array_map(function ($k) use ($templatePrefix) {\n return $templatePrefix . $k;\n },\n array_keys(get_object_vars($this))),\n get_object_vars($this)\n );\n return $properties;\n }", "public static function get_prop_array( array $mf, $properties, $args = null ) {\n\t\tif ( ! self::is_microformat( $mf ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$data = array();\n\t\tforeach ( $properties as $p ) {\n\t\t\tif ( array_key_exists( $p, $mf['properties'] ) ) {\n\t\t\t\tforeach ( $mf['properties'][ $p ] as $v ) {\n\t\t\t\t\tif ( self::is_microformat( $v ) ) {\n\t\t\t\t\t\t$v = self::parse_item( $v, $mf, $args );\n\t\t\t\t\t}\n\t\t\t\t\t$data[ $p ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "public function toArray() \n\t{\n\t\t$properties = array_merge(parent::toArray(), $this->properties);\n\t\tforeach ($properties as $name => $rawValue) {\n\t\t\t$value = $this->get($name, $rawValue);\n\t\t\t\n\t\t\tif ($value instanceof \\Bliss\\Component || $value instanceof \\Bliss\\Collection) {\n\t\t\t\t$properties[$name] = $value->toArray();\n\t\t\t} else {\n\t\t\t\t$properties[$name] = $value;\n\t\t\t}\n\t\t}\n\t\treturn $properties;\n\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'deviceCount' => fn(ParseNode $n) => $o->setDeviceCount($n->getIntegerValue()),\n 'medianImpactInMs' => fn(ParseNode $n) => $o->setMedianImpactInMs($n->getIntegerValue()),\n 'processName' => fn(ParseNode $n) => $o->setProcessName($n->getStringValue()),\n 'productName' => fn(ParseNode $n) => $o->setProductName($n->getStringValue()),\n 'publisher' => fn(ParseNode $n) => $o->setPublisher($n->getStringValue()),\n 'totalImpactInMs' => fn(ParseNode $n) => $o->setTotalImpactInMs($n->getIntegerValue()),\n ]);\n }", "public function toArray()\n {\n return ['Lax' => __('Lax'), 'Strict' => __('Strict'), 'None' => __('Strict')];\n }", "public static function listFormats(){\n $list = array();\n foreach(self::$_resultFormats as $key => $item){\n $list[$key] = $item['description'];\n }\n return $list;\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'deliveryFrequency' => fn(ParseNode $n) => $o->setDeliveryFrequency($n->getEnumValue(NotificationDeliveryFrequency::class)),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'classification' => fn(ParseNode $n) => $o->setClassification($n->getEnumValue(WindowsQualityUpdateClassification::class)),\n 'isExpeditable' => fn(ParseNode $n) => $o->setIsExpeditable($n->getBooleanValue()),\n 'kbArticleId' => fn(ParseNode $n) => $o->setKbArticleId($n->getStringValue()),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'assignees' => fn(ParseNode $n) => $o->setAssignees($n->getCollectionOfObjectValues([WorkbookEmailIdentity::class, 'createFromDiscriminatorValue'])),\n 'changes' => fn(ParseNode $n) => $o->setChanges($n->getCollectionOfObjectValues([WorkbookDocumentTaskChange::class, 'createFromDiscriminatorValue'])),\n 'comment' => fn(ParseNode $n) => $o->setComment($n->getObjectValue([WorkbookComment::class, 'createFromDiscriminatorValue'])),\n 'completedBy' => fn(ParseNode $n) => $o->setCompletedBy($n->getObjectValue([WorkbookEmailIdentity::class, 'createFromDiscriminatorValue'])),\n 'completedDateTime' => fn(ParseNode $n) => $o->setCompletedDateTime($n->getDateTimeValue()),\n 'createdBy' => fn(ParseNode $n) => $o->setCreatedBy($n->getObjectValue([WorkbookEmailIdentity::class, 'createFromDiscriminatorValue'])),\n 'createdDateTime' => fn(ParseNode $n) => $o->setCreatedDateTime($n->getDateTimeValue()),\n 'percentComplete' => fn(ParseNode $n) => $o->setPercentComplete($n->getIntegerValue()),\n 'priority' => fn(ParseNode $n) => $o->setPriority($n->getIntegerValue()),\n 'startAndDueDateTime' => fn(ParseNode $n) => $o->setStartAndDueDateTime($n->getObjectValue([WorkbookDocumentTaskSchedule::class, 'createFromDiscriminatorValue'])),\n 'title' => fn(ParseNode $n) => $o->setTitle($n->getStringValue()),\n ]);\n }", "public function toArray(): array\n {\n $serialized = collect($this->properties);\n\n //partial serialization only for initialized properties\n if ($this->isPartial) {\n $serialized = $serialized->intersectByKeys(array_flip($this->initializedProperties));\n }\n\n $serialized = $serialized->mapWithKeys(function ($value, $property) {\n if ($value instanceof Arrayable) {\n $value = $value->toArray();\n }\n\n if ($this->snakeOnSerialize) {\n $property = Str::snake($property);\n }\n\n return [$property => $value];\n });\n\n $this->resetSerializationConditions();\n\n return $serialized->toArray();\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'endDate' => fn(ParseNode $n) => $o->setEndDate($n->getDateValue()),\n 'expirationDate' => fn(ParseNode $n) => $o->setExpirationDate($n->getDateValue()),\n 'offer' => fn(ParseNode $n) => $o->setOffer($n->getStringValue()),\n 'offerDisplayName' => fn(ParseNode $n) => $o->setOfferDisplayName($n->getStringValue()),\n 'publisher' => fn(ParseNode $n) => $o->setPublisher($n->getStringValue()),\n 'recommendedSku' => fn(ParseNode $n) => $o->setRecommendedSku($n->getStringValue()),\n 'sizeInGB' => fn(ParseNode $n) => $o->setSizeInGB($n->getIntegerValue()),\n 'sku' => fn(ParseNode $n) => $o->setSku($n->getStringValue()),\n 'skuDisplayName' => fn(ParseNode $n) => $o->setSkuDisplayName($n->getStringValue()),\n 'startDate' => fn(ParseNode $n) => $o->setStartDate($n->getDateValue()),\n 'status' => fn(ParseNode $n) => $o->setStatus($n->getEnumValue(CloudPcGalleryImageStatus::class)),\n ]);\n }", "public function applicable_formats() {\n return array('my' => true);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'regionGroup' => fn(ParseNode $n) => $o->setRegionGroup($n->getEnumValue(CloudPcRegionGroup::class)),\n 'regionStatus' => fn(ParseNode $n) => $o->setRegionStatus($n->getEnumValue(CloudPcSupportedRegionStatus::class)),\n 'supportedSolution' => fn(ParseNode $n) => $o->setSupportedSolution($n->getEnumValue(CloudPcManagementService::class)),\n ]);\n }", "public static function getProperties()\n {\n return [\n 'Description' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'Note' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'Code' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'Billable' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'Quantity' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n 'UnitCost' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n 'UnitPrice' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n 'Amount' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n 'AmountTax' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n 'AmountIncludingTax' => [false, self::PROPERTY_TYPE_FLOAT, null, false, false],\n ];\n }", "public static function getProperties()\n {\n return [\n 'id' => [true, self::PROPERTY_TYPE_STRING, null, false, false],\n 'endDate' => [false, self::PROPERTY_TYPE_DATE, null, false, false],\n 'startDate' => [true, self::PROPERTY_TYPE_DATE, null, false, false],\n 'status' => [true, self::PROPERTY_TYPE_ENUM, null, false, false],\n 'price' => [true, self::PROPERTY_TYPE_OBJECT, '\\\\Price', false, false],\n 'product' => [true, self::PROPERTY_TYPE_OBJECT, '\\\\Product', false, false],\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'archiveFolder' => fn(ParseNode $n) => $o->setArchiveFolder($n->getStringValue()),\n 'automaticRepliesSetting' => fn(ParseNode $n) => $o->setAutomaticRepliesSetting($n->getObjectValue([AutomaticRepliesSetting::class, 'createFromDiscriminatorValue'])),\n 'dateFormat' => fn(ParseNode $n) => $o->setDateFormat($n->getStringValue()),\n 'delegateMeetingMessageDeliveryOptions' => fn(ParseNode $n) => $o->setDelegateMeetingMessageDeliveryOptions($n->getEnumValue(DelegateMeetingMessageDeliveryOptions::class)),\n 'language' => fn(ParseNode $n) => $o->setLanguage($n->getObjectValue([LocaleInfo::class, 'createFromDiscriminatorValue'])),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'timeFormat' => fn(ParseNode $n) => $o->setTimeFormat($n->getStringValue()),\n 'timeZone' => fn(ParseNode $n) => $o->setTimeZone($n->getStringValue()),\n 'userPurpose' => fn(ParseNode $n) => $o->setUserPurpose($n->getEnumValue(UserPurpose::class)),\n 'userPurposeV2' => fn(ParseNode $n) => $o->setUserPurposeV2($n->getEnumValue(MailboxRecipientType::class)),\n 'workingHours' => fn(ParseNode $n) => $o->setWorkingHours($n->getObjectValue([WorkingHours::class, 'createFromDiscriminatorValue'])),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'classification' => fn(ParseNode $n) => $o->setClassification($n->getEnumValue(PermissionClassificationType::class)),\n 'permissionId' => fn(ParseNode $n) => $o->setPermissionId($n->getStringValue()),\n 'permissionName' => fn(ParseNode $n) => $o->setPermissionName($n->getStringValue()),\n ]);\n }", "public function toArray()\n {\n return array(\n \"field_name\" => $this->fieldName,\n \"direction\" => $this->direction,\n );\n }", "public function getToStringFields()\n {\n $out = array();\n foreach($this->_map as $alias => $options)\n {\n if(!empty($options[self::MAP_TO_STRING]))\n {\n $out[] = $alias;\n }\n }\n return $out;\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'attributeMappings' => fn(ParseNode $n) => $o->setAttributeMappings($n->getCollectionOfObjectValues([AttributeMapping::class, 'createFromDiscriminatorValue'])),\n 'enabled' => fn(ParseNode $n) => $o->setEnabled($n->getBooleanValue()),\n 'flowTypes' => fn(ParseNode $n) => $o->setFlowTypes($n->getEnumValue(ObjectFlowTypes::class)),\n 'metadata' => fn(ParseNode $n) => $o->setMetadata($n->getCollectionOfObjectValues([ObjectMappingMetadataEntry::class, 'createFromDiscriminatorValue'])),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'scope' => fn(ParseNode $n) => $o->setScope($n->getObjectValue([Filter::class, 'createFromDiscriminatorValue'])),\n 'sourceObjectName' => fn(ParseNode $n) => $o->setSourceObjectName($n->getStringValue()),\n 'targetObjectName' => fn(ParseNode $n) => $o->setTargetObjectName($n->getStringValue()),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'number' => fn(ParseNode $n) => $o->setNumber($n->getStringValue()),\n 'type' => fn(ParseNode $n) => $o->setType($n->getEnumValue(PhoneType::class)),\n ]);\n }", "public static function serialFormats()\n {\n return self::$serialFormats;\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'attributeDestination' => fn(ParseNode $n) => $o->setAttributeDestination($n->getObjectValue([AccessPackageResourceAttributeDestination::class, 'createFromDiscriminatorValue'])),\n 'attributeName' => fn(ParseNode $n) => $o->setAttributeName($n->getStringValue()),\n 'attributeSource' => fn(ParseNode $n) => $o->setAttributeSource($n->getObjectValue([AccessPackageResourceAttributeSource::class, 'createFromDiscriminatorValue'])),\n 'id' => fn(ParseNode $n) => $o->setId($n->getStringValue()),\n 'isEditable' => fn(ParseNode $n) => $o->setIsEditable($n->getBooleanValue()),\n 'isPersistedOnAssignmentRemoval' => fn(ParseNode $n) => $o->setIsPersistedOnAssignmentRemoval($n->getBooleanValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n ];\n }", "public function toJSON()\n\t{\n\t\t$columns = array();\n\t\t\n\t\t$rf = new ReflectionClass($this);\n\t\t$props = $rf->getProperties();\n\t\tforeach ($props as $prop)\n\t\t{\n\t\t\t$column = AttributeReader::PropertyAttributes($this,$prop->getName())->Column;\n\t\t\t$columns[$column] = $prop->getValue($this);\n\t\t}\n\n\t\treturn json_encode($columns);\n\t}", "public function getDisplayFormatTypeAllowableValues()\n {\n return [\n self::DISPLAY_FORMAT_TYPE__DEFAULT,\n self::DISPLAY_FORMAT_TYPE_DATE,\n self::DISPLAY_FORMAT_TYPE_NUMBER,\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'recipientActionDateTime' => fn(ParseNode $n) => $o->setRecipientActionDateTime($n->getDateTimeValue()),\n 'recipientActionMessage' => fn(ParseNode $n) => $o->setRecipientActionMessage($n->getStringValue()),\n 'recipientUserId' => fn(ParseNode $n) => $o->setRecipientUserId($n->getStringValue()),\n 'senderShiftId' => fn(ParseNode $n) => $o->setSenderShiftId($n->getStringValue()),\n ]);\n }", "public static function getProperties()\n {\n return [\n 'NumberOfUnits' => [false, self::PROPERTY_TYPE_STRING, null, false, false],\n 'PayPeriodEndDate' => [false, self::PROPERTY_TYPE_DATE, '\\\\DateTimeInterface', false, false],\n 'PayPeriodStartDate' => [false, self::PROPERTY_TYPE_DATE, '\\\\DateTimeInterface', false, false],\n 'LeavePeriodStatus' => [false, self::PROPERTY_TYPE_ENUM, null, false, false],\n ];\n }", "public function toArray()\n {\n return [\n 'field-changes' => $this->fieldChanges,\n 'index-changes' => $this->indexChanges,\n 'add-timestamp' => $this->addTimestamps,\n 'add-soft-delete' => $this->addSoftDelete,\n 'drop-timestamp' => $this->dropTimestamps,\n 'drop-soft-delete' => $this->dropSoftDelete,\n ];\n }", "public function toArray()\n {\n return array(\n \"httpGet\" => $this->httpGet,\n \"httpPost\" => $this->httpPost,\n \"formats\" => $this->formats\n );\n }", "public function toArray()\n {\n return [\n 'xsmall' => __('Extra small'),\n 'small' => __('Small'),\n 'medium' => __('Medium'),\n 'large' => __('Large'),\n 'xlarge' => __('Extra large'),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'endDateTime' => fn(ParseNode $n) => $o->setEndDateTime($n->getDateTimeValue()),\n 'startDateTime' => fn(ParseNode $n) => $o->setStartDateTime($n->getDateTimeValue()),\n ]);\n }", "public function toArray()\n {\n return [\n Import::BEHAVIOR_ADD_UPDATE => __('Add/Update'),\n Import::BEHAVIOR_REPLACE => __('Replace'),\n Import::BEHAVIOR_DELETE => __('Delete')\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'completionDateTime' => fn(ParseNode $n) => $o->setCompletionDateTime($n->getDateTimeValue()),\n 'creationDateTime' => fn(ParseNode $n) => $o->setCreationDateTime($n->getDateTimeValue()),\n 'error' => fn(ParseNode $n) => $o->setError($n->getObjectValue([ClassificationError::class, 'createFromDiscriminatorValue'])),\n 'lastUpdatedDateTime' => fn(ParseNode $n) => $o->setLastUpdatedDateTime($n->getDateTimeValue()),\n 'startDateTime' => fn(ParseNode $n) => $o->setStartDateTime($n->getDateTimeValue()),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'description' => fn(ParseNode $n) => $o->setDescription($n->getStringValue()),\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'members' => fn(ParseNode $n) => $o->setMembers($n->getCollectionOfObjectValues([Identity::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public static function _getPropertyNames(): array\n {\n return [\n 'url',\n ];\n }", "public function getFormatters(): ArrayObject\n {\n $arr = new ArrayObject();\n foreach ($this->columns as $key => $column) {\n if (($formatter = $column->getFormatter()) !== null) {\n $arr->offsetSet($key, $formatter);\n }\n }\n\n return $arr;\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'addedDateTime' => fn(ParseNode $n) => $o->setAddedDateTime($n->getDateTimeValue()),\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'verifiedPublisherId' => fn(ParseNode $n) => $o->setVerifiedPublisherId($n->getStringValue()),\n ];\n }", "function custom_field_formats_for_select() {\n $model = ClassRegistry::init('CustomField');\n $formats = $model->FIELD_FORMATS;\n uasort($formats, array($this, '__sort_custom_field_formats_for_select'));\n $select = array();\n foreach ($formats as $k=>$format) {\n $select[$k] = __($format['name']);\n }\n return $select;\n }", "protected static function getCardFormats() : array\n {\n return Formats::getList();\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'comparisonValue' => fn(ParseNode $n) => $o->setComparisonValue($n->getStringValue()),\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'enforceSignatureCheck' => fn(ParseNode $n) => $o->setEnforceSignatureCheck($n->getBooleanValue()),\n 'operationType' => fn(ParseNode $n) => $o->setOperationType($n->getEnumValue(Win32LobAppPowerShellScriptRuleOperationType::class)),\n 'operator' => fn(ParseNode $n) => $o->setOperator($n->getEnumValue(Win32LobAppRuleOperator::class)),\n 'runAs32Bit' => fn(ParseNode $n) => $o->setRunAs32Bit($n->getBooleanValue()),\n 'runAsAccount' => fn(ParseNode $n) => $o->setRunAsAccount($n->getEnumValue(RunAsAccountType::class)),\n 'scriptContent' => fn(ParseNode $n) => $o->setScriptContent($n->getStringValue()),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'deletedChats' => fn(ParseNode $n) => $o->setDeletedChats($n->getCollectionOfObjectValues([DeletedChat::class, 'createFromDiscriminatorValue'])),\n 'deletedTeams' => fn(ParseNode $n) => $o->setDeletedTeams($n->getCollectionOfObjectValues([DeletedTeam::class, 'createFromDiscriminatorValue'])),\n 'devices' => fn(ParseNode $n) => $o->setDevices($n->getCollectionOfObjectValues([TeamworkDevice::class, 'createFromDiscriminatorValue'])),\n 'teamsAppSettings' => fn(ParseNode $n) => $o->setTeamsAppSettings($n->getObjectValue([TeamsAppSettings::class, 'createFromDiscriminatorValue'])),\n 'teamTemplates' => fn(ParseNode $n) => $o->setTeamTemplates($n->getCollectionOfObjectValues([TeamTemplate::class, 'createFromDiscriminatorValue'])),\n 'workforceIntegrations' => fn(ParseNode $n) => $o->setWorkforceIntegrations($n->getCollectionOfObjectValues([WorkforceIntegration::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function format()\n {\n $result = array();\n\n foreach ($this->groups as $group) {\n $result[] = array(\n 'id' => $group->getInternalId(),\n 'external_id' => $group->getExternalId(),\n 'value' => $group->getName(),\n 'label' => $group->getName(),\n );\n }\n\n return $result;\n }", "public function toArray(): array\n {\n $array = [];\n $str = new Str();\n\n foreach (\\get_object_vars($this) as $property => $value) {\n $array[$str->snake($property)] = $value;\n }\n\n return $array;\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'operation' => fn(ParseNode $n) => $o->setOperation($n->getEnumValue(RuleOperation::class)),\n 'property' => fn(ParseNode $n) => $o->setProperty($n->getStringValue()),\n 'values' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setValues($val);\n },\n 'valuesJoinedBy' => fn(ParseNode $n) => $o->setValuesJoinedBy($n->getEnumValue(BinaryOperator::class)),\n ];\n }", "public function get_field_properties() {\n return array(PARAM_RAW, NULL_NOT_ALLOWED);\n }", "public static function _getPropertyNames(): array\n {\n return [\n 'name',\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'comment' => fn(ParseNode $n) => $o->setComment($n->getStringValue()),\n 'createdBy' => fn(ParseNode $n) => $o->setCreatedBy($n->getObjectValue([IdentitySet::class, 'createFromDiscriminatorValue'])),\n 'createdDateTime' => fn(ParseNode $n) => $o->setCreatedDateTime($n->getDateTimeValue()),\n 'items' => fn(ParseNode $n) => $o->setItems($n->getCollectionOfObjectValues([DocumentSetVersionItem::class, 'createFromDiscriminatorValue'])),\n 'shouldCaptureMinorVersion' => fn(ParseNode $n) => $o->setShouldCaptureMinorVersion($n->getBooleanValue()),\n ]);\n }", "public function toArray()\r\n\t{\r\n\t\t$attributes = parent::toArray();\r\n\r\n\t\tif (! $this->autoTranslations) return $attributes;\r\n\r\n\t\tforeach ($this->translatableAttributes as $field) {\r\n\t\t\t$attributes[$field] = $this->getTranslation($field);\r\n\t\t}\r\n\r\n\t\treturn $attributes;\r\n\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'accessRecommendation' => fn(ParseNode $n) => $o->setAccessRecommendation($n->getStringValue()),\n 'accessReviewId' => fn(ParseNode $n) => $o->setAccessReviewId($n->getStringValue()),\n 'appliedBy' => fn(ParseNode $n) => $o->setAppliedBy($n->getObjectValue([UserIdentity::class, 'createFromDiscriminatorValue'])),\n 'appliedDateTime' => fn(ParseNode $n) => $o->setAppliedDateTime($n->getDateTimeValue()),\n 'applyResult' => fn(ParseNode $n) => $o->setApplyResult($n->getStringValue()),\n 'justification' => fn(ParseNode $n) => $o->setJustification($n->getStringValue()),\n 'reviewedBy' => fn(ParseNode $n) => $o->setReviewedBy($n->getObjectValue([UserIdentity::class, 'createFromDiscriminatorValue'])),\n 'reviewedDateTime' => fn(ParseNode $n) => $o->setReviewedDateTime($n->getDateTimeValue()),\n 'reviewResult' => fn(ParseNode $n) => $o->setReviewResult($n->getStringValue()),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'availability' => fn(ParseNode $n) => $o->setAvailability($n->getCollectionOfObjectValues([ShiftAvailability::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function applicable_formats() {\n return array('all'=>true);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'assignmentFilterType' => fn(ParseNode $n) => $o->setAssignmentFilterType($n->getEnumValue(DeviceAndAppManagementAssignmentFilterType::class)),\n 'groupId' => fn(ParseNode $n) => $o->setGroupId($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'payloadId' => fn(ParseNode $n) => $o->setPayloadId($n->getStringValue()),\n 'payloadType' => fn(ParseNode $n) => $o->setPayloadType($n->getEnumValue(AssociatedAssignmentPayloadType::class)),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'errors' => fn(ParseNode $n) => $o->setErrors($n->getIntegerValue()),\n 'groups' => fn(ParseNode $n) => $o->setGroups($n->getIntegerValue()),\n 'matchedPeopleByRole' => fn(ParseNode $n) => $o->setMatchedPeopleByRole($n->getCollectionOfObjectValues([IndustryDataRunRoleCountMetric::class, 'createFromDiscriminatorValue'])),\n 'memberships' => fn(ParseNode $n) => $o->setMemberships($n->getIntegerValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'organizations' => fn(ParseNode $n) => $o->setOrganizations($n->getIntegerValue()),\n 'people' => fn(ParseNode $n) => $o->setPeople($n->getIntegerValue()),\n 'unmatchedPeopleByRole' => fn(ParseNode $n) => $o->setUnmatchedPeopleByRole($n->getCollectionOfObjectValues([IndustryDataRunRoleCountMetric::class, 'createFromDiscriminatorValue'])),\n 'warnings' => fn(ParseNode $n) => $o->setWarnings($n->getIntegerValue()),\n ];\n }", "public function toArray()\n {\n return [\n 'type' => 'object',\n 'properties' => [\n 'email' => ['type' => 'string'],\n 'key' => ['type' => 'string'],\n 'name' => ['type' => 'string'],\n 'picture' => ['type' => 'string'],\n 'phone' => ['type' => 'string'],\n 'balance' => ['type' => 'integer', 'format' => 'int32'],\n 'codes' => ['type' => 'array', 'items' => ['type' => 'string']],\n 'order_comment_tracking_code' => ['type' => 'string'],\n 'title' => ['type' => 'string'],\n ],\n 'required' => ['email', 'key', 'name', 'phone', 'balance', 'codes', 'order_comment_tracking_code', 'title'],\n ];\n }", "protected function properties()\n {\n return [\n 'title' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::text(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__LOGBOOK__TITLE',\n C__PROPERTY__INFO__DESCRIPTION => 'Title'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__title'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__TITLE'\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__IMPORT => false,\n C__PROPERTY__PROVIDES__EXPORT => false,\n C__PROPERTY__PROVIDES__REPORT => false\n ]\n ]\n ),\n 'type' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__TYPE',\n C__PROPERTY__INFO__DESCRIPTION => 'Type'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__isys_net_type__id',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_net_type',\n 'isys_net_type__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__TYPE',\n C__PROPERTY__UI__PARAMS => [\n 'p_bDisabled' => '1',\n 'p_strTable' => 'isys_net_type',\n 'p_bDbFieldNN' => '1'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false\n ]\n ]\n ),\n 'address' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::text(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET',\n C__PROPERTY__INFO__DESCRIPTION => 'Net'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__address'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__NET_V4',\n C__PROPERTY__UI__PARAMS => [\n 'p_bReadonly' => '',\n 'p_strClass' => 'input input-mini'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => false\n ]\n ]\n ),\n 'netmask' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::text(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__MASK',\n C__PROPERTY__INFO__DESCRIPTION => 'Netmask'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__mask'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__MASK_V4',\n C__PROPERTY__UI__PARAMS => [\n 'p_strClass' => 'input input-mini',\n 'p_bReadonly' => ''\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => false\n ]\n ]\n ),\n 'gateway' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__DEF_GW',\n C__PROPERTY__INFO__DESCRIPTION => 'Default Gateway'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__isys_catg_ip_list__id'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__DEF_GW_V4',\n C__PROPERTY__UI__PARAMS => [\n 'p_arData' => new isys_callback(\n [\n 'isys_cmdb_dao_category_s_net',\n 'callback_property_gateway'\n ]\n )\n ]\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'get_gateway'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false\n ]\n ]\n ),\n 'range_from' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::text(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__ADDRESS_FROM',\n C__PROPERTY__INFO__DESCRIPTION => 'DHCP from'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__address_range_from'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__ADDRESS_RANGE_FROM'\n ]\n ]\n ),\n 'range_to' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::text(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__ADDRESS_TO',\n C__PROPERTY__INFO__DESCRIPTION => 'DHCP to'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__address_range_to'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__ADDRESS_RANGE_TO'\n ]\n ]\n ),\n 'dns_server' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::object_browser(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__DNS_SERVER',\n C__PROPERTY__INFO__DESCRIPTION => 'DNS server'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__id',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_cats_net_list_2_isys_catg_ip_list',\n 'isys_cats_net_list__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__DNS_SERVER'\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'get_net_dns_server'\n ]\n ]\n ]\n ),\n 'dns_domain' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::multiselect(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__DNS_DOMAIN',\n C__PROPERTY__INFO__DESCRIPTION => 'Domain / DNS namespace'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__id',\n C__PROPERTY__DATA__TABLE_ALIAS => 'dns_domain',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_cats_net_list_2_isys_net_dns_domain',\n 'isys_cats_net_list__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__DNS_DOMAIN',\n C__PROPERTY__UI__PARAMS => [\n 'p_strTable' => 'isys_net_dns_domain',\n 'placeholder' => _L('LC__CMDB__CATS__NET__DNS_DOMAIN'),\n 'emptyMessage' => _L('LC__CMDB__CATS__NET__NO_DNS_DOMAINS_FOUND'),\n 'p_onComplete' => \"idoit.callbackManager.triggerCallback('cmdb-cats-net-dns_domain-update', selected);\",\n 'multiselect' => true\n //'p_arData' => new isys_callback(array('isys_cmdb_dao_category_s_net', 'callback_property_dns_domain'))\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__VALIDATION => false,\n C__PROPERTY__PROVIDES__REPORT => false\n ],\n C__PROPERTY__CHECK => [\n C__PROPERTY__CHECK__MANDATORY => false,\n C__PROPERTY__CHECK__VALIDATION => false\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'dialog_multiselect'\n ]\n ]\n ]\n ),\n 'cidr_suffix' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::int(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__CIDR_SUFFIX',\n C__PROPERTY__INFO__DESCRIPTION => 'CIDR-Suffix'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__cidr_suffix'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__CIDR',\n C__PROPERTY__UI__PARAMS => [\n 'p_bReadonly' => '',\n 'p_strClass' => 'input input-mini'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false\n ]\n ]\n ),\n 'reverse_dns' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::text(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATS__NET__REVERSE_DNS',\n C__PROPERTY__INFO__DESCRIPTION => 'Reverse dns'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__reverse_dns'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__REVERSE_DNS'\n ]\n ]\n ),\n 'layer2_assignments' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::object_browser(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__LAYER2_NET',\n C__PROPERTY__INFO__DESCRIPTION => 'Layer-2-net assignments'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_obj__id'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__LAYER2',\n C__PROPERTY__UI__PARAMS => [\n isys_popup_browser_object_ng::C__TITLE => 'LC__BROWSER__TITLE__NET',\n isys_popup_browser_object_ng::C__MULTISELECTION => true,\n isys_popup_browser_object_ng::C__CAT_FILTER => 'C__CATS__LAYER2_NET'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper',\n 'layer_2_assignments'\n ]\n ]\n ]\n ),\n 'address_v6' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::virtual(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET',\n C__PROPERTY__INFO__DESCRIPTION => 'Net v6'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATS__NET__NET_V6'\n ]\n ]\n ),\n 'description' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::commentary(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__LOGBOOK__DESCRIPTION',\n C__PROPERTY__INFO__DESCRIPTION => 'Description'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_cats_net_list__description'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CMDB__CAT__COMMENTARY_' . C__CMDB__CATEGORY__TYPE_SPECIFIC . C__CATS__NET\n ]\n ]\n )\n ];\n }", "public function getStandardJsonFormat(){\n return VoucherValidationLogTransformer::transform($this->prepareVoucherValidationLogGreedyData());\n }", "public function toArray()\n {\n return [\n 'location' => $this->location(),\n 'from' => $this->from(),\n 'to' => $this->to(),\n 'pencil' => $this->pencil\n ];\n }", "public function properties(){\n \t\treturn CMap::mergeArray(\n \t\t\tparent::properties(),\n \t\t\tarray(\n\t\t\t\t'inboundMessageID' => array('type' => 'string'),\n\t\t\t\t'sourceAddress' => array('type' => 'string'),\n\t\t\t\t'messageContent' => array('type' => 'string'),\n\t\t\t\t'externalTransactionID' => array('type' => 'string'),\n\t\t\t\t'status' => array('type' => 'string'),\n\t\t\t\t'dateCreated' => array('type' => 'string'),\n\t\t\t\t'dateModified' => array('type' => 'string'),\n \t\t\t)\n \t\t);\n \t}", "public static function _getPropertyNames(): array\n {\n return [\n ];\n }" ]
[ "0.6252512", "0.618151", "0.6131043", "0.60949105", "0.6042", "0.6037092", "0.5927645", "0.59195846", "0.5906057", "0.5886057", "0.5879472", "0.5816566", "0.58022815", "0.5793941", "0.5793265", "0.5791435", "0.5769309", "0.5744106", "0.57254124", "0.57181686", "0.5706865", "0.5634878", "0.5626163", "0.5622243", "0.5617171", "0.55977446", "0.5575791", "0.5575253", "0.5573523", "0.5549569", "0.5532808", "0.55244017", "0.55153424", "0.55085874", "0.549753", "0.54954135", "0.5491229", "0.54891795", "0.5476992", "0.5472929", "0.54664487", "0.5459349", "0.54489344", "0.54324275", "0.543039", "0.54295343", "0.5426738", "0.54202527", "0.54185414", "0.5415122", "0.54099584", "0.54099584", "0.54055434", "0.5403773", "0.5394194", "0.5390655", "0.5390162", "0.5383619", "0.53791016", "0.5370173", "0.53679144", "0.5365261", "0.5356351", "0.5354881", "0.53415936", "0.5328575", "0.53260636", "0.5324806", "0.5322101", "0.5320646", "0.53156763", "0.5312402", "0.53086966", "0.5304993", "0.5301252", "0.5296504", "0.5295379", "0.529188", "0.52881414", "0.52880824", "0.5287304", "0.5286562", "0.5286491", "0.5282074", "0.527779", "0.5276444", "0.527124", "0.5270809", "0.5270426", "0.5269055", "0.5267184", "0.52578765", "0.52572984", "0.52555615", "0.5255335", "0.52541786", "0.5250331", "0.5249987", "0.52486384", "0.5245784", "0.523765" ]
0.0
-1
Array of attributes where the key is the local name, and the value is the original name
public static function attributeMap() { return self::$attributeMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function changedAttributesName(): array\n {\n $changedAttributes = [];\n $attributes = $this->toArray();\n foreach ($attributes as $key => $value) {\n if (isset($this->originals[$key]) && $value !== $this->originals[$key] && ! ((is_array($this->originals[$key]) || is_object($this->originals[$key])))) {\n $changedAttributes[] = $key;\n }\n }\n return $changedAttributes;\n }", "public function attributesToArray()\n {\n return Helper::toCamelCase($this->attributes());\n }", "private function getApiAttributeNamesArray()\n {\n $array = [\n 'firstname',\n 'lastname',\n 'email',\n 'id',\n 'website_id',\n 'group_id',\n 'prefix',\n 'middlename',\n 'suffix',\n 'dob',\n 'taxvat',\n 'gender',\n 'is_active',\n 'company',\n 'city',\n 'country_id',\n 'region',\n 'postcode',\n 'telephone',\n 'fax',\n 'vat_id',\n 'street_1',\n 'street_2',\n 'subaccounts',\n 'manage_subaccounts',\n 'account_data_modification_permission',\n 'account_order_history_view_permission',\n 'checkout_order_create_permission',\n 'checkout_order_approval_permission',\n 'checkout_cart_view_permission',\n 'checkout_view_permission',\n 'checkout_order_placed_notification_permission',\n 'force_usage_parent_company_name_permission',\n 'force_usage_parent_vat_permission',\n 'force_usage_parent_addresses_permission',\n 'password',\n 'parent_email',\n 'promote',\n 'can_manage_subaccounts',\n ];\n\n return $array;\n }", "abstract public function attributeNames();", "public function attributeNames() {\n\t\treturn array(\n\t\t\t'name',\n\t\t\t'path',\n\t\t);\n\t}", "private function attrNames()\n {\n $dimAttr = [\n 'length' => 'length',\n 'width' => 'width',\n 'height' => 'height',\n ];\n $dsAttr = [\n 'dropship' => 'dropship',\n 'dropship_location' => 'dropship_location'\n ];\n\n $this->attrNames = ($this->mageVersion >= '2.2.5') ? $dsAttr : array_merge($dsAttr, $dimAttr);\n }", "public function getAttributes($name);", "public function attributes(): array\n {\n return [\n $this->attributePrefix.'target' => $this->target(),\n $this->attributePrefix.'filterByType' => $this->filterByType,\n ];\n }", "public static function dataAttributes(array $attributes): array {\n\t\treturn ArrayTools::flatten(ArrayTools::filterKeyPrefixes(ArrayTools::keysReplace(array_change_key_case($attributes), '_', '-'), 'data-', true));\n\t}", "public function attributes()\n {\n return collect(array_keys($this->rules()))\n ->mapWithKeys(function ($key) {\n return [$key => str_replace(['.', '_'], ' ', $key)];\n })\n ->toArray();\n }", "public function attributes() // atribūtu savi nosaukumi\n {\n return[ \n 'fname' => 'Vārds',\n 'lname' => 'Uzvārds',\n 'email' => 'E-pasts',\n 'oldpassword' => 'Paroles lauks',\n 'password' => 'Jaunas paroles lauks',\n 'buttontitle' => 'Pogas virsraksts',\n 'buttonlink' => 'Pogas links',\n 'reciever' => 'Saņēmēju lauks',\n 'emailtitle' => 'Ziņas virsrsksts',\n 'emailtext' => 'Ziņas teksts',\n 'transport' => 'Pasākumu lauks'\n ];\n }", "public function separateTranslationsFromAttributes(): array\n\t{\n\t\t$attributes = collect($this->attributes);\n\n\t\t// Extract the translated values\n\t\t$translatables = $attributes->only($this->translatable);\n\t\t$this->translatedAttributes = $translatables->toArray();\n\n\t\t// Keep only the non-translatable attributes\n\t\t$this->attributes = $attributes->forget($this->translatable)->toArray();\n\n\t\treturn $this->translatedAttributes;\n\t}", "public function getAttributes()\n {\n $return = [];\n foreach ($this->attr as $attr => $info) {\n $return[$attr] = $this->getAttribute($attr);\n }\n\n return $return;\n }", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function attribute_names() {\n\t\n\t\treturn array_keys( $this->attributes );\n\t\t\n\t}", "public function getValidNameAttributes(): array\n {\n return [\n 'Starts with _' => [\n 'attribute_name_0001.xsd', '_foo', \n ], \n 'Starts with letter' => [\n 'attribute_name_0002.xsd', 'f', \n ], \n 'Contains letter' => [\n 'attribute_name_0003.xsd', 'foo', \n ], \n 'Contains digit' => [\n 'attribute_name_0004.xsd', 'f00', \n ], \n 'Contains .' => [\n 'attribute_name_0005.xsd', 'f.bar', \n ], \n 'Contains -' => [\n 'attribute_name_0006.xsd', 'f-bar', \n ], \n 'Contains _' => [\n 'attribute_name_0007.xsd', 'f_bar', \n ], \n 'Surrounded by whitespaces' => [\n 'attribute_name_0008.xsd', 'foo_bar', \n ], \n ];\n }", "public function getAttributes() {\n $attr = array();\n \n $attr[\"id\"] = $this->id_;\n $attr[\"taxonId\"] = $this->taxonId_;\n $attr[\"dbh\"] = $this->dbh_;\n $attr[\"lat\"] = $this->lat_;\n $attr[\"lng\"] = $this->lng_;\n $attr[\"layers\"] = $this->layers_;\n \n return $attr;\n }", "abstract function attributes(): array;", "public function getAttributes()\n {\n return array();\n }", "public function getAttributes()\n {\n return array();\n }", "public function getAttributes()\n {\n return array();\n }", "public function getAttributes()\n {\n return array();\n }", "public function attributeNames()\n {\n return array_merge_recursive(parent::attributeNames(), array(\n 'markup',\n 'name',\n 'plaintext_markup',\n 'subject_markup',\n 'base',\n ));\n }", "public function attributes()\n {\n return [\n 'name' => __('main.name'),\n ];\n }", "private function mapAttributes() {\n\t\t$attributes = [];\n\t\t$originalAttrs = $this->subscribedTopic->getRoute()->getAttributes();\n\n\t\tif (!count($originalAttrs)) {\n\t\t\treturn $attributes;\n\t\t}\n\n\t\tforeach ($originalAttrs as $attr => $obj) {\n\t\t\t$routeParts = explode('/', $this->route);\n\n\t\t\tif (!isset($routeParts[$obj->index])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$attributes[$attr] = $routeParts[$obj->index];\n\t\t}\n\n\t\treturn $attributes;\n\t}", "public function attributes() : array;", "public function attributeNames()\n\t{\n\t\t$class = get_class($this);\n\t\tif(!isset(self::$_names[$class]))\n\t\t{\n\t\t\tself::$_names[$class] = array_merge(array('id'), $this->getNames($this->arrayStructure()));\n\t\t}\n\t\t\n\t\treturn self::$_names[$class];\n\t}", "public static function attributeMap()\n {\n return [\n 'status' => 'status',\n 'quota' => 'quota'\n ];\n }", "public static function attributeMap()\n {\n return [\n 'status' => 'status',\n 'time' => 'time'\n ];\n }", "public function toArray() {\n $attrs = $this->_private_attributes;\n $result = array();\n foreach ($attrs as $key => $attr) {\n if (method_exists($this, \"get\" . underscore_to_camel_case($key, true))) {\n eval('$result[\"' . $key . '\"] = $this->get' . underscore_to_camel_case($key, true) . '();');\n } else {\n $result[$key] = $attr;\n }\n }\n return $result;\n }", "public function attributeNames() {\n\t\t$attributeNames = array(\n\t\t\t'name',\n\t\t\t'category_name',\n\t\t\t'default_content',\n\t\t);\n\t\t$attributeNames = array_merge($attributeNames, $this->contentAttributeNames());\n\t\treturn $attributeNames;\n\t}", "public function getChangedAttributes()\n {\n $output = array();\n\n foreach ($this->attributes as $name => $value) {\n if ($this->hasChanged($name)) {\n $output[$name] = $value;\n }\n }\n\n return $output;\n }", "public function getAttributes()\n {\n return array_merge(\n $this->attributes,\n [\n 'args' => $this->args(),\n 'type' => $this->type(),\n 'resolve' => $this->getResolver(),\n ]\n );\n }", "public function attributeNames() {\n\t\t$attributeNames = array(\n\t\t\t'name',\n\t\t\t'width',\n\t\t\t'height',\n\t\t);\n\t\t$attributeNames = array_merge($attributeNames, $this->existAttributeNames());\n\t\treturn $attributeNames;\n\t}", "public function getUnchangedAttributes()\n {\n $output = array();\n\n foreach ($this->attributes as $name => $value) {\n if (!$this->hasChanged($name)) {\n $output[$name] = $value;\n }\n }\n\n return $output;\n }", "public function getChanges(): array\n {\n $changes = [];\n\n foreach ($this->changedAttributesName() as $key) {\n $changes[$key] = $this->originals[$key];\n }\n\n return $changes;\n }", "public function getAttributeNames ()\n {\n\n return array_keys($this->attributes);\n\n }", "public function attributes(): array\n {\n return [\n 'name' => '角色名称',\n 'staff' => '关联员工',\n 'brand' => '关联品牌',\n 'department' => '关联部门',\n ];\n }", "public function attributes()\n {\n return [\n 'external_id' => 'Third Party Identifier',\n 'name_first' => 'First Name',\n 'name_last' => 'Last Name',\n 'root_admin' => 'Root Administrator Status',\n ];\n }", "public function toArray(): array\n {\n return [\n $this->attribute->getName(),\n $this->name,\n ];\n }", "public function attributeNames()\n {\n $className = get_class($this);\n if (!isset(self::$_names[$className])) {\n $class = new ReflectionClass(get_class($this));\n $names = array();\n foreach ($class->getProperties() as $property) {\n $name = $property->getName();\n if ($property->isPublic() && !$property->isStatic())\n $names[] = $name;\n }\n return self::$_names[$className] = $names;\n } else\n return self::$_names[$className];\n }", "public function toArray()\n {\n $attributes = parent::toArray();\n \n foreach ($this->getTranslatableAttributes() as $name) {\n $attributes[$name] = $this->getTranslation($name, app()->getLocale());\n }\n \n return $attributes;\n }", "protected function prepareAttributes(array $attributes)\n\t{\n\t\t$result = array();\n\n\t\tforeach ($attributes as $key => $attributeValue)\n\t\t{\n\t\t\t$newKey = mb_strtolower($key);\n\t\t\t$newKey = str_replace('_', '-', $newKey);\n\n\t\t\tif (is_array($attributeValue))\n\t\t\t{\n\t\t\t\t$newAttribute = $this->prepareAttributes($attributeValue);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$newAttribute = $attributeValue;\n\t\t\t}\n\n\t\t\t$result[$newKey] = $newAttribute;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function toArray()\r\n\t{\r\n\t\t$attributes = parent::toArray();\r\n\r\n\t\tif (! $this->autoTranslations) return $attributes;\r\n\r\n\t\tforeach ($this->translatableAttributes as $field) {\r\n\t\t\t$attributes[$field] = $this->getTranslation($field);\r\n\t\t}\r\n\r\n\t\treturn $attributes;\r\n\t}", "protected function getAttributes()\n {\n return [];\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function attributes()\n {\n return [\n 'client_id' => trans('financials.client'),\n 'name' => trans('persona.name'),\n 'email' => trans('persona.email'),\n 'password' => trans('auth.password'),\n 'password_confirmation' => trans('auth.password:confirmation'),\n 'role' => trans('persona.title'),\n 'stored_file' => trans('persona.image'),\n ];\n }", "public function attributes()\n {\n return [\n ];\n }", "public function attributes(): array\n {\n return [\n //\n ];\n }", "public function attributes(): array\n {\n return [\n //\n ];\n }", "public function getAttributes()\n\t{\n\t\treturn array(\n\t\t\t'usuario' => $this->usuario,\n\t\t\t'correo' => $this->correo,\n\t\t\t'cedula'=>$this->cedula,\n\t\t\t//'firstName' => $this->firstName,\n\t\t\t//'lastName' => $this->lastName,\n\t\t);\n\t}", "private function _processAttributes($attributes){\r\n\r\n if(Help::isAssoc($attributes)){\r\n\r\n foreach($attributes as $key => $value){\r\n $attrs[] = $key.'('.$value.')';\r\n }\r\n }\r\n else{\r\n $attrs = $attributes;\r\n }\r\n\r\n return $attrs;\r\n }", "public function attributes()\n {\n return array_merge(\n parent::attributes(),\n ['date', 'origin', 'originName', 'total']\n );\n }", "public function getCustomAttributes(): array;", "public static function attributeMap()\n {\n return [\n 'application_id' => 'application_id',\n 'is_default' => 'is_default',\n 'role' => 'role',\n 'type' => 'type',\n '_issues' => '_issues'\n ];\n }", "public static function attributeMap();", "public function getAttributesNames(){\n\t\t$this->_connect();\n\t\treturn ActiveRecordMetaData::getAttributes($this->_source, $this->_schema);\n\t}", "public function attributes()\n {\n return [];\n }", "public function attributes()\n {\n return [];\n }", "public function attributes()\n {\n return [];\n }", "protected static function keyToAttributeMapping()\n {\n return array();\n }", "public function getOldAttributes()\n {\n return $this->_oldAttributes === null ? [] : $this->_oldAttributes;\n }", "public function getAttributes() {}", "public function getAttributes() {}", "public function attributes()\n {\n return [\n 'name' => __('basic::elf.name'),\n 'slug' => __('basic::elf.slug'),\n 'image' => __('basic::elf.image'),\n 'preview' => __('basic::elf.preview'),\n 'thumbnail' => __('basic::elf.thumbnail'),\n 'description' => __('basic::elf.description'),\n 'additional_text' => __('gallery::elf.additional_text'),\n 'option' => __('gallery::elf.option'),\n 'active' => __('basic::elf.active'),\n 'link' => __('basic::elf.link'),\n ];\n }", "public function attributes()\n {\n return [\n 'name' => 'nombre',\n 'last_name' => 'apellido',\n 'num_id' => 'cédula',\n 'email' => 'correo',\n 'birthdate' => 'fecha',\n 'sex' => 'sexo',\n 'place_birthdate' => 'lugar de nacimiento',\n 'blood_group' => 'grupo sanguineo',\n 'phone_person' => 'telefono personal',\n 'location_home' => 'lugar donde vive',\n 'phone_home' => 'telefono de casa',\n 'location_work' => 'lugar de trabajo ',\n 'phone_work' => 'telefono de trabajo',\n 'profession' => 'profesión',\n 'current_occupation' => 'ocupación',\n 'observation' => 'observación',\n ];\n }", "public function getAttributeNames()\n {\n return array_keys($this->attributes);\n }", "public function getAddAttrArray()\n {\n $custom = $this->select(Customization::ADD_ATTR)->get();\n $result = array_values($custom->toArray()[0]);\n array_unshift($result, __('general.select_attr'));\n return $result;\n }", "function get_attr()\n\t{\n\t\t$a = array();\n\t\twhile (($s = array_shift($this->pieces))) {\n\t\t\tif (($i = strpos($s,\":\")) >= 1) {\n\t\t\t\t$attr = substr($s,0,$i);\n\t\t\t\t$val = substr($s,$i+1);\n\t\t\t\tif (($j = strpos($val,\"(\"))\n\t\t\t\t && ($k = strpos($val,\")\"))\n\t\t\t\t && ($k > $j)) {\n\t\t\t\t\t$a[\"arg:\".$attr] = substr($val,$j+1,$k-($j+1));\n\t\t\t\t\t$val = substr($val,0,$j);\n\t\t\t\t}\n\t\t\t\t$a[$attr] = $val;\n\t\t\t} elseif (intval($s) > 0) {\n\t\t\t if ($a['$scale'] != \"\")\n\t\t\t\t$a['scale'] = intval($s);\n\t\t\t}\n\t\t}\n\t\treturn $a;\n\t}", "public function getAttributes() {\n $toReturn = array();\n $toReturn[\"id\"] = $this->id_;\n $toReturn[\"username\"] = $this->username_;\n $toReturn[\"email\"] = $this->email_;\n $toReturn[\"displayName\"] = $this->displayName_;\n $toReturn[\"firstName\"] = $this->firstName_;\n $toReturn[\"lastName\"] = $this->lastName_;\n $toReturn[\"postalCode\"] = $this->postalCode_;\n if ($this->privileges_ !== null) {\n $toReturn[\"privileges\"] = $this->privileges_;\n } else {\n $toReturn[\"privileges\"] = array();\n }\n \n $toReturn[\"isVerified\"] = $this->isVerified_;\n return $toReturn;\n }", "function getAttrList() {\n return array_keys($this->attributes);\n }", "protected function getSerializableAttributeNames(): array {\n return array_keys(get_object_vars($this));\n }", "protected function getAttributesToObfuscate(): array\n {\n return config('logbook.obfuscated_fields');\n }", "function getAttributes()\r\n\t{\r\n\t\t$result = array();\r\n\t\t$attributes = $this->object->getAttributes();\r\n\t\t\r\n\t\tforeach( $attributes as $key => $attribute )\r\n\t\t{\r\n\t\t\tif ( $key == 'OrderNum' ) continue;\r\n\t\t\tif ( $key == 'RecordCreated' ) continue;\r\n\t\t\tif ( $key == 'RecordModified' ) continue;\r\n\t\t\t\t\r\n\t\t\tarray_push( $result, $key );\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function attributes()\n {\n return [\n 'name' => '商品名',\n 'price' => '価格',\n 'description' => '説明文',\n 'tag_for_search' => '検索用タグ',\n 'img' => '画像',\n 'stock' => '在庫数'\n ];\n }", "public function dataProviderNormalizeUserAttributes()\n {\n return [\n [\n [\n 'name' => 'raw/name',\n 'email' => 'raw/email',\n ],\n [\n 'raw/name' => 'name value',\n 'raw/email' => 'email value',\n ],\n [\n 'name' => 'name value',\n 'email' => 'email value',\n ],\n ],\n [\n [\n 'name' => function ($attributes) {\n return $attributes['firstName'] . ' ' . $attributes['lastName'];\n },\n ],\n [\n 'firstName' => 'John',\n 'lastName' => 'Smith',\n ],\n [\n 'name' => 'John Smith',\n ],\n ],\n [\n [\n 'email' => ['emails', 'prime'],\n ],\n [\n 'emails' => [\n 'prime' => '[email protected]'\n ],\n ],\n [\n 'email' => '[email protected]',\n ],\n ],\n [\n [\n 'email' => ['emails', 0],\n 'secondaryEmail' => ['emails', 1],\n ],\n [\n 'emails' => [\n '[email protected]',\n ],\n ],\n [\n 'email' => '[email protected]',\n ],\n ],\n [\n [\n 'name' => 'file_get_contents',\n ],\n [\n 'file_get_contents' => 'value',\n ],\n [\n 'name' => 'value',\n ],\n ],\n ];\n }", "public function getFlatAttributes() {\n $attrib = array();\n foreach($this->attributes as $a) {\n $attrib = $attrib + $a;\n }\n return $attrib;\n }", "public function defineAttributes()\n\t{\n\t\treturn array();\n\t}", "public function getAttributeNames()\n {\n $names = array_keys($this->_attrs);\n sort($names);\n return $names;\n }", "protected function attributes()\n {\n return [];\n }", "public function getAttributes() {\n return $this->attributes->getArray();\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }" ]
[ "0.73336", "0.68268436", "0.65760714", "0.65756506", "0.65030116", "0.6489458", "0.64807576", "0.6445652", "0.64143735", "0.63852084", "0.6381065", "0.6349757", "0.62795633", "0.6254031", "0.6254031", "0.6254031", "0.6254031", "0.62487864", "0.6192782", "0.61687446", "0.61621976", "0.61337525", "0.61337525", "0.61337525", "0.61337525", "0.61080104", "0.61067927", "0.61017734", "0.61005735", "0.6098226", "0.60923576", "0.60829395", "0.6071283", "0.6057216", "0.6056825", "0.6038051", "0.603803", "0.60321957", "0.6012105", "0.60005033", "0.59993994", "0.59896296", "0.59756994", "0.5953592", "0.5934222", "0.59249204", "0.59192836", "0.59164405", "0.5911171", "0.5911171", "0.5911171", "0.5911171", "0.5911171", "0.5911171", "0.5911171", "0.5911171", "0.5911171", "0.5899692", "0.5898575", "0.5893561", "0.5893561", "0.58876544", "0.5880664", "0.58755046", "0.58674294", "0.5863127", "0.5859776", "0.58524966", "0.5851779", "0.5851779", "0.5851779", "0.58459735", "0.5830237", "0.5827107", "0.58263385", "0.5822662", "0.58211565", "0.5812358", "0.5810034", "0.5801915", "0.5797703", "0.57963604", "0.5793313", "0.5790889", "0.5781644", "0.5768648", "0.5766543", "0.5762364", "0.5762052", "0.5759843", "0.5759753", "0.57538253", "0.5752608", "0.5752608", "0.5752608", "0.5752608", "0.5752608", "0.5752608", "0.5752608", "0.5752608", "0.5752608" ]
0.0
-1
Array of attributes to setter functions (for deserialization of responses)
public static function setters() { return self::$setters; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAttributes();", "public static function setters();", "public static function setters()\n {\n return [\n 'status' => 'setStatus',\n 'quota' => 'setQuota'\n ];\n }", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "public static function setters()\n {\n return [\n 'application_id' => 'setApplicationId',\n 'is_default' => 'setIsDefault',\n 'role' => 'setRole',\n 'type' => 'setType',\n '_issues' => 'setIssues'\n ];\n }", "public function setAttributes($attributes){ }", "public static function setters()\n {\n return [\n 'status' => 'setStatus',\n 'time' => 'setTime'\n ];\n }", "public function __construct($daten = array())\n{\n if ($daten) {\n foreach ($daten as $k => $v) {\n $setterName = 'set' . ucfirst($k);\n // wenn ein ungültiges Attribut übergeben wurde\n // (ohne Setter), ignoriere es\n if (method_exists($this, $setterName)) {\n $this->$setterName($v);\n }\n }\n }\n}", "public function setAttributes($arr) {\n foreach($arr as $key => $val) {\n switch($key) {\n case \"id\":\n case \"user_id\":\n //casting null to int will return 0; don't want that\n if ($val !== null) {\n $this->id_ = (int) $val;\n }\n break; \n case \"username\":\n $this->username_ = $val;\n break; \n case \"email\":\n $this->email_ = $val;\n break; \n case \"displayName\":\n case \"display_name\":\n $this->displayName_ = $val;\n break; \n case \"firstName\":\n case \"first_name\":\n $this->firstName_ = $val;\n break; \n case \"lastName\":\n case \"last_name\":\n $this->lastName_ = $val;\n break; \n case \"postalCode\":\n case \"postal_code\":\n $this->postalCode_ = $val;\n break; \n case \"isVerified\":\n case \"is_verified\":\n $this->isVerified_ = (int) $val;\n break; \n case \"privileges\":\n //might be a string of comma-separated numbers, or an array\n if (is_array($val)) {\n $this->privileges_ = $val;\n } else if ($val !== null) {\n //clear array first\n unset($this->privileges_);\n $this->privileges_ = array();\n $tmp = explode(\",\", $val);\n foreach($tmp as $v){\n if (is_numeric($v)) {\n //$this->privileges_[(int) $v] = 1;\n $this->privileges_[] = (int) $v;\n }\n }\n \n }\n break;\n\n default:\n //ignore any others\n }\n }\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public function setAttributes($values)\n {\n if (is_array($values)) {\n foreach ($values as $name => $value) {\n $setter = 'set' . ucfirst($name);\n if (method_exists($this, $setter)) {\n // set property\n $this->$setter($value);\n }\n }\n }\n }", "public static function setters()\n {\n return [\n 'tenant_id' => 'setTenantId',\n 'expires_in' => 'setExpiresIn',\n 'scopes' => 'setScopes'\n ];\n }", "public function setAttributes($attributes);", "public function setAttributes($attributes)\n {\n foreach($attributes as $key => $value) {\n $this->$key = $value;\n }\n }", "abstract protected function setRequiredGetters();", "abstract protected function setValidationCustomAttributes(): array;", "protected abstract function initializeAttributes(): array;", "public function setAttrs($attrs);", "public function __construct(array $attributes)\n {\n foreach ($attributes as $attribute => $value){\n $this->$attributes = $value;\n }\n }", "abstract function attributes(): array;", "public function setRawAttributes($attributes) {\n $regex_attributes = \"/(?P<key>[a-z0-9-]+)=?(?P<value> [a-z0-9-]+)?,?/ix\";\n $attrib = array();\n if($attributes != '') {\n $parts = array();\n $result = preg_match_all($regex_attributes, $attributes, $parts);\n if(!$result) {\n $this->attributes = $attrib;\n return $this;\n }\n $keys = $parts['key'];\n $values = $parts['value'];\n $allowed_keys = $this->getAllowedAttributes();\n $allowed_values = $this->getAllowedAttributeValues();\n foreach ($keys as $index => $key) {\n $key = strtolower($key);\n // The key is in the allowed_keys array\n if(in_array($key, $allowed_keys)) {\n $value = strtolower($values[$index]);\n if(array_key_exists($key, $allowed_values)) {\n // For this key exists a allowed values array\n if(in_array($value, $allowed_values[$key])) {\n // Otherwise we check if the value is in the array\n $attrib[$key][] = $value; \n } else {\n // OK, we found a key wich is not allowed\n $allowedValues = implode(', ', $allowed_values[$key]);\n throw new Exception(\"$this->class: '$value' not allowed for attribute '$key'! Allowed values are: $allowedValues\");\n } \n } else {\n // For this key, no array with allowed values exist. we just save the key and asume any value is allowed\n $attrib[$key][] = $value;\n //throw new Exception(\"$this->class: '$value' not allowed for attribute '$key'! Allowed values are: $allowedValues\");\n }\n } else {\n $keyIsAllowed = false;\n foreach($allowed_values as $otherKey => $otherValues) {\n if(in_array($key, $otherValues)) {\n $attrib[$otherKey][] = $key;\n $keyIsAllowed = true;\n }\n }\n if(!$keyIsAllowed) {\n throw new Exception(sprintf(\"%s: '%s' not allowed as attribute!\", $this->class, $key));\n }\n }\n }\n }\n $this->attributes = $attrib;\n return $this;\n }", "function update_attributes($array = array())\n {\n foreach ($array as $key => $value) {\n $this->_stdObject->{$key} = $value;\n }\n }", "public function setAttributes(array $attributes)\n\t{\n\t\t$allowedAttributes = array('usuario','correo','cedula');\n\t\tforeach($attributes as $name=>$value) {\n\t\t\tif (in_array($name, $allowedAttributes))\n\t\t\t\t\t$this->$name = $value;\n\t\t}\n\t\treturn true;\n\t}", "public function prepAttributesForUse()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\tswitch ($config['type'])\n\t\t\t{\n\t\t\t\tcase AttributeType::DateTime:\n\t\t\t\t{\n\t\t\t\t\tif ($value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (DateTimeHelper::isValidTimeStamp($value))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dateTime = new DateTime('@'.$value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO: MySQL specific.\n\t\t\t\t\t\t\t$dateTime = DateTime::createFromFormat(DateTime::MYSQL_DATETIME, $value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->setAttribute($name, $dateTime);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AttributeType::Mixed:\n\t\t\t\t{\n\t\t\t\t\tif (!empty($value) && is_string($value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAttribute($name, JsonHelper::decode($value));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAttribute($name, array());\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testMagicMethodSetThrowsExceptionValuesNotAnArray()\n\t{\n\t\t$stub = new \\Orchestra\\Support\\Form\\Fieldset(function ($f) {});\n\n\t\t$stub->attributes = 'foo';\n\t}", "public function set()\n {\n $args = func_get_args();\n\n if ( count($args) == 2 )\n {\n $this->attributes[$args[0]] = $args[1];\n }\n elseif ( count($args) == 1 && is_array($args[0]) ) \n {\n $this->attributes = ( array_merge($this->attributes, $args[0]) );\n }\n\n return $this;\n }", "public function hydrate($donnees){\n foreach($donnees as $key => $value){\n //on delcare la varible method\n $method = 'set'.ucfirst($key);\n//on verifie si la methode existe\n if(method_exists($this,$method)){\n $this->$method($value);\n }\n }\n\n}", "public static function setters() : array\n {\n return self::$setters;\n }", "public static function setters() : array\n {\n return self::$setters;\n }", "public static function setters() : array\n {\n return self::$setters;\n }", "public static function setters() : array\n {\n return self::$setters;\n }", "public static function setters() : array\n {\n return self::$setters;\n }", "public static function setters() : array\n {\n return self::$setters;\n }", "public function initAttribute();", "abstract protected function attributes();", "public function setProperties( ArrayObject $params )\n {\n foreach ( $this->attributeTypes as $attr => $type )\n {\n // 1: fijarse si esta en params\n // 2: verificar si el valor que tiene en params es del mismo tipo que el atributo\n // - Si el tipo es numerico, y el valor es string, ver que sea un string numerico. http://www.php.net/is_numeric (ojo con numeros negativos o si empiezan con \".\" o \",\", probar!!!)\n // - Si el tipo es date o time, y el tipo es un string, ver que el string tiene forma de date o time.\n // - Distinguir entre valor cero y valor null.\n\n // TODO: Ver como se podrian tambien setear listas de \"objetos simples\" (no es la idea que esto setee atributos que son PO, solo atributos simples)\n if (isset($params[$attr]) && !$this->isInyectedAttribute($attr)) // IMPORTANTE: id, class, deleted no se pueden setear por set properties!!!\n {\n // Esto es set$attr pero mas rapido!\n // TODO: Chekeos de tipos...\n // WARNING: Esto solo setea atributos simples! Hay que ver si puedo hacer el tema de setear atributos de clases asociadas... (depende de la notacion de las keys de params)\n // SI HAGO TODO EL CHEKEO EN setAttributeValue, solo llamo a esa y listo...\n \n $this->attributeValues[$attr] = (is_string($params[$attr]) ? trim($params[$attr]) : $params[$attr]);\n \n // Si attr el un id de un hasOne, y viene un string vacio, me tira un error en DatabaseXXX\n // al intentar poner un '' en un campo INT id, pero NULL le puedo poner. Asi que si viene\n // un valor vacio, le pongo NULL.\n if ($this->attributeValues[$attr] === '') $this->attributeValues[$attr] = NULL;\n \n \n // FIXME: deberia garantizar que solo vienen valores simples en params.\n \n // Marco como dirty en atributos simples (asignar en cada loop del for es mas barato\n // que estar chequeando si se modifico un campo y setear afuera del loop).\n $this->dirty = true;\n }\n }\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'bold' => fn(ParseNode $n) => $o->setBold($n->getBooleanValue()),\n 'color' => fn(ParseNode $n) => $o->setColor($n->getStringValue()),\n 'italic' => fn(ParseNode $n) => $o->setItalic($n->getBooleanValue()),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n 'size' => fn(ParseNode $n) => $o->setSize($n->getFloatValue()),\n 'underline' => fn(ParseNode $n) => $o->setUnderline($n->getStringValue()),\n ]);\n }", "function set(array $array){\n foreach($this as $atributo => $valor){\n if(isset($array[$atributo])){\n $this->$atributo = $array[$atributo];\n }\n }\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'updateCategory' => fn(ParseNode $n) => $o->setUpdateCategory($n->getEnumValue(UpdateCategory::class)),\n ]);\n }", "public function set_attributes($attributes)\n {\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'mailExchange' => fn(ParseNode $n) => $o->setMailExchange($n->getStringValue()),\n 'preference' => fn(ParseNode $n) => $o->setPreference($n->getIntegerValue()),\n ]);\n }", "protected function hydrate($array){\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\t$methodName = 'set'.ucfirst($key);\r\n\t\t\tif(method_exists($this, $methodName)){\r\n\t\t\t\t$this->$methodName($value);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function setValues($array){\r\n\t\tforeach($array as $key => $val){\r\n\t\t\t$key = lcfirst(str_replace(\" \",\"\",ucwords(str_replace(\"_\",\" \",$key))));\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t\t}\r\n\t}", "function setValues($array){\r\n\t\tforeach($array as $key => $val){\r\n\t\t\t$key = lcfirst(str_replace(\" \",\"\",ucwords(str_replace(\"_\",\" \",$key))));\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t\t}\r\n\t}", "public function setAttributes($values)\n {\n if (!empty($values)) {\n foreach ($values as $name => $value) {\n $this->setAttribute($name, $value);\n }\n }\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'urls' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setUrls($val);\n },\n ]);\n }", "public function getCustomAttributes(): array;", "public function setAttributes($values, $safeOnly = true)\n\t{\n\t\tparent::setAttributes($values, $safeOnly);\n\n\t\t// Looking only for file attributes (and fix null error on fly)\n\t\tif ( is_array($values) )\n\t\t{\n\t\t\t$attributes = array_flip($safeOnly ? $this->safeAttributes() : $this->attributes());\n\n\t\t\t$class = StringHelper::basename(get_called_class());\n\n\t\t\tforeach ($values as $name => $value)\n\t\t\t{\n\t\t\t\tif ( isset( $attributes[$name] ) )\n\t\t\t\t{\n\t\t\t\t\tif ( isset($_FILES[$class]['name'][$name]) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$uploadedFile = UploadedFile::getInstance($this, $name);\n\n\t\t\t\t\t\tif ( $uploadedFile )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->$name = $uploadedFile;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ( ! $this->isNewRecord )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->$name = $this->oldAttributes[$name];\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}", "public function setAttributes($values, $safeOnly = true)\n\t{\n\t\tparent::setAttributes($values, $safeOnly);\n\n\t\t// Looking only for file attributes (and fix null error on fly)\n\t\tif ( is_array($values) )\n\t\t{\n\t\t\t$attributes = array_flip($safeOnly ? $this->safeAttributes() : $this->attributes());\n\n\t\t\t$class = StringHelper::basename(get_called_class());\n\n\t\t\tforeach ($values as $name => $value)\n\t\t\t{\n\t\t\t\tif ( isset( $attributes[$name] ) )\n\t\t\t\t{\n\t\t\t\t\tif ( isset($_FILES[$class]['name'][$name]) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$uploadedFile = UploadedFile::getInstance($this, $name);\n\n\t\t\t\t\t\tif ( $uploadedFile )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->$name = $uploadedFile;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ( ! $this->isNewRecord )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->$name = $this->oldAttributes[$name];\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}", "public function defineAttributes()\n\t{\n\t\treturn array();\n\t}", "public function setAttributes(array $params)\n {\n foreach($params as $name => $value) {\n $this->setAttribute($name, $value);\n }\n }", "public function hydrate( array $attributes ) {\n\n\t\t// Set all the field from $data\n\t\tforeach ( $attributes as $fieldName => $fieldValue ) {\n\t\t\t$this->set( $fieldName, $fieldValue );\n\t\t}\n\n\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'recipientActionDateTime' => fn(ParseNode $n) => $o->setRecipientActionDateTime($n->getDateTimeValue()),\n 'recipientActionMessage' => fn(ParseNode $n) => $o->setRecipientActionMessage($n->getStringValue()),\n 'recipientUserId' => fn(ParseNode $n) => $o->setRecipientUserId($n->getStringValue()),\n 'senderShiftId' => fn(ParseNode $n) => $o->setSenderShiftId($n->getStringValue()),\n ]);\n }", "public function getAttributes(): array\n {\n // Get all attributes using all the getters.\n $attributes = [];\n foreach(\\array_keys(\\get_object_vars($this)) as $attribute) {\n\n // Construct the getter name.\n $getter = \\lcfirst(\\str_replace('_', '', \\ucwords($attribute, '_')));\n\n // Get the attribute's value from the getter.\n $attributes[$attribute] = $this->{$getter}();\n }\n\n return $attributes;\n }", "public function attributes()\n {\n return $this->morphToMany(Attribute::class, 'attribute_able');\n }", "public function __construct($daten = array())\n {\n if ($daten) {\n foreach ($daten as $k => $v) {\n $setterName = 'set' . ucfirst($k);\n // wenn ein ungültiges Attribut übergeben wurde\n // (ohne Setter), ignoriere es\n if (method_exists($this, $setterName)) {\n $this->$setterName($v);\n }\n }\n }\n }", "public function setAttr($attributes = array())\n {\n foreach ($attributes as $key => $value) {\n if (property_exists(get_class($this), $key))\n $this->$key = $value;\n }\n return $this;\n }", "function setValues($array){\r\n\t\tforeach($array as $key => $val)\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'response' => fn(ParseNode $n) => $o->setResponse($n->getEnumValue(ResponseType::class)),\n 'time' => fn(ParseNode $n) => $o->setTime($n->getDateTimeValue()),\n ];\n }", "public function attributes() : array;", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'callEventType' => fn(ParseNode $n) => $o->setCallEventType($n->getEnumValue(TeamworkCallEventType::class)),\n 'callId' => fn(ParseNode $n) => $o->setCallId($n->getStringValue()),\n 'initiator' => fn(ParseNode $n) => $o->setInitiator($n->getObjectValue([IdentitySet::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function fill(array $attributes)\n {\n $existingAttributes = get_object_vars($this);\n\n foreach ($existingAttributes as $attributeName => $oldAttributeValue) {\n array_key_exists($attributeName, $attributes) ? $this->$attributeName = $attributes[$attributeName] : NULL;\n }\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'assignmentState' => fn(ParseNode $n) => $o->setAssignmentState($n->getStringValue()),\n 'duration' => fn(ParseNode $n) => $o->setDuration($n->getStringValue()),\n 'reason' => fn(ParseNode $n) => $o->setReason($n->getStringValue()),\n 'requestedDateTime' => fn(ParseNode $n) => $o->setRequestedDateTime($n->getDateTimeValue()),\n 'roleId' => fn(ParseNode $n) => $o->setRoleId($n->getStringValue()),\n 'roleInfo' => fn(ParseNode $n) => $o->setRoleInfo($n->getObjectValue([PrivilegedRole::class, 'createFromDiscriminatorValue'])),\n 'schedule' => fn(ParseNode $n) => $o->setSchedule($n->getObjectValue([GovernanceSchedule::class, 'createFromDiscriminatorValue'])),\n 'status' => fn(ParseNode $n) => $o->setStatus($n->getStringValue()),\n 'ticketNumber' => fn(ParseNode $n) => $o->setTicketNumber($n->getStringValue()),\n 'ticketSystem' => fn(ParseNode $n) => $o->setTicketSystem($n->getStringValue()),\n 'type' => fn(ParseNode $n) => $o->setType($n->getStringValue()),\n 'userId' => fn(ParseNode $n) => $o->setUserId($n->getStringValue()),\n ]);\n }", "private function fillArray($array) {\n\t\t$result = array();\n\t\tforeach ($array as $attr => $val) {\n\t\t\t$setMethod = 'set' . ucfirst($attr);\n\t\t\t$returnType = $this->getReturnTypeOfSetMethod($setMethod);\n\t\t\tif ($returnType) {\n\t\t\t\t$result[$attr] = new $returnType(); \n\t\t\t} else {\n\t\t\t\t$result[$attr] = 'abc';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "function update_attributes($attributes) {\n\t\t\tif(is_array($attributes)) {\n\t\t \t \t// Test each attribute to be updated\n\t\t \t \t// and process according to its type\n\t\t\t\tforeach($attributes as $field => $value) {\n\t\t\t\t\t# datetime / date parts check\n\t\t\t\t\tif(preg_match('/^\\w+\\(.*i\\)$/i', $field)) {\n\t\t\t\t\t\t// The name of this attribute ends in '(?i)'\n\t\t\t\t\t\t// indicating that it's part of a date or time\n\t\t\t\t\t\t$datetime_field = substr($field, 0, strpos($field, '('));\n\t\t\t\t\t\tif(!in_array($datetime_field, $datetime_fields)) {\n\t\t\t\t\t\t\t$datetime_fields[] = $datetime_field;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif(is_object($value) && get_parent_class($value) == __CLASS__ && $this->auto_save_associations) {\n\t\t\t\t\t\t# this elseif checks if first its an object if its parent is ActiveRecord\n\t\t\t\t\t\tif($association_type = $this->get_association_type($field)) {\n\t\t\t\t\t\t\t$this->save_associations[$association_type][] = $value;\n\t\t\t\t\t\t\tif($association_type == \"belongs_to\") {\n\t\t\t\t\t\t\t\t$foreign_key = Inflector::singularize($value->table_name).\"_id\";\n\t\t\t\t\t\t\t\t$this->$foreign_key = $value->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif(is_array($value) && $this->auto_save_associations) {\n\t\t\t\t\t\t# this elseif checks if its an array of objects and if its parent is ActiveRecord\n\t\t\t\t\t\tif($association_type = $this->get_association_type($field)) {\n\t\t\t\t\t\t\t$this->save_associations[$association_type][] = $value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->$field = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t \t \t \t\t// Just a simple attribute, copy it\n\t\t\t\t\t\t$this->$field = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If any date/time fields were found, assign the\n\t\t\t\t// accumulated values to corresponding attributes\n\t\t\t\tif(count($datetime_fields)) {\n\t\t\t\t\tforeach($datetime_fields as $datetime_field) {\n\t\t\t\t\t\t$datetime_format = '';\n\t\t\t\t\t\t$datetime_value = '';\n\n\t\t\t\t\t\tif($attributes[$datetime_field.'(1i)']\n\t\t\t\t\t\t\t&& $attributes[$datetime_field.'(2i)']\n\t\t\t\t\t\t\t&& $attributes[$datetime_field.'(3i)']) {\n\t\t\t\t\t\t\t$datetime_value = $attributes[$datetime_field.'(1i)']\n\t\t\t\t\t\t\t. '-' . $attributes[$datetime_field.'(2i)']\n\t\t\t\t\t\t\t. '-' . $attributes[$datetime_field.'(3i)'];\n\t\t\t\t\t\t\t$datetime_format = $this->date_format;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$datetime_value .= ' ';\n\n\t\t\t\t\t\tif($attributes[$datetime_field.'(4i)']\n\t\t\t\t\t\t\t&& $attributes[$datetime_field.'(5i)']) {\n\t\t\t\t\t\t\t$datetime_value .= $attributes[$datetime_field.'(4i)']\n\t\t\t\t\t\t\t. ':' . $attributes[$datetime_field.'(5i)'];\n\t\t\t\t\t\t\t$datetime_format .= ' '.$this->time_format;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($datetime_value = trim($datetime_value)) {\n\t\t\t\t\t\t\t$datetime_value = date($datetime_format, strtotime($datetime_value));\n\t\t\t\t\t\t\t//error_log('($field) $datetime_field = $datetime_value');\n\t\t\t\t\t\t\t$this->$datetime_field = $datetime_value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->set_habtm_attributes($attributes);\n\t\t\t}\n\t\t}", "function __set($attr_name, $value) {\n // in $attr_name, replace _ with \" \"\n $attr_name = str_replace('_', ' ', $attr_name);\n $attr_name = ucwords($attr_name);\n $attr_name = str_replace(' ', '', $attr_name);\n $function = \"set$attr_name\";\n //var_dump($function);\n $this->$function($value);\n }", "public function hydrate($data)\n\t{\n\t\tforeach ($data as $attribut => $value)\n\t\t{\n\t\t\t$methode = 'set'.ucfirst($attribut);\n\t\t\tif (is_callable([$this, $methode]))\n\t\t\t{\n\t\t\t\t$this->$methode($value);\n\t\t\t}\n\t\t}\n\t}", "public function __construct($daten = array())\n {\n if ($daten) {\n foreach ($daten as $k => $v) {\n $setterName = 'set' . ucfirst($k);\n // wenn ein ungültiges Attribut übergeben wurde\n // (ohne Setter), ignoriere es\n if (method_exists($this, $setterName)) {\n $this->$setterName($v);\n }\n }\n }\n // $this->setEncoding();\n }", "function set_attrs($attrs)\n {\n foreach($attrs as $key => $value) {\n if ($key == \"meta_name\") { continue; }\n if ($key == \"vocab\") { continue; }\n if ($key == \"text\") { continue; }\n if ($key == \"lang\") { continue; }\n $this->attrs[$key] = $value; \n }\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'clickAction' => fn(ParseNode $n) => $o->setClickAction($n->getStringValue()),\n 'clickDateTime' => fn(ParseNode $n) => $o->setClickDateTime($n->getDateTimeValue()),\n 'id' => fn(ParseNode $n) => $o->setId($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'sourceId' => fn(ParseNode $n) => $o->setSourceId($n->getStringValue()),\n 'uriDomain' => fn(ParseNode $n) => $o->setUriDomain($n->getStringValue()),\n 'verdict' => fn(ParseNode $n) => $o->setVerdict($n->getStringValue()),\n ];\n }", "public function getAttributes()\n {\n return array_merge(\n $this->attributes,\n [\n 'args' => $this->args(),\n 'type' => $this->type(),\n 'resolve' => $this->getResolver(),\n ]\n );\n }", "public function setAttributes(Array $attributes): self\n {\n\t\tforeach($attributes as $k => $v) {\n\t\t\t$this->setAttribute($k, $v);\n\t\t}\n\t\treturn $this;\n\t}", "function set(array $data) {\n\t\tforeach ($data as $key => $value) {\n\t\t\t$this->$key = $value;\n\t\t}\n\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'additionalInformation' => fn(ParseNode $n) => $o->setAdditionalInformation($n->getStringValue()),\n 'creationDateTime' => fn(ParseNode $n) => $o->setCreationDateTime($n->getDateTimeValue()),\n 'expirationDateTime' => fn(ParseNode $n) => $o->setExpirationDateTime($n->getDateTimeValue()),\n 'referenceKey' => fn(ParseNode $n) => $o->setReferenceKey($n->getStringValue()),\n 'referenceSystem' => fn(ParseNode $n) => $o->setReferenceSystem($n->getStringValue()),\n 'requestorId' => fn(ParseNode $n) => $o->setRequestorId($n->getStringValue()),\n 'requestorName' => fn(ParseNode $n) => $o->setRequestorName($n->getStringValue()),\n 'requestType' => fn(ParseNode $n) => $o->setRequestType($n->getStringValue()),\n 'roleId' => fn(ParseNode $n) => $o->setRoleId($n->getStringValue()),\n 'roleName' => fn(ParseNode $n) => $o->setRoleName($n->getStringValue()),\n 'tenantId' => fn(ParseNode $n) => $o->setTenantId($n->getStringValue()),\n 'userId' => fn(ParseNode $n) => $o->setUserId($n->getStringValue()),\n 'userMail' => fn(ParseNode $n) => $o->setUserMail($n->getStringValue()),\n 'userName' => fn(ParseNode $n) => $o->setUserName($n->getStringValue()),\n ]);\n }", "public function getSetters() {\n $fqsen = $this->fqsen;\n $setters = [];\n $propertiesPropertyFound = false;\n do {\n //var_dump($fqsen);\n $class = $this->fqsenToClass($fqsen);\n $methods = $class->getMethods();\n foreach ($methods as $method) {\n if (preg_match('/^set([A-Z0-9].*)$/', $method->getName(), $matches) && !array_key_exists($matches[1], $setters)) {\n $setters[lcfirst($matches[1])] = null;\n }\n }\n if (!$propertiesPropertyFound) {\n $properties = $this->classGetProperty($class, \"properties\");\n if ($properties) {\n $properties = $properties->getDefault();\n $properties = $this->arrayTokenScanner->scan($properties);\n foreach ($properties as $propertyKey => $propertyValue) {\n if (!array_key_exists($propertyKey, $setters)) {\n $setters[$propertyKey] = $propertyValue;\n }\n }\n $propertiesPropertyFound = true;\n }\n }\n $fqsen = strval($class->getParent());\n } while ($fqsen);\n return $setters;\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'activityGroupNames' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setActivityGroupNames($val);\n },\n 'address' => fn(ParseNode $n) => $o->setAddress($n->getStringValue()),\n 'azureSubscriptionId' => fn(ParseNode $n) => $o->setAzureSubscriptionId($n->getStringValue()),\n 'azureTenantId' => fn(ParseNode $n) => $o->setAzureTenantId($n->getStringValue()),\n 'countHits' => fn(ParseNode $n) => $o->setCountHits($n->getIntegerValue()),\n 'countHosts' => fn(ParseNode $n) => $o->setCountHosts($n->getIntegerValue()),\n 'firstSeenDateTime' => fn(ParseNode $n) => $o->setFirstSeenDateTime($n->getDateTimeValue()),\n 'ipCategories' => fn(ParseNode $n) => $o->setIpCategories($n->getCollectionOfObjectValues([IpCategory::class, 'createFromDiscriminatorValue'])),\n 'ipReferenceData' => fn(ParseNode $n) => $o->setIpReferenceData($n->getCollectionOfObjectValues([IpReferenceData::class, 'createFromDiscriminatorValue'])),\n 'lastSeenDateTime' => fn(ParseNode $n) => $o->setLastSeenDateTime($n->getDateTimeValue()),\n 'riskScore' => fn(ParseNode $n) => $o->setRiskScore($n->getStringValue()),\n 'tags' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setTags($val);\n },\n 'vendorInformation' => fn(ParseNode $n) => $o->setVendorInformation($n->getObjectValue([SecurityVendorInformation::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'subscriptionId' => fn(ParseNode $n) => $o->setSubscriptionId($n->getStringValue()),\n 'subscriptionName' => fn(ParseNode $n) => $o->setSubscriptionName($n->getStringValue()),\n ]);\n }", "public function setAttributes ($attributes)\n {\n\n $this->attributes = array_merge($this->attributes, $attributes);\n\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'email' => fn(ParseNode $n) => $o->setEmail($n->getStringValue()),\n 'identity' => fn(ParseNode $n) => $o->setIdentity($n->getObjectValue([CommunicationsUserIdentity::class, 'createFromDiscriminatorValue'])),\n 'presenterDetails' => fn(ParseNode $n) => $o->setPresenterDetails($n->getObjectValue([VirtualEventPresenterDetails::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function setAttributes(array $attributes, $merge = false);", "public function copyAttributesToValues()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$this->values[$field] = $this->$field ;\n\t\t}\n\t}", "protected function castAttributes(array $fields): void\n {\n // Loops through all the supplied Field's list.\n foreach ($fields as $field => $value) {\n // Builds up the Mutator's name.\n $mutator = $this->createMutatorName(self::$CASTPREFIX, $field);\n\n // Checks if the mutator exists in the instance, and if so, loads the value into it.\n if (\\array_search($mutator, $this->castList) !== false) {\n $this->{$mutator}($value);\n }\n }\n }", "public function set_attributes( $attributes = array(), $override = true ) {\n\t\n\t\tif ( true == $override ) {\n\t\t\t$this->attributes = array_merge( $this->attributes, $attributes );\n\t\t}\n\t\telse {\n\t\t\t$this->attributes = array_merge( $attributes, $this->attributes );\n\t\t}\n\t\n\t}", "public function testSetters()\n {\n foreach ($this->expectedSetters as $method => $parameter) {\n $this->entity->$method($parameter);\n }\n\n $actualResult = $this->entity->toArray();\n\n $this->assertArraysAreSimilar($this->testData, $actualResult, 'toArray');\n }", "public function setAttributes($values, $safeOnly = true){\n $params = $this->limpiarParametrosConEspacios($values);\n parent::setAttributes($params, $safeOnly);\n $this->barrio = strtolower($this->barrio);\n $this->calle = strtolower($this->calle);\n }", "abstract protected function getDirectGetters();", "public function getCustomAttributes() {}" ]
[ "0.680262", "0.66679907", "0.6505545", "0.64688873", "0.64688873", "0.64688873", "0.64303744", "0.63683504", "0.63627255", "0.63459826", "0.63396704", "0.61683947", "0.61683947", "0.61683947", "0.61683947", "0.61683947", "0.61683947", "0.61683947", "0.61683947", "0.61683947", "0.61683947", "0.61683947", "0.61683947", "0.61683947", "0.61455905", "0.6124729", "0.60965043", "0.6064889", "0.60280144", "0.59300935", "0.5861647", "0.5857414", "0.583125", "0.58289456", "0.5802956", "0.57730716", "0.5769649", "0.57669306", "0.57439446", "0.57416034", "0.5712461", "0.5712227", "0.5712227", "0.5712227", "0.5712227", "0.5712227", "0.5712227", "0.5693902", "0.5689162", "0.5666289", "0.5662849", "0.5661436", "0.563428", "0.5614137", "0.56094044", "0.56041044", "0.5598898", "0.5598898", "0.5595137", "0.557315", "0.5562302", "0.55468214", "0.55468214", "0.5544497", "0.554371", "0.5530686", "0.5527515", "0.55244553", "0.5513968", "0.5511702", "0.5510402", "0.5506593", "0.55063456", "0.550503", "0.55007327", "0.54983866", "0.5498155", "0.5491734", "0.5489885", "0.5485283", "0.547875", "0.54760724", "0.5474538", "0.54676914", "0.54661655", "0.5464422", "0.54623854", "0.54590654", "0.5444538", "0.54367185", "0.54365623", "0.5433229", "0.54249495", "0.5423897", "0.54130095", "0.5410177", "0.54087967", "0.5407178", "0.5403355", "0.5403267", "0.5402394" ]
0.0
-1
Array of attributes to getter functions (for serialization of requests)
public static function getters() { return self::$getters; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAttributes(): array\n {\n // Get all attributes using all the getters.\n $attributes = [];\n foreach(\\array_keys(\\get_object_vars($this)) as $attribute) {\n\n // Construct the getter name.\n $getter = \\lcfirst(\\str_replace('_', '', \\ucwords($attribute, '_')));\n\n // Get the attribute's value from the getter.\n $attributes[$attribute] = $this->{$getter}();\n }\n\n return $attributes;\n }", "abstract protected function getDirectGetters();", "public function toArray() {\n $attrs = $this->_private_attributes;\n $result = array();\n foreach ($attrs as $key => $attr) {\n if (method_exists($this, \"get\" . underscore_to_camel_case($key, true))) {\n eval('$result[\"' . $key . '\"] = $this->get' . underscore_to_camel_case($key, true) . '();');\n } else {\n $result[$key] = $attr;\n }\n }\n return $result;\n }", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "abstract function attributes(): array;", "public static function getters();", "public static function getters()\n {\n return [\n 'status' => 'getStatus',\n 'quota' => 'getQuota'\n ];\n }", "public static function getters()\n {\n return [\n 'status' => 'getStatus',\n 'time' => 'getTime'\n ];\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes(){ }", "public function getAttributes() {}", "public function getAttributes() {}", "public function attributes() : array;", "public function getAttributes()\n {\n }", "function getAttributes()\n {\n }", "public function getCustomAttributes(): array;", "protected function getAttributeSavedMethods()\n {\n $attributes = [];\n foreach($this->getDirty() as $attribute => $value) {\n if($this->hasAttributeSavedMethod($attribute)) {\n $attributes[] = $attribute;\n }\n }\n return $attributes;\n }", "public static function attributes()\n {\n $class = self::loadDelegationClass();\n \n return call_user_func($class.'::attributes');\n }", "public function getAttributes(): iterable;", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return [\n 'tenant_id' => 'getTenantId',\n 'expires_in' => 'getExpiresIn',\n 'scopes' => 'getScopes'\n ];\n }", "public static function getters()\n {\n return [\n 'application_id' => 'getApplicationId',\n 'is_default' => 'getIsDefault',\n 'role' => 'getRole',\n 'type' => 'getType',\n '_issues' => 'getIssues'\n ];\n }", "public function getCustomAttributes() {}", "public static function getters() : array\n {\n return self::$getters;\n }", "public static function getters() : array\n {\n return self::$getters;\n }", "public static function getters() : array\n {\n return self::$getters;\n }", "public static function getters() : array\n {\n return self::$getters;\n }", "public static function getters() : array\n {\n return self::$getters;\n }", "public static function getters() : array\n {\n return self::$getters;\n }", "public static function attributeMap();", "public function attributes();", "public function get_attributes()\n {\n }", "public function get_attributes()\n {\n }", "protected function getAttributes()\n {\n return [];\n }", "public function getRestHookableAttributes(): array\n {\n return [];\n }", "public function getAttributes() {\n $attr = array();\n \n $attr[\"id\"] = $this->id_;\n $attr[\"taxonId\"] = $this->taxonId_;\n $attr[\"dbh\"] = $this->dbh_;\n $attr[\"lat\"] = $this->lat_;\n $attr[\"lng\"] = $this->lng_;\n $attr[\"layers\"] = $this->layers_;\n \n return $attr;\n }", "public function getData ()\n {\n\n $data = [];\n\n foreach ($this as $key => $value) {\n\n $method = 'get' . ucfirst(camel_case($key));\n\n if (method_exists($this, $method)) {\n\n $data[$key] = $this->{$method}();\n\n }\n\n }\n\n $data['request_data'] = $this->hideProtectedFields($data['request_data']);\n\n return $data;\n }", "public function attributes(): array\n {\n return [\n //\n ];\n }", "public function attributes(): array\n {\n return [\n //\n ];\n }", "protected function attributes() {\n\t $attributes = array();\n\t foreach(static::$table_fields as $field) {\n\t if(property_exists( $this, $field)) {\n\t $attributes[$field] = $this->$field;\n\t }\n\t }\n\t return $attributes;\n }", "public function getAttributes()\n {\n return array_merge(\n $this->attributes,\n [\n 'args' => $this->args(),\n 'type' => $this->type(),\n 'resolve' => $this->getResolver(),\n ]\n );\n }", "public function getAttributes()\n {\n return array();\n }", "public function getAttributes()\n {\n return array();\n }", "public function getAttributes()\n {\n return array();\n }", "public function getAttributes()\n {\n return array();\n }", "abstract protected function attributes();", "abstract public function attributeNames();", "public function __get($method)\n\t{\n\t\treturn array($this, $method);\t\t\n\t}", "public function attr() {\n\t\treturn utils::attr($this->attr, func_get_args());\n\t}", "function GetAttributes();", "protected function attributes() {\n $attributes = array();\n foreach(static::$db_fields as $field) {\n if(property_exists($this, $field)) {\n $attributes[$field] = $this->$field;\n }\n }\n return $attributes;\n }", "public function getGetterNames(): array\n {\n return [['document'], ['documentManager']];\n }", "public function getAttributes() {\n return array_merge($this->getFields(), $this->getProperties());\n }", "abstract protected function setRequiredGetters();", "public function getAttributeList(): array;", "private function getApiAttributeNamesArray()\n {\n $array = [\n 'firstname',\n 'lastname',\n 'email',\n 'id',\n 'website_id',\n 'group_id',\n 'prefix',\n 'middlename',\n 'suffix',\n 'dob',\n 'taxvat',\n 'gender',\n 'is_active',\n 'company',\n 'city',\n 'country_id',\n 'region',\n 'postcode',\n 'telephone',\n 'fax',\n 'vat_id',\n 'street_1',\n 'street_2',\n 'subaccounts',\n 'manage_subaccounts',\n 'account_data_modification_permission',\n 'account_order_history_view_permission',\n 'checkout_order_create_permission',\n 'checkout_order_approval_permission',\n 'checkout_cart_view_permission',\n 'checkout_view_permission',\n 'checkout_order_placed_notification_permission',\n 'force_usage_parent_company_name_permission',\n 'force_usage_parent_vat_permission',\n 'force_usage_parent_addresses_permission',\n 'password',\n 'parent_email',\n 'promote',\n 'can_manage_subaccounts',\n ];\n\n return $array;\n }", "public function getAttributesFields(): array\n {\n $fields = [];\n\n // Only fields without relations\n foreach ($this->fieldsArray(false) as $attribute) {\n $fields[$attribute] = [\n 'name' => $attribute,\n 'type' => $this->overrideMethod(\n 'set'.Str::studly($attribute).'Type',\n [$this, 'callGraphQLType'],\n $attribute\n ),\n 'privacy' => function (array $args) use ($attribute): bool {\n $method = 'get'.Str::studly($attribute).'Privacy';\n\n return $this->$method($args);\n },\n ];\n }\n\n return $fields;\n }", "public function serializers()\n {\n // Each entry represents a function call.\n return array(\n // Each entry represents an argument for the function call.\n array(new \\Nayru\\Serializer\\JsonConf),\n array(new \\Nayru\\Serializer\\Php)\n );\n }", "protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach(self::$db_fields as $field) {\n\t\t\tif(property_exists($this, $field)){\n\t\t\t\t$attributes[$field] = $this->$field;\n\t\t\t}\n\t\t}\n\t\treturn $attributes;\n\t}", "public function getAttributesList()\n {\n }", "public function attributes()\n {\n $attributes = array();\n foreach(self::$db_fields as $field)\n {\n if(property_exists($this,$field))\n {\n $attributes[$field] = $this->$field;\n }\n }\n return $attributes;\n }", "public function attributes()\n {\n return [];\n }", "public function attributes()\n {\n return [];\n }", "public function attributes()\n {\n return [];\n }", "public function get(...$keys)\n {\n if (count($keys) == 1 && trait_exists($keys[0])) {\n $trait = new ReflectionClass($keys[0]);\n $keys = collect(array_merge($trait->getProperties(), $trait->getMethods()))->map(function ($reflect) {\n // Looking for abstract public or public methods or properties.\n if (\n $reflect->getModifiers() != ReflectionMethod::IS_PUBLIC\n && $reflect->getModifiers() != ReflectionMethod::IS_PUBLIC + ReflectionMethod::IS_ABSTRACT\n ) {\n return;\n }\n\n return $reflect->name;\n })->filter()->toArray();\n }\n $attributes = [];\n\n foreach ($keys as $key) {\n $attributes[$key] = $this->getAttribute($key);\n }\n\n return collect($attributes);\n }", "private function requestedAttributes()\n {\n\n $default = [\n 'id',\n 'name',\n 'level',\n 'rarity',\n 'image',\n 'category.0',\n 'category.1',\n 'vendor_price',\n 'buy.quantity',\n 'buy.price',\n 'buy.last_change.time',\n 'buy.last_change.quantity',\n 'buy.last_change.price',\n 'sell.quantity',\n 'sell.price',\n 'sell.last_change.time',\n 'sell.last_change.quantity',\n 'sell.last_change.price',\n 'last_update'\n ];\n\n $requested = $this->getInput('attributes') ?: $default;\n\n if (!is_array($requested)) {\n $requested = explode(',', $requested);\n }\n\n return $requested;\n\n }", "protected function attributes() {\n\t $attributes = array();\n\t foreach(self::$db_fields as $field) {\n\t if(property_exists($this, $field)) {\n\t $attributes[$field] = $this->$field;\n\t }\n\t }\n\t return $attributes;\n\t}", "public function getMethods(): array;", "public function getMethods(): array;", "protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach (self::$db_fields as $field) {\n\t\t\tif (property_exists($this, $field)) {\n\t\t\t\t$attributes[$field] = $this->$field;\n\t\t\t}\n\t\t}\n\t\treturn $attributes;\n\t}", "function read(){\n foreach($this as $attribute => $valor){\n $this->$attribute = Request::read($attribute);\n } \n }", "protected function attributes()\n {\n return [];\n }", "public function getAttributes()\n {\n $return = [];\n foreach ($this->attr as $attr => $info) {\n $return[$attr] = $this->getAttribute($attr);\n }\n\n return $return;\n }", "public function __get($attr)\n\t{\n\t\t$functionName = \"get\".$attr;\n\t\treturn $this->$functionName();\n\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'clickAction' => fn(ParseNode $n) => $o->setClickAction($n->getStringValue()),\n 'clickDateTime' => fn(ParseNode $n) => $o->setClickDateTime($n->getDateTimeValue()),\n 'id' => fn(ParseNode $n) => $o->setId($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'sourceId' => fn(ParseNode $n) => $o->setSourceId($n->getStringValue()),\n 'uriDomain' => fn(ParseNode $n) => $o->setUriDomain($n->getStringValue()),\n 'verdict' => fn(ParseNode $n) => $o->setVerdict($n->getStringValue()),\n ];\n }", "public function attributes()\n {\n return [\n ];\n }", "public function attributes() // atribūtu savi nosaukumi\n {\n return[ \n 'fname' => 'Vārds',\n 'lname' => 'Uzvārds',\n 'email' => 'E-pasts',\n 'oldpassword' => 'Paroles lauks',\n 'password' => 'Jaunas paroles lauks',\n 'buttontitle' => 'Pogas virsraksts',\n 'buttonlink' => 'Pogas links',\n 'reciever' => 'Saņēmēju lauks',\n 'emailtitle' => 'Ziņas virsrsksts',\n 'emailtext' => 'Ziņas teksts',\n 'transport' => 'Pasākumu lauks'\n ];\n }", "public static function attributeMap()\n {\n return [\n 'tenant_id' => 'tenant_id',\n 'expires_in' => 'expires_in',\n 'scopes' => 'scopes'\n ];\n }" ]
[ "0.7071254", "0.6628055", "0.6581621", "0.65085584", "0.65085584", "0.65085584", "0.65085584", "0.6499994", "0.64624524", "0.63637143", "0.6363414", "0.6315606", "0.6315606", "0.6315606", "0.6315606", "0.6315606", "0.6315606", "0.6315606", "0.6315606", "0.6315606", "0.62876564", "0.6267457", "0.6267354", "0.6248464", "0.6241648", "0.62360954", "0.623109", "0.6217279", "0.61675936", "0.615824", "0.60485387", "0.60485387", "0.60485387", "0.60485387", "0.60485387", "0.60485387", "0.60485387", "0.60485387", "0.60485387", "0.60485387", "0.60485387", "0.60485387", "0.60485387", "0.60473317", "0.604714", "0.60269815", "0.59508437", "0.59508437", "0.59508437", "0.59508437", "0.59508437", "0.59508437", "0.5949961", "0.59332705", "0.5921448", "0.5921448", "0.58889675", "0.5883016", "0.58548725", "0.58483315", "0.5835835", "0.5835835", "0.5830045", "0.5811857", "0.5797117", "0.5797117", "0.5797117", "0.5797117", "0.57843965", "0.5783929", "0.57823", "0.57805383", "0.57761973", "0.5760105", "0.575843", "0.5753376", "0.5743079", "0.5742538", "0.5735495", "0.5734641", "0.5715958", "0.5711641", "0.5709014", "0.5703054", "0.5688089", "0.5688089", "0.5688089", "0.5687686", "0.56864893", "0.5683283", "0.56796813", "0.56796813", "0.5674506", "0.5672195", "0.5666733", "0.56622463", "0.5658593", "0.56384563", "0.5619268", "0.56180435", "0.56154925" ]
0.0
-1
The original name of the model.
public function getModelName() { return self::$openAPIModelName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOriginalName(): string\n {\n return $this->originalName;\n }", "public function getOriginalName(): string\n {\n\t\treturn $this->originalName;\n\t}", "public function getOriginalName();", "protected function getModelName()\n {\n $fullyQualifiedClassName = substr(static::class, 0, -10); // \\App\\Repositories\\{name}Repository => \\App\\Repositories\\{name}\n $nameArray = explode('\\\\', $fullyQualifiedClassName); // [App, Repositories, {name}]\n return array_pop($nameArray); // {name}\n }", "private function getModelName() : string\n {\n return collect(explode('\\\\', get_class($this)))->last();\n }", "public function getOrigName()\n\t{\n\t\treturn $this->orig_name;\n\t}", "public function getName()\n {\n return empty($this->model->name) ? $this->id : $this->model->name;\n }", "public function modelName(): string\n {\n return class_basename($this->model);\n }", "private function getModelName()\n {\n $function = new \\ReflectionClass( $this->model ); \n return $function->getShortName();\n }", "public function getModelName() {\n\t\treturn $this->getSourceName();\n\t}", "protected function getModelName()\n {\n return ucwords(str_singular(camel_case($this->meta['table'])));\n }", "protected function get_model_name()\n {\n }", "public function getModelName()\n {\n return $this->getModel()->name;\n }", "public function getName()\r\n\t{\r\n\t\treturn $this->_modelName;\r\n\r\n\t}", "public function getModelName()\n {\n if (!$name = $this->modelName) {\n $tableName = $this->getName();\n\n $modelNames = [];\n foreach (explode('_', $tableName) as $word) {\n $modelNames[] = ucfirst(Inflector::singularize($word));\n } //foreach\n $modelName = implode('', $modelNames);\n\n $this->setModelName($name = ucfirst($this->isReservedPHPWord($modelName) ? $tableName : $modelName));\n } // if\n\n return $name;\n }", "public function getModelName() ;", "public function getNomeOriginal()\n {\n return $this->nome_original;\n }", "public function getModelName();", "public static function getNameModel()\n {\n return Yii::t('app', 'My model');\n }", "protected function modelClassName()\n {\n if (!$this->isValidModelName()) return null;\n\n return str_replace('{model}', $this->modelName, $this->modelPath);\n }", "public function getRealName() {\n\t\treturn $this->name;\n\t}", "public static function getModelName() {\r\n\t\t\treturn static::ModelName;\r\n\t\t}", "public function getRealName()\n {\n\treturn $this->name;\n }", "public function getOriginalQualifiedName() {}", "public function getOriginalQualifiedName() {}", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "public function getModelName()\n {\n return self::$axerveModelName;\n }", "public function getRawName()\n {\n return $this->rawName;\n }", "protected function getCrudName(): string\n {\n return strtolower(Str::plural(class_basename($this->option('model'))));\n }", "protected function getNameInput()\n {\n return Str::singular(parent::getNameInput());\n }", "public function getOriginalClassName(): string\n {\n return $this->originalClassName;\n }", "public function getModelSingular()\n {\n return strtolower($this->getModelSimpleName());\n }", "public function getOriginalLabel()\n {\n return $this->originalLabel;\n }", "public function getNameAttribute()\n {\n return $this->translateOrNew($this->locale())->name;\n }", "public function getNameAttribute()\n {\n return $this->translateOrNew($this->locale())->name;\n }", "public function getModelSimpleName()\n {\n return end(explode('\\\\', $this->modelName));\n }", "public function getOriginalQualifiedName();", "public function getModelNameBasedOnClassName(): string\n {\n $fqn = explode(\"\\\\\", get_class($this));\n\n return strtolower(end($fqn));\n }", "public function getRealName()\n\t{\n\t\treturn $this->real_name;\n\t}", "public function getModelName()\n {\n return $this->getConfig()->modelName;\n }", "public function getSingularModelName()\n {\n\n return strtolower(class_basename($this->model));\n }", "public function getModelName()\n {\n return self::$modelName;\n }", "private function getPropertyName(): string\n {\n $name = $this->foreignKey->getLocalTableName();\n if ($this->hasLocalUniqueIndex()) {\n $name = TDBMDaoGenerator::toSingular($name);\n }\n return TDBMDaoGenerator::toCamelCase($name);\n }", "public function getTranslationModelName(): string\n {\n return rtrim(app('locale')->translationNamespace(), '\\\\')\n . '\\\\' . class_basename(get_called_class()) . 'Translation';\n }", "public function name()\n {\n return $this->getName();\n }", "public function name()\n {\n return $this->getName();\n }", "protected function getShortModel(): string\n {\n return class_basename($this->option('model'));\n }", "public function getRealName() {}", "private function guessName () : string {\n return $this->inflector()->pluralize($this->inflector()->tableize(class_basename($this)));\n }", "abstract protected function getModelName(): string;", "public function getModel()\n\t{\n\t\treturn $this->resource->name;\n\t}", "protected function getTypeName(): string\n {\n if (isset($this->typeName)) {\n return $this->typeName;\n }\n\n return $this->getModelNameBasedOnClassName();\n }", "public function getModelName() : string\n {\n return self::$openAPIModelName;\n }", "public function getModelName() : string\n {\n return self::$openAPIModelName;\n }", "public function getModelName() : string\n {\n return self::$openAPIModelName;\n }", "public function getModelName() : string\n {\n return self::$openAPIModelName;\n }", "public function getModelName() : string\n {\n return self::$openAPIModelName;\n }", "public function getModelName() : string\n {\n return self::$openAPIModelName;\n }", "public function getModelClassName()\n {\n \treturn $this->modelClassName;\n }", "public function getName()\n\t{\n\t\treturn $this->neoeloquent->getConfigOption('name');\n\t}", "protected function filterName(): string\n {\n return Str::snake(class_basename($this));\n }", "public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }", "public function getName()\n {\n return $this->attributes->name;\n }", "public function name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n return $this->name;\n }", "protected function getNameInput()\n {\n $model = $this->option('model') ? $this->option('model') : $this->argument('model');\n\n $dir = $this->option('dir');\n if (strlen($dir) && !Str::endsWith($dir, DIRECTORY_SEPARATOR)) {\n $dir .= DIRECTORY_SEPARATOR;\n }\n\n return (strlen($dir) ? $dir : 'Models/') . $model;\n }", "public function getNewName()\n {\n return $this->newName;\n }", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "function __toString()\r\n\t{\r\n\t\treturn ucfirst($this->model);\r\n\t}", "public static function modelName()\n {\n // strip namespacing\n $paths = explode('\\\\', get_called_class());\n\n return end($paths);\n }", "public function get_name() {\n\n\t\treturn $this->name;\n\t}", "public function get_name() {\r\n\t\treturn '';\r\n\t}", "public function name() {\n return $this->name;\n }", "public function get_name()\n {\n\n return $this->name;\n }", "public function name()\n {\n if (isset($this->attributes[self::NAME])) {\n return $this->attributes[self::NAME];\n }\n\n return $this->path();\n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "function get_name () {\n return $this -> name;\n }", "public function get_name() {\n return $this->_name;\n }", "public function get_name() {\r\n return $this->name;\r\n }", "protected function getNameInput()\n {\n $this->model = trim($this->argument('name'));\n return $this->model . 'Controller';\n }", "public function get_name()\n {\n return $this->name;\n }", "public function get_name()\n {\n return $this->name;\n }", "public function getModelName() : string\n {\n $config_key = 'scheduleable.repositories.' . snake_case(class_basename(static::class)) . '.model_class';\n return config($config_key);\n }", "public function getSingularName()\n {\n return rtrim($this->name, 's');\n }", "public function getName()\n {\n return $this->internalName;\n }", "public function getOriginalModel()\n {\n return $this->originalModel;\n }", "public function getName() {\n return $this->__name;\n }", "public function get_name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }" ]
[ "0.8049394", "0.8009097", "0.78275126", "0.76391584", "0.7627209", "0.7593081", "0.7523105", "0.7521305", "0.752127", "0.74997205", "0.7447327", "0.74081933", "0.7396217", "0.7394014", "0.7382641", "0.73469776", "0.7308018", "0.72705245", "0.7265924", "0.71966106", "0.7167547", "0.71573305", "0.7141169", "0.71197253", "0.71197253", "0.7118121", "0.7111463", "0.7100072", "0.7092449", "0.7074712", "0.7057723", "0.7053056", "0.70421124", "0.7025104", "0.7025104", "0.70227194", "0.70201826", "0.6970913", "0.6969749", "0.6947627", "0.6931335", "0.68846375", "0.68816656", "0.6873529", "0.6871413", "0.6871413", "0.6866337", "0.683194", "0.6824957", "0.6821632", "0.68161386", "0.68127775", "0.6805725", "0.6805725", "0.6805725", "0.6805725", "0.6805725", "0.6805725", "0.68019354", "0.68019027", "0.67922866", "0.676861", "0.67648715", "0.6764426", "0.676266", "0.67603827", "0.6759073", "0.6757683", "0.6757683", "0.6757683", "0.6757683", "0.67564005", "0.67534417", "0.6744676", "0.67382616", "0.6730801", "0.67225176", "0.6717658", "0.67137766", "0.67110336", "0.6704679", "0.6702349", "0.6693402", "0.66906685", "0.66906685", "0.66848224", "0.6681023", "0.6672914", "0.66727364", "0.667067", "0.6662121", "0.66583544", "0.66583544", "0.66583544", "0.6653855", "0.6653855", "0.6653855", "0.6653855", "0.6653855", "0.6653855", "0.6653855" ]
0.0
-1
Show all the invalid properties with reasons.
public function listInvalidProperties() { $invalidProperties = []; return $invalidProperties; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listInvalidProperties();", "public function listInvalidProperties()\n {\n $invalid_properties = parent::listInvalidProperties();\n\n return $invalid_properties;\n }", "public function listInvalidProperties() {\n\n $invalidProperties = [];\n\n /*\n * Any needed validation goes here. If a property requires no validation\n * (e.g. it's OK for it to be empty) then it may be omitted.\n */\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n $allowed_values = [\"CREDIT_CARD\", \"CASH\", \"THIRD_PARTY_CARD\", \"NO_SALE\", \"SQUARE_WALLET\", \"SQUARE_GIFT_CARD\", \"UNKNOWN\", \"OTHER\"];\n if (!in_array($this->container['event_type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'event_type', must be one of #{allowed_values}.\";\n }\n\n $allowed_values = [\"OTHER_BRAND\", \"VISA\", \"MASTERCARD\", \"AMERICAN_EXPRESS\", \"DISCOVER\", \"DISCOVER_DINERS\", \"JCB\", \"CHINA_UNIONPAY\", \"SQUARE_GIFT_CARD\"];\n if (!in_array($this->container['card_brand'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'card_brand', must be one of #{allowed_values}.\";\n }\n\n $allowed_values = [\"MANUAL\", \"SCANNED\", \"SQUARE_CASH\", \"SQUARE_WALLET\", \"SWIPED\", \"WEB_FORM\", \"OTHER\"];\n if (!in_array($this->container['entry_method'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'entry_method', must be one of #{allowed_values}.\";\n }\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n $allowedValues = $this->getStyleIdentifierAllowableValues();\n if (!in_array($this->container['style_identifier'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'style_identifier', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTextEffectAllowableValues();\n if (!in_array($this->container['text_effect'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'text_effect', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getUnderlineAllowableValues();\n if (!in_array($this->container['underline'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'underline', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties() {\n\t\treturn array();\n\t}", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n return [];\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getLevelAllowableValues();\n if (!is_null($this->container['level']) && !in_array($this->container['level'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'level', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'status', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n $allowed_values = $this->getBootOrderAllowableValues();\n if (!in_array($this->container['boot_order'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'boot_order', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getFirewallAllowableValues();\n if (!in_array($this->container['firewall'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'firewall', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getVideoModelAllowableValues();\n if (!in_array($this->container['video_model'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'video_model', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getVncAllowableValues();\n if (!in_array($this->container['vnc'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'vnc', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n $allowedValues = $this->getTypeAllowableValues();\r\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'type', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getStatusAllowableValues();\r\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'status', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n $allowedValues = $this->getTypeAllowableValues();\r\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'type', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getStatusAllowableValues();\r\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'status', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['legalName'] === null) {\n $invalidProperties[] = \"'legalName' can't be null\";\n }\n if ($this->container['registeredAddress'] === null) {\n $invalidProperties[] = \"'registeredAddress' can't be null\";\n }\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'type', must be one of '%s'\",\n $this->container['type'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getVatAbsenceReasonAllowableValues();\n if (!is_null($this->container['vatAbsenceReason']) && !in_array($this->container['vatAbsenceReason'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'vatAbsenceReason', must be one of '%s'\",\n $this->container['vatAbsenceReason'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getFieldAllowableValues();\n if (!is_null($this->container['field']) && !in_array($this->container['field'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'field', must be one of '%s'\",\n $this->container['field'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getOpAllowableValues();\n if (!is_null($this->container['op']) && !in_array($this->container['op'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'op', must be one of '%s'\",\n $this->container['op'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['id'] === null) {\n $invalidProperties[] = \"'id' can't be null\";\n }\n if ($this->container['type'] === null) {\n $invalidProperties[] = \"'type' can't be null\";\n }\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getResultAllowableValues();\n if (!is_null($this->container['result']) && !in_array($this->container['result'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'result', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n if ($this->container['locale'] === null) {\n $invalidProperties[] = \"'locale' can't be null\";\n }\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getCostTypeAllowableValues();\n if (!is_null($this->container['cost_type']) && !in_array($this->container['cost_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'cost_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['overview'] === null) {\n $invalidProperties[] = \"'overview' can't be null\";\n }\n return $invalidProperties;\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n if ($this->container['text'] === null) {\r\n $invalidProperties[] = \"'text' can't be null\";\r\n }\r\n if ($this->container['textOriginal'] === null) {\r\n $invalidProperties[] = \"'textOriginal' can't be null\";\r\n }\r\n if ($this->container['textNormalised'] === null) {\r\n $invalidProperties[] = \"'textNormalised' can't be null\";\r\n }\r\n if (!is_null($this->container['score']) && ($this->container['score'] > 1E+2)) {\r\n $invalidProperties[] = \"invalid value for 'score', must be smaller than or equal to 1E+2.\";\r\n }\r\n if (!is_null($this->container['score']) && ($this->container['score'] < 0)) {\r\n $invalidProperties[] = \"invalid value for 'score', must be bigger than or equal to 0.\";\r\n }\r\n return $invalidProperties;\r\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getFraudResultTypeAllowableValues();\n if (!is_null($this->container['fraudResultType']) && !in_array($this->container['fraudResultType'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'fraudResultType', must be one of '%s'\",\n $this->container['fraudResultType'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getRecurringProcessingModelAllowableValues();\n if (!is_null($this->container['recurringProcessingModel']) && !in_array($this->container['recurringProcessingModel'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'recurringProcessingModel', must be one of '%s'\",\n $this->container['recurringProcessingModel'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'status', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n if ($this->container['name'] === null) {\n $invalid_properties[] = \"'name' can't be null\";\n }\n if ($this->container['type'] === null) {\n $invalid_properties[] = \"'type' can't be null\";\n }\n $allowed_values = array(\"text\", \"range\", \"category\");\n if (!in_array($this->container['type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'type', must be one of #{allowed_values}.\";\n }\n\n if ($this->container['sort_type'] === null) {\n $invalid_properties[] = \"'sort_type' can't be null\";\n }\n $allowed_values = array(\"alphabetical\", \"count\", \"value\", \"size\");\n if (!in_array($this->container['sort_type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'sort_type', must be one of #{allowed_values}.\";\n }\n\n if ($this->container['values'] === null) {\n $invalid_properties[] = \"'values' can't be null\";\n }\n return $invalid_properties;\n }" ]
[ "0.7954126", "0.7814029", "0.7804116", "0.780055", "0.780055", "0.780055", "0.7795368", "0.77933925", "0.7785144", "0.7781625", "0.7781625", "0.77577174", "0.77577174", "0.77577174", "0.77577174", "0.77577174", "0.77577174", "0.7743693", "0.7742531", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.77358544", "0.7712601", "0.77002573", "0.77002573", "0.77002573", "0.77002573", "0.77002573", "0.77002573", "0.76904494", "0.76904494", "0.7684163", "0.7679419", "0.76636475", "0.76584613", "0.76518965", "0.76518965", "0.76518965", "0.76518965", "0.76423055", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.763543", "0.76108176", "0.7610424", "0.76066333", "0.7596187" ]
0.0
-1
Validate all the properties in the model return true if all passed
public function valid() { return count($this->listInvalidProperties()) === 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate(){\n\t\t$valid = true;\n\t\t$ref = new ReflectionObject($this);\n\t\tforeach($ref->getProperties() as $prop){\n\t\t\tif(isset($this->_atributosMetadata[$prop->getName()])){\n\t\t\t\t$propMetadata = $this->_atributosMetadata[$prop->getName()];\n\t\t\t\tif($propMetadata->needValidate){\n\t\t\t\t\t$propMetadata->Validate($prop->getValue($this));\n\t\t\t\t\tif($propMetadata->isValid){\n\t\t\t\t\t\t$valid = $valid && $propMetadata->isValid; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $valid;\t\t\n\t}", "public function isValid(): bool\n {\n return count($this->filterProperties()) === 5;\n }", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function valid()\r\n {\r\n return count($this->listInvalidProperties()) === 0;\r\n }", "public function validate(){\n $valid = true;\n foreach($this->fields as $field){\n if(!$field->validate()) $valid = false;\n }\n $this->setIsValid($valid);\n return $valid;\n }", "public function isValid()\n {\n if(\n empty($this->getPropertyType()) ||\n empty($this->getLastName()) ||\n empty($this->getPhone()) ||\n empty($this->getOrigin()) ||\n empty($this->getInterest())\n ) {\n return false;\n }\n return true;\n }" ]
[ "0.76944476", "0.7569596", "0.72817", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.72507316", "0.7234517", "0.7229663" ]
0.0
-1
Returns true if offset exists. False otherwise.
public function offsetExists($offset) { return isset($this->container[$offset]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function offsetExists($offset): bool\n {\n return false;\n }", "public function hasOffset(){\n return $this->_has(1);\n }", "public function offsetExists($offset): bool;", "public function offsetExists($offset) {\n\t\t$result = false;\n\t\t\n\t\tif($this->_data[$offset]) {\n\t\t\t$result = true;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function offsetExists($offset)\n {\n return isset($this->data[$offset]) ? true : false;\n }", "public function offsetExists($offset)\n {\n return true;\n }", "public function offsetExists($offset): bool\n {\n return isset($this->contents[$offset]);\n }", "public function offsetExists($offset){\n\t\treturn $this->has($offset);\n\t}", "public function offsetExists($offset)\n {\n return !is_null($this->getAttribute($offset));\n }", "public function offsetExists($offset)\n {\n return !is_null($this->getAttribute($offset));\n }", "public function offsetExists($offset): bool\n {\n return isset($this->json()[$offset]);\n }", "public function offsetExists($offset) {\n\t\treturn $this->hasValueForKey($offset);\n\t}", "public function offsetExists($offset): bool\n {\n return $this->__isset($offset);\n }", "public function offsetExists($offset)\n {\n // init\n $length = $this->length();\n $offset = (int) $offset;\n\n if ($offset >= 0) {\n return ($length > $offset);\n }\n\n return ($length >= abs($offset));\n }", "public function offsetExists($offset): bool\n {\n return $this->getAttribute($offset) !== null;\n }", "public function offsetExists($offset): bool\n {\n return $this->has($offset);\n }", "public function exists($offset): bool\n {\n return $this->get($offset) !== null;\n }", "public function offsetExists($offset): bool\n {\n return isset($this->{$offset});\n }", "public function offsetExists($offset) {\n\t\treturn isset($this->data[$offset]);\n\t}", "public function offsetExists($offset) {\n\t\treturn isset($this->data[$offset]);\n\t}", "public function offsetExists($offset): bool\n {\n return isset($this->array[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return (bool) $this->get($offset);\n }", "public function offsetExists($offset)\n {\n return isset($this->$offset);\n }", "public function offsetExists($offset) : bool\n {\n return isset($this->attributes[$offset]);\n }", "public function offsetExists(mixed $offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists(mixed $offset): bool\n {\n return $this->has((string) $offset);\n }", "public function offsetExists($offset) {\n return $this->__isset($offset);\n }", "public function offsetExists($offset) {\n\t\treturn isset($this->tokens[$offset]);\n\t}", "public function offsetExists($offset) {\n $value = $this->{\"get$offset\"}();\n return $value !== null;\n }", "public function offsetExists($offset) {\n\t\treturn isset($this->pile[$offset]);\n\t}", "public function offsetExists($offset)\n {\n return ! is_null($this->getAttribute($offset));\n }", "public function offsetExists($offset) {\n return isset(current($this->_data)[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return array_key_exists($offset, $this->array);\n }", "public function offsetExists ($offset)\n {\n try\n {\n $this->get ($offset);\n }\n catch (InvalidArgumentException $exception)\n {\n return false;\n }\n catch (UnexpectedValueException $exception)\n {\n return false;\n }\n \n return true;\n }", "public function offsetExists($offset)\n {\n return $this->__isset($offset);\n }", "public function offsetExists($offset)\n {\n return $this->__isset($offset);\n }", "public function offsetExists($offset)\n {\n return $this->__isset($offset);\n }", "public function offsetExists($offset) {\n\t\tsettype($offset, 'integer');\n\n\t\tif ($offset >= 0 && $offset < $this->indexMax) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->container[$offset]);\n }", "public function has($offset) {\n return $this->offsetExists($offset);\n }", "public function offsetExists($offset): bool\n {\n return isset($this->items()[$offset]);\n }", "public function offsetExists($offset):bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset)\n {\n return isset($this->$offset);\n\n }", "public function offsetExists($offset);", "public function offsetExists($offset);", "public function offsetExists($offset) : bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset) : bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset) : bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset) : bool\n {\n return isset($this->container[$offset]);\n }", "public function offsetExists($offset) : bool\n {\n return isset($this->container[$offset]);\n }" ]
[ "0.8555834", "0.8536144", "0.84876734", "0.8325894", "0.8322583", "0.8300258", "0.821515", "0.81559885", "0.8143132", "0.8143132", "0.81348807", "0.81315136", "0.8130816", "0.8128181", "0.8118165", "0.81153667", "0.81060076", "0.8103301", "0.80874085", "0.80874085", "0.8082012", "0.80752295", "0.8074589", "0.8064161", "0.80609185", "0.80597305", "0.8058638", "0.8055913", "0.80540025", "0.805388", "0.8049724", "0.80424815", "0.8039266", "0.803328", "0.803072", "0.803072", "0.803072", "0.80282956", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.8023719", "0.80212057", "0.80201447", "0.801126", "0.80099213", "0.80095094", "0.80095094", "0.8007395", "0.8007395", "0.8007395", "0.8007395", "0.8007395" ]
0.0
-1
Sets value based on offset.
public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set($offset, $value);", "public function set($offset, $value = null);", "function setOffset($value) {\n $this->offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset,$value) {\n if (is_null($offset)) {\n current($this->_data)[] = $value;\n } else {\n current($this->_data)[$offset] = $value;\n }\n }", "public function offsetSet($offset, $value)\n {\n $this->getValue()[$offset] = $value;\n }", "public function offsetSet( $offset, $value ) {\n\t\t// ...\n\t}", "public function offsetSet($offset, $value);", "public function offsetSet($offset, $value);", "public function offsetSet($offset, $value){\n\t\t$this->set($offset, $value);\n\t}", "public function offsetSet($offset, $value) {}", "public function offsetSet($offset, $value) {}", "public function offsetSet($offset, $value) {}", "public function offsetSet($offset, $value) {}", "public function offsetSet(mixed $offset, mixed $value): void\n {\n if (Arr::accessible($this->value)) {\n $this->value[$offset] = $value;\n }\n }", "public function offsetSet($offset, $value) { }", "public function offsetSet($offset, $value)\r\n {\r\n $this->data[$offset] = $value;\r\n }", "public function offsetSet($offset, $value)\n\t{\n\t\t$this->{$offset} = $value;\n\t}", "public function offsetSet($offset, $value)\n {\n $this->_data[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->_data[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->data[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->data[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n\n\n $this->__set($offset, $value);\n }", "public\t\tfunction\tsetValue($offset, $value)\n\t\t{\n\t\t\tif(array_key_exists($offset, $this->_values) && $this->_values[$offser] !== $value) {\n\t\t\t\t$this->_values[$offset]\t=\t$value;\n\t\t\t\t$this->_saved\t\t\t=\tfalse;\n\t\t\t}\n\t\t}", "public function offsetSet($offset,$value) {\n if ($offset == \"\") {\n\t $this->_data[] = $value;\n\t}else {\n\t $this->_data[$offset] = $value;\n\t}\n }", "public function setOffset($offset, $value, $container = 'default');", "public function offsetSet($offset, $value)\n {\n }", "public function offsetSet($offset, $value)\n {\n $this->setModel($value, $offset);\n }", "public function offsetSet($offset, $value) \n {\n }", "public function offsetSet($offset, $value) { \n if (is_null($offset)) {\n $this->insert($value);\n $this->incrementLength();\n } else {\n if (is_null($this->offsetGet($offset))) {\n $this->incrementLength();\n }\n\n $this->update($offset, $value); \n }\n }", "public function offsetSet($offset, $value)\n {\n if (!is_null($offset)) {\n $this->data[$offset] = $value;\n }\n }", "public function offsetSet ($offset, $value) {\n $this->__set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n }", "public function offsetSet($offset, $value) {\n $this->__set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->item[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->setAttribute($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->elements[$offset] = $offset;\n }", "public function offsetSet($offset, $value)\n {\n if ($offset == null)\n {\n $this->data[] = $offset;\n }\n else\n {\n $this->data[$offset] = $value;\n }\n $this->size++;\n }", "public function offsetSet($offset, $value): void;", "final public function offsetSet($offset, $value)\n\t{\n\t\t$this->__set($offset, $value);\n\t}", "public function offsetSet($offset, $value)\n {\n $this->__set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->__set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->__set($offset, $value);\n }", "public function offsetSet($offset , $value) {\n $this->_items[$offset] = $value;\n }", "public function offsetSet($offset, $value)\n {\n $method = 'set' . str_replace(\" \", \"\", ucwords(strtr($offset, \"_-\", \" \")));\n if(method_exists($this, $method)){\n $this->$method($value);\n }\n }", "public function offsetSet($offset, $value)\n\t{\n\t\t// TODO: Implement offsetSet() method.\n\t}", "public function offsetSet($offset, $value)\n {\n if (is_null($offset)) {\n $this->data[] = $value;\n } else {\n $this->data[$offset] = $value;\n }\n }", "public function offsetSet($offset, $value)\n {\n if (is_null($offset)) {\n $this->data[] = $value;\n } else {\n $this->data[$offset] = $value;\n }\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n $this->set($offset, $value);\n }", "public function offsetSet($offset,$value)\n\t{\n\t\t$this->store()->offsetSet($offset,$value);\n\t}", "public function offsetSet($offset, $value): void\n {\n $this->update($offset, $value);\n }", "public function offsetSet($offset, $value): void\n {\n }", "public function offsetSet($offset, $value)\n {\n if ($offset === null) {\n $this->data[] = $value;\n } else {\n $this->data[$offset] = $value;\n }\n }", "public function set($offset, $value): void\n {\n $this->store->set($offset, $value);\n }", "public function offsetSet($offset, $value)\n\t\t{\n\t\t\tif(is_null($offset))\n\t\t\t\t$this->source[] = $value;\n\t\t\telse\n\t\t\t\t$this->source[$offset] = $value;\n\t\t}", "public function offsetSet(mixed $offset, mixed $value)\n {\n $this->set((string) $offset, $value);\n }", "public function offsetSet($offset, $value)\n {\n\n // add the data depending an offset has been passed or not\n if (is_null($offset)) {\n $offset = apc_inc($this->serial);\n }\n\n // store the data back to the property\n $this->__set($offset, $value);\n }", "public function offsetSet($offset, $value) {\n\t\tif(!array_key_exists($offset, $this->_data)) {\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('The specified column \"' . $offset . '\" is not a part of this record, the value was not assigned.');\n\t\t}\n\t\t\n\t\t$this->_data[$offset] = $value;\n\t}", "public function offsetSet($offset, $value)\n {\n parent::offsetSet($offset, $value);\n $this->performHook('modified');\n }", "public function offsetSet($offset, $value): void\n {\n $items = &$this->items();\n $items[$offset] = $value;\n }", "public /*void*/ function offsetSet(/*scalar*/ $offset, /*mixed*/ $value)\n\t{\n\t\tif($offset === null) {\n\t\t\t$this->_data[] = $value;\n\t\t} else {\n\t\t\t$this->_data[$offset] = $value;\n\t\t}\n\t}", "function offsetSet($offset, $value) {\n $property = defined('static::$DOMAIN_PROPERTY') ? static::$DOMAIN_PROPERTY : 'data';\n if(!isset($this->{$property})) {\n $this->{$property} = [];\n }\n \n if (is_null($offset)) {\n $offset = 0;\n if (!empty($this->{$property})) {\n $keys = \\preg_grep( '#^(0|([1-9][0-9]*))$#', \\array_keys($this->{$property}));\n if (!empty($keys)) {\n $offset = \\max($keys) + 1;\n }\n }\n }\n\n $this->{$property}[$offset] = $value;\n }", "public function offsetSet($offset, $value)\r\n {\r\n if ( ! isset($offset)) {\r\n $this->add($value);\r\n } else {\r\n $this->set($offset, $value);\r\n }\r\n }" ]
[ "0.8670502", "0.84270954", "0.821386", "0.8191476", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.8170767", "0.81676894", "0.8118936", "0.8105677", "0.80739844", "0.80739844", "0.8055169", "0.8049614", "0.8049066", "0.8049066", "0.8049066", "0.8047941", "0.80345124", "0.8014046", "0.8012902", "0.80005074", "0.80005074", "0.79962283", "0.79962283", "0.7993535", "0.7988586", "0.79849035", "0.79569495", "0.79568005", "0.7947382", "0.7944527", "0.79422164", "0.7940082", "0.79384965", "0.7937125", "0.7935071", "0.7918337", "0.7916076", "0.7908293", "0.7908293", "0.7908293", "0.79033184", "0.78849", "0.787758", "0.7874427", "0.78388196", "0.78388196", "0.78388196", "0.78323215", "0.78242445", "0.78159875", "0.78142", "0.78142", "0.7813506", "0.7813506", "0.7813506", "0.7813506", "0.7813506", "0.7813506", "0.78095996", "0.7808172", "0.78012717", "0.779916", "0.77978307", "0.7793151", "0.7784688", "0.7784433", "0.7757673", "0.77549654", "0.77270854", "0.7702829", "0.7696581", "0.7691455" ]
0.0
-1
Gets the string presentation of the object
public function __toString() { return json_encode( ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "public function __toString() {\n\t\treturn $this->getPrint();\n\t}", "public function visualize()\n {\n \n return new StringWrapper('object('.$this->name().')');\n \n }", "public function __toString()\n {\n $result = $this->show();\n return $result ? $result : '';\n }", "public function getToString()\n {\n return $this->toString();\n }", "public function to_string() { return $this->__toString(); }", "public function __toString()\n {\n return $this->formatAsString();\n }", "public function toString()\n {\n $data = $this->origin->data();\n $out = '';\n if (is_scalar($data) || is_null($data)) {\n $out = (string) $data;\n } elseif (is_object($data) && method_exists($data, '__toString')) {\n $out = (string) $data;\n }\n return $out;\n }", "function asString () {\n \t\treturn $this->printableString();\n \t}", "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\n {\n return $this->format();\n }", "public function __toString()\n {\n return sprintf('%s -> %s', $this->getLugar(), $this->getMotivo());\n }", "public function toString()\n {\n return $this->__toString();\n }", "public function __toString()\r\n {\r\n return $this->getFormattedString();\r\n }", "public function __toString() {\n\t\t\treturn Core\\Convert::toString($this->render());\n\t\t}", "public function __toString() { return $this->as_string(); }", "public function __toString()\n {\n try {\n return $this->toString();\n } catch (\\Exception $e) {\n return '';\n }\n }", "public function toString()\n {\n return $this->cast('string');\n }", "public function __toString()\n\t{\n\t\treturn $this->get();\n\t}", "public function __toString() {\r\n return $this->toString();\r\n }", "public function __toString()\n {\n return $this->toFormattedString();\n }", "public function __toString()\n {\n return $this->make()->toString();\n }", "public function __toString(): string\n {\n return (string) $this->format();\n }", "public function __toString() {\n\t\treturn get_class($this) . '-object ' . \"\\n\";\n\t}", "public function __toString()\n {\n return $this->assemble();\n }", "public function toString()\n {\n $data = $this->getProperties();\n $out = get_class($this).' ('.CRLF;\n foreach ($data as $key => $value) {\n $type = gettype($value);\n $value = is_bool($value) ? (int) $value : $value;\n $value = is_string($value) ? '\"'.$value.'\"' : $value;\n $value = is_object($value) ? implode(CRLF.TAB, explode(CRLF, (string) $value)) : $value;\n $value = is_array($value) ? print_r($value, true) : $value;\n $out .= TAB.$key.' ('.$type.')';\n $out .= ': '.$value.CRLF;\n }\n\n return $out.');';\n }", "public function __toString() {\n return $this->toString();\n }", "public function __toString() {\n return $this->toString();\n }", "function __toString() \n {\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) {\n if ($obj != NULL) {\n $obj->name = $name; #nombre de la variable que hace de nombre de objecto\n $str .= $obj->label();\n $str .= $obj;\n $str .= \"<br />\\n\";\n }\n }\n return $str;\n }", "public function __toString() {\n return $this->assemble();\n }", "public function __toString() {\n\t\treturn $this->toString();\n\t}", "public function __toString() {\n\t\treturn $this->toString();\n\t}", "public function __toString() {\n return $this->as_string();\n }", "function __toString() {\n return $this->string();\n }", "public function __toString () {\r\n\t\treturn '';\r\n\t}", "public function __tostring() {\r\n return (string) $this->object->getId();\r\n }", "public function __toString() {\n \n return $this->toString();\n }", "public function __toString()\n {\n return (string) $this->getContents();\n }", "public function __toString()\n {\n \treturn $this->get();\n }", "public function __tostring();", "public function __toString()\n {\n return $this->adaptor->render();\n }", "public function __toString()\n {\n return (string) $this->exportTo(SekolahPaudPeer::DEFAULT_STRING_FORMAT);\n }", "public function toString() {\n return $this->getClassName().'<'.$this->name.'>';\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->toString();\n }", "public function toString()\n {\n return json_encode($this->obj);\n }", "public function __toString(){\n\t\t$ref = new ReflectionObject($this);\n\t\t$r = \"[\".$ref->getName().\"]\\n\";\n\t\tforeach($ref->getProperties() as $prop){\n\t\t\t$r .= \"\\t - \".$prop->getName().\"=\".$prop->getValue().\"\\n\";\n\t\t}\n\t\treturn $r;\n\t}", "public function __toString()\n {\n return $this->_;\n }", "public function __toString()\n {\n return $this->_;\n }", "public function __toString()\n {\n return $this->_;\n }", "public function __toString()\n {\n return (string) $this->exportTo(SanitasiPeer::DEFAULT_STRING_FORMAT);\n }", "public function __tostring()\n {\n return get_class($this) . '#' . $this->get_id() . ' (' . $this->get_title() . ')';\n }", "public function __toString() {\n return $this->toString();\n }", "public function __toString()\n {\n return $this->_render();\n }", "public function __toString() : string {\n return $this->box . ' ' . $this->created->format('c');\n }", "public function __toString()\n {\n return (string) $this->exportTo(JadwalPeer::DEFAULT_STRING_FORMAT);\n }", "public function __toString(): string\n {\n return $this -> text;\n }", "public function __toString() {\n\t\t\treturn $this->name();\n\t\t}", "public function __toString()\n\t{\n\t\treturn '';\n\t}", "public function __toString()\n {\n notice('Object: \"'.get_class($this).'\" is used as string');\n\n return 'Object('.get_class($this).')';\n }", "public function __toString(){\n return $this->convert();\n }", "public function __toString()\n {\n return $this->toNative();\n }", "public function __toString() {\n\t\treturn $this->debug();\n\t}", "public function __toString()\n\t{\n\t\treturn $this->_toString();\n\t}", "public function toString() {\n $s= $this->getClassName().'@('.$this->hashCode().\"){\\n\";\n $s.= ' [ name ] '.$this->name.\"\\n\";\n $s.= ' [ value ] '.$this->value.\"\\n\";\n $s.= ' [ mustUnderstand ] '.xp::stringOf($this->mustUnderstand).\"\\n\";\n $s.= ' [ encodingStyle ] '.$this->encodingStyle.\"\\n\";\n $s.= ' [ actor ] '.$this->actor.\"\\n\";\n return $s.'}';\n }", "public function __toString()\n {\n return $this->reference ?? '';\n }", "public function __toString()\n {\n return $this->render(true);\n }", "public function __toString() : string\n {\n return $this->toString();\n }", "public function __toString() {\n\t\treturn $this->name->getFullyQualifiedName();\n//\t\t$s = $this->name->getFullyQualifiedName();\n//\t\t$c = $this->extended;\n//\t\twhile($c !== NULL){\n//\t\t\t$s .= \"->\" . $c->name;\n//\t\t\t$c = $c->extended;\n//\t\t}\n//\t\treturn $s;\n\t}", "public function __toString() {\n\t\treturn $this->render();\n\t}", "public function __toString()\n {\n return $this->make()->render();\n }", "public function __toString()\n {\n return $this->output();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }" ]
[ "0.78987753", "0.78987753", "0.78655267", "0.78240114", "0.7798868", "0.77837336", "0.77770287", "0.77690274", "0.77437395", "0.774057", "0.7733258", "0.7733258", "0.7733258", "0.7695146", "0.767794", "0.76635754", "0.76593804", "0.7630339", "0.76228136", "0.7610629", "0.7575354", "0.7573883", "0.75735986", "0.75721085", "0.7561757", "0.75431705", "0.7537132", "0.75362605", "0.75335604", "0.75335604", "0.75276136", "0.7519024", "0.7514037", "0.7514037", "0.75004286", "0.7499962", "0.7497666", "0.74929035", "0.7487213", "0.7479636", "0.74712914", "0.7462192", "0.74601185", "0.7455943", "0.7455742", "0.745568", "0.745568", "0.745568", "0.745568", "0.745568", "0.745568", "0.745568", "0.745568", "0.745568", "0.745568", "0.745568", "0.745568", "0.745568", "0.745568", "0.745568", "0.74519074", "0.745044", "0.7448012", "0.7448012", "0.7448012", "0.7446098", "0.74429476", "0.7441371", "0.7430801", "0.74215424", "0.74149144", "0.74128985", "0.74083585", "0.74013644", "0.7390187", "0.7385503", "0.73853725", "0.7384312", "0.73842263", "0.7383548", "0.7380489", "0.73800004", "0.7369339", "0.7366414", "0.7363444", "0.7361871", "0.7358607", "0.73577785", "0.73577785", "0.73577785", "0.73577785", "0.73577785", "0.73577785", "0.73577785", "0.73577785", "0.73577785", "0.73577785", "0.73577785", "0.73577785", "0.73577785", "0.73577785" ]
0.0
-1
Gets a headersafe presentation of the object
public function toHeaderValue() { return json_encode(ObjectSerializer::sanitizeForSerialization($this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function presentHeader() {\r\n $html = parent::presentHeader();\r\n\r\n return $html;\r\n }", "\n using \\IngwiePhoenix\\UniterMPC\\Models\\Displayable;\n\n public function __toDOM() {\n return (<div>\n <p>We present to you:</p>\n <span class=\"title\">{$this->title}</div>\n </div>);\n }", "public function visualize()\n {\n \n return new StringWrapper('object('.$this->name().')');\n \n }", "public function getPresentation();", "public function getHeading(): string;", "public function __toString()\n { \n if (in_array($this->object->extension(), ['html', 'twig', 'md'])) {\n return $this->render();\n } else {\n return $this->content();\n }\n }", "function newsroom_elated_get_header() {\n $id = newsroom_elated_get_page_id();\n\n //will be read from options\n $header_type = 'header-type3';\n $header_behavior = newsroom_elated_options()->getOptionValue('header_behaviour');\n\n if(HeaderFactory::getInstance()->validHeaderObject()) {\n $parameters = array(\n 'hide_logo' => newsroom_elated_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'header_in_grid' => newsroom_elated_options()->getOptionValue('header_in_grid') == 'yes' ? true : false,\n 'logo_position' => newsroom_elated_get_meta_field_intersect('logo_position',$id),\n 'show_sticky' => in_array($header_behavior, array(\n 'sticky-header-on-scroll-up',\n 'sticky-header-on-scroll-down-up'\n )) ? true : false,\n );\n\n $parameters = apply_filters('newsroom_elated_header_type_parameters', $parameters, $header_type);\n\n HeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n }\n }", "public function format_for_header()\n {\n }", "function biagiotti_mikado_get_header() {\n\t\t$id = biagiotti_mikado_get_page_id();\n\t\t\n\t\t//will be read from options\n\t\t$header_type = biagiotti_mikado_get_meta_field_intersect( 'header_type', $id );\n\t\t\n\t\t$menu_area_in_grid = biagiotti_mikado_get_meta_field_intersect( 'menu_area_in_grid', $id );\n\t\t\n\t\t$header_behavior = biagiotti_mikado_get_meta_field_intersect( 'header_behaviour', $id );\n\t\t\n\t\tif ( HeaderFactory::getInstance()->validHeaderObject() ) {\n\t\t\t$parameters = array(\n\t\t\t\t'hide_logo' => biagiotti_mikado_options()->getOptionValue( 'hide_logo' ) == 'yes',\n\t\t\t\t'menu_area_in_grid' => $menu_area_in_grid == 'yes',\n\t\t\t\t'show_sticky' => in_array( $header_behavior, array( 'sticky-header-on-scroll-up', 'sticky-header-on-scroll-down-up' ) ),\n\t\t\t\t'show_fixed_wrapper' => in_array( $header_behavior, array( 'fixed-on-scroll' ) ),\n\t\t\t);\n\t\t\t\n\t\t\t$parameters = apply_filters( 'biagiotti_mikado_filter_header_type_parameters', $parameters, $header_type );\n\t\t\t\n\t\t\tHeaderFactory::getInstance()->getHeaderObject()->loadTemplate( $parameters );\n\t\t}\n\t}", "protected function _toHtml()\n {\n $this->assign('headline', $this->getData('slide_headline'));\n $this->assign('content', $this->getData('slide_content'));\n\n $this->assign('med_img', $this->getData('slide_image_medium'));\n $this->assign('small_img', $this->getData('slide_image_small'));\n $this->assign('large_img', $this->getData('slide_image_large'));\n\n return parent::_toHtml();\n }", "public function present() {\n\t\t$data = [\n\t\t\t'key'=>$this->key,\n\t\t\t'team'=>$this->team,\n\t\t\t'views'=>$this->views,\n 'after'=>$this->after\n\t\t];\n\n\t\tif($this->cards !== null) {\n\t\t $data['cards'] = $this->cards;\n }\n\n\t\t$json = htmlspecialchars(json_encode($data), ENT_NOQUOTES);\n\t\treturn <<<HTML\n<div class=\"cl-trello-sprinter\" style=\"display:none\">$json</div>\t\t\nHTML;\n\t}", "public function __toString()\n {\n return $this->rawHeaders . \"\\n\\n\" . $this->rawBody;\n }", "function getContent() {\t \r\n\t \t$content = isSet($this->headery) ? '\\headery'.round(TWIPS_IN_CM * $this->headery).' ' : '';\t \r\n\t\t$content .= '{\\\\'.$this->type.' ';\t\t\t\t\t\t\r\n\t\t$content .= parent::getContent();\r\n\t\t$content .= '\\par ';\r\n\t\t$content .= '}';\r\n\t\treturn $content.\"\\r\\n\";\r\n\t}", "public function headings() {\n\t\t$vals = array_keys(get_object_vars($this));\n\t\treturn( array_reduce($vals, create_function('$a,$b','return is_null($a) ? \"$b\" : \"$a\".\"\\t\".\"$b\";')));\n\t}", "public function headings() {\n\t\t$vals = array_keys(get_object_vars($this));\n\t\treturn( array_reduce($vals,\n\t\t\t\tcreate_function('$a,$b','return is_null($a) ? \"$b\" : \"$a\".\"\\t\".\"$b\";')));\n\t}", "public function extObjHeader() {}", "public function __toString()\n {\n return $this->getTitle();\n }", "public function __toString()\n {\n return $this->getTitle();\n }", "public function __toString()\n {\n return $this->getTitle();\n }", "public function getDisplay();", "function get_a($object, $html_format = true)\n{\n if (is_array($object)) {\n $content = print_r($object, true);\n } else {\n ob_start();\n var_dump($object);\n $content = ob_get_contents();\n ob_end_clean();\n }\n if ($html_format) {\n $content = \"<pre>\".htmlentities($content).\"</pre>\";\n }\n return $content;\n}", "public function render()\n {\n return $this->toJson();\n }", "public function displayData()\r\n {\r\n $htmlContent = '';\r\n $htmlContent .= html_entity_decode($this->content);\r\n return $htmlContent;\r\n }", "public function getContentObject() {}", "function createHeader($options = array()) {\n $header = new Header( $options );\n $html = $header->html();\n return $html;\n}", "public function toHTML() {\n\t\treturn rtrim( static::buildHTML( get_object_vars($this) ), PHP_EOL );\n\t}", "public function toHTML();", "public function __toString()\n {\n return $this->adaptor->render();\n }", "public function __toString()\n {\n return $this->body();\n }", "public function __toString()\n {\n $headers = $this->headers();\n\n $buffer = [];\n foreach ($headers as $k => $v) {\n $buffer[] = $k . ': ' . $v;\n }\n\n return implode(\"\\t\", $buffer);\n }", "public function __toString() {\n return $this->getContent();\n }", "public function getAmfHeaders();", "public function getPreview();", "public function __toString()\n {\n return $this->make()->render();\n }", "public function __toString()\n {\n return $this->view->fetch($this->template);\n }", "public function as_text ()\n {\n $opts = $this->context->text_options;\n \n if ($this->subject)\n {\n $pieces [] = $opts->convert_to_html_entities ($this->subject);\n }\n \n if (!empty($this->_objects))\n {\n $objs = array_reverse($this->_objects);\n $titles = null;\n \n foreach ($objs as $obj)\n {\n if (empty($titles))\n {\n // Do not truncate the first, most important title in the list\n \n $formatter = $obj->title_formatter ();\n $formatter->max_visible_output_chars = 0;\n $title = $opts->convert_to_html_entities ($obj->title_as_plain_text ($formatter));\n }\n else \n {\n $title = $opts->convert_to_html_entities ($obj->title_as_plain_text ());\n }\n \n $titles [] = $title; \n }\n \n $text = join ($this->separator, $titles);\n \n if (! empty($text))\n {\n $pieces [] = $text;\n }\n }\n\n if ($this->group)\n {\n $pieces [] = $opts->convert_to_html_entities ($this->group);\n }\n \n if (isset ($pieces))\n {\n $Result = $this->prefix . join ($this->separator, $pieces) . $this->suffix;\n }\n else\n {\n $Result = $this->prefix . $this->suffix;\n }\n \n return $Result; \n }", "function getDisplay() {\n return $this->display;\n }", "public function buildHeader() {\n return [\n ['data' => t('Teaching format'), 'class' => ['align-middle']],\n ['data' => t('Event'), 'class' => ['align-middle']],\n ['data' => t('Tutor'), 'class' => ['align-middle']],\n ['data' => t('Location'), 'class' => ['align-middle']],\n ['data' => t('Room'), 'class' => ['align-middle']],\n [\n 'data' => t('Date/time'),\n 'field' => 'time.field_event_time_value',\n 'sort' => 'desc',\n 'class' => ['align-middle'],\n ],\n ['data' => t('Registration status'), 'class' => ['align-middle']],\n ];\n }", "public function getOutputHeaders()\n {\n }", "public function getContent()\n {\n return $this->objOutput->getObjectRender()->overrideContent($this->output);\n }", "public function getContent()\n {\n return $this->objOutput->getObjectRender()->overrideContent($this->output);\n }", "public function docHeaderContent() {}", "public function getHtml()\n {\n if ($html = $this->forgeIframe()) return $html;\n if ($html = $this->forgeVideo()) return $html;\n if ($html = $this->forgeObject()) return $html;\n }", "function showHeader(){\n\t\t$header = \"\";\n\t\t// print the header row\n\t\t$header .= \"\t<tr>\\n\";\n\t\t// loop the fields\n\t\tforeach ($this->fields as $field) {\n\t\t\t// print each field\n\t\t\t$header .= \"\t\t<th>\".$field.\"</th>\\n\";\n\t\t}\n\t\t// end the header row\n\t\t$header .= \"\t</tr>\\n\";\n\t\treturn $header;\n\t}", "function __toString()\n\t{\n\t\treturn $this->getTitle();\n\t}", "function get_page_heading()\n {\n return $this->object->get_page_title();\n }", "public function index()\n {\n return view(\"pages.admin.specification.hdr.hdr\",$this->data);\n }", "public function toHtml();", "public function getEnhanced();", "public function __toString()\n {\n UI_Datagrid::addHeader($this->datagrid);\n return $this->datagrid->getHTML();\n }", "public function getDisplayData()\n {\n return $this->displayData;\n }", "public function toHeaderValue() : string\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function toHeaderValue() : string\n {\n return json_encode(ObjectSerializer::sanitizeForSerialization($this));\n }", "public function get_heading() {\n\t\tif ( $this->object['voucher_count'] == 1 ) {\n\t\t\treturn apply_filters( 'woocommerce_email_heading_' . $this->id, $this->format_string( $this->heading ), $this->object );\n\t\t} else {\n\t\t\treturn apply_filters( 'woocommerce_email_heading_' . $this->id, $this->format_string( $this->heading_multiple ), $this->object );\n\t\t}\n\t}", "public function getPropertiesPreview() {\n return '';\n }", "public function __toString()\n {\n $result = $this->show();\n return $result ? $result : '';\n }", "public function get_display() {\n return $this->view->display_handler;\n }", "public function __toString()\n {\n return $this->response->get('json');\n }", "public function displayType(): object\n {\n return $this->displayType;\n }", "public function getInfo(){ \n return $this->title .' ('. $this->year . ')';\n }", "public function format() {\n\n /* * Add the mandatary props* */\n if (!is_null($this->name)) {\n $result[self::NAME_KEY] = $this->name;\n }\n\n /* * Add the optional props if any* */\n if (!is_null($this->optionalProperties)) {\n $result = array_merge($result, $this->optionalProperties);\n }\n\n\n return $result;\n }", "public function __toString(): string\n {\n return $this->getTitle();\n }", "protected function getTableHeader() {\n /** @var \\Drupal\\webform\\WebformInterface $webform */\n $webform = $this->getEntity();\n $header = [];\n $header['title'] = $this->t('Title');\n\n $header['key'] = [\n 'data' => $this->t('Key'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ];\n $header['type'] = [\n 'data' => $this->t('Type'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ];\n $header['correct_answer'] = $this->t('Answer');\n $header['weight'] = $this->t('Weight');\n $header['operations'] = $this->t('Operations');\n// $header['answer'] = [\n// 'data' => $this->t('Answer'),\n// 'class' => [RESPONSIVE_PRIORITY_LOW],\n// ];\n//\n// $header['required'] = [\n// 'data' => $this->t('Required'),\n// 'class' => ['webform-ui-element-required', RESPONSIVE_PRIORITY_LOW],\n// ];\n// $header['parent'] = $this->t('Parent');\n// $header['operations'] = [\n// 'data' => $this->t('Operations'),\n// 'class' => ['webform-ui-element-operations'],\n// ];\n return $header;\n }", "public function __toString(){ return $this->render(); }", "public function toHTML($object){\n\t\t$title = Resource::get_title($object);\n\t\t$url = Resource::get_url($object);\n\t\t$html = \"<a href='{$url}'>{$title}</a>\";\n\t\treturn $html;\n\t}", "public function render()\n {\n return view('components.jet-heading');\n }", "public function __toString()\n {\n if (method_exists($this, 'getName')) {\n return $this->getName();\n } elseif (method_exists($this, 'getTitle')) {\n return $this->getTitle();\n } else {\n return '';\n }\n\n }", "public function toHeaderValue() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }", "public function toHeaderValue() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }", "public function toHeaderValue() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }", "public function toHeaderValue() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }", "public function toHeaderValue() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }", "public function toHeaderValue() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }", "public function getMeta();", "public function getMeta();" ]
[ "0.61159414", "0.6068017", "0.60532254", "0.60413814", "0.5781261", "0.5628451", "0.5612692", "0.55510443", "0.55439895", "0.5515508", "0.5511252", "0.55019116", "0.5494934", "0.54865175", "0.547702", "0.54236686", "0.5421538", "0.5421538", "0.54153484", "0.5390828", "0.5374325", "0.5368358", "0.5367384", "0.5366975", "0.53603345", "0.5357342", "0.5350275", "0.5342944", "0.53426796", "0.5337054", "0.5331422", "0.5325759", "0.53205174", "0.53191763", "0.53125566", "0.5312477", "0.5310434", "0.5305851", "0.53009313", "0.52947956", "0.52947956", "0.5291835", "0.52768236", "0.5273531", "0.5273135", "0.5267671", "0.5264405", "0.5250121", "0.52376777", "0.52371836", "0.523431", "0.5233697", "0.5233697", "0.52281773", "0.5224229", "0.52192146", "0.5214723", "0.5213895", "0.5212308", "0.5209096", "0.52066165", "0.5197623", "0.5188138", "0.51859075", "0.51803833", "0.51799357", "0.517864", "0.51771486", "0.51771486", "0.51771486", "0.51771486", "0.51771486", "0.51771486", "0.5176461", "0.5176461" ]
0.0
-1
Run the database seeds.
public function run() { if(DB::table('types')->count() == 0){ DB::table('types')->insert([ [ 'nome' => 'Italiano', ], [ 'nome' => 'Regionale', ], [ 'nome' => 'Giapponese', ], [ 'nome' => 'Thailandese', ], [ 'nome' => 'Messicano', ], [ 'nome' => 'Greco', ], [ 'nome' => 'Arabo', ], [ 'nome' => 'Cinese', ], [ 'nome' => 'Fusion', ], [ 'nome' => 'Pizza', ], [ 'nome' => 'Pesce', ], [ 'nome' => 'Altro', ] ]); } else { echo "\e[31mTable is not empty, therefore NOT "; } }
{ "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() { $clients = Client::all(); $products = Product::all(); $publishers = Publisher::all(); $platforms = Platform::all(); $selectedPlatform = null; $selectedPublisher = null; return view('special_user_price.index', compact('products', 'publishers', 'platforms', 'selectedPlatform', 'selectedPublisher', 'clients')); }
{ "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
$validator = Validator::make($request>all(), [
public function getCorrectionPage(Request $request) { // 'slug' => 'required' // ]); // if ($validator->fails()) { // return response()->json([ // 'message' => 'Validations', // 'validation_messages' => $validator->errors(), // ], 400); // } else { $content = Page::where(['slug' => $request->slug])->select(['content'])->get(); return response()->json($content, 200); // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(Request $request)\n {\n $validator = Validator::make($request->all());\n dd($validator);\n }", "protected function validator(Request $request)\n {\n return Validator::make($request, [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'suburb' => 'required',\n 'zipcode' => 'required',\n\t\t\t\n ]);\n }", "private function validator(Request $request)\n {\n //validate the form...\n }", "protected function validator(Request $request)\n {\n return Validator::make($request->all(), [\n 'rol' => 'required',\n 'name' => 'required|max:255',\n 'lastname' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|same:confirmpass',\n 'confirmpass' => 'required|min:6',\n 'phone' => 'required',\n 'cubicle' => 'required_if:rol,2'\n ]);\n }", "protected function validator(Request $request)\n {\n return Validator::make($request->all(), [\n 'userid' => 'required|max:11',\n 'page' => ''\n ]);\n }", "protected function validator(Request $request)\n {\n return Validator::make($request->all(), [\n 'userid' => 'required|max:11',\n 'password' => 'required'\n ]);\n }", "protected function validarCliente($request){\n $validator = Validator::make($request->all(), [\n \"nome\" => \"required\",\n \"CPF\" => \"numeric\",\n \"endereco\" => \"required\",\n \"bairro\" => \"required\",\n \"telefone\" => \"required | numeric\",\n \"celular\" => \"required | numeric\",\n \"sexo\" => \"required\",\n ]);\n return $validator;\n}", "protected function validation($request)\n {\n\n $validator = Validator::make($request->all(), [\n 'firstname' => 'required',\n 'lastname' => 'required',\n 'email' => 'required',\n 'pocketmoney' => 'required',\n 'password' => 'required',\n 'age' => 'required',\n 'city' => 'required',\n 'state' => 'required',\n 'zip' => 'required',\n 'country' => 'required',\n ]);\n\n return $validator;\n }", "public static function validate(Request $request)\n {\n return Validator::make($request->all(), self::$rules);\n }", "public function rules(Request $request)\n {\n return [\n //\n 'sasaran_id' => 'required',\n 'nama_program' => 'required',\n ];\n }", "protected function validator(Request $request)\n {\n return Validator::make($request, [\n 'name' => ['required', 'string', 'max:255'],\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n 'password' => ['required', 'string', 'min:8', 'confirmed'],\n ]);\n }", "protected function validator(Request $request)\n\t{\n\t\treturn Validator::make($request->all(), [\n\t\t\t'title' => 'required',\n\t\t\t]);\n\t}", "private function validation(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|max:255',\n 'body' => 'required',\n 'image'=>'image|mimes:jpeg,png,jpg,gif,svg|max:1024',\n ]);\n return $validator;\n\n }", "protected function validator(array $request)\n {\n return Validator::make($request, [\n 'branchnumber' => ['required', 'string', 'max:255'],\n 'branchname' => ['required', 'string', 'max:255'],\n 'logo' => ['string', 'max:255'],\n ]);\n }", "public function myformPost(Request $request)\n\n {\n\n\n $validator = Validator::make($request->all(), [\n\n 'first_name' => 'required',\n\n 'last_name' => 'required',\n\n 'email' => 'required|email',\n\n 'address' => 'required',\n\n ]);\n\n\n if ($validator->passes()) {\n\n\n return response()->json(['success'=>'Added new records.']);\n\n }\n\n\n return response()->json(['error'=>$validator->errors()->all()]);\n\n }", "public function validation(Request $request) {\n\n return Validator::make($request->all(), [\n\n \"matriculatedId\" => [\"required\", \"numeric\"], \n \"gradeFirstTrimester\" => [\"required\", \"numeric\"],\n \"gradeFirstRecuperation\" => [\"required\", \"numeric\"],\n \"firstPredictedLesson\" => [\"required\", \"numeric\", \"integer\"],\n \"firstPerformedLesson\" => [\"required\", \"numeric\", \"integer\"],\n \"gradeSecondTrimester\" => [\"required\", \"numeric\"],\n \"gradeSecondRecuperation\" => [\"required\", \"numeric\"],\n \"secondPredictedLesson\" => [\"required\", \"numeric\", \"integer\"],\n \"secondPerformedLesson\" => [\"required\", \"numeric\", \"integer\"],\n \"gradeThirdTrimester\" => [\"required\", \"numeric\"],\n \"gradeThirdRecuperation\" => [\"required\", \"numeric\"],\n \"thirdPredictedLesson\" => [\"required\", \"numeric\", \"integer\"],\n \"thirdPerformedLesson\" => [\"required\", \"numeric\", \"integer\"],\n \"situationBeforeFinalRecup\" => [\"required\", \"string\"],\n \"gradeFinalRecuperation\" => [\"required\", \"numeric\"],\n \"situationAfterFinalRecup\" => [\"required\", \"string\"]\n\n ]);\n\n }", "function validateRequest(Request $request)\n {\n $rule = [\n 'description' => ['string', 'min:2', 'max:191'],\n 'longitude' => ['required', 'numeric'],\n 'latitude' => ['required', 'numeric']\n ];\n \n $validator = Validator::make($request->all(), $rule);\n if ($validator->fails()){\n return response()->json([\"message\" => $validator->messages()->toArray()], 422);\n }\n return true;\n }", "public static function storeValidation($request)\n {\n return [\n 'name' => 'max:191|required',\n 'email' => 'email|max:191|required|unique:users,email',\n 'password' => 'required',\n 'role' => 'array|required',\n 'role.*' => 'integer|exists:roles,id|max:4294967295|required',\n 'remember_token' => 'max:191|nullable',\n 'matchstatus' => 'max:191|nullable',\n 'customer_id' => 'max:191|nullable',\n 'status' => 'max:191|nullable',\n 'cancelmembership' => 'max:191|nullable',\n 'unsubscribeemail' => 'max:191|nullable',\n 'usersubscribe' => 'max:191|nullable',\n 'shareedit' => 'max:191|nullable',\n 'sharetime' => 'max:191|nullable',\n 'block' => 'max:191|nullable',\n 'sendemail' => 'max:191|nullable',\n 'lastvisitdate' => 'max:191|nullable',\n 'activation' => 'max:191|nullable',\n 'params' => 'max:191|nullable',\n 'lastresettime' => 'max:191|nullable',\n 'resetcount' => 'max:191|nullable',\n 'otpkey' => 'max:191|nullable',\n 'otep' => 'max:191|nullable',\n 'requirereset' => 'max:191|nullable',\n 'lookingfor' => 'in:Male,Female|max:191|nullable',\n 'ethnicity' => 'max:191|nullable',\n 'country_id' => 'integer|exists:countries,id|max:4294967295|nullable',\n 'state_id' => 'integer|exists:states,id|max:4294967295|nullable',\n 'city_id' => 'integer|exists:cities,id|max:4294967295|nullable',\n 'gender' => 'in:Male,Female,Other|max:191|nullable',\n 'personality' => 'max:191|nullable',\n 'aboutme' => 'max:65535|nullable',\n 'dob' => 'date_format:' . config('app.date_format') . '|max:191|nullable',\n 'devicetype' => 'max:191|nullable',\n 'devicetoken' => 'max:191|nullable',\n 'facebookid' => 'max:191|nullable',\n 'gmailid' => 'max:191|nullable',\n 'ntcount' => 'max:191|nullable',\n 'pictures' => 'nullable',\n 'online' => 'nullable',\n 'license' => 'nullable'\n ];\n }", "function store(ValidationRequest $request){\n $datosValidados = $request->validated();\n }", "public function rules(Request $request)\n {\n //dd($request->all());\n return [\n 'menu_id' => 'required',\n 'description_en' => 'required',\n 'information_en' => 'required',\n // 'nutrition_facts' => 'required',\n 'serving_size' => 'required',\n 'calories' => 'required',\n 'carbs' => 'required',\n 'protein' => 'required',\n 'fat' => 'required'\n \n ];\n }", "protected function validateData($request)\n {\n return Validator::make($request, [\n 'course_id' => 'required',\n 'tutor_id' => 'required'\n ]);\n }", "public function rules(Request $request)\n {\n // $id = $request->input('id', null);\n return [\n 'name' => \"required\",\n 'supplier_id' => 'required',\n 'import_price' =>'required',\n // 'quantity' => 'required',\n 'status' => 'required',\n 'category_id' => 'required',\n 'selling_price' => 'required',\n // 'unit_id' => 'required',\n 'avatar' => 'required'\n ];\n }", "protected function validateData($request)\n {\n return Validator::make($request, [\n 'ticket_id' => 'required',\n 'user_id' => 'required'\n ]);\n }", "public function validate_data($data)\n {\n\n $data = $request->all();\n \n\n }", "private function validation(Request $request)\n {\n $request->validate([\n 'title' => ['required', 'string'],\n 'description' => ['required', 'string'],\n ]);\n }", "public function validation($request)\n {\n try {\n\n return $this->validate($request,[\n 'fname' => 'required|max:225',\n 'lname' => 'required|max:225',\n //'email' => 'required|string|email|max:255',\n 'password' => 'required|confirmed|min:6',\n 'date' => 'required|date|date|before:today',\n 'phone' => 'required|numeric|min:10',\n 'gender' => 'required|max:225',\n 'location' => 'required|max:225',\n // 'jobType' => 'required|max:225',\n // 'exProfession' => 'required|max:225',\n // 'qualification' => 'required|max:225',\n // 'language' => 'required|max:225',\n // 'licence' => 'required|max:225',\n // 'image' => 'required|max:225',\n // 'loc1' => 'required|max:225',\n // 'loc2' => 'required|max:225',\n // 'loc3' => 'required|max:225',\n // 'loc4' => 'required|max:225',\n ]);\n \n } \n catch(Exception $ex) {\n return response($ex->getMessage(), 400);\n }\n \n }", "public function rules(Request $request)\n {\n return [\n \"first_name\" => \"required|string|min:2|max:191|regex:/^[a-zA-Z ]+$/u\",\n \"last_name\" => \"required|string|min:2|max:191|regex:/^[a-zA-Z ]+$/u\",\n \"address\" => \"required|min:2\",\n ];\n }", "public function validateCreateDeviceParameter(Request $request){\n $validator = \\Validator::make($request->isJson() ? $request->json()->all() : $request->all() , [\n 'onesignal_id' => 'required|max:255',\n ]);\n return $validator;\n }", "protected function userDetailsValidator($request) {\n \treturn Validator::make($request,[\n 'company_id' => 'required',\n 'department_id' => 'required',\n 'group_id' => 'required',\n 'role_id' => 'required'\n ]);\n \t}", "public function rules(Request $request)\n {\n return [\n 'name' => [\n 'required',\n 'max:50'\n ],\n 'provider_name' => [\n 'required',\n 'max:50'\n ],\n 'category' => [\n 'max:50'\n ],\n 'mobile_no' => [\n 'required',\n 'regex:/^([0-9\\s\\-\\+\\(\\)]*)$/',\n 'min:10'\n ],\n 'email' => [\n 'sometimes',\n 'nullable',\n 'email'\n ],\n 'name' => [\n 'required',\n 'max:50'\n ],\n ];\n }", "protected function validator(array $data)\n {\n return Validator::make($data, [\n 'name' => 'required|string|max:255',\n 'surname' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|min:6|confirmed',\n 'country_id' => 'int']);\n }", "function validateRequest($request) {\n $rules = \n [\n 'name' => 'required',\n 'address' => 'required',\n 'phone' => 'required|numeric',\n 'profession' => 'required|in:engineering,maths,physics'\n ]; \n // if validation fails, it will produce an error response }\n $this->validate($request, $rules);\n }", "public static function storeValidation($request)\n {\n return [\n 'amount' => 'max:191|required',\n 'category_id' => 'required'\n ];\n }", "protected function validator(array $data)\n {\n //return true;\n return Validator::make($data, [\n //'name' => 'required',\n 'name' => ['required','string','max:255'],\n 'email' => ['required','string','email','max:255','unique:users'],\n //'password' => 'required|string|min:6|confirmed',\n //'mobile' => 'required|numeric|min:10',\n //'country_id'=>'required',\n //'city_id'=>'required',\n //'address'=>'required',\n\n ]);\n }", "public function createUserValidator() {\n return Validator::make($this->request->all(), [\n 'first_name' => 'required||string',\n 'last_name' => 'required||string',\n 'email' => 'required|email|string',\n 'password' => 'required',\n 'username' => 'required||string',\n ]);\n }", "public function rules(\\Illuminate\\Http\\Request $request)\n {\n $id=$request->id;\n// dd($id);\n return [\n 'name'=>'required',\n 'company'=>'required',\n 'years'=>'required',\n 'months'=>'required',\n 'days'=>'required',\n 'address'=>'required',\n 'phone_number'=>'required|unique:members,phone_number,'.$id,\n 'email'=>'required|unique:members,email,'.$id,\n// 'state'=>'required',\n 'exchange_type'=>'required',\n 'member_type'=>'required',\n 'points'=>'required',\n\n ];\n }", "protected function validator(array $data)\n {\n $validator = Validator::make($data, [\n 'name' => 'required|string|max:255',\n 'lastname' => 'required|string|max:255',\n 'building_name' => 'required|string|max:255',\n 'nb_loc' => 'required|max:10',\n 'nb_app' => 'required|max:70',\n 'cin'=>'required|min:8|max:8',\n 'state' => 'required|not_in:0',\n 'city' => 'required|not_in:0',\n 'street' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|min:6|confirmed',\n ],[\n 'name.required'=>'champs nom obligatoire',\n 'lastname.required'=>'champs prenom obligatoire',\n 'building_name.required'=>'champs nom de batiment obligatoire',\n 'nb_loc.required'=>'champs Nombre des locaux commercials à l\\'extérieur obligatoire',\n 'nb_loc.max'=>'champs au max 10',\n 'nb_app.required'=>'champs nombre des appartements obligatoire',\n 'nb_app.max'=>'champs au max 70 appartements',\n 'state.required'=>'champs gouvernat obligatoire',\n 'city.required'=>'champs ville obligatoire',\n 'email.required'=>'champs email obligatoire',\n 'email.email'=>'champs doit être un email',\n 'cin.required'=>'champs cin obligatoire',\n 'cin.min'=>'champs cin au min 8 caracteres',\n 'cin.max'=>'champs cin au max 8 caracteres' ,\n\n 'password.required'=>'champs password obligatoire',\n 'password.min'=>'le champ password doit avoir au minimum 6 caractère',\n 'password.confirmed'=>'La confirmation du mot de passe ne correspond pas.',\n\n\n ]);\n if($validator->fails()) {\n\n return $validator;\n }\n else {\n return $validator;\n }\n\n }", "protected function validator(Request $request, array $data)\n {\n $phone = $request->input('phone');\n $email = $request->input('email');\n return Validator::make($data, [\n 'name' => 'required|max:255',\n 'phone' => 'required|numeric|unique:users',\n 'code' => 'code:' . $phone,\n 'ecode' => 'code:' . $email,\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|confirmed|min:6',\n ]);\n }", "public function validateForm($request){\n $this->validate($request, [\n 'name' => 'bail|required|max:255',\n 'dob' => 'required',\n 'gender' => 'required',\n 'mobile_number' => 'required|min:10|max:10',\n 'address' => 'required|min:3',\n 'photo' => 'image|max:1999',\n 'current_salary' => 'required',\n 'join_date' => 'required',\n 'remark' =>'required',\n 'dept_id' => 'required'\n ]);\n }", "protected function validator(array $data)\n {\n dd($data);\n return Validator::make($data, [\n 'membType'=>'required',\n 'businessNature'=>'required',\n 'specNature'=>'required',\n 'repBy'=>'required',\n 'memberName' => ['required', 'string', 'max:255'],\n 'image' => 'required',\n 'ComName'=> 'required',\n 'Desg'=> 'required',\n 'StrNo1'=> 'required',\n 'Zipcode1'=> 'required',\n 'city1'=> 'required',\n 'country1'=> 'required',\n 'StrNo2' => 'required',\n 'Zipcode2' => 'required',\n 'city2' => 'required',\n 'country2' => 'required',\n 'PhnOffice' => 'required',\n 'PhnRes' => 'required',\n 'fax' => 'required',\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n 'skype' => 'required',\n 'web' => 'required',\n 'mobile' => 'required',\n 'password' => ['required', 'string', 'min:8', 'confirmed'],\n 'confpass' => 'required',\n 'proposerName' => 'required',\n 'proposerNo' => 'required',\n 'seconderName' => 'required',\n 'seconderNo' => 'required',\n 'qualification' => 'required',\n 'JoinDate' => 'required',\n 'association' => 'required', \n\n ]);\n }", "public function rules(Request $request)\n { \n \n return [\n 'checkin' => 'required',\n 'checkout' => 'required',\n 'room_type' => 'required',\n 'adult' => 'required',\n 'kid' => 'required',\n ];\n \n }", "protected function validator(array $data)\n {\n $validator = Validator::make($data, [\n 'name' => ['required', 'string', 'max:255'],\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n 'password' => ['required', 'string', 'min:8'],\n 'phone'=>'required|min:9|max:10',\n 'latitude'=>'required',\n 'longitude'=>'required',\n 'type'=>'required',\n ]);\n return $validator;\n \n }", "public function validator(Request $data)\n {\n $this->validate($data, [\n 'email' => ['required', 'string', 'email', 'exists:users'],\n 'password' => ['required', 'string'],\n 'account' => ['required', 'string', 'exists:users']\n ]);\n }", "private function validar(Request $request)\r\n {\r\n $rules = array(\r\n 'nombre' => 'required',\r\n 'sede_id' => 'required',\r\n 'fecha' => 'required|date|after_or_equal:today',\r\n );\r\n return Validator::make($request->all(), $rules);\r\n }", "protected function validator(array $data)\n {\n return Validator::make($data, [\n 'title' => 'required',\n 'content' => 'required',\n ]);\n }", "protected function validateData($request)\n {\n return Validator::make($request, [\n 'description' => 'required|max:25'\n ]);\n }", "private function storeRequestValidationRules(Request $request) {\n return [\n ];\n }", "protected function createUserValidator($request) {\n \treturn Validator::make($request,[\n 'first_name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'last_name' => 'required',\n 'password' => 'required|min:6',\n 'status' => 'required'\n ]);\n \t}", "public function rules(Request $request)\n {\n $sotiennap = str_replace(\",\",\"\", $request->sotiennap);\n $validSotiennap = \"\";\n if($sotiennap < 10000) {\n $validSotiennap = \"|min:10000\";\n }\n return [\n 'sotiennap' => \"required\".$validSotiennap,\n 'tenkhachhang' => \"required\",\n 'email' => 'required|email',\n /* 'phone' => \"required|digits_between:10,12\",\n 'quocgia' => \"required\",\n 'tinh' => \"required\",\n 'diachi' => \"required\",*/\n 'noidung' => \"required\",\n 'captcha' => 'required|captcha'\n ];\n }", "public function rules()\n {\n //dd($this->request);\n return $rules = [\n 'country_id' => 'required|numeric',\n 'first_name' => 'required|max:50|regex:/^[a-z A-Z]/u|',\n 'middle_name' => 'max:50',\n 'last_name' => 'required|max:50|regex:/^[a-z A-Z]/u|',\n 'dob' => 'required',\n 'email' => 'required|email|max:50|unique:users',\n 'country_code' => 'required',\n 'phone' => 'required|max:20|min:8',\n ];\n }", "protected function validator(array $data)\n {\n return Validator::make($data, [\n 'name' => 'required|string|min:11|max:75|regex:/^[\\p{L} ]+$/u',\n 'email' => 'required|email|unique:users|min:12|max:50',\n 'password' => ['required', 'string', 'min:8', 'max:22', 'confirmed'],\n ], [\n 'name.required' => 'الاسم مطلوب',\n 'name.string' => 'حقل الاسم يجب ان يكون نص فقط',\n 'name.min' => 'الاسم يجب ان لايقل عن 11 حرف',\n 'name.max' => 'الاسم يجب ان لا يزيد عن 75 حرف',\n 'name.regex' => 'الاسم يجب ان يتكون من الاحرف والمسافات فقط',\n\n 'email.required' => 'البريد الالكتروني مطلوب',\n 'email.email' => 'تأكد من ادخال البريد الالكتروني بشكل طحيح',\n 'email.min' => 'يجب ان لا يقل البريد الالكتروني عن 12 حرف',\n 'email.max' => 'يجب ان لا يزيد البريد الالكتروني عن 50 حرف',\n 'email.unique' => 'البريد الالكتروني مستخدم بالفعل',\n\n 'password.required' => 'يجب ادخال الرقم السري',\n 'password.min' => 'يجب ان يتكون الرقم السري على الاقل من 8 رموز',\n 'password.max' => 'يحب الايزيد الرقم السري على 22 رمز',\n 'password.confirmed' => 'كلمة السر غير متطابقة',\n\n ]);\n }", "public function store(Request $request)\n {\n {\n $request->validate([\n 'nim' => 'required',\n 'nama' => 'required',\n 'jurusan' => 'required',\n 'kode' => 'required',\n 'matakuliah' => 'required',\n 'sks' => 'required',\n 'grade' => 'required',\n \n ]);\n }\n }", "public function create_new_validator(array $data)\n {\n return Validator::make($data, [\n 'name' => 'required|alpha_num|min:5|max:255|unique:users',\n 'empresa' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|same:password',\n 'user_level' => 'required',\n 'bio' => '',\n 'phone' => '',\n 'skype_user' => '',\n 'user_profile_pic' => 'image'\n ], [\n 'name.required' => 'Ingrese un nombre de usuario',\n 'name.max' => 'La longitud del nombre de usuario no puede ser mayor a 255 carácteres',\n 'name.unique' => 'El nombre de usuario ya existe',\n 'first_name.required' => 'Ingrese un nombre',\n 'last_name.required' => 'Ingrese un apellido',\n 'email.required' => 'Ingrese un correo electrónico',\n 'password.required' => 'Ingrese una contraseña',\n 'password.min' => 'Su contraseña debe tener al menos 6 carácteres',\n 'password_confirmation.required' => 'Confirme su contraseña',\n 'password.same' => 'Sus contraseñas deben coincidir',\n 'password_confirmation.same' => 'Sus contraseñas deben coincidir',\n 'user_profile_pic.image' => 'El archivo debe ser una imagen',\n 'user_level.required' => 'Debe seleccionar un nivel de acceso',\n 'empresa.required' => 'Ingrese el nombre de su empresa'\n ]);\n }", "protected function validator(array $data)\n {\n\n return Validator::make($data, [\n //'Nombres' => 'required|max:255',\n // ,\n 'email' => 'required|email|max:255|unique:users'\n // 'password' => 'required|confirmed|min:6'\n ]);\n }", "public function validator()\n {\n }", "public function validatePostRequest($request) {\n /* validatasi data post */\n $check = ['nama_pelajaran' => 'required', 'deskripsi' => 'required'];\n return $request->validate($check);\n }", "protected function validator(Request $request)\n {\n $validator = Validator::make($request->all(), [\n \n\t\t\t'question' => ['required'],\n\t\t\t'answer' => ['required'],\n\n ]);\n\n if($validator->fails()) return false;\n return true;\n }", "public function validation()\n {\n\n }", "private function valideRequest(Request $request)\n {\n $participationRequest = new ParticipationRequest();\n return $validator = Validator::make($request->toArray(), $participationRequest->rules());\n }", "public function store(Request $request)\n {\n $formInput = $this->validate($request,[\n\n 'nombre' => 'required|max:255',\n 'apellido' => 'required|max:255',\n 'dni' => 'required|max:255',\n 'telefono' => 'required|max:255',\n 'email' => 'required|max:255',\n 'direccion' => 'required|max:255',\n\n 'peso' => 'required|max:255',\n 'tamaño' => 'required|max:255',\n 'destino' => 'required|max:255',\n 'pago' => 'required|max:255',\n 'descripcion' => 'required|max:255',\n\n 'nombre2' => 'required|max:255',\n 'apellido2' => 'required|max:255',\n 'dni2' => 'required|max:255',\n 'telefono2' => 'required|max:255',\n 'email2' => 'required|max:255',\n 'direccion2' => 'required|max:255',\n ],[\n 'nombre.required' => 'El campo nombre remitente es obligatorio',\n 'apellido.required' => 'El campo apellido remitente es obligatorio',\n 'dni.required' => 'El campo DNI remitente es obligatorio',\n 'telefono.required' => 'El campo telefono remitente es obligatorio',\n 'email.required' => 'El campo email remitente es obligatorio',\n 'direccion.required' => 'El campo direccion remitente es obligatorio',\n\n 'peso.required' => 'El campo peso es obligatorio',\n 'tamaño.required' => 'El campo tamaño es obligatorio',\n 'destino.required' => 'El campo destino es obligatorio',\n 'pago.required' => 'El campo pago es obligatorio',\n 'descripcion.required' => 'El campo descripcion es obligatorio',\n\n 'nombre2.required' => 'El campo nombre destinatario es obligatorio',\n 'apellido2.required' => 'El campo apellido destinatario es obligatorio',\n 'dni2.required' => 'El campo DNI destinatario es obligatorio',\n 'telefono2.required' => 'El campo telefono destinatario es obligatorio',\n 'email2.required' => 'El campo email remitente es obligatorio',\n 'direccion2.required' => 'El campo direccion destinatario es obligatorio',\n\n ]);\n\n $errores = null;\n DB::beginTransaction();\n try {\n\n $clienter_aux = ClienteRemitente::where('dni_clienter','=',$request->dni) ->select('id') ->first();\n if (empty($clienter_aux))\n {\n $origen = New ClienteRemitente;\n $origen -> nombre_clienter = $request -> nombre;\n $origen -> apellido_clienter = $request -> apellido;\n $origen -> dni_clienter = $request -> dni;\n $origen -> telefono_clienter = $request -> telefono;\n $origen -> email_clienter = $request -> email;\n $origen -> direccion_clienter = $request -> direccion;\n $origen -> save();\n $rem = $origen -> id;\n }\n else {\n $rem=$clienter_aux -> id;\n }\n\n $cliente_aux = ClienteDestinatario::where('dni_cliente','=',$request->dni2) ->select('id') ->first();\n if (empty($cliente_aux))\n {\n $destino = New ClienteDestinatario;\n $destino -> nombre_cliente = $request -> nombre2;\n $destino -> apellido_cliente = $request -> apellido2;\n $destino -> dni_cliente = $request -> dni2;\n $destino -> telefono_cliente = $request -> telefono2;\n $destino -> email_cliente = $request -> email2;\n $destino -> direccion_cliente = $request -> direccion2;\n $destino -> save();\n $dest = $destino -> id;\n }\n else {\n $dest=$cliente_aux -> id;\n }\n\n\n $encomienda = New Encomienda;\n $encomienda -> peso_encomienda = $request -> peso;\n $encomienda -> tamaño_encomienda = $request -> tamaño;\n $encomienda -> destino_encomienda = $request -> destino;\n $encomienda -> pago_encomienda = $request -> pago;\n $encomienda -> descripcion_encomienda = $request -> descripcion;\n $encomienda -> id_personal = Auth::user()->id;\n $encomienda -> id_clienteremitente = $rem;\n $encomienda -> id_clientedestinatario = $dest;\n $encomienda -> save();\n\n\t DB::commit();\n\t $success = true;\n } catch (\\Exception $e) {\n\t $success = false;\n $errores = $e->getMessage();\n\t DB::rollback();\n return view('inicio', compact('errores'));\n }\n if ($success) {\n $destin = ClienteDestinatario::where('id','=',$encomienda-> id_clientedestinatario ) ->select('email_cliente','nombre_cliente','apellido_cliente') ->first();\n $remit = ClienteRemitente::where('id','=',$encomienda-> id_clienteremitente ) ->select('nombre_clienter','apellido_clienter') ->first();\n $objDemo = new \\stdClass();\n $objDemo->datos = $encomienda -> id;\n $objDemo->datos2 = $remit-> nombre_clienter;\n $objDemo->datos3 = $remit-> apellido_clienter;\n $objDemo->sender = 'Integral Pack Express';\n $objDemo->receiver = $destin -> nombre_cliente;\n $objDemo->receiver2 = $destin -> apellido_cliente;\n Mail::to($destin->email_cliente)->send(new CodigoEncReceived($objDemo));\n return redirect('inicio');\n }\n\n }", "public function store(Request $request)\n \t{\n dd($request->all());\n \t\t// 1. Validamos\n \t\t$request->validate([\n \t\t\t// input_name => rules,\n \t\t\t'name' => 'required | max:30',\n 'price' => 'required | integer | max:5',\n 'description' => 'required | max:30',\n 'poster' => 'required | image',\n 'colors' => 'required',\n \t\t\t'sizes' => 'required ',\n\n \t\t], [\n \t\t\t// input_name.rule => message\n \t\t\t'name.required' => 'El campo nombre es obligatorio',\n 'name.max' => 'El campo nombre debe contener máximo 30 carácteres',\n 'price.required' => 'El campo precio es obligatorio',\n 'price.integer' => 'El campo precio debe ser un número',\n 'price.max' => 'El campo precio debe contener máximo 5 carácteres',\n 'description.required' => 'La descripción es obligatoria',\n 'description.max' => 'La descripción debe contener máximo 30 carácteres',\n 'poster.required' => 'La imagen es obligatoria',\n 'poster.image' => 'La imagen no es un formato válido',\n 'colors.required' => 'Debes seleccionar al menos un color',\n 'sizes.required' => 'Debes seleccionar al menos un talle',\n\n \t\t]);\n }", "protected function post_validator(Request $request)\n {\n return Validator::make($request->all(), [\n 'userid' => 'required|max:11',\n 'postid' => 'required|max:11'\n ]);\n }", "public function rules(Request $request)\n {\n return [\n\n 'choose_id' => 'required',\n 'name' => 'required|unique:product,name,'.$request->id.',id',\n 'code' => 'required|unique:product,code,'.$request->id.',id',\n 'name_vn' => 'required',\n 'detail' => 'required',\n 'detail_vn' => 'required',\n 'description' => 'required',\n 'description_vn' => 'required',\n 'collection_id' => 'required',\n 'district_id' => 'required',\n 'address' => 'required',\n 'price' => 'required',\n 'active' => 'required',\n ];\n }", "public function rules(Request $request)\n {\n return [\n 'name' => 'required|max:100',\n 'email' => 'required|email|max:255|unique:users,email,' . $request->get('id'),\n 'password' => 'confirmed',\n ];\n }", "private function validateRequest()\n {\n $rules = [\n 'email' => 'required|email',\n 'password' => 'required|between:3,20'\n ];\n $this->request->validate($rules);\n }", "public function store(Request $request)\n {\n Validator::make($request->all(), [\n 'field' => 'required',\n 'label' => 'required',\n 'value' => 'required',\n 'page_category_id' => 'required',\n ])->validate();\n }", "protected function validator(array $data)\n {\n return Validator::make($data, [\n 'idstd' => 'required|string|max:10',\n 'name' => 'required|string|max:255',\n 'years' => 'required|string|max:4',\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|min:6|confirmed',\n ]);\n }", "protected function validator(array $data)\n {\n return Validator::make($data, [\n 'first_name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required',\n //'dob' => 'required',\n 'address' => 'required',\n 'phone_number' => 'required',\n //'doctor_practice' => 'required',\n\n ]);\n }", "public function validator(Request $request , $id =null)\n {\n $data = $request->all();\n $validateUpdate = '';\n if ($request->method() == 'PATCH' || $request->method() == 'PUT') {\n $validateUpdate = ',username,'.$id;\n }\n\n return Validator::make($data, [\n 'fullname' => 'required|string|max:191',\n 'username' => 'required|string|max:191|unique:kids'.$validateUpdate,\n 'age' => 'integer|required',\n 'pin' => 'required|string|min:4',\n 'user_id' => 'required|integer|exists:users,id',\n ]);\n }", "public function rules(Request $request):array\n {\n return [\n\n 'financial_code' => 'required|unique:users,financial_code,'.$request->id.',id',\n 'first_name_ar' => 'required',\n 'first_name_en' => 'required',\n 'last_name_en' => 'required',\n 'last_name_ar' => 'required',\n 'position_id' => 'required',\n 'department_id' => 'required',\n 'parent_id' => 'required',\n 'contract_type_id' => 'required',\n 'user_group_id' => 'required',\n 'number_of_hours' => 'required',\n 'basic_salary' => 'required',\n 'gross_salary' => 'required',\n 'taxes' => 'required',\n 'insurance' => 'required',\n ];\n }", "public function validateRequestApi($request)\n {\n $request->setContainer(app());\n if(method_exists($request, \"getValidator\"))\n $validator = $request->getValidator();\n else\n $validator = Validator::make($request->all(), $request->rules(),$request->messages());\n \n //if get errors, throw errors\n if ($validator->fails()) {\n $errors = json_decode($validator->errors());\n throw new Exception(json_encode($errors), 400);\n } else {//if vlaidation is sucessful, return true\n return true;\n }\n }", "public function store(Request $request)\n {\n $validatedData = $request->validate([\n 'nombre_cat_cri_eva' => 'required|max:45',\n 'ponderacion_cat_cri_eva' => 'required|max:6'\n ],\n [\n 'nombre_cat_cri_eva.required' => 'El nombre del criterio es necesario',\n 'nombre_cat_cri_eva.max' => 'El nombre del criterio debe contener como maximo 45 caracteres',\n 'ponderacion_cat_cri_eva.required'=> 'La ponderación del criterio es necesario',\n 'ponderacion_cat_cri_eva.max'=> 'La ponderación del criterio debe contener como maximo 6 caracteres',\n ]\n );\n\n// return var_dump($request);\n cat_cri_eva_criterio_evaluacionModel::create\n ([\n 'nombre_cat_cri_eva' \t => $request['nombre_cat_cri_eva'],\n 'ponderacion_cat_cri_eva' \t => $request['ponderacion_cat_cri_eva'],\n 'id_pdg_asp' => $request['id_pdg_asp']\n ]);\n\n Return redirect('catCriterios')->with('message','Criterio Registrado correctamente!') ;\n\n }", "protected function validator(array $data){\n return Validator::make($data, [\n 'exam_name'=> 'required|string|max:255',\n 'desc'=> 'required|string|max:255',\n 'grade'=> 'required|int',\n 'open'=> 'required|int',\n 'subject_id'=> 'required|int'\n ]);\n }", "protected function validator(array $data)\n {\n return Validator::make($data, [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n //'password' => 'required|confirmed|min:6',\n ]);\n }", "protected function validator(array $data)\n {\n return Validator::make($data, [\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|min:6|confirmed',\n //'referrer_id' => 'required',\n //'position' => 'required',\n 'first_name' => ['required', 'regex:/^[A-ZÀÂÇÉÈÊËÎÏÔÛÙÜŸÑÆŒa-zàâçéèêëîïôûùüÿñæœ0-9_.,() ]+$/'],\n 'last_name' => ['required', 'regex:/^[A-ZÀÂÇÉÈÊËÎÏÔÛÙÜŸÑÆŒa-zàâçéèêëîïôûùüÿñæœ0-9_.,() ]+$/'],\n 'birth_day' => 'required',\n 'mobile' => 'required',\n 'street_address' => 'required',\n 'city' => ['required', 'regex:/^[A-ZÀÂÇÉÈÊËÎÏÔÛÙÜŸÑÆŒa-zàâçéèêëîïôûùüÿñæœ0-9_.,() ]+$/'],\n //'post_code' => 'required|numeric|min:0',\n 'country' => 'required',\n 'username' => 'required|unique:users',\n ]);\n }", "public function ValidateRequest(Request $request)\n {\n $this->validate($request, [\n 'title' => 'required'\n ]);\n }", "function validateRequest($request){\n\n $rules = [\n 'lang' => 'required'\n ];\n\n $validation = Validator::make($request->all(), $rules, $messages = [\n 'required' => 'The :attribute field is required.',]);\n \n if($validation->fails()){\n \n throw new \\ErrorException('Langauge required!');\n }\n\n if(!empty($request->input('diff_time')) && intval($request->input('diff_time')) < 0){\n throw new \\ErrorException('Diff Time less than zero !');\n }\n\n if(!empty($request->input('per_page')) && intval($request->input('per_page')) < 0){\n throw new \\ErrorException('Per page less than zero !');\n }\n\n if(!empty($request->input('page')) && intval($request->input('page')) < 0){\n throw new \\ErrorException('Page less than zero !');\n }\n }", "public function rules(Request $request)\n {\n\n\n $validation_array= [\n \"category\"=>\"required|exists:categories,id\",\n \"product\"=>\"required|exists:products,id\",\n \"user\"=>\"required|exists:users,id\",\n \"selling_price\"=>\"required|numeric\",\n \"stock\"=>\"required|numeric\",\n \"size\"=>\"required|exists:sizes,id\",\n \"code\"=>\"required|unique:stocks,code\"\n\n ];\n\n\n return $validation_array;\n }", "protected function validator(array $data)\n {\n return Validator::make($data, [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6',\n 'g-recaptcha-response' => 'required|recaptcha',\t\t\n ]);\n }", "public function store(Request $request)\n {\n # code...\n dd($request); \n $this->validate($request,[//start validating everything that the request is receiving\n //left key, must be named as the \"name\" atribute of the inputs included in the request\n 'name'=>'required|min:3|max:20',\n 'email'=>'required|min:11|email',\n 'password'=>'required|min:8|regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{6,}$/',\n 'level'=>'required|min:5',\n 'img'=>'required'//TODO: resolver imágenes que no puedo validar ni por mimes\n ]);\n /*if($validator->fails()){// is useful when using ($validador= Validator::make($request->all(),[]) up there insted of $this->validate...\n dd('campos llenados incorrectamente');//lline that prints in a new page\n }else{\n dd('done, mi chavo (hecho, si eres peña)');//lline that prints in a new page\n }*/\n \n }", "public function validator(array $data)\n\t{\n\t\treturn Validator::make($data, [\n\t\t\t'email' => 'required|email|max:255|unique:usuarios',\n\t\t\t'password' => 'required|confirmed|min:6',\n 'pregunta'=>'required|max:255',\n 'respuesta'=>'required|max:255',\n 'sede'=>'required',\n 'tipo'=>'required'\n\t\t]);\n\t}", "protected function validator(array $data)\n {\n return Validator::make($data, [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|unique:users,email',\n 'password'=>'required|min:8',\n 'g-recaptcha-response' => 'required',\n ],[\n 'first_name.required' => 'وارد کردن نام اجباری است',\n 'last_name.required' => 'وارد کردن نام خانوادگی اجباری است',\n 'email.required' => 'وارد کردن ایمیل اجباری است',\n 'password.required' => 'وارد کردن پسورد اجباری است',\n 'g-recaptcha-response.required' => 'زدن تیک من ربات نیستم اجباری است',\n 'password.min' => 'حداقل طول پسورد باید 8 کاراکتر باشد',\n 'first_name.max' => 'نام طولانی تر از حد مجاز است',\n 'last_name.max' => 'نام خانوادگی طولانی تر از حد مجاز است',\n 'email.email' => 'ایمیل وارد شده معتبر نیست',\n 'email.unique' => 'ایمیل وارد شده قبلا در سیستم ثبت شده است',\n ]);\n }", "protected function updateUserValidator($request) {\n \treturn Validator::make($request,[\n 'first_name' => 'required|max:255',\n 'last_name' => 'required',\n 'status' => 'required'\n ]);\n \t}", "public function rules()\n {\n \n\n //validações para campos obrigatórios \n return [\n 'name' => 'required',\n 'email' => 'required|email|',\n 'password' => 'required|min:8',\n \n ];\n\n }", "public function store(Request $request)\n {\n $validatorData = $request->validate([\n 'nom'=> 'required|max:60',\n 'prenom'=> 'required|max:60',\n 'sexe'=>'max:1|in:m,f',\n 'email'=>'email|required|unique:candidat|max:120',\n 'localite_id' => 'nullable|numeric',\n 'code_postal' => 'max:10',\n 'localite' => 'max:120',\n 'date_naissance'=>'nullable|date',\n 'telephone'=>'max:20',\n 'mobile'=>'max:20',\n 'linkedin'=>'nullable|url|unique:candidat|max:255',\n 'site'=>'nullable|url|unique:candidat|max:255',\n ],[\n 'nom.required'=>__('general.error_lastname'),\n 'nom.max'=>__('general.error_lastname_caractere'),\n\n 'prenom.required'=>__('general.error_firstname'),\n 'prenom.max'=>__('general.error_firsname_caractere'),\n\n 'sexe.max'=>__('general.error_sex_m_f'),\n 'sexe.in'=>__('general.error_sex_m_f'),\n\n 'email.required'=>__('general.error_email'),\n 'email.email'=>__('general.error_type_email'),\n 'email.unique'=>__('general.error_exist_email'),\n 'email.max'=>__('general.error_email_caractere'),\n\n 'localite_id.numeric' =>__('general.error_type_localite'),\n //'code_postal.required' => 'Veuillez entrer un code postal.',\n 'code_postal.max' =>__('general.error_zip_caractere'),\n //'localite.required' => 'Veuillez entrer une localité.',\n 'localite.max' =>__('general.error_localite_caractere'),\n\n 'date_naissance.date'=>__('general.error_type_birth_date'),\n\n 'telephone.max'=>__('general.error_phone_caractere'),\n 'mobile.max'=>__('general.error_phone_caractere'),\n\n 'linkedin.url'=>__('general.error_valide_linkedin'),\n 'linkedin.unique'=>__('general.error_db_linkedin'),\n 'linkedin.max'=>__('general.error_linkedin_caractere'),\n\n 'site.url'=>__('general.error_valide_website'),\n 'site.unique'=>__('general.error_db_website'),\n 'site.max'=>__('general.error_website_caractere'),\n ]);\n\n\n $candidat = new candidat(Input::all());\n $data = Input::all();\n\n //Ajout éventuel d'une nouvelle localité\n if($data['localite_id']==null) { \n if($data['code_postal']!='' && $data['localite']!='') {\n //Rechercher si la localité existe déja dans la DB\n $localite = Localite::where('code_postal',$data['code_postal'])->get()->first();\n\n if($localite) {\n $candidat->localite_id = $localite->id;\n } else {\n $localite = new Localite();\n $localite->code_postal = $data['code_postal'];\n $localite->localite = $data['localite'];\n \n if($localite->save()) {\n $candidat->localite_id = $localite->id;\n \n Session::put('success',__('general.succes_locality'));\n } else {\n Session::push('errors',__('general.error_locality'));\n \n return redirect()->route('candidats.create');\n }\n }\n }\n }\n\n if($candidat->save()){\n Session::put('success',__('general.success_candidate_save'));\n\n $langues = Input::all('langue');\n if(isset($langues['langue'])) {\n foreach($langues['langue'] as $langueId => $langueNiveau) {\n $candidatLangue = new CandidatLangue();\n $candidatLangue->candidat_id = $candidat->id;\n $candidatLangue->langue_id = substr($langueId,strrpos($langueId,'|')+1);\n $candidatLangue->niveau = $langueNiveau;\n\n if(!$candidatLangue->save()) {\n Session::push('errors',__('general.error_language_save'));\n }\n\n }\n }\n\n $diplomes = Input::all('diplome_ecole_ids');\n if(isset($diplomes['diplome_ecole_ids'])) {\n foreach($diplomes['diplome_ecole_ids'] as $diplomeEcoleId) {\n $candidatDiplomeEcole = new CandidatDiplomeEcole();\n $candidatDiplomeEcole->candidat_id = $candidat->id;\n $candidatDiplomeEcole->diplome_ecole_id = $diplomeEcoleId;\n\n if(!$candidatDiplomeEcole->save()) {\n Session::push('errors',__('general.error_diploma_save'));\n }\n\n }\n }\n\n //Gestion des emplois antérieurs\n $data = Input::all('socCan');\n if(isset($data['socCan']) && !empty($data['socCan']['societeIds'])) {\n $cptNotSaved = 0;\n \n try {\n for($i=0;$i<sizeof($data['socCan']['socCanIds']);$i++) {\n //Cas d'une nouvelle société\n $societeId = $data['socCan']['societeIds'][$i];\n\n if($societeId!='' && !is_numeric($societeId)) {\n $societe = Societe::where('nom_entreprise','=',$societeId)\n ->get()->first();\n\n $societeId = $societe->id;\n }\n\n //Cas d'une nouvelle société\n $fonctionId = $data['socCan']['fonctionIds'][$i];\n \n if($fonctionId!='' && !is_numeric($fonctionId)) {\n $fonction = Fonction::where('fonction','=',$fonctionId)\n ->get()->first();\n\n $fonctionId = $fonction->id;\n }\n\n $newCandidatSociete[] = CandidatSociete::updateOrCreate([\n 'id'=> $data['socCan']['socCanIds'][$i],\n ],[\n 'candidat_id'=> $candidat->id,\n 'societe_id'=> $societeId,\n 'fonction_id'=> $fonctionId ? $fonctionId: null ,\n 'date_debut'=> $data['socCan']['dateDebuts'][$i] ? $data['socCan']['dateDebuts'][$i]:null,\n 'date_fin'=> $data['socCan']['dateFins'][$i] ? $data['socCan']['dateFins'][$i]:null,\n 'societe_actuelle'=>$i==0 ? 1:0,\n ]);\n } \n } catch (\\Exception $e) {\n $cptNotSaved++;\n $message = $e->getMessage();\n }\n \n if($cptNotSaved) {\n Session::push('errors',\"Une erreur s\\'est produite lors de l\\'enregristrement des emplois antérieurs $cptNotSaved! $message\");\n \n }\n }\n\n //Déplacer le cv dans le dossier uploads\n $cvFiles = $request->file('cv_ids');\n \n if($cvFiles){\n for($i=0;$i<count($cvFiles);$i++){\n \n //Déplacer le fichier dans le dossier de téléchargement public\n $filename = Storage::putFile('public/uploads/cvs',$cvFiles[$i]);\n \n //Récuperer le nouveau nom de fichier\n $filename = strrchr($filename,\"/\");\n \n //Récuperer l'url du dossier de téléchargement\n $realPath = Storage::disk('public')->getDriver()->getAdapter()\n ->applyPathPrefix('uploads/cvs/'.$filename);\n\n //Lire le contenu du CV \n $cvContent = $this->readDocument($realPath, $cvFiles[$i]->getClientOriginalName());\n \n //Enregistrer le document dans la base de donnée\n $cv = new Document ();\n $cv-> type ='CV';\n $cv-> description = $request->input('descriptionsForCV') [$i];\n $cv->url_document = '/uploads/cvs'.$filename;\n $cv->filename = $cvFiles[$i]->getClientOriginalName();\n $cv->mission_id = null;\n $cv->candidat_id = $candidat->id;\n $cv->user_id = auth()->user()->id;\n $cv->content = $cvContent;\n \n if(!$cv->save()){\n Session::push('errors',__('general.error_cv_save'));\n }\n }\n } \n }\n else{\n Session::push('errors',__('general.error_general'));\n }\n\n return redirect()->route('candidatures.create.from.candidat',[$candidat->id]);\n \n }", "public function store(Request $request)\n {\n $valitated = request()->validate([\n 'reference' => 'required|unique:customes,reference',\n 'company_name' =>'required',\n 'address' =>'required',\n 'contact_person'=>'required',\n 'contact_number'=>'required',\n 'email'=>'required|email',\n 'password'=>'required'\n ]);\n }", "public function rules()\n {\n return [\n 'firstname' => 'required|string',\n 'lastname' => 'required|string',\n 'email' => 'required|string',\n 'password' => 'required|string',\n\n\n ];\n }", "public function validator(array $data)\n {\n return Validator::make($data, [\n 'name' => 'required|max:255',\n 'surname' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|confirmed|min:6',\n 'captcha' => 'required|captcha',\n ]);\n }", "protected function validator(array $data)\n { \n return Validator::make($data, [\n 'name' => ['required', 'string', 'max:255'],\n 'apellido' => ['required', 'string', 'max:255'],\n 'nombreComercio' => ['required', 'string', 'max:255','unique:comercios,nombre'],\n 'sexo' => ['required', 'not_in:0'],\n 'email' => ['required', 'string', 'email', 'max:255'],\n ]);\n }", "public function rules(Request $request)\n {\n if ($request->method == 'PUT') {\n return [\n 'name' => 'sometimes|max:40|',\n 'company_size' => 'sometimes|int|max:10000',\n 'slogan' => 'sometimes|max:50|',\n 'website' => 'sometimes|max:40|',\n 'logo' => 'sometimes|image|max:1000|',\n 'message_title' => 'sometimes|max:50|',\n 'message_content' => 'sometimes|max:100|',\n 'main_photo' => 'sometimes|image|max:2000|',\n 'about_us' => 'sometimes|max:1000|',\n 'why_us' => 'sometimes|max:1000|',\n 'recruiting_steps' => 'sometimes|max:1000|',\n 'address' => 'sometimes|max:200|',\n 'email' => 'sometimes|max:50||',\n 'phone_number' => 'sometimes|int|',\n 'location' => 'sometimes|max:40|',\n ];\n }\n return [\n 'name' => 'required|max:40|unique:companies',\n 'company_size' => 'required|int|max:10000',\n 'slogan' => 'required|max:50|',\n 'website' => 'required|max:40|',\n 'logo' => 'required|image|max:1000|',\n 'message_title' => 'required|max:50|',\n 'message_content' => 'required|max:1000|',\n 'main_photo' => 'required|image|max:2000|',\n 'about_us' => 'required|max:2000|',\n 'why_us' => 'nullable|max:2000|',\n 'recruiting_steps' => 'nullable|max:1000|',\n 'address' => 'required|max:200|',\n 'email' => 'required|max:50|unique:companies,email|',\n 'phone_number' => 'required|int|',\n 'location' => 'required|max:40|',\n ];\n }", "public function rules()\n {\n // dd(request()->user()->id);\n // dd(request::all());\n return [\n 'email' => 'required|email|unique:users', \n \n 'passwd' => 'required|regex:/^[\\w]{6,18}$/',\n 'repass' => 'required|same:passwd',\n ];\n }", "protected function validator(array $data)\n {\n return Validator::make($data, [\n 'name' => 'required|min:5',\n 'gerant' => 'required',\n 'telephone' => 'required',\n 'date' => 'required',\n 'localite' => 'required'\n\n ]);\n }", "public function updateUserValidator() {\n return Validator::make($this->request->all(), [\n 'first_name' => 'required||string',\n 'last_name' => 'required||string',\n 'email' => 'required|email|string',\n 'username' => 'required||string',\n ]);\n }", "protected function validator($request)\n {\n $data = $request->all();\n $vcode = $request->session()->get('p'.$data['phone']);\n return Validator::make($data, [\n 'name' => 'required|max:255|unique:users,name',\n 'phone' => 'required|phone|max:255|unique:users,phone',\n 'email' => 'required|email|max:255|unique:users,email',\n 'phonecode' => 'required|regex:/' . $vcode['verifycode'] . '/',\n 'password' => 'required|confirmed|min:6|max:20',\n ]);\n }", "public function store(Request $request)\n {\n $this -> validate($request,[\n 'name' => 'required|string|alpha|min:3|max:20',\n 'family' => 'required|string|alpha|min:3|max:20',\n 'username' => 'required|string|alpha_dash|min:3|max:20|unique:users',\n 'cellphone' => 'required|string|digits:11|unique:users',\n 'password' => 'required|string|min:8|confirmed',\n ],[\n 'required' => 'اخطار:این فیلد ضروری است',\n 'max' => 'اخطار:ماکسیمم تعداد کاراکتر مجاز ۲۰ می باشد.',\n 'name.min' => 'اخطار:مینیموم تعداد کاراکتر مجاز ۳ می‌باشد.',\n 'family.min' => 'اخطار:مینیموم تعداد کاراکتر مجاز ۳ می‌باشد.',\n 'username.min' => 'اخطار:مینیموم تعداد کاراکتر مجاز ۳ می‌باشد.',\n 'password.min' => 'اخطار:مینیموم تعداد کاراکتر مجاز ۸ می‌باشد.',\n 'cellphone.digits' => 'اخطار:شماره تلفن همراه شامل ۱۱ عدد می باشد!',\n 'unique' => 'اخطار:داده از قبل موجود می باشد.',\n 'confirmed' => 'اخطار:عدم مطابقت رمز عبور و تکرار آن',\n 'alpha_dash'=>'اخطار:نام کاربری باید فقط شامل حروف و اعداد و ـ باشد.',\n 'alpha'=>'اخطار:نام و نام خانوادگی باید فقط شامل حروف باشد،بدون فاصله!',\n 'confirmed'=>'اخطار:عدم مطابقت رمز عبور با تکرار آن',\n ]);\n $user=new User();\n $user -> name = $request -> name;\n $user -> family = $request -> family;\n $user -> username = $request -> username;\n $user -> cellphone = $request -> cellphone;\n $user -> password = Hash::make($request -> password);\n\n $user -> save();\n /*return view('user',compact('user'));*/\n return redirect()->route('users.index')->with('success','کاربر جدید با موفقیت ایجاد شد.');\n }", "protected function validateData($request)\n {\n return Validator::make($request, [\n 'course_registered_user_id' => 'required',\n 'type_ticket_id' => 'required|integer',\n 'status_ticket_id' => 'required|integer',\n 'source_ticket_id' => 'required|integer',\n 'priority_ticket_id' => 'required|integer',\n 'motive_ticket_id' => 'required|integer',\n 'user_create_id' => 'required|integer',\n 'user_assigned_id' => 'required|integer',\n 'closing_date' => 'bool',\n ]);\n }", "public function store(Request $request) {\n $params = $request->request->all();\n $email_address = $params['email'];\n $role_id = $params['role_id'];\n $guid = $params['guid'];\n $password = $params['password'];\n $timezone_name = $params['timezone_name'];\n\n $validator = Validator::make($request->all(), [\n 'email' => 'Required|min:3|max:255|email',\n 'role_id' => 'required|min:1|max:255',\n 'guid' => 'required|min:1|max:255',\n 'password' => 'required|min:3|max:255',\n 'timezone_name' => 'required|min:3|max:255',\n ], [\n 'email.required' => 'El email es requerido',\n 'email.min' => 'El email debe tener mínimo 3 caracteres y máximo 255',\n 'email.max' => 'El email debe tener mínimo 3 caracteres y máximo 255',\n 'role_id.required' => 'El role es requerido',\n 'role_id.min' => 'El role debe tener mínimo 1 caracteres y máximo 255',\n 'role_id.max' => 'El role debe tener mínimo 1 caracteres y máximo 255',\n 'guid.required' => 'La Compania es requerido',\n 'guid.min' => 'La Compania debe tener mínimo 1 caracteres y máximo 255',\n 'guid.max' => 'La Compania debe tener mínimo 1 caracteres y máximo 255',\n 'password.required' => 'La clave es requerida',\n 'password.min' => 'La clave debe tener mínimo 3 caracteres y máximo 255',\n 'password.max' => 'La clave debe tener mínimo 3 caracteres y máximo 255',\n 'timezone_name.required' => 'La Zona Horaria es requerido',\n 'timezone_name.min' => 'La Zona Horaria debe tener mínimo 3 caracteres y máximo 255',\n 'timezone_name.max' => 'La Zona Horaria debe tener mínimo 3 caracteres y máximo 255',\n ]);\n // customize messages\n /* if ($validator->messages()->has('name')) {\n $message = \"El nombre es requerido y debe tener una longitud de entre 3 y 255 caracteres\";\n $validator->messages()->get('name', $message);\n } */\n\n if ($validator->fails()) {\n return redirect('/user')\n ->withErrors($validator)\n ->withInput();\n }\n\n $arr_user = array();\n $user = new WebUsers();\n $arr_user = $user->createWebUser($email_address, $role_id, $password, $timezone_name, $guid);\n return response()->json($arr_user);\n }", "protected function validator(array $data)\n {\n if ($data['doctype']==\"RECEPTIONIST\") {\n return Validator::make($data, [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'phone' => 'required|min:10|max:10|unique:users,phone',\n 'pan' => 'min:10|max:10|unique:users,pan',\n 'doctype' => 'required'\n ],[\n 'pan.unique'=>'A User with this PAN Number already exists!',\n 'phone.unique'=>'User with this phone number already exists'\n ]);\n }else{\n return Validator::make($data, [\n 'name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|min:6|confirmed',\n 'phone' => 'required|min:10|max:10|unique:users,phone',\n 'pan' => 'required|min:10|max:10|unique:users,pan',\n 'doctype' => 'required',\n 'speciality' => 'required',\n 'medicalcouncil' => 'required',\n 'registrationyear' => 'required',\n 'registrationnumber'=>'required'\n ],[\n 'pan.required' => 'PAN Number is required',\n 'pan.unique'=>'A User with this PAN Number already exists!',\n 'phone.unique'=>'User with this phone number already exists',\n 'medicalcouncil.required'=>'The Medical Council name is required',\n 'registrationyear.required'=>'The Registration Year is required',\n 'registrationnumber.required'=>'Please provide Registration Number'\n ]);\n }\n\n\n\n}", "protected function validator(array $data)\n {\n // return Validator::make($data, [\n // 'fname' => ['required', 'string', 'max:255'],\n // 'lname' => ['required', 'string', 'max:255'],\n // 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n // 'password' => ['required', 'string', 'min:8', 'confirmed'],\n // 'phone' => ['required', 'string'],\n // 'pincode' => ['required', 'string'],\n // 'city' => ['required', 'string'],\n // 'state' => ['required', 'string'],\n // 'country' => ['required', 'string'],\n // ]);\n }", "protected function validator(array $data)\n {\n return Validator::make($data, [\n 'full_name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'tel'=>'required|max:10|unique:users',\n 'company_name'=>'required|string|max:100',\n // 'access_level'=>'required|string',\n // 'is_enabled'=>'required|integer',\n // 'token'=>'required|string'\n\n\n ]);\n }", "public function store(Request $request)\n {\n \n $validator = \\Validator::make($request->all(), [\n 'ahero_gross_value_of_crop_millions'=>'required|numeric',\n 'ahero_hectares_cropped'=>'required|numeric',\n 'ahero_number_of_plots_holders'=>'required|numeric',\n 'ahero_paddy_yields_tonnes'=>'required|numeric',\n 'ahero_payments_to_plot_holders_millions'=>'required|numeric',\n 'all_schemes_gross_value_of_crop_millions'=>'required|numeric',\n 'all_schemes_hectares_cropped'=>'required|numeric',\n 'all_schemes_number_of_plots_holders'=>'required|numeric',\n \n 'all_schemes_paddy_yields_tonnes'=>'required|numeric',\n 'all_schemes_payments_to_plot_holders_millions'=>'required|numeric',\n 'bunyala_gross_value_of_crop_millions'=>'required|numeric',\n 'bunyala_hectares_cropped'=>'required|numeric',\n 'bunyala_number_of_plots_holders'=>'required|numeric',\n 'bunyala_paddy_yields_tonnes'=>'required|numeric',\n 'bunyala_payments_to_plot_holders_millions'=>'required|numeric',\n 'mwea_gross_value_of_crop_millions'=>'required|numeric',\n 'mwea_hectares_cropped'=>'required|numeric',\n \n \n 'mwea_number_of_plots_holders'=>'required|numeric',\n 'mwea_paddy_yields_tonnes'=>'required|numeric',\n 'mwea_payments_to_plot_holders_million'=>'required|numeric',\n 'perkerra_gross_value_of_crop_millions'=>'required|numeric',\n 'perkerra_hectares_cropped'=>'required|numeric',\n 'perkerra_number_of_plots_holders'=>'required|numeric',\n 'perkerra_payments_to_plot_holders_millions'=>'required|numeric',\n 'perkerra_seed_maize_tonnes'=>'required|numeric',\n 'west_kano_gross_value_of_crop_millions'=>'required|numeric',\n 'west_kano_hectares_cropped'=>'required|numeric',\n 'west_kano_number_of_plots_holders'=>'required|numeric',\n 'west_kano_paddy_yields_tonnes'=>'required|numeric',\n 'west_kano_payments_to_plot_holders_millions'=>'required|numeric',\n 'year'=>'required|numeric' \n \n ]);\n \n if ($validator->fails())\n {\n return response()->json(['errors'=>$validator->errors()->all()]);\n }\n else{\n $irrigation = new agriculture_irrigation_schemes_model();\n $irrigation->ahero_gross_value_of_crop_millions =$request->ahero_gross_value_of_crop_millions;\n $irrigation->ahero_hectares_cropped=$request->ahero_hectares_cropped;\n $irrigation->ahero_number_of_plots_holders=$request->ahero_number_of_plots_holders;\n $irrigation->ahero_paddy_yields_tonnes =$request->ahero_paddy_yields_tonnes;\n $irrigation->ahero_payments_to_plot_holders_millions=$request->ahero_payments_to_plot_holders_millions;\n $irrigation->all_schemes_gross_value_of_crop_millions=$request->all_schemes_gross_value_of_crop_millions;\n $irrigation->all_schemes_hectares_cropped=$request->all_schemes_hectares_cropped;\n $irrigation->all_schemes_number_of_plots_holders =$request->all_schemes_number_of_plots_holders;\n \n $irrigation->all_schemes_paddy_yields_tonnes=$request->all_schemes_paddy_yields_tonnes;\n $irrigation->all_schemes_payments_to_plot_holders_millions=$request->all_schemes_payments_to_plot_holders_millions;\n $irrigation->bunyala_gross_value_of_crop_millions=$request->bunyala_gross_value_of_crop_millions;\n \n \n $irrigation->bunyala_number_of_plots_holders=$request->bunyala_number_of_plots_holders;\n $irrigation->bunyala_paddy_yields_tonnes=$request->bunyala_paddy_yields_tonnes;\n $irrigation->bunyala_payments_to_plot_holders_millions=$request->bunyala_payments_to_plot_holders_millions;\n $irrigation->bunyala_hectares_cropped=$request->bunyala_hectares_cropped;\n $irrigation->mwea_gross_value_of_crop_millions=$request->mwea_gross_value_of_crop_millions;\n\n $irrigation->mwea_hectares_cropped=$request->mwea_hectares_cropped;\n $irrigation->mwea_number_of_plots_holders=$request->mwea_number_of_plots_holders;\n $irrigation->mwea_paddy_yields_tonnes=$request->mwea_paddy_yields_tonnes;\n $irrigation->mwea_payments_to_plot_holders_million=$request->mwea_payments_to_plot_holders_million;\n $irrigation->perkerra_gross_value_of_crop_millions=$request->perkerra_gross_value_of_crop_millions;\n $irrigation->perkerra_hectares_cropped=$request->perkerra_hectares_cropped;\n $irrigation->perkerra_number_of_plots_holders=$request->perkerra_number_of_plots_holders;\n $irrigation->perkerra_payments_to_plot_holders_millions=$request->perkerra_payments_to_plot_holders_millions;\n \n $irrigation->perkerra_seed_maize_tonnes=$request->perkerra_seed_maize_tonnes;\n $irrigation->west_kano_gross_value_of_crop_millions=$request->west_kano_gross_value_of_crop_millions;\n\n $irrigation->west_kano_hectares_cropped=$request->west_kano_hectares_cropped;\n\n $irrigation->west_kano_number_of_plots_holders=$request->west_kano_number_of_plots_holders;\n \n\n $irrigation->west_kano_paddy_yields_tonnes=$request->west_kano_paddy_yields_tonnes;\n\n\n $irrigation->west_kano_payments_to_plot_holders_millions=$request->west_kano_payments_to_plot_holders_millions;\n\n $irrigation->year=$request->year;\n $irrigation->save();\n return response()->json($irrigation);\n echo json_encode(array(\"status\" => TRUE));\n\n }\n }" ]
[ "0.8198059", "0.7709767", "0.76003826", "0.74958646", "0.74917626", "0.74232006", "0.7388696", "0.73845035", "0.732648", "0.7309286", "0.73073226", "0.7293627", "0.72934026", "0.72436434", "0.7203664", "0.7201324", "0.7127739", "0.7126738", "0.71084297", "0.710417", "0.70866305", "0.7077356", "0.7035046", "0.7022756", "0.7013705", "0.7005454", "0.7001123", "0.69541967", "0.6953585", "0.69332415", "0.6912984", "0.68979347", "0.68855816", "0.6885049", "0.6883855", "0.68814576", "0.6876872", "0.6875076", "0.6873913", "0.6871152", "0.6864178", "0.686377", "0.68568146", "0.685528", "0.68462086", "0.6845678", "0.68354166", "0.6832722", "0.6819692", "0.67858684", "0.67800426", "0.67620254", "0.6760782", "0.67561555", "0.6753684", "0.6748788", "0.6745182", "0.67423093", "0.67398465", "0.6733243", "0.6726162", "0.67211187", "0.6700635", "0.6699586", "0.6693304", "0.66901207", "0.6683946", "0.6677528", "0.6675267", "0.6674377", "0.6674206", "0.667397", "0.66694236", "0.6669363", "0.66650057", "0.66634256", "0.66593874", "0.66554564", "0.66530967", "0.6638244", "0.6633118", "0.6621906", "0.66204494", "0.66189426", "0.6616345", "0.66141766", "0.6611249", "0.66101956", "0.65958774", "0.6595813", "0.6594538", "0.6583689", "0.65832764", "0.6579527", "0.65763676", "0.6572263", "0.6561177", "0.6559628", "0.6558751", "0.655185", "0.6551172" ]
0.0
-1
Setup the test environment.
public function setUp() { parent::setUp(); $this->user = Orchestra\Model\User::find(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp(): void\n {\n $this->setUpTheTestEnvironment();\n }", "protected function prepareRealTestEnvironment() {}", "protected function setUp()\n {\n parent::setUp();\n\n $this->checkExtension('phalcon');\n\n // Creating the application\n $this->bootstrap = new Bootstrap(self::getConfig());\n $this->app = $this->bootstrap->make($this->kernel());\n $this->app->boot();\n }", "public function setUp()\n {\n $this->initTestEnvironment('htpasswd_crypt');\n }", "protected function setUp() {\n parent::setUp();\n Monkey\\setUp();\n }", "protected function setUp()\n {\n Kohana::config('database')->default = Kohana::config('database')\n ->unit_testing;\n Auth::instance()->login(TEST_USERNAME, TEST_PASSWORD);\n\n // Index data and start up the search daemon\n exec('indexer --all --config ' . SPHINX_CONF);\n exec('searchd --config ' . SPHINX_CONF);\n }", "protected function setUp() {\n\n\t\tparent::setUp();\n\t\tMonkey\\setUp();\n\t}", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->setUpToolsAliases(true);\n $this->setUpToolsRoutes();\n $this->setUpToolsModels();\n }", "protected function setUp () : void {\n\n $_ENV['foo'] = \"bar\";\n $_SERVER['foo'] = \"baz\";\n\n $_ENV['bar'] = \"lorem\";\n $_SERVER['baz'] = \"ipsum\";\n\n // And quux isn't defined.\n }", "protected function setUp() {\n\t\tparent::setUp();\n\t\tMonkey\\setUp();\n\t}", "protected function setUp() {\n\t\tparent::setUp();\n\t\tMonkey\\setUp();\n\t}", "public function setUp(): void\n {\n $container = Robo::createDefaultContainer(null, new NullOutput());\n $this->setContainer($container);\n $this->setConfig(Robo::config());\n }", "public function setUp() {\n $this->setUpSiteAuditTestEnvironment();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->setUpToolsAliases(true);\n $this->setUpToolsModels();\n $this->setUpToolsDB();\n }", "protected function setUp()\n {\n // base directory for a .env file, and load it if it exists.\n $dotenvDir = __DIR__;\n for ($i = 0; $i < 4; $i++) {\n if (file_exists($dotenvDir.'/.env')) {\n $dotenv = new Dotenv($dotenvDir);\n $dotenv->load();\n break;\n }\n $dotenvDir = dirname($dotenvDir);\n }\n\n $this->memberclicks = new MemberClicks(getenv('MEMBERCLICKS_ORG_ID'), getenv('MEMBERCLICKS_CLIENT_ID'), getenv('MEMBERCLICKS_CLIENT_SECRET'));\n $this->memberclicks->auth();\n }", "public static function setup()\n {\n try {\n $env = \\Dotenv\\Dotenv::create(__DIR__ . '/../../private/');\n $env->load();\n $env->required([\n 'ENVIRONMENT',\n ]);\n } catch (\\Exception $e) {\n echo $e;\n }\n }", "protected function setUp()\n {\n parent::setUp();\n\n $run = dirname(__FILE__) . '/_run';\n if (file_exists($run) === false) {\n mkdir($run, 0755);\n }\n\n $this->_clearRunResources($run);\n\n include_once 'PHP/Depend.php';\n include_once 'PHP/Depend/StorageRegistry.php';\n include_once 'PHP/Depend/Storage/MemoryEngine.php';\n\n PHP_Depend_StorageRegistry::set(\n PHP_Depend::TOKEN_STORAGE,\n new PHP_Depend_Storage_MemoryEngine()\n );\n PHP_Depend_StorageRegistry::set(\n PHP_Depend::PARSER_STORAGE,\n new PHP_Depend_Storage_MemoryEngine()\n );\n\n if (defined('STDERR') === false) {\n define('STDERR', fopen('php://stderr', true));\n }\n }", "public function setUp()\n {\n // 'This test has not been implemented yet.'\n return;\n\n $this->setupDomains();\n $this->setupCountries();\n $this->setupLanguages();\n $this->setupCategories();\n }", "public function setUp()\n {\n $this->app = Application::instance();\n }", "public function setUp() : void\n {\n Config::setCategory('paths', [\n 'configs' => realpath(__DIR__ . '/../../configs'),\n 'root' => realpath(__DIR__ . '/../../../../../..'),\n 'src' => realpath(__DIR__ . '/../../../../../../src')\n ]);\n // Purposely set this to a weird value so we can test that it gets overwritten with the \"test\" environment\n $this->environment = new Environment();\n $this->container = new Container();\n $this->container->bindInstance(Environment::class, $this->environment);\n $this->container->bindInstance(BootstrapperCache::class, $this->createMock(BootstrapperCache::class));\n $this->container->bindInstance(RouteCache::class, $this->createMock(RouteCache::class));\n $this->container->bindInstance(ViewCache::class, $this->createMock(ViewCache::class));\n $this->container->bindInstance(IMigrator::class, $this->createMock(IMigrator::class));\n $this->container->bindInstance(FixMigrationsCommand::class, $this->createMock(FixMigrationsCommand::class));\n $this->container->bindInstance(IContainer::class, $this->container);\n\n // Setup the bootstrappers\n $bootstrapperRegistry = new BootstrapperRegistry();\n $bootstrapperDispatcher = new BootstrapperDispatcher(\n $this->container,\n $bootstrapperRegistry,\n new BootstrapperResolver()\n );\n $bootstrapperRegistry->registerEagerBootstrapper(self::$bootstrappers);\n $bootstrapperDispatcher->dispatch(false);\n\n parent::setUp();\n }", "public function setUp()\n {\n $this->loadEnv();\n\n require_once(__DIR__ . '/functions.php');\n\n // Allows for persistence of array cache to improve test performance,\n // e.g. by caching the LWA token to minimize OAuth requests. If this\n // is not desireable, see implementation of tearDown method below.\n if (!static::$arrayCache instanceof ArrayCache) {\n static::$arrayCache = new ArrayCache();\n }\n }", "protected function setUp()\n {\n if ($this->bootstrap) require $this->bootstrap;\n $this->dispatcher->dispatch('test.before', new \\Codeception\\Event\\Test($this));\n $this->codeGuy = new CodeGuy($scenario = new \\Codeception\\Scenario($this));\n $scenario->run();\n }", "protected function setUp()\n {\n $this->preSetup();\n parent::setUp();\n }", "protected function setUp(): void\n {\n $publicPath = __DIR__ . '/../../src/Provider/public/';\n\n $this->processRunner = new ProcessRunner('php', ['-S', 'localhost:7202', '-t', $publicPath]);\n\n $this->processRunner->run();\n }", "public function setUp ( )\n {\n $this->bootstrap = new Zend_Application(\n APPLICATION_ENV, ROOT_PATH . '/etc/application.ini'\n );\n\n parent::setUp();\n }", "public function setUp ( )\n {\n $this->bootstrap = new Zend_Application(\n APPLICATION_ENV, ROOT_PATH . '/etc/application.ini'\n );\n\n parent::setUp();\n }", "public function setUp()\n {\n require_once 'Zend/Application.php';\n\n // Create application, bootstrap, and run\n $application = new \\Zend_Application(\n APPLICATION_ENV,\n GEMS_ROOT_DIR . '/configs/application.example.ini'\n );\n\n $this->bootstrap = $application;\n\n parent::setUp();\n }", "public function setUp()\n {\n $this->setApplicationConfig(\n Bootstrap::getConfig()\n );\n\n parent::setUp();\n }", "public function setUp()\n {\n /*\n * Force reload of October singletons\n */\n PluginManager::forgetInstance();\n UpdateManager::forgetInstance();\n\n /*\n * Create application instance\n */\n parent::setUp();\n\n /*\n * Switch to the testing environment\n */\n if (file_exists(base_path($this->envTestingFile()))) {\n if (file_get_contents(base_path('.env')) !== file_get_contents(base_path($this->envTestingFile()))) {\n $this->switchEnvironment();\n }\n\n $this->refreshEnvironment();\n }\n\n /*\n * Ensure system is up to date\n */\n $this->runOctoberUpCommand();\n\n /*\n * Detect plugin from test and autoload it\n */\n $this->pluginTestCaseLoadedPlugins = [];\n $pluginCode = $this->guessPluginCodeFromTest();\n\n if ($pluginCode !== false) {\n $this->runPluginRefreshCommand($pluginCode, false);\n }\n\n /*\n * Disable mailer\n */\n Mail::pretend();\n }", "protected function setUp()\n {\n // Prepare the playground.\n $zip = new ZipArchive();\n $zip->open(__DIR__.'/resources.zip');\n $zip->extractTo(__DIR__.'/playground');\n }", "public final function setUp() {\n\t\t// run the default setUp() method first\n\t\tparent::setUp();\n\t}", "static function setup() {\n\n $zfRoot = realpath(dirname(basename(__FILE__)) . '/../lib/');\n \n $compassRoot = realpath(dirname(basename(__FILE__)) . '/..');\n\n TestConfiguration::$compassRoot = $compassRoot;\n TestConfiguration::$zfRoot = $zfRoot;\n \n require_once 'PHPUnit/Framework.php';\n require_once 'PHPUnit/Framework/TestSuite.php';\n require_once 'PHPUnit/TextUI/TestRunner.php';\n \n error_reporting( E_ALL | E_STRICT );\n \n set_include_path($compassRoot . '/application/models/'\n . PATH_SEPARATOR . $zfRoot\n . PATH_SEPARATOR . get_include_path()\n );\n \n include 'Zend/Loader.php';\n Zend_Loader::registerAutoload();\n \n // load configuration\n $section = 'test';\n $config = new Zend_Config_Ini($compassRoot .'/application/config.ini', $section);\n Zend_Registry::set('config', $config);\n \n date_default_timezone_set($config->date_default_timezone);\n \n // set up database\n $db = Zend_Db::factory($config->database);\n Zend_Db_Table::setDefaultAdapter($db);\n Zend_Registry::set('db', $db); \n }", "public function setUp()\n {\n $this->app = RenaApp::getInstance();\n }", "public function setUp()\n {\n $this->app = $this->createApplication();\n }", "public function setUp()\n {\n parent::setUp();\n \n $this->app = $this->createApplication();\n }", "protected function setUp()\n {\n global $di;\n\n // Setup di\n $this->di = new DIFactoryConfig();\n $this->di->loadServices(ANAX_INSTALL_PATH . \"/config/di\");\n $this->di->loadServices(ANAX_INSTALL_PATH . \"/test/config/di\");\n\n // Use a different cache dir for unit test\n $this->di->get(\"cache\")->setPath(ANAX_INSTALL_PATH . \"/test/cache\");\n\n // View helpers uses the global $di so it needs its value\n $di = $this->di;\n\n // Setup the controller\n $this->controller = new WeatherJsonController();\n $this->controller->setDI($this->di);\n $this->controller->initialize();\n }", "public function setUp() : void\n {\n parent::setUp();\n\n config(array(\n 'app.allowexport' => true,\n 'app.readonly' => false, // avoid conflict by confirming default\n ));\n\n $this->token = factory(Token::class)->create();\n\n $this->setTestingUser($this->token->user);\n }", "protected function setUp()\n {\n $this->api_key = getenv('API_KEY');\n $this->api = new Api($this->api_key);\n }", "public function setUp(): void\n\t{\n\t\t$this->auth = new Arifrh\\Auth\\Auth();\n\t\t$this->auth->testMode();\n\t}", "protected function setUp(): void\n {\n if (!self::TEST_ENABLE) {\n $this->markTestSkipped('Test disabled.');\n }\n $this->config = new Config(\n Config::ENV_CLI,\n __DIR__ . self::CONFIG_PATH\n );\n $this->container = new Container(\n $this->config->getSettings(Config::_SERVICES)\n );\n $this->userRepository = new Users($this->container);\n $this->instance = new Core($this->container);\n }", "public function setUp()\n {\n\n $this->XMLtools = GeneralUtility::makeInstance(XmlTools::class);\n }", "protected function setUp() {\r\n $this->application = new TestApplication();\r\n }", "function quickSetUp()\n {\n $this->setUp(null, null, null, null, null);\n }", "public final function setUp() {\n\t\t//run the default setUp() method first\n\t\tparent::setUp();\n\t}", "protected function setUp()\n {\n $container = include 'config/container.php';\n InsideConstruct::setContainer($container);\n }", "public function setUp(): void\n {\n if (!defined('ROOT_DIR')) {\n define(\"ROOT_DIR\", __DIR__ . \"/../\");\n }\n \n if (!class_exists('Database', false)) {\n require(\"./www/classes/database.class.php\");\n }\n if (!class_exists('Settings', false)) {\n require(\"./www/classes/settings.class.php\");\n }\n $this->settings = new \\Settings();\n \n try {\n $this->database = new \\Database($this->settings);\n } catch (Exception $error) {\n $this->markTestSkipped(\"Something went when loading Database class: \" .\n $error->getMessage());\n }\n }", "public function setUp() {\n\t\t\\OMV\\Environment::set(\"OMV_CONFIG_FILE\", sprintf(\n\t\t\t\"%s/../data/config.xml\", getcwd()));\n\t\t// Setup the model manager.\n\t\t$modelMngr = \\OMV\\DataModel\\Manager::getInstance();\n\t\t$modelMngr->load();\n\t}", "public function setUp() {\n\t\tparent::setUp();\n\t\tMonkey\\setUp();\n\n\t\t$this->setup_common_wp_stubs();\n\t}", "public static function setUpBeforeClass() {\n global $app;\n\n Debug::enable();\n\n $app = new \\Silex\\Application();\n\n require 'config/test.php'; /* seperate config for the test db */\n require 'src/app.php';\n\n self::createSchema();\n\n $app['session.test'] = true;\n\n }", "public function setUp()\n {\n parent::setUp();\n\n $config = [\n \"use_ssl\" => false,\n \"protocol\" => \"http\",\n \"host\" => \"bigalice2.nem.ninja\", // testing uses online NIS\n \"port\" => 7890,\n \"endpoint\" => \"/\",\n ];\n\n // each test should have its own API configured\n $this->client = new API();\n $this->client->setOptions($config);\n\n // each test should have its own SDK instance\n $this->sdk = new SDK([], $this->client);\n }", "public function setup()\n {\n $this->app = new Application(BASE_PATH, Environment::testing());\n\n // Create a test double for our User entity\n $user = m::mock('OpenCFP\\Domain]Entity\\User');\n $user->shouldReceive('hasPermission')->with('admin')->andReturn(1);\n $user->shouldReceive('getId')->andReturn(1);\n $user->shouldReceive('hasAccess')->with('admin')->andReturn(true);\n\n // Create a test double for our Sentry object\n $sentry = m::mock('Cartalyst\\Sentry\\Sentry');\n $sentry->shouldReceive('check')->andReturn(true);\n $sentry->shouldReceive('getUser')->andReturn($user);\n $this->app['sentry'] = $sentry;\n $this->app['user'] = $user;\n }", "protected function setUp()\n {\n global $di;\n\n // Setup di\n $this->di = new DIFactoryConfig();\n $this->di->loadServices(ANAX_INSTALL_PATH . \"/config/di\");\n $this->di->loadServices(ANAX_INSTALL_PATH . \"/test/config/di\");\n\n // Use a different cache dir for unit test\n // $this->di->get(\"cache\")->setPath(ANAX_INSTALL_PATH . \"/test/cache\");\n\n // View helpers uses the global $di so it needs its value\n $di = $this->di;\n\n // Setup the controller\n $this->controller = new WeatherController();\n $this->controller->setDI($this->di);\n $this->controller->initialize();\n }", "protected function setUp()\n {\n vfsStream::setup('root');\n $this->config = new MultilevelBag();\n }", "protected function setUp()\n {\n global $di;\n\n // Setup di\n $this->di = new DIFactoryConfig();\n $this->di->loadServices(ANAX_INSTALL_PATH . \"/config/di\");\n // $this->di->loadServices(ANAX_INSTALL_PATH . \"/test/config/di\");\n\n // View helpers uses the global $di so it needs its value\n $di = $this->di;\n\n // Setup the controller\n $this->controller = new BookController();\n $this->controller->setDI($this->di);\n // $this->controller->initialize();\n }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public function setUp()\n {\n $this->bootstrap = new Zend_Application(\n APPLICATION_ENV,\n APPLICATION_PATH . '/configs/application.ini'\n );\n parent::setUp();\n }", "protected function setUp(): void\n {\n $this->createAndInitDoctrineProvider();\n\n // declare audited entites\n $this->configureEntities();\n\n // setup entity schema only\n $this->setupEntitySchemas();\n\n $this->setupEntities();\n }", "public function setUp()\n {\n $this->createApplication();\n parent::setUp();\n //$this->resolveApplicationConsoleKernel($this->app);\n //$this->resolveApplicationHttpKernel($this->app);\n $this->getEnvironmentSetUp($this->app);\n\n $this->migrateUp();\n }", "protected function setUp()\n {\n global $di;\n\n // Setup di\n $this->di = new DIMagic();\n $this->di->loadServices(ANAX_INSTALL_PATH . \"/config/di\");\n\n // Use a different cache dir for unit test\n $this->di->get(\"cache\")->setPath(ANAX_INSTALL_PATH . \"/test/cache\");\n\n // View helpers uses the global $di so it needs its value\n $di = $this->di;\n\n // Setup the controller\n $this->controller = new IPAPIController();\n $this->controller->setDI($this->di);\n $this->controller->initialize();\n }", "protected function setUp() : void\n {\n global $di;\n\n // Init service container $di to contain $app as a service\n $di = new DIFactoryConfig();\n $di->loadServices(ANAX_INSTALL_PATH . \"/config/di\");\n $di->loadServices(ANAX_INSTALL_PATH . \"/test/config/di\");\n\n //set a test-cache for tests\n //$di->get(\"cache\")->setPath(ANAX_INSTALL_PATH . \"/test/cache\");\n\n // Create and initiate the controller\n $this->controller = new WeatherControllerMock();\n\n $this->controller->setDi($di);\n }", "protected function setUp ()\n {}", "public function setup() {}", "protected function setUp(): void\n {\n $this->container = new Container();\n }", "public function setUp()\n {\n parent::setUp();\n $this->createApplication();\n }", "public function setUp(): void {\n // Set API details in config.\n set_config('turnitinapiurl', 'http://www.example.com', 'plagiarism_turnitinsim');\n set_config('turnitinapikey', 1234, 'plagiarism_turnitinsim');\n set_config('turnitinenablelogging', 0, 'plagiarism_turnitinsim');\n }", "protected function setUp() {\n\t\tparent::setUp();\n\t\tConfig::getInstance()->set(array(\n\t\t\t'resource.session.test.namespace' => 'test',\n\t\t\t'resource.session.test.cookieName' => 'testSession',\n\t\t\t'resource.session.test.cookieDomain' => 'testdomain',\n\t\t\t'resource.session.test.cookiePath' => '/test',\n\n\t\t\t'resource.missingNamespace.cookieName' => 'testSession',\n\t\t));\n\t}", "public function setUp()\n {\n parent::setUp();\n\n $this->app['config']->set('database.default', 'sqlite');\n $this->app['config']->set('database.connections.sqlite.database', ':memory:');\n $this->app['config']->set('jsonapi', [EmployeesTransformer::class, OrdersTransformer::class]);\n $this->app['config']->set('app.url', 'http://localhost/');\n $this->app['config']->set('app.debug', true);\n $this->app['config']->set('app.key', \\env('APP_KEY', '1234567890123456'));\n $this->app['config']->set('app.cipher', 'AES-128-CBC');\n\n $this->app->boot();\n\n $this->migrate();\n }", "public static function setUpBeforeClass(): void\n {\n EasyPost::setApiKey(getenv('EASYPOST_TEST_API_KEY'));\n\n VCR::turnOn();\n }", "public static function setUpBeforeClass(): void\n {\n EasyPost::setApiKey(getenv('EASYPOST_TEST_API_KEY'));\n\n VCR::turnOn();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->controller(Runner::class);\n }", "public function setUp(): void {}", "protected function setUp()\n {\n // Create a new klein app,\n // since we need one pretty much everywhere\n $this->klein_app = new Klein();\n }", "protected function setUp() {\n\n $this->installer = new Core_Installer();\n $this->installer->installTest();\n $this->installer->loginAsSuperAdmin();\n \n \n $this->bootstrap = new Zend_Application('testing', APPLICATION_PATH . '/configs/application.ini'); //\n $this->view = Zend_Registry::get('view');\n \n $manager = new Core_Model_User_Manager();\n $manager->login(array('username'=>'testSuperAdmin','password'=>'password'));\n \n $this->contentInstaller = new Content_Installer();\n $this->contentInstaller->installTest();\n\n $this->service = new Content_Model_Template_Service();\n parent::setUp();\n \n $request = $this->getRequest();\n $request->setModuleName('Content');\n $request->setControllerName('Index');\n }", "public function setUp()\n {\n parent::setUp();\n $this->prepareForTests();\n }", "public function setUp() {}", "public function setUp() {}", "public function setUp()\n {\n $_SERVER['REQUEST_URI'] = 'testing';\n $_SERVER['HTTP_REFERER'] = 'https://beta.gac.edu/billy/concert/newPage.php?concert=edit';\n TestBase::$pdo = $this->getDBH();\n\n\n if (!is_dir(self::$testFileDir . 'drafts')) {\n mkdir(self::$testFileDir . 'drafts');\n }\n if (!is_dir(self::$testFileDir . 'staged')) {\n mkdir(self::$testFileDir . 'staged');\n }\n if (!is_dir(self::$testFileDir . 'editableDrafts')) {\n mkdir(self::$testFileDir . 'editableDrafts');\n }\n parent::setUp();\n }", "public function setUp() {}", "protected function setUp()\n {\n global $testCase;\n $testCase = 'table_for_test';\n\n $this->container = include './config/container.php';\n $this->store = $this->container->get(StoreFactory::KEY);\n }", "protected function setUp()\n {\n $this->app = new Container();\n }", "public function setUp(): void\n {\n parent::setUp();\n\n $this->translator = $this->app->make('translator');\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() {}" ]
[ "0.80901235", "0.7966224", "0.7863841", "0.7753466", "0.762472", "0.7597421", "0.7575249", "0.7566005", "0.7549789", "0.75387037", "0.75387037", "0.7531871", "0.75232726", "0.7503708", "0.7485439", "0.745243", "0.7442338", "0.74330586", "0.74315375", "0.7414113", "0.7413566", "0.74093527", "0.7406758", "0.73901033", "0.73891467", "0.73891467", "0.7386752", "0.7362907", "0.7361446", "0.73611325", "0.73572767", "0.73562026", "0.73532826", "0.7347029", "0.73463583", "0.7342768", "0.73328316", "0.7329232", "0.7327938", "0.73263717", "0.73225355", "0.73200315", "0.7314672", "0.73100144", "0.73092896", "0.7279675", "0.7257726", "0.72512007", "0.7249415", "0.72451353", "0.72409797", "0.7225421", "0.722017", "0.7219355", "0.7215936", "0.7200318", "0.7199734", "0.7189764", "0.71892846", "0.71844983", "0.71801084", "0.71756536", "0.717403", "0.7173614", "0.71692073", "0.71652454", "0.71613395", "0.7159628", "0.7159628", "0.71582526", "0.71537435", "0.71514195", "0.7143289", "0.71390766", "0.7138506", "0.7138485", "0.71384305", "0.71380377", "0.71368694", "0.71363246", "0.71352774", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71297055", "0.71290404", "0.71290404", "0.7128608", "0.7128608", "0.7128608" ]
0.0
-1
Teardown the test environment.
public function tearDown() { unset($this->user); $this->be(null); parent::tearDown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function tearDown(): void\n {\n $this->tearDownTheTestEnvironment();\n }", "public function teardown()\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($this->_standardLib);\n unset($this->_daughter);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }", "function tearDown() {\n // Remove any remaining test files\n wp_rmdir_recursive('test://');\n\n // Unregister test stream wrapper\n WP_Stream_Wrapper_Registry::unregister_wrapper('test');\n }", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "protected function tearDown() {\n\t\tparent::tearDown();\n\n\t\t$this->cleanupTestDirectory();\n\t}", "public function tearDown()\n {\n unset($this->psrContextFactory);\n }", "public function tearDown(): void {\n // Remove any temporary directories that were created.\n $filesystem = new Filesystem();\n foreach ($this->tmpDirs as $dir) {\n $filesystem->remove($dir);\n }\n // Clear out variables from the previous pass.\n $this->tmpDirs = [];\n $this->io = NULL;\n // Clear the composer cache dir, if it was set\n putenv('COMPOSER_CACHE_DIR=');\n }", "protected function tearDown()\n {\n session_destroy(); //req'd because Kml class sets a cookie\n $this->clearRequest();\n $this->clearTmpFiles();\n }", "public function tearDown(): void\n {\n unset($_SERVER['foo'], $_ENV['foo']);\n }", "public function tearDown()\n {\n unset($this->app);\n unset($this->client);\n\n m::close();\n }", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "protected function tearDown()\n\t{\n\t\tunset($GLOBALS['__DB__']);\n\n\t\tparent::tearDown();\n\t}", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->filesystem);\n unset($this->diskSpace);\n unset($this->commandTester);\n }", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "function __destruct() {\n if ($this->testDir) {\n $this->eraseTempDir();\n }\n $this->unsetMockSession();\n }", "protected function tearDown()\n {\n unset($this->output);\n }", "public static function tearDownAfterClass()\n {\n if (null !== static::$kernel) {\n static::$kernel->shutdown();\n }\n }", "public function tearDown()\n {\n unset($this->helper);\n }", "protected function tearDown()\n {\n $this->kernel->shutdown();\n $this->kernel = null;\n parent::tearDown();\n }", "public function teardown()\n {\n parent::teardown();\n }", "protected function tearDown()\n\t{\n\t\tunset($this->_instance);\n\t\tparent::tearDown();\n\t}", "public static function tearDown()\n {\n self::$instance = null;\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 doTearDown(): void\n {\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 parent::tearDown();\n\n if ((bool) getenv('CLEANUP_TEST_DOCKER_SECRETS')) {\n DockerSecretFile::cleanup();\n }\n }", "protected function tearDown() {\n\t\t$this->Application = null;\n\t\tparent::tearDown ();\n\t}", "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(): void\n {\n parent::tearDown();\n unset($this->purifier);\n unset($this->em);\n unset($this->objectiveManager);\n unset($this->learningMaterialManager);\n unset($this->courseLearningMaterialManager);\n unset($this->sessionLearningMaterialManager);\n unset($this->sessionDescriptionManager);\n unset($this->commandTester);\n }", "protected function tearDown()\n {\n $this->clock = NULL;\n }", "public function tearDown() : void {\n\t\tunset($this->ls); /* Kill circular references */\n\t\tunset($this->lsconn); /* Kill circular references */\n\t}", "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->stack = null;\n }", "protected function tearDown()\n\t{\n\t\t$_SERVER = $this->backupServer;\n\t\tunset($this->backupServer);\n\t\tunset($this->options);\n\t\tunset($this->input);\n\t\tunset($this->client);\n\t\tunset($this->oauth);\n\t\tunset($this->object);\n\t}", "public function tearDown()\n\t{\n\t\tunset($this->stub);\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\tFragseizeObj::release( $this->uid );\n\t}", "protected function tearDown() {\n spl_autoload_unregister('autoloadForTesting');\n unset($this->object);\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "protected function tearDown ()\n {\n $this->downTest();\n\n parent::tearDown();\n }", "function tearDown() {\n\t\t$this->wfRecursiveRemoveDir( $this->tmpName );\n\t}", "protected function tearDown()\n {\n \\RPI\\Foundation\\Helpers\\FileUtils::delTree(__DIR__.\"/LESSPHPTest/ROOT\");\n }", "public function tearDown()\n {\n $this->app = null;\n }", "public function tearDown()\n {\n unset(\n $this->webhook_processor,\n $this->webhook,\n $this->domain,\n $this->subscriber,\n $this->data\n );\n }", "public function tearDown()\n {\n parent::tearDown();\n\n unset($this->stringHelper);\n unset($this->dateTransformer);\n }", "protected function tearDown() {\n Monkey\\tearDown();\n parent::tearDown();\n }", "protected function tearDown() {\r\n\t\tunset ( $this->configReader );\r\n\t}", "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 }", "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 $this->listener = null;\n $this->event = null;\n $this->request = null;\n }", "protected function tearDown()\n\t{\n\t\t$this->instance = null;\n\t}", "public function tearDown()\n {\n TestvfsStreamWrapper::unregister();\n }", "public static function tearDownAfterClass(): void\n {\n VCR::eject();\n VCR::turnOff();\n }", "public static function tearDownAfterClass(): void\n {\n VCR::eject();\n VCR::turnOff();\n }", "protected function tearDown()\n\t{\n\t\t$this->restoreFactoryState();\n\t}", "public static function tearDown()\n {\n self::init();\n\n // Handle current_user placing on the end since there are some things\n // that need current user for the clean up\n if (isset(self::$registeredVars['current_user'])) {\n $cu = self::$registeredVars['current_user'];\n unset(self::$registeredVars['current_user']);\n self::$registeredVars['current_user'] = $cu;\n }\n\n // unregister variables in reverse order in order to have dependencies unregistered after dependants\n $unregisterVars = array_reverse(self::$registeredVars);\n foreach ($unregisterVars as $varName => $isCalled) {\n if ($isCalled) {\n unset(self::$registeredVars[$varName]);\n if (method_exists(__CLASS__, 'tearDown_' . $varName)) {\n call_user_func(__CLASS__ . '::tearDown_' . $varName, array());\n } elseif (isset($GLOBALS[$varName])) {\n unset($GLOBALS[$varName]);\n }\n }\n }\n\n // Restoring of system variables\n foreach (self::$initVars as $scope => $vars) {\n foreach ($vars as $name => $value) {\n $GLOBALS[$name] = $value;\n }\n }\n\n // Restore the activity stream.\n Activity::enable();\n\n // Restoring of theme\n SugarThemeRegistry::set(self::$systemVars['SugarThemeRegistry']->dirName);\n SugarCache::$isCacheReset = false;\n\n return true;\n }", "public function tearDown() {\n\t\tunset($this->objectInstance);\n\t}", "public function tearDown() {\n $this->container = null;\n }", "protected function tearDown()\n {\n unset($this->app);\n\n m::close();\n }", "protected function tearDown() {\r\n\t\t$this->testObject = null;\r\n\t\tparent::tearDown ();\r\n\t}", "protected function tearDown() {\r\n\t\t$this->testObject = null;\r\n\t\tparent::tearDown ();\r\n\t}", "protected function tearDown()\n\t{\n\t\t$this->_zendId3 = null;\n\n\t\tparent::tearDown();\n\t}", "protected function tearDown() {\n\n\t\tMonkey\\tearDown();\n\t\tparent::tearDown();\n\t}", "protected function tearDown()\n {\n $this->helper = null;\n parent::tearDown();\n }", "protected function tearDown(): void\n {\n $this->processRunner->stop();\n }", "protected function tearDown()\n {\n if ($this->app) {\n foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {\n call_user_func($callback);\n }\n }\n\n $this->setUpHasRun = false;\n\n if (property_exists($this, 'serverVariables')) {\n $this->serverVariables = [];\n }\n\n if (class_exists('Mockery')) {\n Mockery::close();\n }\n\n $this->afterApplicationCreatedCallbacks = [];\n $this->beforeApplicationDestroyedCallbacks = [];\n }", "protected function tearDown() {\r\n\t\tparent::tearDown();\r\n\t\tunset ( $this->mockedCacheCleanerBuilder );\r\n\t\tunset ( $this->mockedEventDispatcher );\r\n\t\tunset ( $this->mockedEventQueue );\r\n\t\tunset ( $this->mockedEventRepository );\r\n\t\tunset ( $this->mockedTypo3DbBackend );\r\n\t\tunset ( $this->cacheEventHandler );\r\n\t}", "protected function tearDown() {\n\t\tMonkey\\tearDown();\n\t\tparent::tearDown();\n\t}", "protected function tearDown() {\n\t\tMonkey\\tearDown();\n\t\tparent::tearDown();\n\t}", "protected function tearDown(): void\n {\n unset($this->object);\n }", "protected function tearDown() {\n $this->dbh = null;\n $this->storage = null;\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()\n\t{\n\t\tunset( $this->_mock, $this->_object );\n\t}", "protected function tearDown()\n {\n $this->calculator = NULL;\n }", "protected function tearDown()\n {\n Zend_Registry::_unsetInstance();\n }", "protected function tearDown()\n {\n $this->tgLog = null;\n }", "public function tearDown(): void\n {\n Session::getInstance()->destroy();\n Session::kill();\n }", "protected function tearDown()\r\n {\r\n $this->session->logout();\r\n }", "protected function tearDown() {\n unset($this->object);\n }", "protected function tearDown() {\n unset($this->object);\n }", "protected function tearDown()\n {\n $this->client = null;\n }", "protected function tearDown()\n {\n unset($this->remotepath);\n }", "protected function tearDown()\n {\n exec('rm -rf '.$this->testDir);\n chdir(__DIR__);\n }", "protected function tearDown()\n {\n exec('rm -rf '.$this->testDir);\n chdir(__DIR__);\n }", "public function tearDown()\n {\n unset($this->VenusFuelDepot);\n }", "public function tearDown() {\n $this->auth->logout();\n }", "public function tearDown(): void\n {\n parent::tearDown();\n\n Mockery::close();\n\n unset($this->faker, $this->waqi);\n }", "public function tearDown() {\n\t\tMonkey\\tearDown();\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n {\n if (file_exists($this->__testFilePath)) {\n unlink($this->__testFilePath);\n }\n if (is_dir($this->__testFileDir)) {\n rmdir($this->__testFileDir);\n }\n }" ]
[ "0.7998766", "0.79613054", "0.7924188", "0.79189134", "0.7918296", "0.7879467", "0.77666545", "0.77458763", "0.7690417", "0.76795965", "0.7600415", "0.75892365", "0.75767565", "0.75593007", "0.7538844", "0.7537637", "0.75308084", "0.7526055", "0.7521324", "0.75087386", "0.74944776", "0.7493998", "0.74936813", "0.7492018", "0.7480414", "0.74728197", "0.7456276", "0.7450223", "0.74430615", "0.7437754", "0.7433711", "0.7430415", "0.74274933", "0.7405855", "0.7405277", "0.74047005", "0.7404231", "0.74034446", "0.73985744", "0.73985744", "0.73985744", "0.73985744", "0.73985744", "0.7398525", "0.73922795", "0.7384917", "0.7383513", "0.7381366", "0.73741484", "0.73741484", "0.73741484", "0.7369376", "0.7367581", "0.7367368", "0.7364521", "0.73594767", "0.7358932", "0.73575205", "0.73504096", "0.7350031", "0.7349275", "0.7345347", "0.73449117", "0.73426336", "0.73421055", "0.73421055", "0.73403805", "0.7338911", "0.7337467", "0.73349196", "0.73261946", "0.73241407", "0.73241407", "0.7319512", "0.73181295", "0.73171544", "0.7317142", "0.7315245", "0.73142946", "0.73071694", "0.73071694", "0.7306489", "0.7301127", "0.7297257", "0.72940713", "0.7293287", "0.7291367", "0.7288582", "0.7288529", "0.7288306", "0.728397", "0.728397", "0.7278027", "0.7277669", "0.7276388", "0.7276388", "0.7275164", "0.72734606", "0.7269759", "0.7269734", "0.72672427" ]
0.0
-1
Test Request GET (orchestra)/users without auth
public function testGetUsersPageWithoutAuth() { $response = $this->call('orchestra::users@index'); $this->assertInstanceOf('Laravel\Redirect', $response); $this->assertEquals(302, $response->foundation->getStatusCode()); $this->assertEquals(handles('orchestra::login'), $response->foundation->headers->get('location')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetUser()\n {\n $headers = $this->authenticate();\n $response = $this->json('GET', '/api/user', [], $headers);\n $response->assertStatus(200);\n }", "public function testGetUser()\n {\n $response = $this->get('getuser');\n\n $response->assertStatus(200);\n }", "public function testUserApiReturnsUsers()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $users = factory(User::class, 2)->create();\n\n // $this->json('GET', 'api/v1/users')\n // ->seeJsonStructure([\n // '*' => [\n // 'northstar_id', 'created_at', 'updated_at', 'role',\n // ]\n // ]);\n }", "public function testGetUserAll()\n {\n $response = $this->request()->json('GET','/api/users');\n $response->assertStatus(200);\n }", "public function testShowUser()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/1');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n \"data\" => [\n \"id\",\n \"employee_code\",\n \"name\",\n \"email\",\n \"team\",\n \"role\",\n \"total_borrowed\",\n \"total_donated\"\n ]\n \n ])->assertStatus(Response::HTTP_OK);\n }", "public function test_unauthorized_fetch()\n {\n $headers = [\n 'Authorization' => \"Bearer None\"\n ];\n\n $response = $this\n ->withHeaders($headers)\n ->json('GET', '/api/github-users', [\n 'logins' => [\n 'souinhua',\n 'taylorotwell',\n 'no_one_151asd@'\n ]\n ]);\n\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n }", "public function testGetSingleUserPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function testSuccessWithNoUsersToList()\n {\n $response = $this->getJson($this->endpoint(), $this->authenticationHeaders())->assertStatus(200);\n\n // Check the basic api endpoint structure.\n $this->assertEndpointBaseStructure($response);\n }", "public function test_unauthorized_user_cannot_access_the_user_route()\n {\n $response = $this->getJson('/user');\n\n $response->assertStatus(401);\n }", "public function testShowUserWithoutAddresses()\n {\n $user = factory(User::class)->state('lecturer')->create();\n $response = $this->withHeaders([\n ])->getJson(\"/api/user/{$user->id}\", []);\n\n $response->assertStatus(200)\n ->assertJson([\"user\" => $user->toArray()]);\n }", "public function user_route_api()\n {\n $this->withoutExceptionHandling();\n $response = $this->get('/api/test-user');\n\n $response->assertStatus(200);\n }", "public function testGetUsersPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\t\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.index', $response->content->view);\n\t}", "public function testuserGet200()\n {\n $response = $this->runApp('GET', '//user/{id}');\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertContains('Success', (string)$response->getBody());\n }", "function loadUsersDetail()\n {\n $this->get('/usuarios/5')\n ->assertStatus(200)\n ->assertSee('Mostrando detalle del usuario: 5');\n }", "public function testGetApiUser()\n {\n $token = $this->getAuthToken();\n /* @var TestResponse $response */\n $this->json(\n 'GET',\n '/api/user',\n [],\n [\n 'Content-Type: application/x-www-form-urlencoded',\n 'Cache-Control: no-cache',\n 'Authorization' => 'Bearer ' . $token . '',\n ],\n 'Get current user'\n ) ->assertStatus(200)\n ->assertJsonStructure(\n [\n 'data' => [\n 'id',\n 'email',\n 'profile',\n 'privacySettings',\n ],\n 'channel',\n ]\n );\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 }", "public function testListUsers()\n {\n echo \"\\nTesting user listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/users\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function testUserIndex()\n {\n $user = factory('App\\User')->create();\n\n $this->get('/api/v1/users');\n\n $username = json_decode($this->response->getContent(), true)[0][\"username\"];\n\n $this->assertEquals(\n $user[\"username\"], $username);\n }", "public function testUsersNoLogin()\n {\n $response = $this->get('/users');\n\n $response->assertStatus(302);\n }", "public function testIndex()\n {\n $response = $this->getJson(route('users.index'), $this->headers);\n\n $response->assertStatus(200);\n }", "public function testGetProfileUserNotExist()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/thor\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n //AppBundle:User object not found. (404 Not Found)\r\n $this->assertTrue($response->code === 404);\r\n\r\n }", "public function testUserApiReturnsResponse()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $this->json('GET', 'api/v1/users')\n // ->assertResponseStatus('200');\n }", "public function testAccess() {\n\n $this->drupalGet('udb3/api/1.0/user');\n $this->assertResponse('403');\n\n }", "public function testUserWithoutAccesToResource()\n {\n $this->unlogged();\n $this->visit('/resource')\n ->seePageIs(route('auth.getLogin'))\n ->see('Login');\n }", "public function testListUsersSuccess()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"users\": \"user\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->get('api/user/list-users', $this->headers)\n ->assertStatus(200)\n ->assertJson(['users' => 'user']);\n\n }", "public function testAdminUser()\n {\n //$user = Sentry::getUserProvider()->findByLogin('[email protected]');\n //$this->be($user);\n\n $response = $this->call('GET', 'admin/users');\n\n // Make sure we can't view the admin pages.\n $this->assertFalse($response->isNotFound());\n }", "function messageNoUsers()\n {\n $this->get('/usuarios?empty')\n ->assertStatus(200)\n ->assertSee('No hay usuarios registrados');\n }", "public function testUserIndex()\n {\n $response = $this->actingAs($this->user())->get(route('task_statuses.index'));\n $response->assertOk();\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 test_authorized_user_can_access_the_user_route()\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n\n $response = $this->get('/user');\n\n $response->assertStatus(200);\n $response->assertJson(['data' => ['name' => $user->name, 'email' => $user->email]]);\n }", "public function test()\n {\n $this->getAuthenticatedUser();\n return response()->json(['data' => ['status' => 'OK']], 200);\n }", "public function testCGetAction200()\n {\n self::$_client->request(Request::METHOD_GET, self::RUTA_API);\n $response = self::$_client->getResponse();\n self::assertTrue($response->isSuccessful());\n self::assertJson($response->getContent());\n $users = json_decode($response->getContent(), true);\n self::assertArrayHasKey('users', $users);\n }", "public function testGetAccountsUsingGET()\n {\n }", "public function testGetProfileOtherUserNoRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/steve-rogers\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Steve Rogers', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->relationships->isFriend);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function testWithValidTokenButNoUserInDb()\n {\n $token = JWT::encode(['id' => 4], Security::getSalt());\n\n $request = new ServerRequest();\n $request = $request->withEnv('HTTP_AUTHORIZATION', 'Bearer ' . $token);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n\n $request = new ServerRequest(['url' => 'posts/index?token=' . $token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }", "public function testShowUserFail()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/2');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n ]);\n $response->assertJson([\n \"meta\" => [\n \"code\" => Response::HTTP_NOT_FOUND\n ]\n ]);\n }", "public function test_it_must_be_authenticated_user()\n {\n $this->json('post' , 'api/orders')->assertStatus(401);\n }", "public function testUserMeGet()\n {\n }", "public function testApiIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/api/comptes');\n\n $response->assertStatus(200)\n ->assertJson([\n\n 'comptes' => true,\n \n ]);\n }", "public function testFilters_noResults()\n {\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(2));\n\n $users->Auth\n ->staticExpects($this->at(2))\n ->method('user')\n ->with('id')\n ->will($this->returnValue(2));\n $this->testAction(\"/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o\");\n $this->assertEquals($this->vars['users'], array());\n }", "public function test_lsvt_api_returns_null_when_user_is_not_found()\n {\n $email = '[email protected]';\n\n $this->httpMock->append(new Response(404, ['Content-Type' => 'text/html'], 'Not found.'));\n\n $test = $this->apiClient->getUserByUsername($email);\n\n $this->assertCount(1, $this->curlHistory);\n $this->assertEquals('https://webservices.lightspeedvt.net/REST/v1//[email protected]', (string)$this->curlHistory[0]['request']->getUri());\n\n $this->assertIsArray($test);\n $this->assertEquals($email, $test['email']);\n }", "public function httpUriGetUserInfoOnlyUser(UnitTester $I)\n {\n $I->wantToTest('Http\\Uri - getUserInfo() - only user');\n $query = 'https://[email protected]:8080/action?param=value#frag';\n $uri = new Uri($query);\n\n $expected = 'phalcon';\n $actual = $uri->getUserInfo();\n $I->assertEquals($expected, $actual);\n }", "public function testUserListForStandardUser()\n {\n $user = User::factory()->create([\n 'type' => 'user',\n ]);\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(403)\n ->assertJson([\n 'success' => false\n ]);\n }", "public function user_route()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testGetOneUserInformation()\n {\n $response = $this->json('GET', $this->userEndpoint.'/prostoalex');\n\n // It should return a valid user json with all the basic attributes filled\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'created',\n 'id',\n 'karma',\n 'submitted',\n 'about',\n ])\n ->assertJsonFragment([\n 'id' => 'prostoalex'\n ]);\n }", "public function testSearchAndFilterUser()\n {\n $user = factory(User::class)->create([\n 'email' => 'test@test',\n 'type' => 1\n ]);\n Passport::actingAs($user);\n\n $data = $this\n ->json(\n 'GET',\n 'api/users?term=test'\n )\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [],\n ])\n ->json('data');\n\n $this->assertArraySubset([\n 'email' => 'test@test'\n ], $data[0]);\n\n $data = $this\n ->json(\n 'GET',\n 'api/users?term=test&filter[type]=2'\n )\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [],\n ])\n ->json('data');\n\n $this->assertTrue(empty($data));\n }", "public function index()\n {\n $user = $this->user();\n\n// if ($user == null) {\n// throw new UnauthorizedHttpException(\"Bearer\", \"You are not authorized to see all users.\", null, 0x00C00301);\n// }\n\n if (!policy($user)->canSeeAll($user)) {\n throw new HttpException(403, \"You are not authorized to see all users.\", null, [], 0x00C00302);\n }\n\n $users = $this->repository->all();\n\n return $this->response->collection($users, new UserTransformer, [\"key\" => \"users\"]);\n }", "function loadUsersListPage()\n {\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Listado de usuarios')\n ->assertSee('Javier')\n ->assertSee('Francisco');\n }", "public function index_get()\n\t {\t\n \t$users=$this->User_Model->get_users();\n // Check if the users data store contains users (in case the database result returns NULL)\n if ($users)\n {\n // Set the response and exit\n $this->response($users, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code\n }\n else\n {\n // Set the response and exit\n $this->response([\n 'status' => FALSE,\n 'message' => 'No users were found'\n ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n \n\t }", "public function test_show_user_as_unauthorized_user()\n {\n $user = User::factory()->create();\n $user2 = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user2->id]));\n\n $response->assertStatus(403);\n }", "public function testSearchAdminWithoutToken()\n {\n $this -> call('GET','api/classes/admins/search',['string' => $this -> userCredentials[\"email\"]]);\n $this -> seeJsonEquals([\n 'error' => 'Token does not exist anymore. Login again.'\n ]);\n }", "public function testSeeSingleUserTest()\n {\n $user = \\App\\User::firstOrFail();\n $response = $this->get('/users/'.$user->id);\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function testIndex(): void\r\n {\r\n $client = static::createClient();\r\n $userRepository = static::$container->get(UserDoctrineRepository::class);\r\n\r\n $testUser = $userRepository->getUserByEmail('[email protected]');\r\n \r\n // Symfony helper.\r\n $client->loginUser($testUser);\r\n\r\n $client->request('GET', '/admin');\r\n\r\n static::assertResponseIsSuccessful();\r\n }", "public function testWPGetProfileOtherUserNoRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/bucky-barnes\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Bucky Barnes', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->user->isWellnessPro);\r\n\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n }", "function user_get()\n {\n $id = $this->get('id');\n if ($id == '') {\n $user = $this->db->get('auth_user')->result();\n } else {\n $this->db->where('id', $id);\n $user = $this->db->get('auth_user')->result();\n }\n $this->response($user, 200);\n }", "public function index() // Secured Endpoint \n {\n $users = Cache::rememberForever('users', \n fn() => DB::table('users')->get());\n \n return response()->json([\n 'success' => true,\n 'payload' => $users\n ]);\n }", "function GET()\n {\n $user = $this->router()->user();\n \n if ( ! $user->mayManageUsers())\n {\n throw new NotAuthorized();\n }\n \n $users = array();\n foreach(User::listAllIds() as $id)\n {\n $user = User::loadById($id);\n $users[] = array(\n \"email\" => $user->email(),\n \"id\" => $user->id(),\n \"name\" => $user->name(),\n \"privileges\" => $user->privileges()\n );\n }\n $this->setReturnVariable(\"data\", array(\"users\" => $users));\n }", "public function testAdminGetListadoAction()\n {\n $headers = $this->getHeaders('[email protected]');\n $client = static::createClient();\n $client->followRedirects();\n $client->request('GET', '/api/v1.0/usuarios', [], [], $headers);\n self::assertEquals(200, $client->getResponse()->getStatusCode());\n }", "public function test_index_without_data()\n {\n $this->makeUser('master');\n\n $response = $this->get('/api/admin/tag');\n\n $response->assertStatus(200);\n }", "public function cestEmptyUsers(\\FunctionalTester $I)\n {\n /**\n * @todo IMPLEMENT THIS\n */\n $I->amOnPage([\n 'base/api',\n 'users' => [\n ],\n 'platforms' => [\n 'gitlab',\n ]\n ]);\n $expected = \"<pre>Bad Request: Missing required parameters: users</pre>\";\n $I ->assertEquals($expected, $I ->grabPageSource());\n $I->seeResponseCodeIs(400);\n }", "public function test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\n }", "public function test_successful_fetch()\n {\n $token = $this->getUserCreatedToken();\n $headers = [\n 'Authorization' => \"Bearer $token\"\n ];\n\n $response = $this\n ->withHeaders($headers)\n ->json('GET', '/api/github-users', [\n 'logins' => [\n 'souinhua',\n 'taylorotwell',\n 'no_one_151asd@'\n ]\n ]);\n\n $response->assertSuccessful();\n }", "public function testUnauthorizedGetUserPeopleFails()\n {\n $response = $this->withHeaders([\n 'Accept' => 'application/json'\n ]) ->get('/api/v1/people');\n\n\n $response->assertStatus(401);\n }", "public function test_show_user_as_user()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function testGetAccountUsingGET()\n {\n }", "public function testEndPoint()\n {\n\n $user = Auth::loginUsingId(1);\n\n// $response = $this->actingAs($user)\n// ->get('dashboard/orders/create');\n $response = $this->get('dashboard/orders/create');\n\n $response->assertStatus(200);\n }", "public function testGetInfoUser()\n {\n $id = 1;\n $this->json('GET', \"api/user/get-info/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"data\" => [\n \"created_at\",\n \"email\",\n \"name\",\n \"id\",\n \"org_id\",\n \"updated_at\"\n ]\n ]);\n }", "public function testUserListForAdmin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'data' => true,\n ]);\n }", "public function testIndexWithoutToken()\n {\n // Create user\n $this -> createUser($this -> userCredentials);\n\n $this -> call('GET','api/classes');\n $this -> seeJsonEquals([\n 'error' => 'Token does not exist anymore. Login again.'\n ]);\n }", "public function testSearchAdminsSuccessful()\n {\n $this -> withoutMiddleware();\n\n // Create users\n $this -> createUser($this -> userCredentials);\n $this -> createUser($this -> userCredentials2);\n $this -> createUser($this -> userCredentials3);\n\n $user = User::where('email',$this -> userCredentials)->first();\n $token = JWTAuth::fromUser($user);\n JWTAuth::setToken($token);\n\n // Search for users that exists\n $this -> call('GET','api/classes/admins/search',['string' => $this -> userCredentials[\"email\"]]);\n $this -> seeJson([\n 'email' => $this ->userCredentials[\"email\"]\n ]);\n $this -> dontSeeJson([\n 'email' => $this ->userCredentials2[\"email\"]\n ]);\n $this -> dontSeeJson([\n 'email' => $this ->userCredentials3[\"email\"]\n ]);\n\n // Search for user that does not exist\n $this -> call('GET','api/classes/admins/search',['string' => '[email protected]']);\n $this -> seeJson([]);\n }", "public function testGetNetworkMerakiAuthUsers()\n {\n }", "public function testGetNetworkMerakiAuthUser()\n {\n }", "public function test_lsvt_api_can_get_user_by_username()\n {\n $email = '[email protected]';\n\n $this->httpMock->append(new Response(200, ['Content-Type' => 'application/json'], json_encode($this->getUserEmailResponse($email))));\n\n $test = $this->apiClient->getUserByUsername($email);\n\n $this->assertCount(1, $this->curlHistory);\n $this->assertEquals('https://webservices.lightspeedvt.net/REST/v1//[email protected]', (string)$this->curlHistory[0]['request']->getUri());\n\n $this->assertIsArray($test);\n $this->assertEquals($email, $test['email']);\n }", "public function testUserLogin()\n {\n $response = $this->get('/login')\n ->assertStatus(200)\n ->assertSee('Login');\n }", "public function test_authenticated_users_can_see_detailed_customer_list()\n {\n $this->actingAs(factory(User::class)->create());\n\n // If the route customers/detailedlist can be visited(i.e get), assert \"true\"\n $response = $this->get('/customers/detailedlist')->assertOk();\n\n }", "public function testNoAuth() : void\n {\n $response = $this->get(action('HomeController@index'));\n\n $response->assertStatus(200);\n }", "public function testThatGetUserRequestIsFormattedProperly()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->get( '__test_user_id__' );\n\n $this->assertEquals( 'GET', $api->getHistoryMethod() );\n $this->assertEquals( 'https://api.test.local/api/v2/users/__test_user_id__', $api->getHistoryUrl() );\n\n $headers = $api->getHistoryHeaders();\n $this->assertEquals( 'Bearer __api_token__', $headers['Authorization'][0] );\n $this->assertEquals( self::$expectedTelemetry, $headers['Auth0-Client'][0] );\n }", "public function testGetProfileOtherUserSupporter()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/tony-stark\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Tony Stark', $response->body->data->user->name);\r\n\r\n $this->assertEquals(1, $response->body->data->relationships->isSupportee);\r\n\r\n }", "public function test_can_view_profile_of_any_user()\n {\n // When i access his profile\n // Then i can see his name\n $user = create(User::class);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeText($user->name);\n }", "public function test_you_have_to_be_authenticated()\n {\n $this->json('get' , 'api/cart')->assertStatus(401);\n\n }", "public function testItReturnsAUserByUserId()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users/{$user1->id}\")\n ->assertStatus(200)\n ->assertJson([\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n ]);\n }", "public function index_get()\n {\n $response = $this->UserM->all_user();\n $this->response($response);\n }", "public function testShowUser()\n {\n \t$user = factory(User::class)->create()''\n \t$response = $this->actingAs($user)->withSession(['Foo' => 'bar'])->get('/memes');\n \t$response->assertStatus(200);\n \n }", "public function testGetRequest()\n {\n $admin = $this->getAdminUser();\n $user = factory(\\App\\User::class)->create();\n $grade = factory(\\App\\Grade::class)->create();\n $userGrade = UserGrade::create([\n 'user_id' => $user->id,\n 'grade_id' => $grade->id\n ]);\n $response = $this->actingAs($user)->call('GET', \"/api/user/{$user->id}/grade\");\n $this->assertEquals(200, $response->status());\n }", "public function getAuthenticated($user) { \r\n return $this->makeRequest('get', \"/user\");\r\n }", "public function testSearchUser()\n {\n echo \"\\nTesting user search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users?search=Vicky\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/users?search=Vicky\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function user_get($id=0)\n\t{\n\n\t\t\t$data=$this->um->getData('users',$id);\n\t\t\tif (!empty($data)) {\n\t\t\t\t\n\t\t\t$this->response($data,RestController::HTTP_OK);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->response(['status'=>false,'message'=>'no data found'],RestController::HTTP_NOT_FOUND);\n\t\t\t}\n\t}", "public function testGetUserTransactions() {\n $user = User::whereEmail('[email protected]')->first();\n $token = JWTAuth::fromUser($user);\n \n $response = $this->withHeaders(['Authorization' => \"Bearer $token\"])->get(route('api.transaction.user'));\n\n $response->assertStatus(200);\n }", "public function testGetListActionWithoutToken()\n {\n // Create an un-authenticated client\n $client = static::createClient();\n // Test the route\n $client->request('GET', '/api/products');\n // Check the response\n $this->assertSame(Response::HTTP_UNAUTHORIZED, $client->getResponse()->getStatusCode());\n }", "public function testOnlyLoggedInUsersServersAreReturned()\n {\n /** @var \\Pterodactyl\\Models\\User[] $users */\n $users = factory(User::class)->times(3)->create();\n\n /** @var \\Pterodactyl\\Models\\Server[] $servers */\n $servers = [\n $this->createServerModel(['user_id' => $users[0]->id]),\n $this->createServerModel(['user_id' => $users[1]->id]),\n $this->createServerModel(['user_id' => $users[2]->id]),\n ];\n\n $response = $this->actingAs($users[0])->getJson('/api/client');\n\n $response->assertOk();\n $response->assertJsonPath('object', 'list');\n $response->assertJsonPath('data.0.object', Server::RESOURCE_NAME);\n $response->assertJsonPath('data.0.attributes.identifier', $servers[0]->uuidShort);\n $response->assertJsonPath('data.0.attributes.server_owner', true);\n $response->assertJsonPath('meta.pagination.total', 1);\n $response->assertJsonPath('meta.pagination.per_page', config('pterodactyl.paginate.frontend.servers'));\n }", "public function test_if_users_list_loads_with_data()\n {\n factory(User::class)->create([\n 'name'=>'Joel' \n ]);\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Joel'); \n }", "public function testUsersCanGetDashboardData()\n {\n $user = factory(User::class)->create();\n\n $account = factory(Account::class)->create(['user_id' => $user->id]);\n\n factory(Transaction::class, 4)->create(['account_id' => $account->id]);\n\n $this->actingAs($user, 'users')->get('/api/dashboard')->assertJsonStructure([\n 'status',\n 'transactions',\n 'accounts',\n 'balance',\n 'recent_transactions'\n ])->assertStatus(200);\n }", "public function helloworld_get() {\n $users = [\n ['id' => 0, 'name' => 'John', 'email' => '[email protected]'],\n ['id' => 1, 'name' => 'Jim', 'email' => '[email protected]'],\n ];\n\n\t\t// Set the response and exit\n\t\t$this->response( $users, 200 );\n\t}", "public function testGetSingleUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.edit', $response->content->view);\n\t}", "public function testAuthenticationsInweboIdGet()\n {\n }", "public function testUserWithAccesToResource()\n {\n $this->logged();\n $this->visit('/resource')\n ->seePageIs('/resource');\n }", "public function get($user) { \r\n return $this->makeRequest('get', \"/users/{$user}\");\r\n }", "public function testShowUnauthicatedAccess(): void { }", "public function index()\n {\n return $this->sendResponse(User::where('id', '!=', '1')->get());\n }" ]
[ "0.73905694", "0.7291999", "0.7228858", "0.7228108", "0.69783807", "0.6955865", "0.6943423", "0.69301015", "0.68712085", "0.68689054", "0.6837579", "0.6836188", "0.67942494", "0.67812806", "0.67724943", "0.67131424", "0.6707258", "0.67035097", "0.6684727", "0.6673713", "0.6671661", "0.66683394", "0.6660784", "0.66412693", "0.664036", "0.66283244", "0.6607075", "0.65929675", "0.6587093", "0.6581188", "0.65747267", "0.6564242", "0.6562636", "0.6553442", "0.654568", "0.65411085", "0.6537825", "0.65271556", "0.6524818", "0.6522077", "0.65056074", "0.65008146", "0.6493559", "0.64907545", "0.6488162", "0.64881104", "0.64767146", "0.64627403", "0.6457065", "0.64545494", "0.6445793", "0.6411847", "0.64061147", "0.6405725", "0.6402084", "0.6385791", "0.63724136", "0.6367669", "0.6365166", "0.63588655", "0.63511056", "0.6349071", "0.6341427", "0.6341275", "0.63353026", "0.63320243", "0.6331735", "0.6331143", "0.63289726", "0.6300666", "0.62992245", "0.62962013", "0.6280372", "0.62791437", "0.6275249", "0.6254048", "0.6253858", "0.62512666", "0.6249672", "0.62430644", "0.62392235", "0.62376386", "0.6236274", "0.6235793", "0.62344706", "0.6234324", "0.6232803", "0.62291604", "0.6228565", "0.6223035", "0.6215498", "0.6212677", "0.61977065", "0.6182558", "0.61785936", "0.61644745", "0.61625755", "0.6160581", "0.61594546", "0.6156238" ]
0.73100895
1
Test Request GET (orchestra)/users
public function testGetUsersPage() { $this->be($this->user); $response = $this->call('orchestra::users@index'); $this->assertInstanceOf('Laravel\Response', $response); $this->assertEquals(200, $response->foundation->getStatusCode()); $this->assertEquals('orchestra::users.index', $response->content->view); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUserApiReturnsUsers()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $users = factory(User::class, 2)->create();\n\n // $this->json('GET', 'api/v1/users')\n // ->seeJsonStructure([\n // '*' => [\n // 'northstar_id', 'created_at', 'updated_at', 'role',\n // ]\n // ]);\n }", "public function testGetUser()\n {\n $response = $this->get('getuser');\n\n $response->assertStatus(200);\n }", "public function testGetUserAll()\n {\n $response = $this->request()->json('GET','/api/users');\n $response->assertStatus(200);\n }", "public function testGetUser()\n {\n $headers = $this->authenticate();\n $response = $this->json('GET', '/api/user', [], $headers);\n $response->assertStatus(200);\n }", "public function testListUsers()\n {\n echo \"\\nTesting user listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/users\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function testListUsersSuccess()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"users\": \"user\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->get('api/user/list-users', $this->headers)\n ->assertStatus(200)\n ->assertJson(['users' => 'user']);\n\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "function loadUsersDetail()\n {\n $this->get('/usuarios/5')\n ->assertStatus(200)\n ->assertSee('Mostrando detalle del usuario: 5');\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 }", "public function testUserIndex()\n {\n $user = factory('App\\User')->create();\n\n $this->get('/api/v1/users');\n\n $username = json_decode($this->response->getContent(), true)[0][\"username\"];\n\n $this->assertEquals(\n $user[\"username\"], $username);\n }", "public function testuserGet200()\n {\n $response = $this->runApp('GET', '//user/{id}');\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertContains('Success', (string)$response->getBody());\n }", "public function testShowUser()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/1');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n \"data\" => [\n \"id\",\n \"employee_code\",\n \"name\",\n \"email\",\n \"team\",\n \"role\",\n \"total_borrowed\",\n \"total_donated\"\n ]\n \n ])->assertStatus(Response::HTTP_OK);\n }", "public function testUserApiReturnsResponse()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $this->json('GET', 'api/v1/users')\n // ->assertResponseStatus('200');\n }", "function loadUsersListPage()\n {\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Listado de usuarios')\n ->assertSee('Javier')\n ->assertSee('Francisco');\n }", "public function testIndex()\n {\n $response = $this->getJson(route('users.index'), $this->headers);\n\n $response->assertStatus(200);\n }", "public function testCGetAction200()\n {\n self::$_client->request(Request::METHOD_GET, self::RUTA_API);\n $response = self::$_client->getResponse();\n self::assertTrue($response->isSuccessful());\n self::assertJson($response->getContent());\n $users = json_decode($response->getContent(), true);\n self::assertArrayHasKey('users', $users);\n }", "public function testGetApiUser()\n {\n $token = $this->getAuthToken();\n /* @var TestResponse $response */\n $this->json(\n 'GET',\n '/api/user',\n [],\n [\n 'Content-Type: application/x-www-form-urlencoded',\n 'Cache-Control: no-cache',\n 'Authorization' => 'Bearer ' . $token . '',\n ],\n 'Get current user'\n ) ->assertStatus(200)\n ->assertJsonStructure(\n [\n 'data' => [\n 'id',\n 'email',\n 'profile',\n 'privacySettings',\n ],\n 'channel',\n ]\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 test_if_users_list_loads_with_data()\n {\n factory(User::class)->create([\n 'name'=>'Joel' \n ]);\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Joel'); \n }", "public function test_lsvt_api_can_get_user_by_username()\n {\n $email = '[email protected]';\n\n $this->httpMock->append(new Response(200, ['Content-Type' => 'application/json'], json_encode($this->getUserEmailResponse($email))));\n\n $test = $this->apiClient->getUserByUsername($email);\n\n $this->assertCount(1, $this->curlHistory);\n $this->assertEquals('https://webservices.lightspeedvt.net/REST/v1//[email protected]', (string)$this->curlHistory[0]['request']->getUri());\n\n $this->assertIsArray($test);\n $this->assertEquals($email, $test['email']);\n }", "public function helloworld_get() {\n $users = [\n ['id' => 0, 'name' => 'John', 'email' => '[email protected]'],\n ['id' => 1, 'name' => 'Jim', 'email' => '[email protected]'],\n ];\n\n\t\t// Set the response and exit\n\t\t$this->response( $users, 200 );\n\t}", "public function testUserIndex()\n {\n $response = $this->actingAs($this->user())->get(route('task_statuses.index'));\n $response->assertOk();\n }", "public function index_get()\n\t {\t\n \t$users=$this->User_Model->get_users();\n // Check if the users data store contains users (in case the database result returns NULL)\n if ($users)\n {\n // Set the response and exit\n $this->response($users, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code\n }\n else\n {\n // Set the response and exit\n $this->response([\n 'status' => FALSE,\n 'message' => 'No users were found'\n ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n \n\t }", "public function testSeeSingleUserTest()\n {\n $user = \\App\\User::firstOrFail();\n $response = $this->get('/users/'.$user->id);\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function testGetInfoUser()\n {\n $id = 1;\n $this->json('GET', \"api/user/get-info/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"data\" => [\n \"created_at\",\n \"email\",\n \"name\",\n \"id\",\n \"org_id\",\n \"updated_at\"\n ]\n ]);\n }", "public function testUserMeGet()\n {\n }", "function users() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $query = \"select * from users;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n\n if ($r->num_rows > 0) {\n $result = array(); \n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200);\n } else {\n $this->response('',204);\n }\n }", "public function users_get()\n {\n // $users = [\n // ['id' => 0, 'name' => 'John', 'email' => '[email protected]'],\n // ['id' => 1, 'name' => 'Jim', 'email' => '[email protected]'],\n // ];\n\n $id = $this->get( 'id' );\n\n if ( $id === null )\n {\n $users = $this->user_model->get();\n // Check if the users data store contains users\n if ( $users )\n {\n // Set the response and exit\n $this->response( $users, 200 );\n }\n else\n {\n // Set the response and exit\n $this->response( [\n 'status' => false,\n 'message' => 'No users were found'\n ], 404 );\n }\n }\n else\n {\n $user = $this->user_model->users($id);\n if ($user)\n {\n $this->response( $user, 200 );\n }\n else\n {\n $this->response( [\n 'status' => false,\n 'message' => 'No such user found'\n ], 404 );\n }\n }\n }", "public function index_get()\n {\n $response = $this->UserM->all_user();\n $this->response($response);\n }", "public function user_route_api()\n {\n $this->withoutExceptionHandling();\n $response = $this->get('/api/test-user');\n\n $response->assertStatus(200);\n }", "public function test_it_returns_a_list_of_users()\n {\n User::insert([\n ['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook'],\n ['email' => '[email protected]', 'given_name' => 'Andy', 'family_name' => 'Hook'],\n ]);\n\n $response = $this->call('GET', '/users');\n\n $this->assertEquals(200, $response->status());\n $this->assertEquals(User::all()->toJson(), $response->getContent());\n }", "public function test_show_user_as_user()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function getUserAction()\n {\n //get input\n $params = $this->getUrlParams();\n\n $limit = (isset($params['limit']))?$params['limit']:null;\n $offset = (isset($params['offset']))?$params['offset']:null;\n\n //validate input\n //TODO: add validate here\n\n //get data in service\n $result = $this->userService->getUser($params, $limit, $offset);\n\n if (!$result['success']) {\n //process error\n return $this->responseError($result['message'], '/users');\n }\n\n // print_r(count($result['data'])); exit;\n\n //return data\n $encoder = $this->createEncoder($this->modelName, $this->schemaName);\n\n //get total\n $total = (isset($result['total']))?$result['total']:null;\n\n return $this->response($encoder, $result['data'], $limit, $offset, $total);\n\n \n }", "public function testGetOneUserInformation()\n {\n $response = $this->json('GET', $this->userEndpoint.'/prostoalex');\n\n // It should return a valid user json with all the basic attributes filled\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'created',\n 'id',\n 'karma',\n 'submitted',\n 'about',\n ])\n ->assertJsonFragment([\n 'id' => 'prostoalex'\n ]);\n }", "public function test_successful_fetch()\n {\n $token = $this->getUserCreatedToken();\n $headers = [\n 'Authorization' => \"Bearer $token\"\n ];\n\n $response = $this\n ->withHeaders($headers)\n ->json('GET', '/api/github-users', [\n 'logins' => [\n 'souinhua',\n 'taylorotwell',\n 'no_one_151asd@'\n ]\n ]);\n\n $response->assertSuccessful();\n }", "public function testSearchUser()\n {\n echo \"\\nTesting user search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users?search=Vicky\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/users?search=Vicky\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function usersActionGet(): object\n {\n // Sets webpage title\n $title = \"Users\";\n\n // Sets extended webpage title\n $titleExtended = \" | Eshop\";\n\n // Framework variables\n $response = $this->app->response;\n $session = $this->app->session;\n\n // Verifies if user is logged in\n if (!$session->get(\"loggedIn\")) {\n $response->redirect(\"eshop/login\");\n };\n\n // Calls getUsers method and stores data in $resultset\n $resultset = $this->admin->getUsers();\n\n // Data array\n $data = [\n \"title\" => $title,\n \"titleExtended\" => $titleExtended,\n \"resultset\" => $resultset\n ];\n\n // Includes admin header\n $this->app->page->add(\"content/header_admin\");\n\n // Adds route and sends data array to view\n $this->app->page->add(\"content/users\", $data);\n\n // Renders page\n return $this->app->page->render($data);\n }", "public function user_get($id=0)\n\t{\n\n\t\t\t$data=$this->um->getData('users',$id);\n\t\t\tif (!empty($data)) {\n\t\t\t\t\n\t\t\t$this->response($data,RestController::HTTP_OK);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->response(['status'=>false,'message'=>'no data found'],RestController::HTTP_NOT_FOUND);\n\t\t\t}\n\t}", "public function testUserListForAdmin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'data' => true,\n ]);\n }", "public function testSuccessWithNoUsersToList()\n {\n $response = $this->getJson($this->endpoint(), $this->authenticationHeaders())->assertStatus(200);\n\n // Check the basic api endpoint structure.\n $this->assertEndpointBaseStructure($response);\n }", "function users(){\n\t\t\tif($this->rest->getRequestMethod() != \"GET\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\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\t$user_data = $this->model->getUsers();\n\t\t\t\tif(count($user_data)>0) {\n\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t$response_array['message']='Total '.count($user_data).' record(s) found.';\n\t\t\t\t\t$response_array['total_record']= count($user_data);\n\t\t\t\t\t$response_array['data']=$user_data;\n\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t} else {\n\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t$response_array['message']='Record not found.';\n\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t$this->rest->response($response_array, 204);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\n\t\t}", "public function testItReturnsAUserByUserId()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users/{$user1->id}\")\n ->assertStatus(200)\n ->assertJson([\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n ]);\n }", "public function testThatGetUserRequestIsFormattedProperly()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->get( '__test_user_id__' );\n\n $this->assertEquals( 'GET', $api->getHistoryMethod() );\n $this->assertEquals( 'https://api.test.local/api/v2/users/__test_user_id__', $api->getHistoryUrl() );\n\n $headers = $api->getHistoryHeaders();\n $this->assertEquals( 'Bearer __api_token__', $headers['Authorization'][0] );\n $this->assertEquals( self::$expectedTelemetry, $headers['Auth0-Client'][0] );\n }", "public function users_get()\n\t{\n\t\t$users = [\n\t\t\t['id' => 0, 'name' => 'John', 'email' => '[email protected]'],\n\t\t\t['id' => 1, 'name' => 'Jim', 'email' => '[email protected]'],\n\t\t];\n\n\t\t$id = $this->get('id');\n\n\t\tif ($id === null) {\n\t\t\t// Check if the users data store contains users\n\t\t\tif ($users) {\n\t\t\t\t// Set the response and exit\n\t\t\t\t$this->response($users, 200);\n\t\t\t} else {\n\t\t\t\t// Set the response and exit\n\t\t\t\t$this->response([\n\t\t\t\t\t'status' => false,\n\t\t\t\t\t'message' => 'No users were found'\n\t\t\t\t], 404);\n\t\t\t}\n\t\t} else {\n\t\t\tif (array_key_exists($id, $users)) {\n\t\t\t\t$this->response($users[$id], 200);\n\t\t\t} else {\n\t\t\t\t$this->response([\n\t\t\t\t\t'status' => false,\n\t\t\t\t\t'message' => 'No such user found'\n\t\t\t\t], 404);\n\t\t\t}\n\t\t}\n\t}", "public function testApiIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/api/comptes');\n\n $response->assertStatus(200)\n ->assertJson([\n\n 'comptes' => true,\n \n ]);\n }", "public function testAdminUser()\n {\n //$user = Sentry::getUserProvider()->findByLogin('[email protected]');\n //$this->be($user);\n\n $response = $this->call('GET', 'admin/users');\n\n // Make sure we can't view the admin pages.\n $this->assertFalse($response->isNotFound());\n }", "public function testIndex(): void\r\n {\r\n $client = static::createClient();\r\n $userRepository = static::$container->get(UserDoctrineRepository::class);\r\n\r\n $testUser = $userRepository->getUserByEmail('[email protected]');\r\n \r\n // Symfony helper.\r\n $client->loginUser($testUser);\r\n\r\n $client->request('GET', '/admin');\r\n\r\n static::assertResponseIsSuccessful();\r\n }", "public function user_route()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testThatGetAllUsersRequestIsFormattedProperly()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->getAll();\n\n $this->assertEquals( 'GET', $api->getHistoryMethod() );\n $this->assertEquals( 'https://api.test.local/api/v2/users', $api->getHistoryUrl() );\n\n $headers = $api->getHistoryHeaders();\n $this->assertEquals( 'Bearer __api_token__', $headers['Authorization'][0] );\n $this->assertEquals( self::$expectedTelemetry, $headers['Auth0-Client'][0] );\n }", "public function testGetAccountsUsingGET()\n {\n }", "public function get($user) { \r\n return $this->makeRequest('get', \"/users/{$user}\");\r\n }", "public function testGetUserByUsernameAction200(array $user)\n {\n self::$_client->request(\n Request::METHOD_GET,\n self::RUTA_API . '/username/' . $user['username']\n );\n $response = self::$_client->getResponse();\n\n self::assertEquals(Response::HTTP_OK, $response->getStatusCode());\n self::assertJson((string) $response->getContent());\n $user_aux = json_decode((string) $response->getContent(), true);\n self::assertEquals($user, $user_aux['user']);\n }", "public function test_it_returns_a_single_user()\n {\n $user = User::create(['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook']);\n\n $response = $this->call('GET', '/users/1');\n\n $this->assertEquals(200, $response->status());\n $this->assertJsonStringEqualsJsonString($user->toJson(), $response->getContent());\n }", "public function test_can_view_profile_of_any_user()\n {\n // When i access his profile\n // Then i can see his name\n $user = create(User::class);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeText($user->name);\n }", "public function test_lsvt_api_returns_null_when_user_is_not_found()\n {\n $email = '[email protected]';\n\n $this->httpMock->append(new Response(404, ['Content-Type' => 'text/html'], 'Not found.'));\n\n $test = $this->apiClient->getUserByUsername($email);\n\n $this->assertCount(1, $this->curlHistory);\n $this->assertEquals('https://webservices.lightspeedvt.net/REST/v1//[email protected]', (string)$this->curlHistory[0]['request']->getUri());\n\n $this->assertIsArray($test);\n $this->assertEquals($email, $test['email']);\n }", "public function index()\n {\n $query = User::all();\n\n //con resources api\n return UsersResource::collection($query)->additional([\n 'response' => true,\n 'message' => 'Los usuarios fueron listados.'\n ]);\n }", "public function testGetUsers()\n {\n }", "public function testGetSingleUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.edit', $response->content->view);\n\t}", "public function getUsersAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $users = $em->getRepository('UserBundle:User')->findAll();\n\n return $this->json(array(\n 'users' => $users,\n ));\n }", "public function testGetUserAction200(array $user)\n {\n self::$_client->request(\n Request::METHOD_GET,\n self::RUTA_API . '/' . $user['id']\n );\n $response = self::$_client->getResponse();\n\n self::assertEquals(Response::HTTP_OK, $response->getStatusCode());\n self::assertJson((string) $response->getContent());\n $user_aux = json_decode((string) $response->getContent(), true);\n self::assertEquals($user, $user_aux['user']);\n }", "function user_get()\n {\n $id = $this->get('id');\n if ($id == '') {\n $user = $this->db->get('auth_user')->result();\n } else {\n $this->db->where('id', $id);\n $user = $this->db->get('auth_user')->result();\n }\n $this->response($user, 200);\n }", "public function test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\n }", "public function userIndex(){\n MyLogger::info(\"Entering RestController userIndex()\");\n\n\n $users = $this->restService->getAllUsers();\n $result = NULL;\n if ($users) {\n $result = new DTO(\"200\", \"Users Found\", $users);\n } else {\n $result = new DTO(\"404\", \"No User Found\", NULL);\n }\n\n\n MyLogger::info(\"Exiting RestController userIndex()\");\n\n return json_encode($result);\n }", "public function testExample()\n {\n $response = $this->get('/api/users');\n $response->assertStatus(200)\n\t\t ->assertJsonStructure([\n\t\t \t\t[\n\t\t \t\t\t'id',\n\t\t \t\t\t'name',\n\t\t \t\t\t'last_name',\n\t\t \t\t\t'age',\n\t\t \t\t\t'phone',\n\t\t \t\t\t'photo',\n\t\t \t\t\t'admission_date'\n\t\t \t\t]\n\t\t ]);\n }", "public function index()\n {\n $this->authorize('view_users_content', User::class);\n $users = User::all();\n return response([ 'users' => USERResource::collection($users), 'message' => 'Retrieved successfully'], 200);\n \n }", "function user() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id']; \n if ($id > 0) {\n $query = \"select * from users where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error . __LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('',406);\n }\n }", "public function test_authorized_user_can_access_the_user_route()\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n\n $response = $this->get('/user');\n\n $response->assertStatus(200);\n $response->assertJson(['data' => ['name' => $user->name, 'email' => $user->email]]);\n }", "public function testShowUserWithoutAddresses()\n {\n $user = factory(User::class)->state('lecturer')->create();\n $response = $this->withHeaders([\n ])->getJson(\"/api/user/{$user->id}\", []);\n\n $response->assertStatus(200)\n ->assertJson([\"user\" => $user->toArray()]);\n }", "public function test()\n {\n $this->getAuthenticatedUser();\n return response()->json(['data' => ['status' => 'OK']], 200);\n }", "public function testListUserIdentities()\n {\n }", "public function testShowUser()\n {\n $user = User::find(1);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->visit('/users/' . $user->id)\n ->assertSee($user->id)\n ->assertSee($user->full_name)\n ->assertSee($user->email);\n });\n }", "public function testIndexUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@user'))\n ->assertSee('FIRST NAME');\n });\n }", "function GET()\n {\n $user = $this->router()->user();\n \n if ( ! $user->mayManageUsers())\n {\n throw new NotAuthorized();\n }\n \n $users = array();\n foreach(User::listAllIds() as $id)\n {\n $user = User::loadById($id);\n $users[] = array(\n \"email\" => $user->email(),\n \"id\" => $user->id(),\n \"name\" => $user->name(),\n \"privileges\" => $user->privileges()\n );\n }\n $this->setReturnVariable(\"data\", array(\"users\" => $users));\n }", "public function testGetUsertByID()\n {\n echo \"\\nTesting the user retrieval by ID...\";\n $response = $this->getUser(\"44225\");\n //echo $response;\n $result = json_decode($response);\n $user = $result->User;\n $this->assertTrue((!is_null($user)));\n \n }", "public function testFindUsers()\n {\n\n }", "public function index()\n {\n $user = User::all();\n return $this->sendResponse($user, 'Lista de usuarios', 200);\n }", "public function testAdminGetListadoAction()\n {\n $headers = $this->getHeaders('[email protected]');\n $client = static::createClient();\n $client->followRedirects();\n $client->request('GET', '/api/v1.0/usuarios', [], [], $headers);\n self::assertEquals(200, $client->getResponse()->getStatusCode());\n }", "public function httpUriGetUserInfoOnlyUser(UnitTester $I)\n {\n $I->wantToTest('Http\\Uri - getUserInfo() - only user');\n $query = 'https://[email protected]:8080/action?param=value#frag';\n $uri = new Uri($query);\n\n $expected = 'phalcon';\n $actual = $uri->getUserInfo();\n $I->assertEquals($expected, $actual);\n }", "public function testSearchAndFilterUser()\n {\n $user = factory(User::class)->create([\n 'email' => 'test@test',\n 'type' => 1\n ]);\n Passport::actingAs($user);\n\n $data = $this\n ->json(\n 'GET',\n 'api/users?term=test'\n )\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [],\n ])\n ->json('data');\n\n $this->assertArraySubset([\n 'email' => 'test@test'\n ], $data[0]);\n\n $data = $this\n ->json(\n 'GET',\n 'api/users?term=test&filter[type]=2'\n )\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [],\n ])\n ->json('data');\n\n $this->assertTrue(empty($data));\n }", "public function index()\n {\n $serv = new UserService();\n \n $userArr = $serv->getAllUsers();\n \n if (count($userArr) != 0)\n {\n $dto = new DTO(0, \"retrieved all users\", $userArr);\n }\n else\n {\n $dto = new DTO(1, \"no users found\", $userArr);\n }\n return json_encode($dto);\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function get_users()\n {\n $isFetched = $this->User_m->get_users_m();\n \n $res['status'] = $isFetched ? true : false;\n $res['message'] = $isFetched ? 'Users fetched.' : 'Users not found.';\n $res['count'] = $this->count_user();\n $res['data'] = $isFetched;\n \n http_response_code(200);\n\n echo json_encode($res);\n }", "public function index()\n {\n $user = User::all();\n\n return $this->sendResponse(UserResource::collection($user), 'User retrieved successfully.');\n }", "public function user_get()\n\t{\n\t\t$id = $this->get('id');\n\t\tif ($id == null) {\n\t\t\t$data = $this->User->showUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->User->showUser($id);\n\t\t}\n\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>true,\n\t\t\t\t'message'=>'Id tidak ada'\n\t\t\t],200);\n\t\t}\n\n\t}", "public function testGetNetworkMerakiAuthUsers()\n {\n }", "public function testGetAccountUsingGET()\n {\n }", "public function getUsers(){\n if($this->get_request_method() != \"GET\"){\n $this->response('',406);\n }\n $role = $_REQUEST[\"role\"];\n\n $query=\"SELECT * FROM `usuario` WHERE `rol` = \" . $role;\n\n $this->db->get($query);\n }", "public function index()\n {\n return response()->responseUtil(User::all(['id', 'name', 'realName', 'openId', 'nickName', 'avatarUrl', 'cellphone', 'officephone','regTime', 'email']));\n }", "public function testUserUserIDGet()\n {\n }", "public function userList() \n { \n $user = User::get(); \n return response([ 'data' => ToArray::collection($user), 'message' => 'Users list retrieved successfully'], $this->successStatus);\n }", "function getUsers(){\n }", "function getUsers(){\n }", "public function testAccess() {\n\n $this->drupalGet('udb3/api/1.0/user');\n $this->assertResponse('403');\n\n }", "public function testGetUsersPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function testUsersAreUsers() {\n $users = $this->users->users();\n $this->assertInstanceOf('NYPL\\Bibliophpile\\User', $users[0]);\n }", "public function testProjectProjectIDUsersGet()\n {\n }", "public function testGetRequest()\n {\n $admin = $this->getAdminUser();\n $user = factory(\\App\\User::class)->create();\n $grade = factory(\\App\\Grade::class)->create();\n $userGrade = UserGrade::create([\n 'user_id' => $user->id,\n 'grade_id' => $grade->id\n ]);\n $response = $this->actingAs($user)->call('GET', \"/api/user/{$user->id}/grade\");\n $this->assertEquals(200, $response->status());\n }", "public function getUsersList()\n {\n }" ]
[ "0.79156667", "0.7845561", "0.7726353", "0.7557474", "0.7535295", "0.7478783", "0.74445224", "0.7387469", "0.7384523", "0.7384521", "0.7324656", "0.718631", "0.7150329", "0.71394646", "0.7125", "0.7102773", "0.70122266", "0.7010986", "0.69692796", "0.6951646", "0.6905688", "0.68914175", "0.6890453", "0.6881716", "0.68748194", "0.6861491", "0.68425083", "0.6835537", "0.6811537", "0.68014467", "0.68003947", "0.6773221", "0.67685854", "0.6761931", "0.6737758", "0.67252815", "0.67195404", "0.6715586", "0.6712143", "0.6710229", "0.6700115", "0.66937244", "0.66795444", "0.66581076", "0.66516876", "0.6647408", "0.66446835", "0.66332334", "0.66328794", "0.66224927", "0.66153455", "0.66128135", "0.6608709", "0.66040134", "0.6601399", "0.6600683", "0.6599015", "0.6587924", "0.6584684", "0.65825707", "0.6573913", "0.6572596", "0.6566646", "0.65558827", "0.65527713", "0.6546391", "0.6539455", "0.6533394", "0.6532768", "0.65318376", "0.65283144", "0.6488987", "0.64850116", "0.64758486", "0.6471919", "0.6465684", "0.6465315", "0.646277", "0.6462767", "0.64509046", "0.64492464", "0.64492464", "0.64492464", "0.64488435", "0.6438918", "0.6433004", "0.643272", "0.64172316", "0.641441", "0.6412772", "0.640761", "0.63993937", "0.63946295", "0.63946295", "0.6382184", "0.6374551", "0.63697666", "0.6367519", "0.635778", "0.6355707" ]
0.75272846
5
Test Request GET (orchestra)/users/view/1 without auth
public function testGetSingleUserPageWithoutAuth() { $response = $this->call('orchestra::users@view', array(1)); $this->assertInstanceOf('Laravel\Redirect', $response); $this->assertEquals(302, $response->foundation->getStatusCode()); $this->assertEquals(handles('orchestra::login'), $response->foundation->headers->get('location')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetUsersPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\t\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.index', $response->content->view);\n\t}", "public function testGetUsersPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function testShowUser()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/1');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n \"data\" => [\n \"id\",\n \"employee_code\",\n \"name\",\n \"email\",\n \"team\",\n \"role\",\n \"total_borrowed\",\n \"total_donated\"\n ]\n \n ])->assertStatus(Response::HTTP_OK);\n }", "public function testGetUser()\n {\n $response = $this->get('getuser');\n\n $response->assertStatus(200);\n }", "public function testGetSingleUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.edit', $response->content->view);\n\t}", "public function testGetUser()\n {\n $headers = $this->authenticate();\n $response = $this->json('GET', '/api/user', [], $headers);\n $response->assertStatus(200);\n }", "public function testProfileView()\n {\n $this->loginReader();\n\n $response = $this->get('api/user/profile/1');\n\n $response->assertStatus(200);\n }", "public function test_users_edit_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function test_users_edit_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function test_authorized_user_can_access_the_user_route()\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n\n $response = $this->get('/user');\n\n $response->assertStatus(200);\n $response->assertJson(['data' => ['name' => $user->name, 'email' => $user->email]]);\n }", "function loadUsersDetail()\n {\n $this->get('/usuarios/5')\n ->assertStatus(200)\n ->assertSee('Mostrando detalle del usuario: 5');\n }", "public function testUserIndex()\n {\n $response = $this->actingAs($this->user())->get(route('task_statuses.index'));\n $response->assertOk();\n }", "public function test_users_create_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function test_can_view_profile_of_any_user()\n {\n // When i access his profile\n // Then i can see his name\n $user = create(User::class);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeText($user->name);\n }", "public function test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\n }", "public function testIndex()\n {\n $response = $this->getJson(route('users.index'), $this->headers);\n\n $response->assertStatus(200);\n }", "public function testShowUser()\n {\n \t$user = factory(User::class)->create()''\n \t$response = $this->actingAs($user)->withSession(['Foo' => 'bar'])->get('/memes');\n \t$response->assertStatus(200);\n \n }", "public function testAccess() {\n\n $this->drupalGet('udb3/api/1.0/user');\n $this->assertResponse('403');\n\n }", "public function user_route()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testSeeSingleUserTest()\n {\n $user = \\App\\User::firstOrFail();\n $response = $this->get('/users/'.$user->id);\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function test_users_create_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function test_unauthorized_user_cannot_access_the_user_route()\n {\n $response = $this->getJson('/user');\n\n $response->assertStatus(401);\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 testUserIndex()\n {\n $user = factory('App\\User')->create();\n\n $this->get('/api/v1/users');\n\n $username = json_decode($this->response->getContent(), true)[0][\"username\"];\n\n $this->assertEquals(\n $user[\"username\"], $username);\n }", "public function testuserGet200()\n {\n $response = $this->runApp('GET', '//user/{id}');\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertContains('Success', (string)$response->getBody());\n }", "public function test_authenticated_users_can_see_detailed_customer_list()\n {\n $this->actingAs(factory(User::class)->create());\n\n // If the route customers/detailedlist can be visited(i.e get), assert \"true\"\n $response = $this->get('/customers/detailedlist')->assertOk();\n\n }", "public function test_login_user_login_view()\n {\n $response = $this->get(route('login'));\n\n $response->assertSuccessful();\n\n $response->assertViewIs('auth.login');\n }", "public function testShowUserWithoutAddresses()\n {\n $user = factory(User::class)->state('lecturer')->create();\n $response = $this->withHeaders([\n ])->getJson(\"/api/user/{$user->id}\", []);\n\n $response->assertStatus(200)\n ->assertJson([\"user\" => $user->toArray()]);\n }", "public function test_show_user_as_user()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function testShowUser()\n {\n $user = User::find(1);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->visit('/users/' . $user->id)\n ->assertSee($user->id)\n ->assertSee($user->full_name)\n ->assertSee($user->email);\n });\n }", "public function user_route_api()\n {\n $this->withoutExceptionHandling();\n $response = $this->get('/api/test-user');\n\n $response->assertStatus(200);\n }", "public function testLeaseRequestViewNoAuthencation()\n {\n $this->get(route('lease.request'))->assertStatus(200);\n }", "public function testGetUserAll()\n {\n $response = $this->request()->json('GET','/api/users');\n $response->assertStatus(200);\n }", "public function testIndex(): void\r\n {\r\n $client = static::createClient();\r\n $userRepository = static::$container->get(UserDoctrineRepository::class);\r\n\r\n $testUser = $userRepository->getUserByEmail('[email protected]');\r\n \r\n // Symfony helper.\r\n $client->loginUser($testUser);\r\n\r\n $client->request('GET', '/admin');\r\n\r\n static::assertResponseIsSuccessful();\r\n }", "public function testShowUnauthicatedAccess(): void { }", "public function test_users_edit_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function testApiIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/api/comptes');\n\n $response->assertStatus(200)\n ->assertJson([\n\n 'comptes' => true,\n \n ]);\n }", "public function testIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/admin/comptes');\n\n $response->assertStatus(200)\n ->assertViewIs('layouts.admin');\n }", "public function testEndPoint()\n {\n\n $user = Auth::loginUsingId(1);\n\n// $response = $this->actingAs($user)\n// ->get('dashboard/orders/create');\n $response = $this->get('dashboard/orders/create');\n\n $response->assertStatus(200);\n }", "public function test_show_user_as_unauthorized_user()\n {\n $user = User::factory()->create();\n $user2 = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user2->id]));\n\n $response->assertStatus(403);\n }", "public function testUserMeGet()\n {\n }", "public function test()\n {\n $this->getAuthenticatedUser();\n return response()->json(['data' => ['status' => 'OK']], 200);\n }", "public function testRouteShowDetailUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(1)\n ->visit('/users')\n ->click('.table tbody tr:nth-child(1) td:nth-child(7) a:nth-child(1)')\n ->assertPathIs('/users/1')\n ->assertSee('DETAIL USER')\n ->assertSee('User Information');\n });\n }", "public function test_users_edit_unauthenticated_redirects_to_login(){\n $response = $this->get(route('users.edit', ['user'=> 5])); \n $response->assertStatus(302);\n $response->assertRedirect(route('login'));\n }", "public function testShowUserFail()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/2');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n ]);\n $response->assertJson([\n \"meta\" => [\n \"code\" => Response::HTTP_NOT_FOUND\n ]\n ]);\n }", "public function test_users_create_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testUserApiReturnsUsers()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $users = factory(User::class, 2)->create();\n\n // $this->json('GET', 'api/v1/users')\n // ->seeJsonStructure([\n // '*' => [\n // 'northstar_id', 'created_at', 'updated_at', 'role',\n // ]\n // ]);\n }", "public function test_only_logged_in_users_can_see_detailed_customer_list()\n {\n // the login page, assert \"true\"\n $response = $this->get('/customers/detailedlist')->assertRedirect('/login');\n\n }", "public function testUserWithAccesToResource()\n {\n $this->logged();\n $this->visit('/resource')\n ->seePageIs('/resource');\n }", "public function testIndexRoutedUser(): void\n {\n // given\n $expectedStatusCode = 302;\n $user = $this->createUser([User::ROLE_USER]);\n $this->logIn($user);\n\n // when\n $this->httpClient->request('GET', '/tag');\n $resultStatusCode = $this->httpClient->getResponse()->getStatusCode();\n\n // then\n $this->assertEquals($expectedStatusCode, $resultStatusCode);\n }", "public function test_teams_show_authenticated_user_returns_403(){\n $this->signInUser();\n $response = $this->get(route('teams.show', ['team' => 1]));\n $response->assertStatus(403); }", "public function testAdminCanSeeUserIndex()\n {\n $this->actingAs($this->admin_user);\n\n $response = $this->get(route('admin.users.index'));\n\n $response->assertStatus(200);\n }", "public function testStartViewLoggedIn()\n {\n auth()->attempt(['name' => 'admin', 'password' => 'admin']);\n\n $response = $this->get('/');\n\n $response->assertSee('Hello');\n }", "public function testAdminUser()\n {\n //$user = Sentry::getUserProvider()->findByLogin('[email protected]');\n //$this->be($user);\n\n $response = $this->call('GET', 'admin/users');\n\n // Make sure we can't view the admin pages.\n $this->assertFalse($response->isNotFound());\n }", "public function testLoginView()\n {\n $response = $this->get('/login');\n\n $response->assertStatus(200);\n $response->assertSee('Log in to play');\n }", "public function test_unauthorized_fetch()\n {\n $headers = [\n 'Authorization' => \"Bearer None\"\n ];\n\n $response = $this\n ->withHeaders($headers)\n ->json('GET', '/api/github-users', [\n 'logins' => [\n 'souinhua',\n 'taylorotwell',\n 'no_one_151asd@'\n ]\n ]);\n\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n }", "public function testUsuarioPodeVerTelaDeLogin()\n {\n $response = $this->get('/login');\n $response->assertSuccessful();\n $response->assertViewIs('auth.login');\n }", "public function testUserWithoutAccesToResource()\n {\n $this->unlogged();\n $this->visit('/resource')\n ->seePageIs(route('auth.getLogin'))\n ->see('Login');\n }", "public function test_users_edit_leader_returns_403(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 2]));\n $response->assertStatus(403);\n }", "public function testIndexUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@user'))\n ->assertSee('FIRST NAME');\n });\n }", "public function testGetOneUserInformation()\n {\n $response = $this->json('GET', $this->userEndpoint.'/prostoalex');\n\n // It should return a valid user json with all the basic attributes filled\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'created',\n 'id',\n 'karma',\n 'submitted',\n 'about',\n ])\n ->assertJsonFragment([\n 'id' => 'prostoalex'\n ]);\n }", "public function testGetApiUser()\n {\n $token = $this->getAuthToken();\n /* @var TestResponse $response */\n $this->json(\n 'GET',\n '/api/user',\n [],\n [\n 'Content-Type: application/x-www-form-urlencoded',\n 'Cache-Control: no-cache',\n 'Authorization' => 'Bearer ' . $token . '',\n ],\n 'Get current user'\n ) ->assertStatus(200)\n ->assertJsonStructure(\n [\n 'data' => [\n 'id',\n 'email',\n 'profile',\n 'privacySettings',\n ],\n 'channel',\n ]\n );\n }", "public function testClientsPageAsLoggedInUser() {\n\n // Generate user\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/clients')\n ->see($user->email);\n\n }", "public function index()\n {\n $user = $this->user();\n\n// if ($user == null) {\n// throw new UnauthorizedHttpException(\"Bearer\", \"You are not authorized to see all users.\", null, 0x00C00301);\n// }\n\n if (!policy($user)->canSeeAll($user)) {\n throw new HttpException(403, \"You are not authorized to see all users.\", null, [], 0x00C00302);\n }\n\n $users = $this->repository->all();\n\n return $this->response->collection($users, new UserTransformer, [\"key\" => \"users\"]);\n }", "public function testGetRequest()\n {\n $admin = $this->getAdminUser();\n $user = factory(\\App\\User::class)->create();\n $grade = factory(\\App\\Grade::class)->create();\n $userGrade = UserGrade::create([\n 'user_id' => $user->id,\n 'grade_id' => $grade->id\n ]);\n $response = $this->actingAs($user)->call('GET', \"/api/user/{$user->id}/grade\");\n $this->assertEquals(200, $response->status());\n }", "public function testUserLogin()\n {\n $response = $this->get('/login')\n ->assertStatus(200)\n ->assertSee('Login');\n }", "public function testTokenViewPage()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.show', [$this->token->id_hash]));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.show');\n }", "public function httpUriGetUserInfoOnlyUser(UnitTester $I)\n {\n $I->wantToTest('Http\\Uri - getUserInfo() - only user');\n $query = 'https://[email protected]:8080/action?param=value#frag';\n $uri = new Uri($query);\n\n $expected = 'phalcon';\n $actual = $uri->getUserInfo();\n $I->assertEquals($expected, $actual);\n }", "public function testIndexRoute()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs($user)\n ->seeIsAuthenticatedAs($user)\n ->get(route('events.index'))\n ->assertStatus(200);\n }", "public function testItReturnsAUserByUserId()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users/{$user1->id}\")\n ->assertStatus(200)\n ->assertJson([\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n ]);\n }", "public function test_index_returns_view()\n {\n $controller = new UsersController();\n $view = $controller->index();\n $this->assertEquals('admin.users.index', $view->getName());\n $this->assertArrayHasKey('users', $view->getData());\n }", "public function testUsersCanGetDashboardData()\n {\n $user = factory(User::class)->create();\n\n $account = factory(Account::class)->create(['user_id' => $user->id]);\n\n factory(Transaction::class, 4)->create(['account_id' => $account->id]);\n\n $this->actingAs($user, 'users')->get('/api/dashboard')->assertJsonStructure([\n 'status',\n 'transactions',\n 'accounts',\n 'balance',\n 'recent_transactions'\n ])->assertStatus(200);\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 }", "function loadUsersListPage()\n {\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Listado de usuarios')\n ->assertSee('Javier')\n ->assertSee('Francisco');\n }", "public function testGetInfoUser()\n {\n $id = 1;\n $this->json('GET', \"api/user/get-info/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"data\" => [\n \"created_at\",\n \"email\",\n \"name\",\n \"id\",\n \"org_id\",\n \"updated_at\"\n ]\n ]);\n }", "public function testGetProfileOtherUserNoRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/steve-rogers\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Steve Rogers', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->relationships->isFriend);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function test_it_must_be_authenticated_user()\n {\n $this->json('post' , 'api/orders')->assertStatus(401);\n }", "public function testSuccessWithNoUsersToList()\n {\n $response = $this->getJson($this->endpoint(), $this->authenticationHeaders())->assertStatus(200);\n\n // Check the basic api endpoint structure.\n $this->assertEndpointBaseStructure($response);\n }", "public function testFilters_noResults()\n {\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(2));\n\n $users->Auth\n ->staticExpects($this->at(2))\n ->method('user')\n ->with('id')\n ->will($this->returnValue(2));\n $this->testAction(\"/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o\");\n $this->assertEquals($this->vars['users'], array());\n }", "public function test_teams_index_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('teams.index'));\n $response->assertStatus(200);\n $response->assertViewIs('views.teams.index');\n }", "public function testIndexMethod()\n {\n $this->authentication();\n $this->get(route('members.index'));\n $this->seeStatusCode(200);\n }", "public function testGetProfileUserNotExist()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/thor\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n //AppBundle:User object not found. (404 Not Found)\r\n $this->assertTrue($response->code === 404);\r\n\r\n }", "public function test_lsvt_api_returns_null_when_user_is_not_found()\n {\n $email = '[email protected]';\n\n $this->httpMock->append(new Response(404, ['Content-Type' => 'text/html'], 'Not found.'));\n\n $test = $this->apiClient->getUserByUsername($email);\n\n $this->assertCount(1, $this->curlHistory);\n $this->assertEquals('https://webservices.lightspeedvt.net/REST/v1//[email protected]', (string)$this->curlHistory[0]['request']->getUri());\n\n $this->assertIsArray($test);\n $this->assertEquals($email, $test['email']);\n }", "public function testCGetAction200()\n {\n self::$_client->request(Request::METHOD_GET, self::RUTA_API);\n $response = self::$_client->getResponse();\n self::assertTrue($response->isSuccessful());\n self::assertJson($response->getContent());\n $users = json_decode($response->getContent(), true);\n self::assertArrayHasKey('users', $users);\n }", "public function test_show_user_as_admin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($this->admin)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function test_teams_show_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('teams.show', ['team' => 1]));\n $response->assertStatus(200);\n $response->assertViewIs('views.teams.show');\n }", "public function test_teams_index_authenticated_user_returns_403(){\n $this->signInUser();\n $response = $this->get(route('teams.index'));\n $response->assertStatus(403); }", "public function testUsersNoLogin()\n {\n $response = $this->get('/users');\n\n $response->assertStatus(302);\n }", "public function testListUsers()\n {\n echo \"\\nTesting user listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/users\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function testAccessWithUser(): void {\n $this->logInUser();\n $this->getClient()->request(\"GET\", \"/sadmin/contact\");\n\n $this->assertEquals(403, $this->getClient()->getResponse()->getStatusCode(), \"The status code expected is not ok.\");\n }", "public function testGetNetworkMerakiAuthUser()\n {\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function testGetAccountsUsingGET()\n {\n }", "public function index()\n {\n $this->authorize('view_users_content', User::class);\n $users = User::all();\n return response([ 'users' => USERResource::collection($users), 'message' => 'Retrieved successfully'], 200);\n \n }", "public function testLoginActionWithExistingUser()\n {\n $data = [\n '_username' => 'user1',\n '_password' => 'user1',\n ];\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/login');\n $form = $crawler->filter('form[action$=\"login_check\"].form-horizontal button[type=\"submit\"]')->form();\n $crawler = $client->submit($form, $data);\n // Authentified\n $security = $client->getContainer()->get('security.context');\n $this->assertTrue($security->isGranted('ROLE_USER'));\n }", "public function testGetProfileOtherUserSupporter()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/tony-stark\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Tony Stark', $response->body->data->user->name);\r\n\r\n $this->assertEquals(1, $response->body->data->relationships->isSupportee);\r\n\r\n }", "public function testCanShowLogin()\n {\n $response = $this->get('/login');\n\n $response->assertStatus(200);\n }", "public function test_AllRoutesAsUserAvailable()\n {\n //fill DB with demo data to act like a User\n $this->artisan('demo:createDemoClient');\n\n //session\n Session::start();\n $token = session('_token');\n $credentials = array(\n 'email' => '[email protected]',\n 'password' => 'user',\n '_token' => $token\n );\n\n //act as User\n $user = User::where('name', '=', \"User\")->first();\n\n //Login as User\n //GET|HEAD | login\n $this->get('/login')->assertStatus(200)\n ->assertViewIs('auth.login')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | login\n $this->followingRedirects()->post('/login', $credentials)->assertStatus(200)\n ->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //Login: redirect to home\n $this->actingAs($user)->followingRedirects()->get('/login')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | /\n $this->actingAs($user)->followingRedirects()->get('/')\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->post('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->put('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->patch('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->delete('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n $this->actingAs($user)->followingRedirects()->options('/', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | auth/success\n $this->actingAs($user)->followingRedirects()->get('/auth/success')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | captcha/api/{config?}\n $this->actingAs($user)->followingRedirects()->get('/captcha/api/')\n ->assertStatus(200);\n\n //GET|HEAD | captcha/{config?}\n $this->actingAs($user)->followingRedirects()->get('/captcha')\n ->assertStatus(200);\n\n //GET|HEAD | changeclient/{client}\n $this->actingAs($user)->followingRedirects()->get('/changeclient/'.($user->currentclient_id))->assertStatus(200);\n $this->actingAs($user)->followingRedirects()->get('/changeclient/'.($user->currentclient_id+1))->assertStatus(500);\n\n //POST | client\n $this->actingAs($user)->followingRedirects()->post('/client', ['_token' => $token])->assertStatus(402); //not allowed in demo mode\n\n //GET|HEAD | client\n $this->actingAs($user)->followingRedirects()->get('/client')->assertStatus(402); //only as superadmin\n\n //GET|HEAD | client/create\n $this->actingAs($user)->followingRedirects()->get('/client/create')->assertStatus(402); //only as superadmin\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/module\n $this->actingAs($user)->followingRedirects()->get('/client/module')->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->post('/client/module', ['_token' => $token,])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->put('/client/module', ['_token' => $token])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->patch('/client/module', ['_token' => $token])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->delete('/client/module', ['_token' => $token])->assertStatus(402); //only as superadmin\n $this->actingAs($user)->followingRedirects()->options('/client/module')->assertStatus(402); //only as superadmin\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/{clientid}/apply\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/apply')->assertStatus(302);\n $this->actingAs($user)->post('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->put('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id.'/apply', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->options('/client/'.$user->currentclient_id.'/apply')->assertStatus(302);\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/{clientid}/apply/revert\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/apply/revert')->assertStatus(302);\n $this->actingAs($user)->post('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->put('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id.'/apply/revert', ['_token' => $token])->assertStatus(302);\n $this->actingAs($user)->options('/client/'.$user->currentclient_id.'/apply/revert')->assertStatus(302);\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | client/{clientid}/removeuser/{userid}\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/removeuser/'.$user->id)->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->post('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->put('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id.'/removeuser/'.$user->id, ['_token' => $token])->assertStatus(402); //only if admin of client and not in demo mode\n $this->actingAs($user)->options('/client/'.$user->currentclient_id.'/removeuser/'.$user->id)->assertStatus(402); //only if admin of client and not in demo mode\n\n //PUT|PATCH | client/{client}\n $this->actingAs($user)->put('/client/'.$user->currentclient_id, ['_token' => $token])->assertStatus(402); //only if admin of client or superadmin and not in demo mode\n $this->actingAs($user)->patch('/client/'.$user->currentclient_id, ['_token' => $token])->assertStatus(402); //only if admin of client or superadmin and not in demo mode\n\n //GET|HEAD | client/{client}\n $this->actingAs($user)->get('/client/'.$user->currentclient_id)->assertStatus(402); //only if admin of client or superadmin\n\n //DELETE | client/{client}\n $this->actingAs($user)->delete('/client/'.$user->currentclient_id, ['_token' => $token])->assertStatus(402); //only if superadmin and not in demo mode\n\n //GET|HEAD | client/{client}/edit\n $this->actingAs($user)->get('/client/'.$user->currentclient_id.'/edit')->assertStatus(402); //only if admin of client or superadmin\n\n //POST | client_user/admin\n $this->actingAs($user)->post('/client_user/admin', ['_token' => $token, 'client_id' => $user->currentclient_id, 'user_id' => $user->id])\n ->assertStatus(402); //only if admin of client or superadmin\n\n //POST | client_user/trainingeditor\n $this->actingAs($user)->post('/client_user/trainingeditor', ['_token' => $token, 'client_id' => $user->currentclient_id, 'user_id' => $user->id])\n ->assertStatus(402); //only if admin of client or superadmin\n\n //GET|HEAD | clientapply\n $this->actingAs($user)->get('/clientapply')\n ->assertStatus(200)->assertViewIs('client.apply')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | datenschutz\n $this->actingAs($user)->get('/datenschutz')\n ->assertStatus(200)->assertViewIs('legal.datenschutz')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | holiday\n $this->actingAs($user)->followingRedirects()->post('/holiday', ['_token' => $token, 'from' => Carbon::now(), 'to' => Carbon::now()->addDay()])\n ->assertStatus(200);\n\n //GET|HEAD | holiday\n $this->actingAs($user)->get('/holiday')\n ->assertStatus(200)->assertViewIs('holiday.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/create\n $this->actingAs($user)->get('/holiday/create')\n ->assertStatus(200)->assertViewIs('holiday.create')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/storeservice/{service}\n $this->actingAs($user)->followingRedirects()->get('/holiday/storeservice/'.Service::first()->id)\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/storetraining/{training}\n $this->actingAs($user)->followingRedirects()->get('/holiday/storetraining/'.Training::first()->id)\n ->assertStatus(200)->assertViewIs('training.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | holiday/{holiday}\n $this->actingAs($user)->get('/holiday/'.Holiday::first()->id)\n ->assertStatus(200);\n\n //PUT|PATCH | holiday/{holiday}\n $this->actingAs($user)->followingRedirects()->put('/holiday/'.Holiday::first()->id, ['_token' => $token])\n ->assertStatus(200);\n $this->actingAs($user)->followingRedirects()->patch('/holiday/'.Holiday::first()->id, ['_token' => $token])\n ->assertStatus(200);\n\n //GET|HEAD | holiday/{holiday}/edit\n $this->actingAs($user)->followingRedirects()->get('/holiday/'.Training::first()->id.'/edit')\n ->assertStatus(200)->assertViewIs('holiday.edit')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //DELETE | holiday/{holiday}\n $this->actingAs($user)->get('/holiday/'.Holiday::first()->id)\n ->assertStatus(200);\n\n //GET|HEAD | home\n $this->actingAs($user)->get('/home')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | impressum\n $this->actingAs($user)->get('/impressum')\n ->assertStatus(200)->assertViewIs('legal.impressum')\n ->assertSee('Impressum')->assertSee('Datenschutz')\n ->assertSee('Inhaltlich Verantwortlicher gem. ');\n\n //GET|HEAD | mailtest\n $this->actingAs($user)->followingRedirects()->get('/mailtest')\n ->assertStatus(200)->assertViewIs('email.serviceslist')\n ->assertSee('Stand')->assertSee('Uhr')->assertSee('Datum');\n\n //GET|HEAD | news\n $this->actingAs($user)->get('/news')\n ->assertStatus(200)->assertViewIs('news.index');\n\n //POST | news\n $this->actingAs($user)->post('/news', ['_token' => $token])->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/create\n $this->actingAs($user)->get('/news/create')->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/{news}\n $this->actingAs($user)->get('/news/'.News::first()->id)->assertStatus(200);\n\n //DELETE | news/{news}\n $this->actingAs($user)->delete('/news/'.News::first()->id, ['_token' => $token])->assertStatus(402); //only admin of client\n\n //PUT|PATCH | news/{news}\n $this->actingAs($user)->put('/news/'.News::first()->id, ['_token' => $token])->assertStatus(402); //only admin of client\n $this->actingAs($user)->patch('/news/'.News::first()->id, ['_token' => $token])->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/{news}/delete\n $this->actingAs($user)->get('/news/'.News::first()->id.'/delete')->assertStatus(402); //only admin of client\n\n //GET|HEAD | news/{news}/edit\n $this->actingAs($user)->get('/news/'.News::first()->id.'/edit')->assertStatus(402); //only admin of client\n\n //GET|HEAD | order\n $this->actingAs($user)->get('/order')\n ->assertStatus(200)->assertViewIs('order.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | order/create/{package}\n $this->actingAs($user)->get('/order/create/basic')\n ->assertStatus(200)->assertViewIs('order.order')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | order/{package}\n\n //POST | password/email\n $this->actingAs($user)->followingRedirects()->post('/password/email', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | password/reset\n $this->actingAs($user)->followingRedirects()->get('/password/reset')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | password/reset\n $this->actingAs($user)->followingRedirects()->post('/password/reset', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | password/reset/{token}\n\n //GET|HEAD | pdf\n $response = $this->actingAs($user)->get('/pdf');\n self::assertTrue($response->headers->get(\"content-type\") == \"application/pdf\");\n\n //GET|POST|HEAD | position/list_notAuthorized\n $this->actingAs($user)->get('/position/list_notAuthorized')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/list_notAuthorized', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/authorize\n $this->actingAs($user)->get('/position/1/authorize')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/authorize', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/deauthorize\n $this->actingAs($user)->get('/position/1/deauthorize')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/deauthorize', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/position_user\n $this->actingAs($user)->get('/position/1/position_user')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/position_user', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{id}/subscribe\n $this->actingAs($user)->get('/position/1/subscribe')->assertStatus(200);\n $this->actingAs($user)->post('/position/1/subscribe', ['_token' => $token])->assertStatus(200);\n\n //GET|POST|HEAD | position/{id}/unsubscribe\n $this->actingAs($user)->get('/position/1/unsubscribe')->assertStatus(200);\n $this->actingAs($user)->post('/position/1/unsubscribe', ['_token' => $token])->assertStatus(200);\n\n //GET|POST|HEAD | position/{positionid}/subscribe_user/{userid}\n $this->actingAs($user)->get('/position/1/subscribe_user/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/subscribe_user/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | position/{positionid}/unsubscribe_user/{userid}\n $this->actingAs($user)->get('/position/1/subscribe_user/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/position/1/subscribe_user/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //POST | qualification\n $this->actingAs($user)->post('/qualification', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | qualification\n $this->actingAs($user)->get('/qualification')->assertStatus(402);//only as admin\n\n //GET|HEAD | qualification/create\n $this->actingAs($user)->get('/qualification/create')->assertStatus(402);//only as admin\n\n //PUT|PATCH | qualification/{qualification}\n $this->actingAs($user)->put('/qualification/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //DELETE | qualification/{qualification}\n $this->actingAs($user)->delete('/qualification/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | qualification/{qualification}\n $this->actingAs($user)->get('/qualification/1')->assertStatus(402);//only as admin\n\n //GET|HEAD | qualification/{qualification}/edit\n $this->actingAs($user)->get('/qualification/1/edit')->assertStatus(402);//only as admin\n\n //POST | qualification_user/create\n $this->actingAs($user)->post('/qualification_user/create', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|POST|HEAD | qualification_user/delete/{user_id}/{qualification_id}\n $this->actingAs($user)->get('/qualification_user/delete/1/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/qualification_user/delete/1/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | register\n $this->actingAs($user)->followingRedirects()->get('/register')\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //POST | register\n $this->actingAs($user)->followingRedirects()->post('/register', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('home.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|POST|HEAD | sendServicePDF\n $this->actingAs($user)->get('/sendServicePDF')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/sendServicePDF', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | service\n $this->actingAs($user)->get('/service')\n ->assertStatus(200)->assertViewIs('service.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD\n $this->actingAs($user)->get('/servicehistory')->assertStatus(402); //only as admin\n //GET|HEAD\n $this->actingAs($user)->get('/service/finalize/1')->assertStatus(402); //only as admin\n\n //POST | service\n $this->actingAs($user)->post('/service', ['_token' => $token])->assertStatus(403); //only as admin\n\n //GET|HEAD | service/create\n $this->actingAs($user)->get('/service/create')->assertStatus(402);//only as admin\n\n //DELETE | service/{service}\n $this->actingAs($user)->delete('/service/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //PUT|PATCH | service/{service}\n $this->actingAs($user)->put('/service/1', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | service/{service}\n $this->actingAs($user)->get('/service/1')->assertStatus(402);//only as admin\n\n //GET|HEAD | service/{service}/delete\n $this->actingAs($user)->get('/service/1/delete')->assertStatus(402);//only as admin\n\n //GET|HEAD | service/{service}/edit\n $this->actingAs($user)->get('/service/1/edit')->assertStatus(402);//only as admin\n\n //GET|POST|HEAD | statistic\n $this->actingAs($user)->get('/statistic')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/statistic', ['_token' => $token])->assertStatus(402); //only as admin\n\n //GET|HEAD | superadmin/user\n $this->actingAs($user)->get('/superadmin/user')->assertStatus(402);//only as superadmin\n\n //POST | training\n $this->actingAs($user)->followingRedirects()->post('/training', ['_token' => $token])->assertStatus(402); //only as admin or trainingseditor\n\n //GET|HEAD | training\n $this->actingAs($user)->get('/training')\n ->assertStatus(200)->assertViewIs('training.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //GET|HEAD | training/create\n $this->actingAs($user)->get('/training/create')->assertStatus(402);//only as admin\n\n //GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS | training/training_user/{training_userid}/delete\n $training_user = Training_user::first();\n $this->actingAs($user)->followingRedirects()->get('/training/training_user/'.$training_user->id.'/delete')\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->post('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->put('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->patch('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n $this->actingAs($user)->followingRedirects()->delete('/training/training_user/'.$training_user->id.'/delete', ['_token' => $token])\n ->assertStatus(402);//only as admin\n\n //GET|HEAD | training/{training}\n $this->actingAs($user)->get('/training/1')->assertStatus(402);//only as admin or trainingeditor\n\n //PUT|PATCH | training/{training}\n $this->actingAs($user)->put('/training/1', ['_token' => $token])->assertStatus(402);//only as admin or trainingeditor\n\n //DELETE | training/{training}\n $this->actingAs($user)->delete('/training/1', ['_token' => $token])->assertStatus(402);//only as admin or trainingeditor\n\n //GET|HEAD | training/{training}/delete\n $this->actingAs($user)->get('/training/1/delete')->assertStatus(402);//only as admin or trainingeditor\n\n //GET|HEAD | training/{training}/edit\n $this->actingAs($user)->get('/training/1/edit')->assertStatus(402);//only as admin or trainingeditor\n\n //POST | user\n $this->actingAs($user)->post('/user', ['_token' => $token])->assertStatus(402);//not implemented\n\n //GET|HEAD | user\n $this->actingAs($user)->get('/user')->assertStatus(402);//only as admin\n\n //GET|POST|HEAD | user/approve/{id}\n $this->actingAs($user)->get('/user/approve/1')->assertStatus(402);//only as admin\n $this->actingAs($user)->post('/user/approve/1', ['_token' => $token])->assertStatus(402);//only as admin\n\n //GET|HEAD | user/create\n $this->actingAs($user)->get('/user/create')->assertStatus(402);//not implemented\n\n //PUT|PATCH | user/{user}\n //Not allowed in Demo Mode :(\n\n //GET|HEAD | user/{user}\n $this->actingAs($user)->get('/user/1')\n ->assertStatus(200)->assertViewIs('user.profile')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n\n //DELETE | user/{user}\n $this->actingAs($user)->delete('/user/1', ['_token' => $token])->assertStatus(402);//only as superadmin\n\n //GET|HEAD | user/{user}/edit\n $this->actingAs($user)->get('/user/1/edit')->assertStatus(402);//only as admin\n\n //GET|HEAD | userguide\n $response = $this->actingAs($user)->get('/userguide');\n self::assertTrue($response->headers->get(\"content-type\") == \"application/pdf\");\n\n //Calendar\n //GET|HEAD | calendar\n $this->actingAs($user)->followingRedirects()->get('/calendar')\n ->assertStatus(200)->assertViewIs('calendar.index')\n ->assertSee('Impressum')->assertSee('Datenschutz');\n //POST | Calendar\n $this->actingAs($user)->followingRedirects()->post('/calendar', ['_token' => $token])->assertStatus(200)->assertViewIs('calendar.index'); //only as admin or trainingseditor\n //GET | calendar/{calendar}\n $this->actingAs($user)->get('/calendar/1')->assertStatus(402); //only as admin or trainingseditor\n //PUT | calendar/{calendar}\n $this->actingAs($user)->put('/calendar/1', ['_token' => $token])->assertStatus(402); //only as admin or trainingseditor\n //DELETE | calendar/{calendar}\n $this->actingAs($user)->delete('/calendar/1', ['_token' => $token])->assertStatus(402); //only as admin or trainingseditor\n //GET | calendar/{calendar}\n $this->actingAs($user)->get('/calendar/1/edit')->assertStatus(402); //only as admin or trainingseditor\n //GET | calendar/{calendar}\n $this->actingAs($user)->get('/calendar/1/delete')->assertStatus(402); //only as admin or trainingseditor\n //GET|HEAD | alendar/create\n $this->actingAs($user)->get('/calendar/create')->assertStatus(402); //only as admin or trainingseditor\n\n //Survey\n //GET|HEAD survey\n $this->actingAs($user)->get('/survey')->assertStatus(402); //only if admin of client\n //POST survey\n $this->actingAs($user)->post('/survey', ['_token' => $token])->assertStatus(402); //only if admin of client\n //GET|HEAD survey/create\n $this->actingAs($user)->get('/survey/create')->assertStatus(402); //only if admin of client\n //GET|HEAD survey/postpone/{surveyid}\n $this->actingAs($user)->get('/survey/postpone/1')->assertRedirect()->assertCookieMissing('errormessage'); //redirect back on success\n //POST survey/vote/{surveyid}\n $this->actingAs($user)->post('/survey/vote/1', ['_token' => $token, 'value' => \"accept\"])->assertRedirect('/survey/1');\n //GET|HEAD survey/{survey} //set dateStart to yesterday to access a currently activ survey\n $survey = Survey::find(1);\n $survey->dateStart = Carbon::yesterday();\n $survey->save();\n $this->actingAs($user)->get('/survey/1')->assertOk();\n //PUT|PATCH survey/{survey}\n $this->actingAs($user)->put('/survey/1', ['_token' => $token])->assertStatus(402); //only if admin of client\n //DELETE survey/{survey}\n $this->actingAs($user)->delete('/survey/1', ['_token' => $token])->assertStatus(402); //only if admin of client\n //GET|HEAD survey/{survey}/edit\n $this->actingAs($user)->get('/survey/1/edit')->assertStatus(402); //only if admin of client\n\n //POST | logout\n $this->actingAs($user)->followingRedirects()->post('/logout', ['_token' => $token])\n ->assertStatus(200)->assertViewIs('auth.login');\n\n //GET|HEAD | logout\n $this->actingAs($user)->followingRedirects()->get('/logout')\n ->assertStatus(200)->assertViewIs('auth.login');\n }", "public function testUserApiReturnsResponse()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $this->json('GET', 'api/v1/users')\n // ->assertResponseStatus('200');\n }", "public function getAuthenticated($user) { \r\n return $this->makeRequest('get', \"/user\");\r\n }" ]
[ "0.72342503", "0.7144383", "0.70991296", "0.6994099", "0.69748455", "0.69558954", "0.6938054", "0.69293386", "0.6888957", "0.6880549", "0.6798187", "0.6771219", "0.67394197", "0.67293143", "0.6707819", "0.6695675", "0.669192", "0.6684095", "0.66729695", "0.66548973", "0.6649858", "0.6640143", "0.6634007", "0.66105115", "0.66056395", "0.6601792", "0.6599179", "0.6580889", "0.65765446", "0.6574927", "0.65614474", "0.65607744", "0.6550325", "0.6528154", "0.6526511", "0.6518663", "0.6514923", "0.64991534", "0.6494562", "0.647767", "0.6477656", "0.6475385", "0.64573973", "0.6455948", "0.6454711", "0.6445539", "0.6436076", "0.6421146", "0.6415083", "0.64085066", "0.6393154", "0.63850445", "0.637802", "0.63739294", "0.6356681", "0.6345818", "0.6336431", "0.6332362", "0.63314253", "0.63299537", "0.6328415", "0.6323796", "0.6320171", "0.63191766", "0.63086367", "0.6300114", "0.6276453", "0.62763166", "0.6269229", "0.6264469", "0.6262671", "0.62562513", "0.6250162", "0.6249205", "0.6242577", "0.62302446", "0.6219044", "0.6218126", "0.6216539", "0.62067825", "0.6205945", "0.6199341", "0.6191456", "0.6187292", "0.61839205", "0.61830866", "0.6175435", "0.61724675", "0.61706305", "0.6167459", "0.61561435", "0.61536115", "0.6153412", "0.61519736", "0.6141675", "0.61399263", "0.6139919", "0.6135928", "0.6134291", "0.6130244" ]
0.71242034
2
Test Request GET (orchestra)/users/view/1
public function testGetSingleUserPage() { $this->be($this->user); $response = $this->call('orchestra::users@view', array(1)); $this->assertInstanceOf('Laravel\Response', $response); $this->assertEquals(200, $response->foundation->getStatusCode()); $this->assertEquals('orchestra::users.edit', $response->content->view); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetUsersPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\t\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.index', $response->content->view);\n\t}", "function loadUsersDetail()\n {\n $this->get('/usuarios/5')\n ->assertStatus(200)\n ->assertSee('Mostrando detalle del usuario: 5');\n }", "public function testProfileView()\n {\n $this->loginReader();\n\n $response = $this->get('api/user/profile/1');\n\n $response->assertStatus(200);\n }", "public function testShowUser()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/1');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n \"data\" => [\n \"id\",\n \"employee_code\",\n \"name\",\n \"email\",\n \"team\",\n \"role\",\n \"total_borrowed\",\n \"total_donated\"\n ]\n \n ])->assertStatus(Response::HTTP_OK);\n }", "public function testGetUser()\n {\n $response = $this->get('getuser');\n\n $response->assertStatus(200);\n }", "public function testShowUser()\n {\n $user = User::find(1);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->visit('/users/' . $user->id)\n ->assertSee($user->id)\n ->assertSee($user->full_name)\n ->assertSee($user->email);\n });\n }", "public function test_users_edit_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function testUserIndex()\n {\n $user = factory('App\\User')->create();\n\n $this->get('/api/v1/users');\n\n $username = json_decode($this->response->getContent(), true)[0][\"username\"];\n\n $this->assertEquals(\n $user[\"username\"], $username);\n }", "public function testRouteShowDetailUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(1)\n ->visit('/users')\n ->click('.table tbody tr:nth-child(1) td:nth-child(7) a:nth-child(1)')\n ->assertPathIs('/users/1')\n ->assertSee('DETAIL USER')\n ->assertSee('User Information');\n });\n }", "public function test_index_returns_view()\n {\n $controller = new UsersController();\n $view = $controller->index();\n $this->assertEquals('admin.users.index', $view->getName());\n $this->assertArrayHasKey('users', $view->getData());\n }", "public function test_users_edit_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function testIndex()\n {\n $response = $this->getJson(route('users.index'), $this->headers);\n\n $response->assertStatus(200);\n }", "public function testUserIndex()\n {\n $response = $this->actingAs($this->user())->get(route('task_statuses.index'));\n $response->assertOk();\n }", "public function testSeeSingleUserTest()\n {\n $user = \\App\\User::firstOrFail();\n $response = $this->get('/users/'.$user->id);\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function test_can_view_profile_of_any_user()\n {\n // When i access his profile\n // Then i can see his name\n $user = create(User::class);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeText($user->name);\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}", "function loadUsersListPage()\n {\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Listado de usuarios')\n ->assertSee('Javier')\n ->assertSee('Francisco');\n }", "public function test_show_user_as_user()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function test_users_create_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testuserGet200()\n {\n $response = $this->runApp('GET', '//user/{id}');\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertContains('Success', (string)$response->getBody());\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function test_users_create_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testUserApiReturnsUsers()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $users = factory(User::class, 2)->create();\n\n // $this->json('GET', 'api/v1/users')\n // ->seeJsonStructure([\n // '*' => [\n // 'northstar_id', 'created_at', 'updated_at', 'role',\n // ]\n // ]);\n }", "public function testIndexUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@user'))\n ->assertSee('FIRST NAME');\n });\n }", "public function user_route()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testGetUser()\n {\n $headers = $this->authenticate();\n $response = $this->json('GET', '/api/user', [], $headers);\n $response->assertStatus(200);\n }", "public function test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\n }", "public function testGetUserAll()\n {\n $response = $this->request()->json('GET','/api/users');\n $response->assertStatus(200);\n }", "public function testListUsers()\n {\n echo \"\\nTesting user listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/users\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function viewAction()\n {\n $repo = $this->entityManager\n ->getRepository(Entity\\User::class);\n $id = $this->params()->fromRoute('id');\n $entity = $this->params()->fromRoute('entity', 'user');\n $user = $repo->getUser($id, $entity);\n return ['entity' => $user,'id' => $id ];\n }", "public function testShowUser()\n {\n \t$user = factory(User::class)->create()''\n \t$response = $this->actingAs($user)->withSession(['Foo' => 'bar'])->get('/memes');\n \t$response->assertStatus(200);\n \n }", "public function testIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/admin/comptes');\n\n $response->assertStatus(200)\n ->assertViewIs('layouts.admin');\n }", "public function test_login_user_login_view()\n {\n $response = $this->get(route('login'));\n\n $response->assertSuccessful();\n\n $response->assertViewIs('auth.login');\n }", "function view() \n {\n $api = new Module_UserManagement_API();\n\n /* TODO: Check if administrator */\n $users = $api->getUsers();\n $view = Core_View::factory('users');\n\n $view->users = $users;\n echo $view->render();\n }", "public function testIndex(): void\r\n {\r\n $client = static::createClient();\r\n $userRepository = static::$container->get(UserDoctrineRepository::class);\r\n\r\n $testUser = $userRepository->getUserByEmail('[email protected]');\r\n \r\n // Symfony helper.\r\n $client->loginUser($testUser);\r\n\r\n $client->request('GET', '/admin');\r\n\r\n static::assertResponseIsSuccessful();\r\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 }", "public function testListUsersSuccess()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"users\": \"user\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->get('api/user/list-users', $this->headers)\n ->assertStatus(200)\n ->assertJson(['users' => 'user']);\n\n }", "public function test_users_edit_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function testUserMeGet()\n {\n }", "public function test_authorized_user_can_access_the_user_route()\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n\n $response = $this->get('/user');\n\n $response->assertStatus(200);\n $response->assertJson(['data' => ['name' => $user->name, 'email' => $user->email]]);\n }", "public function index()\n {\n $this->authorize('view_users_content', User::class);\n $users = User::all();\n return response([ 'users' => USERResource::collection($users), 'message' => 'Retrieved successfully'], 200);\n \n }", "public function test_if_users_list_loads_with_data()\n {\n factory(User::class)->create([\n 'name'=>'Joel' \n ]);\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Joel'); \n }", "public function viewUserAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new RsvAcl_Model_DbTable_DbUser();\n \t\t$user_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getUser($user_id);\n \t\t//print_r($rs); exit;\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function usersActionGet(): object\n {\n // Sets webpage title\n $title = \"Users\";\n\n // Sets extended webpage title\n $titleExtended = \" | Eshop\";\n\n // Framework variables\n $response = $this->app->response;\n $session = $this->app->session;\n\n // Verifies if user is logged in\n if (!$session->get(\"loggedIn\")) {\n $response->redirect(\"eshop/login\");\n };\n\n // Calls getUsers method and stores data in $resultset\n $resultset = $this->admin->getUsers();\n\n // Data array\n $data = [\n \"title\" => $title,\n \"titleExtended\" => $titleExtended,\n \"resultset\" => $resultset\n ];\n\n // Includes admin header\n $this->app->page->add(\"content/header_admin\");\n\n // Adds route and sends data array to view\n $this->app->page->add(\"content/users\", $data);\n\n // Renders page\n return $this->app->page->render($data);\n }", "public function testGetInfoUser()\n {\n $id = 1;\n $this->json('GET', \"api/user/get-info/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"data\" => [\n \"created_at\",\n \"email\",\n \"name\",\n \"id\",\n \"org_id\",\n \"updated_at\"\n ]\n ]);\n }", "public function testAdminCanSeeUserIndex()\n {\n $this->actingAs($this->admin_user);\n\n $response = $this->get(route('admin.users.index'));\n\n $response->assertStatus(200);\n }", "public function indexAction()\n {\n $u = new UserTable();\n $user = $u->findOne(\"login = ? and firstname = ?\", ['coquel_d', 'christophe']);\n $this->render(\"IndexController:test2\", $user);\n }", "public function testApiIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/api/comptes');\n\n $response->assertStatus(200)\n ->assertJson([\n\n 'comptes' => true,\n \n ]);\n }", "public function test_users_create_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testShowUserWithoutAddresses()\n {\n $user = factory(User::class)->state('lecturer')->create();\n $response = $this->withHeaders([\n ])->getJson(\"/api/user/{$user->id}\", []);\n\n $response->assertStatus(200)\n ->assertJson([\"user\" => $user->toArray()]);\n }", "public function test_authenticated_users_can_see_detailed_customer_list()\n {\n $this->actingAs(factory(User::class)->create());\n\n // If the route customers/detailedlist can be visited(i.e get), assert \"true\"\n $response = $this->get('/customers/detailedlist')->assertOk();\n\n }", "public function testIndexMethod()\n {\n $this->authentication();\n $this->get(route('members.index'));\n $this->seeStatusCode(200);\n }", "public function get($request){\n \n $users = $this->ViewUsers();\n switch(count($request->url_elements)){\n case 1:\n return $users;\n break;\n case 2:\n $users_id = $request->url_elements[1];\n $users = $this->ViewUsers($users_id);\n return $users;\n break;\n }\n }", "public function testGetUsersPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function testGetOneUserInformation()\n {\n $response = $this->json('GET', $this->userEndpoint.'/prostoalex');\n\n // It should return a valid user json with all the basic attributes filled\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'created',\n 'id',\n 'karma',\n 'submitted',\n 'about',\n ])\n ->assertJsonFragment([\n 'id' => 'prostoalex'\n ]);\n }", "public function testGetSingleUserPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function testUrlEditUsers()\n {\n $user = User::find(2);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($this->user)\n ->visit('/admin/users')\n ->click('.button-edit')\n ->assertSee('Update users')\n ->assertPathIs('/admin/users/'.$user->id.'/edit');\n });\n }", "public function view_user($id)\n {\n\n\n }", "public function testIntegrationIndex()\n {\n $userFaker = factory(Model::class)->create([\n 'name' => 'Foo Bar'\n ]);\n $this->visit('user')\n ->see($userFaker->name);\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'name' => $userFaker->name,\n 'email' => $userFaker->email,\n ]);\n $this->assertViewHas('models');\n }", "public function testItReturnsAUserByUserId()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users/{$user1->id}\")\n ->assertStatus(200)\n ->assertJson([\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n ]);\n }", "public function user_route_api()\n {\n $this->withoutExceptionHandling();\n $response = $this->get('/api/test-user');\n\n $response->assertStatus(200);\n }", "public function testIndex(): void\n {\n $response = $this\n ->actingAs($this->user)\n ->get('/');\n $response->assertViewIs('home');\n $response->assertSeeText('Сообщения от всех пользователей');\n }", "public function userAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ($loginUser) {\n header('Content-Type: application/json');\n http_response_code(200);\n echo json_encode(array(\n 'userId' => $loginUser->getId(),\n 'username' => $loginUser->getUsername(),\n 'authenticated' => true,\n 'userType' => $loginUser->getUserType(),\n 'emailAddress' => $loginUser->getEmailAddress(),\n 'firstName' => $loginUser->getFirstName(),\n 'lastName' => $loginUser->getLastName(),\n 'birthdate' => $loginUser->getBirthdate(),\n 'isVerified' => method_exists(($loginUser), 'isVerified') ? $loginUser->isVerified() : null,\n 'isEmailVerified' => method_exists(($loginUser), 'isEmailVerified') ? $loginUser->isEmailVerified() : null,\n 'status' => $loginUser->getStatus(),\n 'uuid' => $loginUser->getUUID(),\n // 'imageId' => $loginUser->getProfileImageId(),\n // 'coverImageType' => $loginUser->getProfileCoverImageType(),\n // 'coverImageId' => $loginUser->getProfileCoverImageId(),\n // 'coverPresetImageId' => $loginUser->getProfileCoverPresetImageId(),\n // 'coverTing' => $loginUser->getProfileCoverTint(),\n ));\n exit();\n } else {\n header('Content-Type: application/json');\n http_response_code(200);\n echo json_encode(array(\n 'authenticated' => false,\n ));\n exit();\n }\n }", "public function testCGetAction200()\n {\n self::$_client->request(Request::METHOD_GET, self::RUTA_API);\n $response = self::$_client->getResponse();\n self::assertTrue($response->isSuccessful());\n self::assertJson($response->getContent());\n $users = json_decode($response->getContent(), true);\n self::assertArrayHasKey('users', $users);\n }", "public function getUserAction()\n {\n //get input\n $params = $this->getUrlParams();\n\n $limit = (isset($params['limit']))?$params['limit']:null;\n $offset = (isset($params['offset']))?$params['offset']:null;\n\n //validate input\n //TODO: add validate here\n\n //get data in service\n $result = $this->userService->getUser($params, $limit, $offset);\n\n if (!$result['success']) {\n //process error\n return $this->responseError($result['message'], '/users');\n }\n\n // print_r(count($result['data'])); exit;\n\n //return data\n $encoder = $this->createEncoder($this->modelName, $this->schemaName);\n\n //get total\n $total = (isset($result['total']))?$result['total']:null;\n\n return $this->response($encoder, $result['data'], $limit, $offset, $total);\n\n \n }", "public function testView() {\n $result = $this->get('/severities/2');\n $this->assertContains('status\":\"success\",\"code\":200,', $result);\n }", "public function testAccess() {\n\n $this->drupalGet('udb3/api/1.0/user');\n $this->assertResponse('403');\n\n }", "public function index_get()\n {\n $response = $this->UserM->all_user();\n $this->response($response);\n }", "public function test_lsvt_api_can_get_user_by_username()\n {\n $email = '[email protected]';\n\n $this->httpMock->append(new Response(200, ['Content-Type' => 'application/json'], json_encode($this->getUserEmailResponse($email))));\n\n $test = $this->apiClient->getUserByUsername($email);\n\n $this->assertCount(1, $this->curlHistory);\n $this->assertEquals('https://webservices.lightspeedvt.net/REST/v1//[email protected]', (string)$this->curlHistory[0]['request']->getUri());\n\n $this->assertIsArray($test);\n $this->assertEquals($email, $test['email']);\n }", "public function testLoginView()\n {\n $response = $this->get('/login');\n\n $response->assertStatus(200);\n $response->assertSee('Log in to play');\n }", "public function testIndexRoutedUser(): void\n {\n // given\n $expectedStatusCode = 302;\n $user = $this->createUser([User::ROLE_USER]);\n $this->logIn($user);\n\n // when\n $this->httpClient->request('GET', '/tag');\n $resultStatusCode = $this->httpClient->getResponse()->getStatusCode();\n\n // then\n $this->assertEquals($expectedStatusCode, $resultStatusCode);\n }", "public function index()\n {\n $this->authorize('viewAny', User::class);\n\n // List the users...\n }", "public function index_get()\n\t {\t\n \t$users=$this->User_Model->get_users();\n // Check if the users data store contains users (in case the database result returns NULL)\n if ($users)\n {\n // Set the response and exit\n $this->response($users, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code\n }\n else\n {\n // Set the response and exit\n $this->response([\n 'status' => FALSE,\n 'message' => 'No users were found'\n ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n \n\t }", "public function index()\n {\n $user = $this->user();\n\n// if ($user == null) {\n// throw new UnauthorizedHttpException(\"Bearer\", \"You are not authorized to see all users.\", null, 0x00C00301);\n// }\n\n if (!policy($user)->canSeeAll($user)) {\n throw new HttpException(403, \"You are not authorized to see all users.\", null, [], 0x00C00302);\n }\n\n $users = $this->repository->all();\n\n return $this->response->collection($users, new UserTransformer, [\"key\" => \"users\"]);\n }", "public function testAdminUser()\n {\n //$user = Sentry::getUserProvider()->findByLogin('[email protected]');\n //$this->be($user);\n\n $response = $this->call('GET', 'admin/users');\n\n // Make sure we can't view the admin pages.\n $this->assertFalse($response->isNotFound());\n }", "public function viewAny(User $user)\n {\n \n }", "public function testUserRead()\n {\n // Connexion à un compte Admin\n $client = static::createClient(array(), array(\n 'PHP_AUTH_USER' => 'Baptiste',\n 'PHP_AUTH_PW' => 'admin',\n ));\n // Récupération de la page de consultation\n $crawler = $client->request('GET', '/user/read');\n //Test pour savoir si la div cachée est récupèrée\n $this->assertSame(1, $crawler->filter('html:contains(\"testRead\")')->count());\n }", "public function test_show_user_as_admin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($this->admin)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function testGetApiUser()\n {\n $token = $this->getAuthToken();\n /* @var TestResponse $response */\n $this->json(\n 'GET',\n '/api/user',\n [],\n [\n 'Content-Type: application/x-www-form-urlencoded',\n 'Cache-Control: no-cache',\n 'Authorization' => 'Bearer ' . $token . '',\n ],\n 'Get current user'\n ) ->assertStatus(200)\n ->assertJsonStructure(\n [\n 'data' => [\n 'id',\n 'email',\n 'profile',\n 'privacySettings',\n ],\n 'channel',\n ]\n );\n }", "public function testTokenViewPage()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.show', [$this->token->id_hash]));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.show');\n }", "public function viewuser() {\n $response = $this->Allusers_model->viewuser();\n return $response;\n }", "public function view(User $user, Given_test $givenTest)\n {\n //\n }", "public function testIndex()\n {\n $testingRoleName = 'user';\n\n /** @var User $user */\n $user = factory(User::class)->create();\n $user->attachRole($testingRoleName);\n\n $userResource = new UserResource($user);\n\n $userResponseJson = response()->json($userResource)->getData();\n\n $userRole = $userResponseJson->roles;\n\n $role = Role::findOrFail($userRole);\n\n $this->assertEquals($testingRoleName, $role->name);\n $this->assertEquals($user->id, $userResponseJson->id);\n $this->assertEquals($user->name, $userResponseJson->name);\n $this->assertEquals($user->email, $userResponseJson->email);\n $this->assertEquals($user->publish, $userResponseJson->publish);\n }", "public function usersAction(){\n\n\n $team_users = $this->api()->search('team-user');\n $users = $this->api()->search('users');\n $view = new ViewModel(['users'=> $users, 'team_users'=>$team_users]);\n return $view;\n// $view->setVariable('response', $response);\n\n\n }", "public function testSearchUser()\n {\n echo \"\\nTesting user search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users?search=Vicky\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/users?search=Vicky\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testUserApiReturnsResponse()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $this->json('GET', 'api/v1/users')\n // ->assertResponseStatus('200');\n }", "public function get($user) { \r\n return $this->makeRequest('get', \"/users/{$user}\");\r\n }", "public function invokeUsers()\r\n {\r\n if (!isset($_GET['users'])) {\r\n $users = $this->model->getUsers();\r\n include 'view/userslist.php';\r\n }\r\n }", "public function test_teams_index_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('teams.index'));\n $response->assertStatus(200);\n $response->assertViewIs('views.teams.index');\n }", "public function testUserUserIDGet()\n {\n }", "public function testVisitAdminUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin')\n ->clickLink('Users')\n ->assertPathIs('/admin/user')\n ->assertTitleContains('User')\n ->assertSee('List Users');\n });\n }", "public function testUserListForAdmin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'data' => true,\n ]);\n }", "public function testGetUserAction200(array $user)\n {\n self::$_client->request(\n Request::METHOD_GET,\n self::RUTA_API . '/' . $user['id']\n );\n $response = self::$_client->getResponse();\n\n self::assertEquals(Response::HTTP_OK, $response->getStatusCode());\n self::assertJson((string) $response->getContent());\n $user_aux = json_decode((string) $response->getContent(), true);\n self::assertEquals($user, $user_aux['user']);\n }", "public function indexAction()\n {\n $users = (new UserCollectionModel())->getUsers();\n echo (new View('userIndex'))\n ->addData('users', $users)\n ->render();\n }", "public function testIndexRoute()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs($user)\n ->seeIsAuthenticatedAs($user)\n ->get(route('events.index'))\n ->assertStatus(200);\n }", "public function index()\n {\n // show list user\n }", "public function testShowUserWithAddresses()\n {\n $user = factory(User::class)->state('administration_worker')->create();\n $response = $this->withHeaders([\n ])->getJson(\"/api/user/{$user->id}\", []);\n\n $response->assertStatus(200)\n ->assertJson([\"user\" => $user->toArray()])\n ->assertJsonPath(\"user.address.id\", $user->address_id)\n ->assertJsonPath(\"user.correspondal_address.id\", $user->correspondal_address_id);\n }", "public function test()\n {\n $this->getAuthenticatedUser();\n return response()->json(['data' => ['status' => 'OK']], 200);\n }", "public function testShowUserFail()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/2');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n ]);\n $response->assertJson([\n \"meta\" => [\n \"code\" => Response::HTTP_NOT_FOUND\n ]\n ]);\n }", "public function testUserWithAccesToResource()\n {\n $this->logged();\n $this->visit('/resource')\n ->seePageIs('/resource');\n }" ]
[ "0.7879806", "0.7369127", "0.7257651", "0.721911", "0.7211713", "0.7178979", "0.714752", "0.7143988", "0.71155167", "0.7100919", "0.7097062", "0.7065654", "0.7030911", "0.6973102", "0.69707596", "0.69518113", "0.690639", "0.6853581", "0.684652", "0.6835651", "0.6828917", "0.68155044", "0.68123806", "0.6777748", "0.6757582", "0.6739506", "0.67384684", "0.67349905", "0.6733948", "0.6724899", "0.6717779", "0.6709853", "0.6682378", "0.6673204", "0.66436696", "0.6636376", "0.6627994", "0.6625049", "0.662353", "0.66185343", "0.65832996", "0.65704703", "0.6560953", "0.65501994", "0.653699", "0.6529263", "0.6528097", "0.6467257", "0.64666516", "0.6454578", "0.6444609", "0.6433077", "0.64204675", "0.64166206", "0.64101416", "0.6408659", "0.639562", "0.639319", "0.6390422", "0.63820094", "0.63389724", "0.63348055", "0.6334387", "0.6333016", "0.63299143", "0.63118094", "0.6310235", "0.63087624", "0.63072026", "0.63007456", "0.6293051", "0.62718165", "0.6256051", "0.6251065", "0.6240969", "0.6238528", "0.6238046", "0.62379265", "0.6236866", "0.62365776", "0.6219531", "0.62192523", "0.62191147", "0.62182033", "0.620941", "0.6207589", "0.62063646", "0.6198204", "0.61978877", "0.6194556", "0.6184725", "0.6174447", "0.61703074", "0.61647683", "0.6164109", "0.6162814", "0.61618423", "0.61617315", "0.6160228", "0.6158964" ]
0.7388909
1
Test Request POST (orchestra)/users/view
public function testPostCreateNewUserPage() { $this->be($this->user); $response = $this->call('orchestra::users@view', array(''), 'POST', array( 'id' => '', 'email' => '[email protected]', 'fullname' => 'Mior Muhammad Zaki', 'password' => '123456', 'roles' => array(2), )); $this->assertInstanceOf('Laravel\Redirect', $response); $this->assertEquals(302, $response->foundation->getStatusCode()); $this->assertEquals(handles('orchestra::users'), $response->foundation->headers->get('location')); $user = Orchestra\Model\User::where_email('[email protected]')->first(); $this->assertGreaterThan(0, $user->id); $this->assertEquals('[email protected]', $user->email); $this->assertEquals('Mior Muhammad Zaki', $user->fullname); $this->assertTrue(Hash::check('123456', $user->password)); $user->delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetUsersPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\t\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.index', $response->content->view);\n\t}", "public function testShowUser()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/1');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n \"data\" => [\n \"id\",\n \"employee_code\",\n \"name\",\n \"email\",\n \"team\",\n \"role\",\n \"total_borrowed\",\n \"total_donated\"\n ]\n \n ])->assertStatus(Response::HTTP_OK);\n }", "public function testGetUser()\n {\n $response = $this->get('getuser');\n\n $response->assertStatus(200);\n }", "public function test_users_create_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testGetSingleUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.edit', $response->content->view);\n\t}", "public function test_users_create_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testUserIndex()\n {\n $user = factory('App\\User')->create();\n\n $this->get('/api/v1/users');\n\n $username = json_decode($this->response->getContent(), true)[0][\"username\"];\n\n $this->assertEquals(\n $user[\"username\"], $username);\n }", "public function testIndex()\n {\n $response = $this->getJson(route('users.index'), $this->headers);\n\n $response->assertStatus(200);\n }", "public function testGetUser()\n {\n $headers = $this->authenticate();\n $response = $this->json('GET', '/api/user', [], $headers);\n $response->assertStatus(200);\n }", "public function test_show_user_as_user()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function testPostUserAction201()\n {\n $rand_num = mt_rand(0, 1000000);\n $nombre = 'Nuevo UsEr POST * ' . $rand_num;\n $p_data = [\n 'username' => $nombre,\n 'email' => 'email' . $rand_num . '@example.com',\n 'password' => 'P4ssW0r4 Us3r P0ST * ñ?¿ áËì·' . $rand_num,\n 'enabled' => mt_rand(0, 2),\n 'isAdmin' => mt_rand(0, 2)\n ];\n\n // 201\n self::$_client->request(\n Request::METHOD_POST, self::RUTA_API,\n [], [], [], json_encode($p_data)\n );\n $response = self::$_client->getResponse();\n self::assertEquals(Response::HTTP_CREATED, $response->getStatusCode());\n self::assertTrue($response->isSuccessful());\n self::assertJson($response->getContent());\n $user = json_decode($response->getContent(), true);\n\n return $user['user'];\n }", "public function testGetUserAll()\n {\n $response = $this->request()->json('GET','/api/users');\n $response->assertStatus(200);\n }", "public function testCreateUser()\n {\n $num = rand(10, 1000);\n $userData = [\n \"name\" => \"John Doe $num\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345\",\n \"org_id\" => 1\n ];\n $this->json('POST', 'api/user/create', $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function test_users_create_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testListUsersSuccess()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"users\": \"user\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->get('api/user/list-users', $this->headers)\n ->assertStatus(200)\n ->assertJson(['users' => 'user']);\n\n }", "public function test_users_edit_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function test_users_edit_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function testUserApiReturnsUsers()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $users = factory(User::class, 2)->create();\n\n // $this->json('GET', 'api/v1/users')\n // ->seeJsonStructure([\n // '*' => [\n // 'northstar_id', 'created_at', 'updated_at', 'role',\n // ]\n // ]);\n }", "public function testProfileView()\n {\n $this->loginReader();\n\n $response = $this->get('api/user/profile/1');\n\n $response->assertStatus(200);\n }", "public function testLoginRegister(){\n $user = User::find(1);\n $this->be($user);\n\n $response =$this->get(route('administracion'));\n $response->assertStatus(200);\n }", "public function testCreateUser()\n {\n $dados = [\n 'unidade_id' => 1,\n 'chave' => '1111',\n 'name' => 'Fulano',\n 'email' => '[email protected]',\n 'password' => 'Gerente',\n 'password_confirmation' => 'Gerente',\n 'ativo' => true,\n 'perfil_id' => 1,\n ];\n\n $this->post('/api/users', $dados, $this->api_token);\n\n $this->assertResponseOk();\n\n $reposta = (array) json_decode($this->response->content());\n\n $this->assertArrayHasKey('unidade_id', $reposta);\n $this->assertArrayHasKey('chave', $reposta);\n $this->assertArrayHasKey('name', $reposta);\n $this->assertArrayHasKey('email', $reposta);\n $this->assertArrayHasKey('ativo', $reposta);\n $this->assertArrayHasKey('perfil_id', $reposta);\n $this->assertArrayHasKey('id', $reposta);\n }", "public function test_if_users_list_loads_with_data()\n {\n factory(User::class)->create([\n 'name'=>'Joel' \n ]);\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Joel'); \n }", "public function test_authorized_user_can_access_the_user_route()\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n\n $response = $this->get('/user');\n\n $response->assertStatus(200);\n $response->assertJson(['data' => ['name' => $user->name, 'email' => $user->email]]);\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function test_it_creates_a_new_user()\n {\n $user = ['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook'];\n\n $this->json('POST', '/users', $user)\n ->seeJson($user);\n }", "public function testUserIndex()\n {\n $response = $this->actingAs($this->user())->get(route('task_statuses.index'));\n $response->assertOk();\n }", "public function testShowUser()\n {\n $user = User::find(1);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->visit('/users/' . $user->id)\n ->assertSee($user->id)\n ->assertSee($user->full_name)\n ->assertSee($user->email);\n });\n }", "function loadUsersDetail()\n {\n $this->get('/usuarios/5')\n ->assertStatus(200)\n ->assertSee('Mostrando detalle del usuario: 5');\n }", "public function test()\n {\n $this->getAuthenticatedUser();\n return response()->json(['data' => ['status' => 'OK']], 200);\n }", "public function testUserApiReturnsResponse()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $this->json('GET', 'api/v1/users')\n // ->assertResponseStatus('200');\n }", "public function testCreateUser()\n {\n $this->visit('/Users/create')\n\t ->type('1', 'role_id')\n\t ->type('Daniel', 'firstname')\n\t ->type('Becerra', 'lastname')\n\t ->type('[email protected]', 'email')\n\t ->type('danielbecerrao', 'user')\n\t ->type('12345678', 'password')\n\t ->type('12345678', 'register')\n\t ->press('Crear')\n\t ->seePageIs('/Users');\n\n }", "public function testResponseJson() {\n $this->visit(\"/api/users/teste\")->seeJson();\n }", "public function user_route_api()\n {\n $this->withoutExceptionHandling();\n $response = $this->get('/api/test-user');\n\n $response->assertStatus(200);\n }", "public function testGetOneUserInformation()\n {\n $response = $this->json('GET', $this->userEndpoint.'/prostoalex');\n\n // It should return a valid user json with all the basic attributes filled\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'created',\n 'id',\n 'karma',\n 'submitted',\n 'about',\n ])\n ->assertJsonFragment([\n 'id' => 'prostoalex'\n ]);\n }", "public function testuserGet200()\n {\n $response = $this->runApp('GET', '//user/{id}');\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertContains('Success', (string)$response->getBody());\n }", "public function testShowUser()\n {\n \t$user = factory(User::class)->create()''\n \t$response = $this->actingAs($user)->withSession(['Foo' => 'bar'])->get('/memes');\n \t$response->assertStatus(200);\n \n }", "public function testAddUser(){\n $em = $this->getContainer()->get('doctrine')->getManager();\n\n $this->connect();\n $client = $this->makeClient();\n\n $crawler = $client->request('GET', '/admin/user/add');\n $response = $client->getResponse();\n\n $this->assertStatusCode(200, $client);\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n\n // Post user\n $crawler = $client->request('GET', '/');\n $button = $crawler->filter('a:contains(\"Admin\")')->eq(0)->link();\n $this->assertTrue($button != null);\n\n $crawler = $client->click($button);\n $button = $crawler->filter('a:contains(\"Utilisateur\")')->eq(0)->link();\n $this->assertTrue($button != null);\n\n// $form = $crawler->selectButton('Ajouter')->form();\n// $form->setValues([\n// 'userbundle_user[username]' => 'boura',\n// 'userbundle_user[email]' => '[email protected]',\n// 'userbundle_user[plainPassword]' => 'bdiallo'\n//\n// ]);\n// $client->submit($form);\n// $this->assertStatusCode('200', $client);\n\n // Verify count of user saved\n// $this->assertCount(2, $em->getRepository('UserBundle:User')->findAll());\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 test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\n }", "public function testEnterCorrectData()\n {\n $user = User::factory()->create();\n \n $response = $this->call('POST', '/admin/signin', [\n 'email' => $user->email,\n 'password' => '123456',\n '_token' => csrf_token()\n ]);\n \n $this->assertEquals(200, $response->getStatusCode());\n\n \n\n }", "public function testListUsers()\n {\n echo \"\\nTesting user listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/users\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \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 }", "public function testIndexCreateUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@create'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->type('first_name', 'cowell@123')\n ->type('last_name', 'cowell@123')\n ->select('id_role', '3')\n ->press('Create')\n ->assertSee('Xong rồi');\n });\n }", "public function testRouteShowDetailUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(1)\n ->visit('/users')\n ->click('.table tbody tr:nth-child(1) td:nth-child(7) a:nth-child(1)')\n ->assertPathIs('/users/1')\n ->assertSee('DETAIL USER')\n ->assertSee('User Information');\n });\n }", "public function testApiIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/api/comptes');\n\n $response->assertStatus(200)\n ->assertJson([\n\n 'comptes' => true,\n \n ]);\n }", "public function test_index_returns_view()\n {\n $controller = new UsersController();\n $view = $controller->index();\n $this->assertEquals('admin.users.index', $view->getName());\n $this->assertArrayHasKey('users', $view->getData());\n }", "function loadCreateUser()\n {\n $this->get('/usuarios/nuevo')\n ->assertStatus(200)\n ->assertSee('Crear nuevo usuario');\n }", "public function actionUser($request)\n {\n return $this->start()->uri(\"/api/user/action\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function user_route()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testGetUserAction200(array $user)\n {\n self::$_client->request(\n Request::METHOD_GET,\n self::RUTA_API . '/' . $user['id']\n );\n $response = self::$_client->getResponse();\n\n self::assertEquals(Response::HTTP_OK, $response->getStatusCode());\n self::assertJson((string) $response->getContent());\n $user_aux = json_decode((string) $response->getContent(), true);\n self::assertEquals($user, $user_aux['user']);\n }", "public function testUbicaciontracker()\n {\n // $response = $this->get('/');\n // $response->assertStatus(200);\n //$this->visit('buque/store');\n // $response = $this->get('/');\n // $this->assertTrue(true);\n $response = $this->withHeaders([\n 'X-Header' => 'Value',\n ])->json('POST', '/user', ['name' => 'Sally']);\n\n $response\n ->assertStatus(201)\n ->assertJson([\n 'created' => true,\n ]);\n }", "public function test_can_view_profile_of_any_user()\n {\n // When i access his profile\n // Then i can see his name\n $user = create(User::class);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeText($user->name);\n }", "public function userAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ($loginUser) {\n header('Content-Type: application/json');\n http_response_code(200);\n echo json_encode(array(\n 'userId' => $loginUser->getId(),\n 'username' => $loginUser->getUsername(),\n 'authenticated' => true,\n 'userType' => $loginUser->getUserType(),\n 'emailAddress' => $loginUser->getEmailAddress(),\n 'firstName' => $loginUser->getFirstName(),\n 'lastName' => $loginUser->getLastName(),\n 'birthdate' => $loginUser->getBirthdate(),\n 'isVerified' => method_exists(($loginUser), 'isVerified') ? $loginUser->isVerified() : null,\n 'isEmailVerified' => method_exists(($loginUser), 'isEmailVerified') ? $loginUser->isEmailVerified() : null,\n 'status' => $loginUser->getStatus(),\n 'uuid' => $loginUser->getUUID(),\n // 'imageId' => $loginUser->getProfileImageId(),\n // 'coverImageType' => $loginUser->getProfileCoverImageType(),\n // 'coverImageId' => $loginUser->getProfileCoverImageId(),\n // 'coverPresetImageId' => $loginUser->getProfileCoverPresetImageId(),\n // 'coverTing' => $loginUser->getProfileCoverTint(),\n ));\n exit();\n } else {\n header('Content-Type: application/json');\n http_response_code(200);\n echo json_encode(array(\n 'authenticated' => false,\n ));\n exit();\n }\n }", "public function test()\n {\n $userData = factory(User::class)->make()->toArray();\n $userData['password'] = $userData['password_confirmation'] = 'qweqweqwe';\n\n /**\n * @see \\App\\Http\\Controllers\\RegisterController::signUp()\n */\n $response = $this->post('/auth/sign-up', $userData);\n\n $response->assertResponseStatus(201);\n\n $user = User::where('email', $userData['email'])->first();\n\n $this->assertNotEmpty($user);\n\n /**\n * @see \\App\\Http\\Controllers\\LoginController::signIn()\n */\n $response = $this->post('/auth/sign-in', [\n 'email' => $user->email,\n 'password' => $userData['password'],\n ]);\n\n $response->assertResponseOk();\n\n $response->seeHeader('Authorization');\n }", "public function testUserListForAdmin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'data' => true,\n ]);\n }", "function loadUsersListPage()\n {\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Listado de usuarios')\n ->assertSee('Javier')\n ->assertSee('Francisco');\n }", "public function testPostUpdateUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$user = Orchestra\\Model\\User::create(array(\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'Mior Muhammad Zaki',\n\t\t\t'password' => '123456',\n\t\t));\n\t\t$user->roles()->sync(array(2));\n\n\t\t$response = $this->call('orchestra::users@view', array($user->id), 'POST', array(\n\t\t\t'id' => $user->id,\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'crynobone',\n\t\t\t'password' => '345678',\n\t\t\t'roles' => array(2),\n\t\t));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::users'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$updated_user = Orchestra\\Model\\User::find($user->id);\n\n\t\t$this->assertEquals('[email protected]', $updated_user->email);\n\t\t$this->assertEquals('crynobone', $updated_user->fullname);\n\t\t$this->assertTrue(Hash::check('345678', $updated_user->password));\n\n\t\t$updated_user->delete();\n\t}", "public function testEndPoint()\n {\n\n $user = Auth::loginUsingId(1);\n\n// $response = $this->actingAs($user)\n// ->get('dashboard/orders/create');\n $response = $this->get('dashboard/orders/create');\n\n $response->assertStatus(200);\n }", "public function test_login_user_login_view()\n {\n $response = $this->get(route('login'));\n\n $response->assertSuccessful();\n\n $response->assertViewIs('auth.login');\n }", "public function testGetInfoUser()\n {\n $id = 1;\n $this->json('GET', \"api/user/get-info/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"data\" => [\n \"created_at\",\n \"email\",\n \"name\",\n \"id\",\n \"org_id\",\n \"updated_at\"\n ]\n ]);\n }", "public function testIndexUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@user'))\n ->assertSee('FIRST NAME');\n });\n }", "public function testSeeSingleUserTest()\n {\n $user = \\App\\User::firstOrFail();\n $response = $this->get('/users/'.$user->id);\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function testGetRequest()\n {\n $admin = $this->getAdminUser();\n $user = factory(\\App\\User::class)->create();\n $grade = factory(\\App\\Grade::class)->create();\n $userGrade = UserGrade::create([\n 'user_id' => $user->id,\n 'grade_id' => $grade->id\n ]);\n $response = $this->actingAs($user)->call('GET', \"/api/user/{$user->id}/grade\");\n $this->assertEquals(200, $response->status());\n }", "public function testCreatingFirstUser()\n {\n $response = $this->postJson('users', [\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'password' => 'password'\n ]);\n\n $response->assertStatus(201);\n }", "public function testIndex(): void\r\n {\r\n $client = static::createClient();\r\n $userRepository = static::$container->get(UserDoctrineRepository::class);\r\n\r\n $testUser = $userRepository->getUserByEmail('[email protected]');\r\n \r\n // Symfony helper.\r\n $client->loginUser($testUser);\r\n\r\n $client->request('GET', '/admin');\r\n\r\n static::assertResponseIsSuccessful();\r\n }", "public function testIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/admin/comptes');\n\n $response->assertStatus(200)\n ->assertViewIs('layouts.admin');\n }", "public function testGetApiUser()\n {\n $token = $this->getAuthToken();\n /* @var TestResponse $response */\n $this->json(\n 'GET',\n '/api/user',\n [],\n [\n 'Content-Type: application/x-www-form-urlencoded',\n 'Cache-Control: no-cache',\n 'Authorization' => 'Bearer ' . $token . '',\n ],\n 'Get current user'\n ) ->assertStatus(200)\n ->assertJsonStructure(\n [\n 'data' => [\n 'id',\n 'email',\n 'profile',\n 'privacySettings',\n ],\n 'channel',\n ]\n );\n }", "public function test_users_edit_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function testUserRegister()\n {\n $response = $this->get('/register')\n ->assertStatus(200)\n ->assertSee('Register');\n }", "public function testPostRegistroSucesso()\n {\n\n $userData = [\n \"nome\" => \"Shang Chi\",\n \"sinopse\" => \"Quero assistir\",\n \"data_lancamento\" => \"10-12-2021\",\n \"nota\" => 10,\n \"maior_18\" => True,\n ];\n\n $this->json('POST', 'api/filmes', $userData, ['Accept' => 'application/json'])\n ->assertStatus(201)\n ->assertJsonStructure([\n \"user\" => [\n 'id',\n 'nome',\n 'data_lancamento',\n \"nota\",\n \"maior_18\",\n 'created_at',\n 'updated_at',\n ],\n ]);\n }", "public function testUsersCanCreateAulas()\n {\n $response = $this->json('GET', 'aulas.index');\n $response\n ->assertStatus(201)\n ->assertExactJson([\n 'created' => true,\n ]);\n }", "public function testShowSuccessfully()\n {\n $this->seed(\\UserTableSeeder::class);\n\n $employer = User::query()->where('email', '[email protected]')->first();\n Passport::actingAs(\n $employer,\n ['employer']\n );\n\n $response = $this->get('https://api.belsaa.com/employer/employer');\n $response->assertStatus(200);\n $response->assertJsonStructure(['id', 'company_name', 'user_attributes' => ['bio', 'legal_document_url', 'office_photo_url']]);\n $response->assertJsonFragment(['id' => $employer->id]);\n }", "public function testPostDeleteUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$user = Orchestra\\Model\\User::create(array(\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'Mior Muhammad Zaki',\n\t\t\t'password' => '123456',\n\t\t));\n\t\t$user->roles()->sync(array(2));\n\n\t\t$this->assertGreaterThan(0, $user->id);\n\n\t\t$user_id = $user->id;\n\t\t\n\t\t$response = $this->call('orchestra::users@delete', array($user_id));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::users'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$user = Orchestra\\Model\\User::find($user_id);\n\n\t\t$this->assertTrue(is_null($user));\n\t}", "public function usersAction(){\n\n\n $team_users = $this->api()->search('team-user');\n $users = $this->api()->search('users');\n $view = new ViewModel(['users'=> $users, 'team_users'=>$team_users]);\n return $view;\n// $view->setVariable('response', $response);\n\n\n }", "public function testUrlEditUsers()\n {\n $user = User::find(2);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($this->user)\n ->visit('/admin/users')\n ->click('.button-edit')\n ->assertSee('Update users')\n ->assertPathIs('/admin/users/'.$user->id.'/edit');\n });\n }", "public function test_show_user_as_admin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($this->admin)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function testExample()\n {\n \t$response = $this->json('POST', '/users', ['name' => 'Sally']);\n $response\n ->assertStatus(200)\n ->assertJson([\n 'created' => true,\n ]);\n }", "public function testPost()\n {\n $user = factory('App\\User')->create();\n $user->room_id = 1;\n $user->save();\n $message = 'helloworld';\n\n $response = $this->actingAs($user)\n ->call('POST', 'post', [\n 'message' => 'title 999',\n '_token' => csrf_token(), // 手動加入 _token\n ]);\n\n $response->assertStatus(201);\n\n //vendor/bin/phpunit\n }", "public function testShowUserWithoutAddresses()\n {\n $user = factory(User::class)->state('lecturer')->create();\n $response = $this->withHeaders([\n ])->getJson(\"/api/user/{$user->id}\", []);\n\n $response->assertStatus(200)\n ->assertJson([\"user\" => $user->toArray()]);\n }", "public function testItReturnsAUserByUserId()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users/{$user1->id}\")\n ->assertStatus(200)\n ->assertJson([\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n ]);\n }", "public function testSignupIndex()\n {\n $user = factory(User::class)->create(['drupal_id' => '100001', 'first_name' => 'Chloe']);\n $user2 = factory(User::class)->create(['drupal_id' => '100002', 'first_name' => 'Dave']);\n\n // For testing, we'll mock a successful Phoenix API response.\n $this->phoenixMock->shouldReceive('getSignupIndex')->with(['users' => ['100001', '100002']])->once()->andReturn([\n 'data' => [\n [\n 'id' => '243',\n 'user' => [\n 'drupal_id' => '100001',\n ],\n ],\n [\n 'id' => '44',\n 'user' => [\n 'drupal_id' => '100002',\n ],\n ],\n ],\n ]);\n\n $this->asUserUsingLegacyAuth($user)->withLegacyApiKeyScopes(['user'])->get('v1/signups?users='.$user->_id.','.$user2->_id);\n\n $this->assertResponseStatus(200);\n $this->seeJson();\n\n $this->seeJsonStructure([\n 'data' => [\n '*' => [\n 'user' => [\n 'id', 'first_name', 'last_initial', 'photo', 'country',\n ],\n ],\n ],\n ]);\n }", "public function testVerUsuarios()\n {\n $user = User::all();\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($user[0])\n ->resize(1300, 1200)\n ->visit('/admin')\n ->clickLink('Usuarios')\n ->clickLink('Administrar usuarios')\n ->assertPathIs('/admin/usuarios')\n ->assertSee('Usuarios')\n ->pause(1000)//peticiones ajax\n ->waitForText('Siguiente')\n ->with('.table', function ($table) use ($user) {\n $table->assertSee($user[1]->email);\n });\n });\n }", "public function testGetUserByUsernameAction200(array $user)\n {\n self::$_client->request(\n Request::METHOD_GET,\n self::RUTA_API . '/username/' . $user['username']\n );\n $response = self::$_client->getResponse();\n\n self::assertEquals(Response::HTTP_OK, $response->getStatusCode());\n self::assertJson((string) $response->getContent());\n $user_aux = json_decode((string) $response->getContent(), true);\n self::assertEquals($user, $user_aux['user']);\n }", "public function testPostRequest()\n {\n $admin = $this->getAdminUser();\n $user = factory(\\App\\User::class)->create();\n $grade = factory(\\App\\Grade::class)->create();\n $data = [\n 'grade_id' => $grade->id\n ];\n $response = $this->actingAs($admin)->call('POST', \"/api/user/{$user->id}/grade/\", $data);\n $this->assertEquals(200, $response->status());\n }", "public function testCGetAction200()\n {\n self::$_client->request(Request::METHOD_GET, self::RUTA_API);\n $response = self::$_client->getResponse();\n self::assertTrue($response->isSuccessful());\n self::assertJson($response->getContent());\n $users = json_decode($response->getContent(), true);\n self::assertArrayHasKey('users', $users);\n }", "public function testUserCanViewSensorList()\n {\n $user = User::factory()->create([\n 'password' => bcrypt($password = 'i-love-laravel'),\n ]);\n\n $response = $this->post('/login', [\n 'email' => $user->email,\n 'password' => $password,\n ]);\n\n $response->assertRedirect('/dashboard');\n $this->assertAuthenticatedAs($user);\n\n $response = $this->get('/sensor/list');\n\n $response->assertStatus(200);\n $response->assertSeeText('Sensors');\n }", "public function testUserMeGet()\n {\n }", "public function testAccess() {\n\n $this->drupalGet('udb3/api/1.0/user');\n $this->assertResponse('403');\n\n }", "public function testGetUserTransactions() {\n $user = User::whereEmail('[email protected]')->first();\n $token = JWTAuth::fromUser($user);\n \n $response = $this->withHeaders(['Authorization' => \"Bearer $token\"])->get(route('api.transaction.user'));\n\n $response->assertStatus(200);\n }", "public function testExample()\n {\n $response = $this->get('/api/users');\n $response->assertStatus(200)\n\t\t ->assertJsonStructure([\n\t\t \t\t[\n\t\t \t\t\t'id',\n\t\t \t\t\t'name',\n\t\t \t\t\t'last_name',\n\t\t \t\t\t'age',\n\t\t \t\t\t'phone',\n\t\t \t\t\t'photo',\n\t\t \t\t\t'admission_date'\n\t\t \t\t]\n\t\t ]);\n }", "public function testUserLogin()\n {\n $response = $this->get('/login')\n ->assertStatus(200)\n ->assertSee('Login');\n }", "public function testAdminCanSeeUserIndex()\n {\n $this->actingAs($this->admin_user);\n\n $response = $this->get(route('admin.users.index'));\n\n $response->assertStatus(200);\n }", "public function testShowUserWithAddresses()\n {\n $user = factory(User::class)->state('administration_worker')->create();\n $response = $this->withHeaders([\n ])->getJson(\"/api/user/{$user->id}\", []);\n\n $response->assertStatus(200)\n ->assertJson([\"user\" => $user->toArray()])\n ->assertJsonPath(\"user.address.id\", $user->address_id)\n ->assertJsonPath(\"user.correspondal_address.id\", $user->correspondal_address_id);\n }", "public function testUsuarioPodeVerTelaDeLogin()\n {\n $response = $this->get('/login');\n $response->assertSuccessful();\n $response->assertViewIs('auth.login');\n }", "public function test()\n {\n $data = [\n 'name' => 'Test user',\n 'email' => '[email protected]',\n 'password' => 'test123',\n ];\n\n\n $this->browse(function (Browser $browser) use ($data) {\n $browser->visit('/')\n ->assertSee('ZAREJESTRUJ SIĘ')\n ->clickLink('Zarejestruj się')\n ->screenshot('1.Register_form')\n ->type('name', $data['name'])\n ->type('email', $data['email'])\n ->type('password', $data['password'])\n ->type('password_confirmation', $data['password'])\n ->screenshot('2.Register_form_filled')\n ->press('Zarejestruj się')\n ->screenshot('3.Registred')\n ->assertSee('Witaj, Test user!')\n ->clickLink($data['name'])\n ->clickLink('Wyloguj')\n ->screenshot('4.Logout')\n ->clickLink('Logowanie')\n ->type('email', $data['email'])\n ->type('password', $data['password'])\n ->press('Logowanie')\n ->screenshot('5.Logged')\n ->assertSee('Witaj, Test user!')\n ;\n });\n }", "public function testLogAuthActionUsingPOST()\n {\n\n }", "public function testRutaCrear(){\n $response = $this->call('GET', 'administracion/usuarios/crear');\n $this->assertEquals(200, $response->status());\n }", "public function testSignupIndexUserInfo()\n {\n $user = factory(User::class)->create(['drupal_id' => '100003', 'first_name' => 'Name']);\n\n // For testing, we'll mock a successful Phoenix API response.\n $this->phoenixMock->shouldReceive('getSignupIndex')->with(['users' => ['100003']])->once()->andReturn([\n 'data' => [\n [\n 'user' => [\n 'drupal_id' => '100003',\n ],\n ],\n ],\n ]);\n\n $this->asUserUsingLegacyAuth($user)->withLegacyApiKeyScopes(['user'])->get('v1/signups?users='.$user->_id);\n $this->assertResponseStatus(200);\n $this->seeJson();\n\n $this->assertEquals('Name', $this->decodeResponseJson()['data'][0]['user']['first_name']);\n }", "public function test_product_view_test()\n {\n //crecion de usuario\n $user = new User();\n $user->name = 'amdin';\n $user->email = '[email protected]';\n $user->password = 'admin312';\n $user->save();\n\n //autenticacion de usuario\n Auth::loginUsingId(1);\n\n //comprobacion de autenticacion\n $this->assertAuthenticated();\n\n // Datos de un producto\n $data['dat'] = array(\n \"cod\" => \"2791\",\n \"name\" => \"Aceite 2000\",\n \"price\" => \"70000\",\n \"amount\" => \"20\",\n \"description\" => \"Aceite para motor\",\n );\n //Acceso a la funcion que permite agregar un producto\n $this->post(route('add_product'), $data);\n\n //llamado a la vista de productos\n $response = $this->get(route('view_product'));\n\n //comprobacion de visualizacion correcta por parte de el usuario\n $response->assertSee(['Gestión de productos','Agrega, actualiza o elimina registros de productos',\n 'ID','Código','Nombre','Valor Unidad','Cantidad','Descripción','Proveedor',\n \"1\",$data['dat']['cod'],$data['dat']['name'],$data['dat']['price'],$data['dat']['amount'],$data['dat']['description']\n ]);\n\n }", "public function postShow()\n {\n $id_user = Input::get('id');\n $user = User::find($id_user);\n if (count($user)) {\n return Response::json(array('user' => $user,\n 'status' => 1));\n }\n return Response::json(array('messages' => 'El usuario no esta registrado',\n 'status' => 0));\n }" ]
[ "0.7452079", "0.7159705", "0.71342266", "0.71106046", "0.7060052", "0.7035511", "0.7019875", "0.68795824", "0.6877745", "0.68536615", "0.6838478", "0.68359435", "0.6768455", "0.67433697", "0.67139703", "0.66954195", "0.6678893", "0.6674292", "0.6652922", "0.6636154", "0.6628976", "0.66260076", "0.6624815", "0.6621665", "0.6588464", "0.6564126", "0.65577424", "0.6555556", "0.6544952", "0.65097004", "0.65070146", "0.649341", "0.6486698", "0.6481359", "0.64738286", "0.64724565", "0.64676857", "0.6465819", "0.6437101", "0.64367664", "0.6436691", "0.6427099", "0.64160717", "0.6406705", "0.6393128", "0.63809663", "0.6379046", "0.6372328", "0.6371162", "0.63654184", "0.63584656", "0.635523", "0.6346181", "0.6340315", "0.6328682", "0.6317998", "0.63168824", "0.6310189", "0.630682", "0.63026446", "0.62917525", "0.6289599", "0.62713385", "0.6256571", "0.6256004", "0.62301105", "0.6229127", "0.6222422", "0.6209618", "0.6209214", "0.6204185", "0.6192071", "0.61784035", "0.61619174", "0.6156934", "0.6155551", "0.61324865", "0.6115285", "0.6108876", "0.6107851", "0.6105554", "0.6101316", "0.6100479", "0.6095835", "0.6093282", "0.6088713", "0.6085707", "0.6085558", "0.6084133", "0.6080394", "0.60793144", "0.6077199", "0.60769415", "0.6070825", "0.60703534", "0.60641325", "0.6062869", "0.60610425", "0.6060718", "0.6047904" ]
0.6823518
12
Test Request POST (orchestra)/users/view/1
public function testPostUpdateUserPage() { $this->be($this->user); $user = Orchestra\Model\User::create(array( 'email' => '[email protected]', 'fullname' => 'Mior Muhammad Zaki', 'password' => '123456', )); $user->roles()->sync(array(2)); $response = $this->call('orchestra::users@view', array($user->id), 'POST', array( 'id' => $user->id, 'email' => '[email protected]', 'fullname' => 'crynobone', 'password' => '345678', 'roles' => array(2), )); $this->assertInstanceOf('Laravel\Redirect', $response); $this->assertEquals(302, $response->foundation->getStatusCode()); $this->assertEquals(handles('orchestra::users'), $response->foundation->headers->get('location')); $updated_user = Orchestra\Model\User::find($user->id); $this->assertEquals('[email protected]', $updated_user->email); $this->assertEquals('crynobone', $updated_user->fullname); $this->assertTrue(Hash::check('345678', $updated_user->password)); $updated_user->delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetUsersPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\t\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.index', $response->content->view);\n\t}", "public function testGetSingleUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.edit', $response->content->view);\n\t}", "public function test_users_create_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testShowUser()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/1');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n \"data\" => [\n \"id\",\n \"employee_code\",\n \"name\",\n \"email\",\n \"team\",\n \"role\",\n \"total_borrowed\",\n \"total_donated\"\n ]\n \n ])->assertStatus(Response::HTTP_OK);\n }", "public function test_users_create_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testUserIndex()\n {\n $user = factory('App\\User')->create();\n\n $this->get('/api/v1/users');\n\n $username = json_decode($this->response->getContent(), true)[0][\"username\"];\n\n $this->assertEquals(\n $user[\"username\"], $username);\n }", "public function testGetUser()\n {\n $response = $this->get('getuser');\n\n $response->assertStatus(200);\n }", "public function test_show_user_as_user()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function testProfileView()\n {\n $this->loginReader();\n\n $response = $this->get('api/user/profile/1');\n\n $response->assertStatus(200);\n }", "public function test_users_edit_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function test_users_edit_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function testPostCreateNewUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@view', array(''), 'POST', array(\n\t\t\t'id' => '',\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'Mior Muhammad Zaki',\n\t\t\t'password' => '123456',\n\t\t\t'roles' => array(2),\n\t\t));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::users'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$user = Orchestra\\Model\\User::where_email('[email protected]')->first();\n\n\t\t$this->assertGreaterThan(0, $user->id);\n\t\t$this->assertEquals('[email protected]', $user->email);\n\t\t$this->assertEquals('Mior Muhammad Zaki', $user->fullname);\n\t\t$this->assertTrue(Hash::check('123456', $user->password));\n\n\t\t$user->delete();\n\t}", "public function testIndex()\n {\n $response = $this->getJson(route('users.index'), $this->headers);\n\n $response->assertStatus(200);\n }", "public function test_users_create_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testPostUserAction201()\n {\n $rand_num = mt_rand(0, 1000000);\n $nombre = 'Nuevo UsEr POST * ' . $rand_num;\n $p_data = [\n 'username' => $nombre,\n 'email' => 'email' . $rand_num . '@example.com',\n 'password' => 'P4ssW0r4 Us3r P0ST * ñ?¿ áËì·' . $rand_num,\n 'enabled' => mt_rand(0, 2),\n 'isAdmin' => mt_rand(0, 2)\n ];\n\n // 201\n self::$_client->request(\n Request::METHOD_POST, self::RUTA_API,\n [], [], [], json_encode($p_data)\n );\n $response = self::$_client->getResponse();\n self::assertEquals(Response::HTTP_CREATED, $response->getStatusCode());\n self::assertTrue($response->isSuccessful());\n self::assertJson($response->getContent());\n $user = json_decode($response->getContent(), true);\n\n return $user['user'];\n }", "public function testCreateUser()\n {\n $num = rand(10, 1000);\n $userData = [\n \"name\" => \"John Doe $num\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345\",\n \"org_id\" => 1\n ];\n $this->json('POST', 'api/user/create', $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function testGetUser()\n {\n $headers = $this->authenticate();\n $response = $this->json('GET', '/api/user', [], $headers);\n $response->assertStatus(200);\n }", "public function testShowUser()\n {\n $user = User::find(1);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->visit('/users/' . $user->id)\n ->assertSee($user->id)\n ->assertSee($user->full_name)\n ->assertSee($user->email);\n });\n }", "public function testGetUserAll()\n {\n $response = $this->request()->json('GET','/api/users');\n $response->assertStatus(200);\n }", "public function testRouteShowDetailUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(1)\n ->visit('/users')\n ->click('.table tbody tr:nth-child(1) td:nth-child(7) a:nth-child(1)')\n ->assertPathIs('/users/1')\n ->assertSee('DETAIL USER')\n ->assertSee('User Information');\n });\n }", "function loadUsersDetail()\n {\n $this->get('/usuarios/5')\n ->assertStatus(200)\n ->assertSee('Mostrando detalle del usuario: 5');\n }", "public function testUserIndex()\n {\n $response = $this->actingAs($this->user())->get(route('task_statuses.index'));\n $response->assertOk();\n }", "public function test_if_users_list_loads_with_data()\n {\n factory(User::class)->create([\n 'name'=>'Joel' \n ]);\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Joel'); \n }", "public function test_index_returns_view()\n {\n $controller = new UsersController();\n $view = $controller->index();\n $this->assertEquals('admin.users.index', $view->getName());\n $this->assertArrayHasKey('users', $view->getData());\n }", "public function test_authorized_user_can_access_the_user_route()\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n\n $response = $this->get('/user');\n\n $response->assertStatus(200);\n $response->assertJson(['data' => ['name' => $user->name, 'email' => $user->email]]);\n }", "public function testListUsersSuccess()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"users\": \"user\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->get('api/user/list-users', $this->headers)\n ->assertStatus(200)\n ->assertJson(['users' => 'user']);\n\n }", "public function testCreateUser()\n {\n $dados = [\n 'unidade_id' => 1,\n 'chave' => '1111',\n 'name' => 'Fulano',\n 'email' => '[email protected]',\n 'password' => 'Gerente',\n 'password_confirmation' => 'Gerente',\n 'ativo' => true,\n 'perfil_id' => 1,\n ];\n\n $this->post('/api/users', $dados, $this->api_token);\n\n $this->assertResponseOk();\n\n $reposta = (array) json_decode($this->response->content());\n\n $this->assertArrayHasKey('unidade_id', $reposta);\n $this->assertArrayHasKey('chave', $reposta);\n $this->assertArrayHasKey('name', $reposta);\n $this->assertArrayHasKey('email', $reposta);\n $this->assertArrayHasKey('ativo', $reposta);\n $this->assertArrayHasKey('perfil_id', $reposta);\n $this->assertArrayHasKey('id', $reposta);\n }", "public function testGetOneUserInformation()\n {\n $response = $this->json('GET', $this->userEndpoint.'/prostoalex');\n\n // It should return a valid user json with all the basic attributes filled\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'created',\n 'id',\n 'karma',\n 'submitted',\n 'about',\n ])\n ->assertJsonFragment([\n 'id' => 'prostoalex'\n ]);\n }", "public function testCreateUser()\n {\n $this->visit('/Users/create')\n\t ->type('1', 'role_id')\n\t ->type('Daniel', 'firstname')\n\t ->type('Becerra', 'lastname')\n\t ->type('[email protected]', 'email')\n\t ->type('danielbecerrao', 'user')\n\t ->type('12345678', 'password')\n\t ->type('12345678', 'register')\n\t ->press('Crear')\n\t ->seePageIs('/Users');\n\n }", "public function test_it_creates_a_new_user()\n {\n $user = ['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook'];\n\n $this->json('POST', '/users', $user)\n ->seeJson($user);\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function testShowUser()\n {\n \t$user = factory(User::class)->create()''\n \t$response = $this->actingAs($user)->withSession(['Foo' => 'bar'])->get('/memes');\n \t$response->assertStatus(200);\n \n }", "public function testUserApiReturnsUsers()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $users = factory(User::class, 2)->create();\n\n // $this->json('GET', 'api/v1/users')\n // ->seeJsonStructure([\n // '*' => [\n // 'northstar_id', 'created_at', 'updated_at', 'role',\n // ]\n // ]);\n }", "public function testLoginRegister(){\n $user = User::find(1);\n $this->be($user);\n\n $response =$this->get(route('administracion'));\n $response->assertStatus(200);\n }", "public function test_can_view_profile_of_any_user()\n {\n // When i access his profile\n // Then i can see his name\n $user = create(User::class);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeText($user->name);\n }", "public function testIndexCreateUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@create'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->type('first_name', 'cowell@123')\n ->type('last_name', 'cowell@123')\n ->select('id_role', '3')\n ->press('Create')\n ->assertSee('Xong rồi');\n });\n }", "public function test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\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 testuserGet200()\n {\n $response = $this->runApp('GET', '//user/{id}');\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertContains('Success', (string)$response->getBody());\n }", "public function test_login_user_login_view()\n {\n $response = $this->get(route('login'));\n\n $response->assertSuccessful();\n\n $response->assertViewIs('auth.login');\n }", "public function testResponseJson() {\n $this->visit(\"/api/users/teste\")->seeJson();\n }", "public function testListUsers()\n {\n echo \"\\nTesting user listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/users\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function testAddUser(){\n $em = $this->getContainer()->get('doctrine')->getManager();\n\n $this->connect();\n $client = $this->makeClient();\n\n $crawler = $client->request('GET', '/admin/user/add');\n $response = $client->getResponse();\n\n $this->assertStatusCode(200, $client);\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n\n // Post user\n $crawler = $client->request('GET', '/');\n $button = $crawler->filter('a:contains(\"Admin\")')->eq(0)->link();\n $this->assertTrue($button != null);\n\n $crawler = $client->click($button);\n $button = $crawler->filter('a:contains(\"Utilisateur\")')->eq(0)->link();\n $this->assertTrue($button != null);\n\n// $form = $crawler->selectButton('Ajouter')->form();\n// $form->setValues([\n// 'userbundle_user[username]' => 'boura',\n// 'userbundle_user[email]' => '[email protected]',\n// 'userbundle_user[plainPassword]' => 'bdiallo'\n//\n// ]);\n// $client->submit($form);\n// $this->assertStatusCode('200', $client);\n\n // Verify count of user saved\n// $this->assertCount(2, $em->getRepository('UserBundle:User')->findAll());\n }", "public function testGetUserAction200(array $user)\n {\n self::$_client->request(\n Request::METHOD_GET,\n self::RUTA_API . '/' . $user['id']\n );\n $response = self::$_client->getResponse();\n\n self::assertEquals(Response::HTTP_OK, $response->getStatusCode());\n self::assertJson((string) $response->getContent());\n $user_aux = json_decode((string) $response->getContent(), true);\n self::assertEquals($user, $user_aux['user']);\n }", "public function test()\n {\n $this->getAuthenticatedUser();\n return response()->json(['data' => ['status' => 'OK']], 200);\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 }", "public function testSeeSingleUserTest()\n {\n $user = \\App\\User::firstOrFail();\n $response = $this->get('/users/'.$user->id);\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function test_users_edit_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function userAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ($loginUser) {\n header('Content-Type: application/json');\n http_response_code(200);\n echo json_encode(array(\n 'userId' => $loginUser->getId(),\n 'username' => $loginUser->getUsername(),\n 'authenticated' => true,\n 'userType' => $loginUser->getUserType(),\n 'emailAddress' => $loginUser->getEmailAddress(),\n 'firstName' => $loginUser->getFirstName(),\n 'lastName' => $loginUser->getLastName(),\n 'birthdate' => $loginUser->getBirthdate(),\n 'isVerified' => method_exists(($loginUser), 'isVerified') ? $loginUser->isVerified() : null,\n 'isEmailVerified' => method_exists(($loginUser), 'isEmailVerified') ? $loginUser->isEmailVerified() : null,\n 'status' => $loginUser->getStatus(),\n 'uuid' => $loginUser->getUUID(),\n // 'imageId' => $loginUser->getProfileImageId(),\n // 'coverImageType' => $loginUser->getProfileCoverImageType(),\n // 'coverImageId' => $loginUser->getProfileCoverImageId(),\n // 'coverPresetImageId' => $loginUser->getProfileCoverPresetImageId(),\n // 'coverTing' => $loginUser->getProfileCoverTint(),\n ));\n exit();\n } else {\n header('Content-Type: application/json');\n http_response_code(200);\n echo json_encode(array(\n 'authenticated' => false,\n ));\n exit();\n }\n }", "public function testIndexUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@user'))\n ->assertSee('FIRST NAME');\n });\n }", "public function testEnterCorrectData()\n {\n $user = User::factory()->create();\n \n $response = $this->call('POST', '/admin/signin', [\n 'email' => $user->email,\n 'password' => '123456',\n '_token' => csrf_token()\n ]);\n \n $this->assertEquals(200, $response->getStatusCode());\n\n \n\n }", "public function user_route()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testGetInfoUser()\n {\n $id = 1;\n $this->json('GET', \"api/user/get-info/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"data\" => [\n \"created_at\",\n \"email\",\n \"name\",\n \"id\",\n \"org_id\",\n \"updated_at\"\n ]\n ]);\n }", "public function user_route_api()\n {\n $this->withoutExceptionHandling();\n $response = $this->get('/api/test-user');\n\n $response->assertStatus(200);\n }", "public function testApiIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/api/comptes');\n\n $response->assertStatus(200)\n ->assertJson([\n\n 'comptes' => true,\n \n ]);\n }", "public function testUserApiReturnsResponse()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $this->json('GET', 'api/v1/users')\n // ->assertResponseStatus('200');\n }", "function loadCreateUser()\n {\n $this->get('/usuarios/nuevo')\n ->assertStatus(200)\n ->assertSee('Crear nuevo usuario');\n }", "public function testIndex(): void\r\n {\r\n $client = static::createClient();\r\n $userRepository = static::$container->get(UserDoctrineRepository::class);\r\n\r\n $testUser = $userRepository->getUserByEmail('[email protected]');\r\n \r\n // Symfony helper.\r\n $client->loginUser($testUser);\r\n\r\n $client->request('GET', '/admin');\r\n\r\n static::assertResponseIsSuccessful();\r\n }", "public function testUbicaciontracker()\n {\n // $response = $this->get('/');\n // $response->assertStatus(200);\n //$this->visit('buque/store');\n // $response = $this->get('/');\n // $this->assertTrue(true);\n $response = $this->withHeaders([\n 'X-Header' => 'Value',\n ])->json('POST', '/user', ['name' => 'Sally']);\n\n $response\n ->assertStatus(201)\n ->assertJson([\n 'created' => true,\n ]);\n }", "public function testUrlEditUsers()\n {\n $user = User::find(2);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($this->user)\n ->visit('/admin/users')\n ->click('.button-edit')\n ->assertSee('Update users')\n ->assertPathIs('/admin/users/'.$user->id.'/edit');\n });\n }", "public function testIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/admin/comptes');\n\n $response->assertStatus(200)\n ->assertViewIs('layouts.admin');\n }", "function loadUsersListPage()\n {\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Listado de usuarios')\n ->assertSee('Javier')\n ->assertSee('Francisco');\n }", "public function actionUser($request)\n {\n return $this->start()->uri(\"/api/user/action\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function testUserListForAdmin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'data' => true,\n ]);\n }", "public function testGetRequest()\n {\n $admin = $this->getAdminUser();\n $user = factory(\\App\\User::class)->create();\n $grade = factory(\\App\\Grade::class)->create();\n $userGrade = UserGrade::create([\n 'user_id' => $user->id,\n 'grade_id' => $grade->id\n ]);\n $response = $this->actingAs($user)->call('GET', \"/api/user/{$user->id}/grade\");\n $this->assertEquals(200, $response->status());\n }", "public function testEndPoint()\n {\n\n $user = Auth::loginUsingId(1);\n\n// $response = $this->actingAs($user)\n// ->get('dashboard/orders/create');\n $response = $this->get('dashboard/orders/create');\n\n $response->assertStatus(200);\n }", "public function testShowSuccessfully()\n {\n $this->seed(\\UserTableSeeder::class);\n\n $employer = User::query()->where('email', '[email protected]')->first();\n Passport::actingAs(\n $employer,\n ['employer']\n );\n\n $response = $this->get('https://api.belsaa.com/employer/employer');\n $response->assertStatus(200);\n $response->assertJsonStructure(['id', 'company_name', 'user_attributes' => ['bio', 'legal_document_url', 'office_photo_url']]);\n $response->assertJsonFragment(['id' => $employer->id]);\n }", "public function testPostDeleteUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$user = Orchestra\\Model\\User::create(array(\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'Mior Muhammad Zaki',\n\t\t\t'password' => '123456',\n\t\t));\n\t\t$user->roles()->sync(array(2));\n\n\t\t$this->assertGreaterThan(0, $user->id);\n\n\t\t$user_id = $user->id;\n\t\t\n\t\t$response = $this->call('orchestra::users@delete', array($user_id));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::users'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$user = Orchestra\\Model\\User::find($user_id);\n\n\t\t$this->assertTrue(is_null($user));\n\t}", "public function testItReturnsAUserByUserId()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users/{$user1->id}\")\n ->assertStatus(200)\n ->assertJson([\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n ]);\n }", "public function testSignupIndex()\n {\n $user = factory(User::class)->create(['drupal_id' => '100001', 'first_name' => 'Chloe']);\n $user2 = factory(User::class)->create(['drupal_id' => '100002', 'first_name' => 'Dave']);\n\n // For testing, we'll mock a successful Phoenix API response.\n $this->phoenixMock->shouldReceive('getSignupIndex')->with(['users' => ['100001', '100002']])->once()->andReturn([\n 'data' => [\n [\n 'id' => '243',\n 'user' => [\n 'drupal_id' => '100001',\n ],\n ],\n [\n 'id' => '44',\n 'user' => [\n 'drupal_id' => '100002',\n ],\n ],\n ],\n ]);\n\n $this->asUserUsingLegacyAuth($user)->withLegacyApiKeyScopes(['user'])->get('v1/signups?users='.$user->_id.','.$user2->_id);\n\n $this->assertResponseStatus(200);\n $this->seeJson();\n\n $this->seeJsonStructure([\n 'data' => [\n '*' => [\n 'user' => [\n 'id', 'first_name', 'last_initial', 'photo', 'country',\n ],\n ],\n ],\n ]);\n }", "public function test()\n {\n $userData = factory(User::class)->make()->toArray();\n $userData['password'] = $userData['password_confirmation'] = 'qweqweqwe';\n\n /**\n * @see \\App\\Http\\Controllers\\RegisterController::signUp()\n */\n $response = $this->post('/auth/sign-up', $userData);\n\n $response->assertResponseStatus(201);\n\n $user = User::where('email', $userData['email'])->first();\n\n $this->assertNotEmpty($user);\n\n /**\n * @see \\App\\Http\\Controllers\\LoginController::signIn()\n */\n $response = $this->post('/auth/sign-in', [\n 'email' => $user->email,\n 'password' => $userData['password'],\n ]);\n\n $response->assertResponseOk();\n\n $response->seeHeader('Authorization');\n }", "public function test_show_user_as_admin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($this->admin)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function testCreatingFirstUser()\n {\n $response = $this->postJson('users', [\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'password' => 'password'\n ]);\n\n $response->assertStatus(201);\n }", "public function viewAction()\n {\n $repo = $this->entityManager\n ->getRepository(Entity\\User::class);\n $id = $this->params()->fromRoute('id');\n $entity = $this->params()->fromRoute('entity', 'user');\n $user = $repo->getUser($id, $entity);\n return ['entity' => $user,'id' => $id ];\n }", "public function testVerUsuarios()\n {\n $user = User::all();\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($user[0])\n ->resize(1300, 1200)\n ->visit('/admin')\n ->clickLink('Usuarios')\n ->clickLink('Administrar usuarios')\n ->assertPathIs('/admin/usuarios')\n ->assertSee('Usuarios')\n ->pause(1000)//peticiones ajax\n ->waitForText('Siguiente')\n ->with('.table', function ($table) use ($user) {\n $table->assertSee($user[1]->email);\n });\n });\n }", "public function testSignupIndexUserInfo()\n {\n $user = factory(User::class)->create(['drupal_id' => '100003', 'first_name' => 'Name']);\n\n // For testing, we'll mock a successful Phoenix API response.\n $this->phoenixMock->shouldReceive('getSignupIndex')->with(['users' => ['100003']])->once()->andReturn([\n 'data' => [\n [\n 'user' => [\n 'drupal_id' => '100003',\n ],\n ],\n ],\n ]);\n\n $this->asUserUsingLegacyAuth($user)->withLegacyApiKeyScopes(['user'])->get('v1/signups?users='.$user->_id);\n $this->assertResponseStatus(200);\n $this->seeJson();\n\n $this->assertEquals('Name', $this->decodeResponseJson()['data'][0]['user']['first_name']);\n }", "public function testAccess() {\n\n $this->drupalGet('udb3/api/1.0/user');\n $this->assertResponse('403');\n\n }", "public function testShowUserWithoutAddresses()\n {\n $user = factory(User::class)->state('lecturer')->create();\n $response = $this->withHeaders([\n ])->getJson(\"/api/user/{$user->id}\", []);\n\n $response->assertStatus(200)\n ->assertJson([\"user\" => $user->toArray()]);\n }", "public function testUsersCanCreateAulas()\n {\n $response = $this->json('GET', 'aulas.index');\n $response\n ->assertStatus(201)\n ->assertExactJson([\n 'created' => true,\n ]);\n }", "public function testGetApiUser()\n {\n $token = $this->getAuthToken();\n /* @var TestResponse $response */\n $this->json(\n 'GET',\n '/api/user',\n [],\n [\n 'Content-Type: application/x-www-form-urlencoded',\n 'Cache-Control: no-cache',\n 'Authorization' => 'Bearer ' . $token . '',\n ],\n 'Get current user'\n ) ->assertStatus(200)\n ->assertJsonStructure(\n [\n 'data' => [\n 'id',\n 'email',\n 'profile',\n 'privacySettings',\n ],\n 'channel',\n ]\n );\n }", "public function test_product_view_test()\n {\n //crecion de usuario\n $user = new User();\n $user->name = 'amdin';\n $user->email = '[email protected]';\n $user->password = 'admin312';\n $user->save();\n\n //autenticacion de usuario\n Auth::loginUsingId(1);\n\n //comprobacion de autenticacion\n $this->assertAuthenticated();\n\n // Datos de un producto\n $data['dat'] = array(\n \"cod\" => \"2791\",\n \"name\" => \"Aceite 2000\",\n \"price\" => \"70000\",\n \"amount\" => \"20\",\n \"description\" => \"Aceite para motor\",\n );\n //Acceso a la funcion que permite agregar un producto\n $this->post(route('add_product'), $data);\n\n //llamado a la vista de productos\n $response = $this->get(route('view_product'));\n\n //comprobacion de visualizacion correcta por parte de el usuario\n $response->assertSee(['Gestión de productos','Agrega, actualiza o elimina registros de productos',\n 'ID','Código','Nombre','Valor Unidad','Cantidad','Descripción','Proveedor',\n \"1\",$data['dat']['cod'],$data['dat']['name'],$data['dat']['price'],$data['dat']['amount'],$data['dat']['description']\n ]);\n\n }", "public function testShowUserWithAddresses()\n {\n $user = factory(User::class)->state('administration_worker')->create();\n $response = $this->withHeaders([\n ])->getJson(\"/api/user/{$user->id}\", []);\n\n $response->assertStatus(200)\n ->assertJson([\"user\" => $user->toArray()])\n ->assertJsonPath(\"user.address.id\", $user->address_id)\n ->assertJsonPath(\"user.correspondal_address.id\", $user->correspondal_address_id);\n }", "public function testAdminCanSeeUserIndex()\n {\n $this->actingAs($this->admin_user);\n\n $response = $this->get(route('admin.users.index'));\n\n $response->assertStatus(200);\n }", "public function testPostRegistroSucesso()\n {\n\n $userData = [\n \"nome\" => \"Shang Chi\",\n \"sinopse\" => \"Quero assistir\",\n \"data_lancamento\" => \"10-12-2021\",\n \"nota\" => 10,\n \"maior_18\" => True,\n ];\n\n $this->json('POST', 'api/filmes', $userData, ['Accept' => 'application/json'])\n ->assertStatus(201)\n ->assertJsonStructure([\n \"user\" => [\n 'id',\n 'nome',\n 'data_lancamento',\n \"nota\",\n \"maior_18\",\n 'created_at',\n 'updated_at',\n ],\n ]);\n }", "public function testUserCanViewSensorList()\n {\n $user = User::factory()->create([\n 'password' => bcrypt($password = 'i-love-laravel'),\n ]);\n\n $response = $this->post('/login', [\n 'email' => $user->email,\n 'password' => $password,\n ]);\n\n $response->assertRedirect('/dashboard');\n $this->assertAuthenticatedAs($user);\n\n $response = $this->get('/sensor/list');\n\n $response->assertStatus(200);\n $response->assertSeeText('Sensors');\n }", "public function usersAction(){\n\n\n $team_users = $this->api()->search('team-user');\n $users = $this->api()->search('users');\n $view = new ViewModel(['users'=> $users, 'team_users'=>$team_users]);\n return $view;\n// $view->setVariable('response', $response);\n\n\n }", "public function testGetUserByUsernameAction200(array $user)\n {\n self::$_client->request(\n Request::METHOD_GET,\n self::RUTA_API . '/username/' . $user['username']\n );\n $response = self::$_client->getResponse();\n\n self::assertEquals(Response::HTTP_OK, $response->getStatusCode());\n self::assertJson((string) $response->getContent());\n $user_aux = json_decode((string) $response->getContent(), true);\n self::assertEquals($user, $user_aux['user']);\n }", "public function testExample()\n {\n \t$response = $this->json('POST', '/users', ['name' => 'Sally']);\n $response\n ->assertStatus(200)\n ->assertJson([\n 'created' => true,\n ]);\n }", "public function testGetSingleUserPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function testUserMeGet()\n {\n }", "public function testEditUsersSuccess()\n {\n $user = User::find(2);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($this->user)\n ->visit('/admin/users/'.$user->id.'/edit')\n ->resize(900, 1000)\n ->assertSee('Update users')\n ->type('name',$user->name)\n ->press('Submit')\n ->assertSee('Successfully updated user!')\n ->assertPathIs('/admin/users');\n });\n $this->assertDatabaseHas('users', [\n 'name' => $user->name]);\n }", "public function testIndexRoutedUser(): void\n {\n // given\n $expectedStatusCode = 302;\n $user = $this->createUser([User::ROLE_USER]);\n $this->logIn($user);\n\n // when\n $this->httpClient->request('GET', '/tag');\n $resultStatusCode = $this->httpClient->getResponse()->getStatusCode();\n\n // then\n $this->assertEquals($expectedStatusCode, $resultStatusCode);\n }", "public function test()\n {\n $data = [\n 'name' => 'Test user',\n 'email' => '[email protected]',\n 'password' => 'test123',\n ];\n\n\n $this->browse(function (Browser $browser) use ($data) {\n $browser->visit('/')\n ->assertSee('ZAREJESTRUJ SIĘ')\n ->clickLink('Zarejestruj się')\n ->screenshot('1.Register_form')\n ->type('name', $data['name'])\n ->type('email', $data['email'])\n ->type('password', $data['password'])\n ->type('password_confirmation', $data['password'])\n ->screenshot('2.Register_form_filled')\n ->press('Zarejestruj się')\n ->screenshot('3.Registred')\n ->assertSee('Witaj, Test user!')\n ->clickLink($data['name'])\n ->clickLink('Wyloguj')\n ->screenshot('4.Logout')\n ->clickLink('Logowanie')\n ->type('email', $data['email'])\n ->type('password', $data['password'])\n ->press('Logowanie')\n ->screenshot('5.Logged')\n ->assertSee('Witaj, Test user!')\n ;\n });\n }", "public function user_view(Request $request) {\n\n $user = User::find($request->id);\n\n if ($user) {\n\n $response_array = ['success'=>true, 'data'=>$user];\n\n return response()->json($response_array, 200); \n\n } else {\n\n $response_array = ['success'=>false, 'error_messages'=>tr('user_not_found')];\n\n return response()->json($response_array, 200); \n\n }\n\n }", "public function postShow()\n {\n $id_user = Input::get('id');\n $user = User::find($id_user);\n if (count($user)) {\n return Response::json(array('user' => $user,\n 'status' => 1));\n }\n return Response::json(array('messages' => 'El usuario no esta registrado',\n 'status' => 0));\n }", "public function testIndex()\n {\n $testingRoleName = 'user';\n\n /** @var User $user */\n $user = factory(User::class)->create();\n $user->attachRole($testingRoleName);\n\n $userResource = new UserResource($user);\n\n $userResponseJson = response()->json($userResource)->getData();\n\n $userRole = $userResponseJson->roles;\n\n $role = Role::findOrFail($userRole);\n\n $this->assertEquals($testingRoleName, $role->name);\n $this->assertEquals($user->id, $userResponseJson->id);\n $this->assertEquals($user->name, $userResponseJson->name);\n $this->assertEquals($user->email, $userResponseJson->email);\n $this->assertEquals($user->publish, $userResponseJson->publish);\n }", "public function testTokenViewPage()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.show', [$this->token->id_hash]));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.show');\n }", "public function testPostRequest()\n {\n $admin = $this->getAdminUser();\n $user = factory(\\App\\User::class)->create();\n $grade = factory(\\App\\Grade::class)->create();\n $data = [\n 'grade_id' => $grade->id\n ];\n $response = $this->actingAs($admin)->call('POST', \"/api/user/{$user->id}/grade/\", $data);\n $this->assertEquals(200, $response->status());\n }", "public function testLogAuthActionUsingPOST()\n {\n\n }", "public function testUserRegister()\n {\n $response = $this->get('/register')\n ->assertStatus(200)\n ->assertSee('Register');\n }" ]
[ "0.73160887", "0.71074474", "0.7040686", "0.7022389", "0.69954544", "0.68918324", "0.68818146", "0.6753285", "0.6733621", "0.67182714", "0.6715476", "0.6712797", "0.6709132", "0.66945577", "0.6652675", "0.66261744", "0.6593666", "0.65934837", "0.6523227", "0.65090525", "0.65017784", "0.64671576", "0.6437713", "0.64313865", "0.6429808", "0.6421168", "0.6418956", "0.6418199", "0.6409512", "0.6405269", "0.63932025", "0.6389339", "0.6370388", "0.63542795", "0.6340133", "0.6333087", "0.63272935", "0.6312322", "0.6308768", "0.630468", "0.62878764", "0.62835777", "0.6270915", "0.62664974", "0.62631416", "0.62480134", "0.62463415", "0.6244255", "0.6241124", "0.6234634", "0.62273365", "0.62116355", "0.621154", "0.6200616", "0.61995757", "0.61930156", "0.6192732", "0.61689645", "0.6152367", "0.61451024", "0.6142751", "0.6140724", "0.613765", "0.6125273", "0.6106328", "0.60990626", "0.6096774", "0.6094983", "0.6081889", "0.6080675", "0.6075009", "0.60703814", "0.6044455", "0.60389274", "0.60387546", "0.6036301", "0.60285705", "0.60280937", "0.60077626", "0.6006683", "0.5994144", "0.5987809", "0.5987766", "0.5983057", "0.59812117", "0.59727085", "0.5971536", "0.5968348", "0.59670854", "0.59661484", "0.5960619", "0.59592557", "0.5951996", "0.59516156", "0.59406614", "0.59395146", "0.5934111", "0.5927141", "0.5916179", "0.5913563" ]
0.6232991
50
Test Request POST (orchestra)/users/view/1
public function testPostDeleteUserPage() { $this->be($this->user); $user = Orchestra\Model\User::create(array( 'email' => '[email protected]', 'fullname' => 'Mior Muhammad Zaki', 'password' => '123456', )); $user->roles()->sync(array(2)); $this->assertGreaterThan(0, $user->id); $user_id = $user->id; $response = $this->call('orchestra::users@delete', array($user_id)); $this->assertInstanceOf('Laravel\Redirect', $response); $this->assertEquals(302, $response->foundation->getStatusCode()); $this->assertEquals(handles('orchestra::users'), $response->foundation->headers->get('location')); $user = Orchestra\Model\User::find($user_id); $this->assertTrue(is_null($user)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetUsersPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\t\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.index', $response->content->view);\n\t}", "public function testGetSingleUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.edit', $response->content->view);\n\t}", "public function test_users_create_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testShowUser()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/1');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n \"data\" => [\n \"id\",\n \"employee_code\",\n \"name\",\n \"email\",\n \"team\",\n \"role\",\n \"total_borrowed\",\n \"total_donated\"\n ]\n \n ])->assertStatus(Response::HTTP_OK);\n }", "public function test_users_create_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testUserIndex()\n {\n $user = factory('App\\User')->create();\n\n $this->get('/api/v1/users');\n\n $username = json_decode($this->response->getContent(), true)[0][\"username\"];\n\n $this->assertEquals(\n $user[\"username\"], $username);\n }", "public function testGetUser()\n {\n $response = $this->get('getuser');\n\n $response->assertStatus(200);\n }", "public function test_show_user_as_user()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function testProfileView()\n {\n $this->loginReader();\n\n $response = $this->get('api/user/profile/1');\n\n $response->assertStatus(200);\n }", "public function test_users_edit_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function test_users_edit_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function testPostCreateNewUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@view', array(''), 'POST', array(\n\t\t\t'id' => '',\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'Mior Muhammad Zaki',\n\t\t\t'password' => '123456',\n\t\t\t'roles' => array(2),\n\t\t));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::users'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$user = Orchestra\\Model\\User::where_email('[email protected]')->first();\n\n\t\t$this->assertGreaterThan(0, $user->id);\n\t\t$this->assertEquals('[email protected]', $user->email);\n\t\t$this->assertEquals('Mior Muhammad Zaki', $user->fullname);\n\t\t$this->assertTrue(Hash::check('123456', $user->password));\n\n\t\t$user->delete();\n\t}", "public function testIndex()\n {\n $response = $this->getJson(route('users.index'), $this->headers);\n\n $response->assertStatus(200);\n }", "public function test_users_create_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testPostUserAction201()\n {\n $rand_num = mt_rand(0, 1000000);\n $nombre = 'Nuevo UsEr POST * ' . $rand_num;\n $p_data = [\n 'username' => $nombre,\n 'email' => 'email' . $rand_num . '@example.com',\n 'password' => 'P4ssW0r4 Us3r P0ST * ñ?¿ áËì·' . $rand_num,\n 'enabled' => mt_rand(0, 2),\n 'isAdmin' => mt_rand(0, 2)\n ];\n\n // 201\n self::$_client->request(\n Request::METHOD_POST, self::RUTA_API,\n [], [], [], json_encode($p_data)\n );\n $response = self::$_client->getResponse();\n self::assertEquals(Response::HTTP_CREATED, $response->getStatusCode());\n self::assertTrue($response->isSuccessful());\n self::assertJson($response->getContent());\n $user = json_decode($response->getContent(), true);\n\n return $user['user'];\n }", "public function testCreateUser()\n {\n $num = rand(10, 1000);\n $userData = [\n \"name\" => \"John Doe $num\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345\",\n \"org_id\" => 1\n ];\n $this->json('POST', 'api/user/create', $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function testGetUser()\n {\n $headers = $this->authenticate();\n $response = $this->json('GET', '/api/user', [], $headers);\n $response->assertStatus(200);\n }", "public function testShowUser()\n {\n $user = User::find(1);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->visit('/users/' . $user->id)\n ->assertSee($user->id)\n ->assertSee($user->full_name)\n ->assertSee($user->email);\n });\n }", "public function testGetUserAll()\n {\n $response = $this->request()->json('GET','/api/users');\n $response->assertStatus(200);\n }", "public function testRouteShowDetailUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(1)\n ->visit('/users')\n ->click('.table tbody tr:nth-child(1) td:nth-child(7) a:nth-child(1)')\n ->assertPathIs('/users/1')\n ->assertSee('DETAIL USER')\n ->assertSee('User Information');\n });\n }", "function loadUsersDetail()\n {\n $this->get('/usuarios/5')\n ->assertStatus(200)\n ->assertSee('Mostrando detalle del usuario: 5');\n }", "public function testUserIndex()\n {\n $response = $this->actingAs($this->user())->get(route('task_statuses.index'));\n $response->assertOk();\n }", "public function test_if_users_list_loads_with_data()\n {\n factory(User::class)->create([\n 'name'=>'Joel' \n ]);\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Joel'); \n }", "public function test_index_returns_view()\n {\n $controller = new UsersController();\n $view = $controller->index();\n $this->assertEquals('admin.users.index', $view->getName());\n $this->assertArrayHasKey('users', $view->getData());\n }", "public function test_authorized_user_can_access_the_user_route()\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n\n $response = $this->get('/user');\n\n $response->assertStatus(200);\n $response->assertJson(['data' => ['name' => $user->name, 'email' => $user->email]]);\n }", "public function testListUsersSuccess()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"users\": \"user\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->get('api/user/list-users', $this->headers)\n ->assertStatus(200)\n ->assertJson(['users' => 'user']);\n\n }", "public function testCreateUser()\n {\n $dados = [\n 'unidade_id' => 1,\n 'chave' => '1111',\n 'name' => 'Fulano',\n 'email' => '[email protected]',\n 'password' => 'Gerente',\n 'password_confirmation' => 'Gerente',\n 'ativo' => true,\n 'perfil_id' => 1,\n ];\n\n $this->post('/api/users', $dados, $this->api_token);\n\n $this->assertResponseOk();\n\n $reposta = (array) json_decode($this->response->content());\n\n $this->assertArrayHasKey('unidade_id', $reposta);\n $this->assertArrayHasKey('chave', $reposta);\n $this->assertArrayHasKey('name', $reposta);\n $this->assertArrayHasKey('email', $reposta);\n $this->assertArrayHasKey('ativo', $reposta);\n $this->assertArrayHasKey('perfil_id', $reposta);\n $this->assertArrayHasKey('id', $reposta);\n }", "public function testGetOneUserInformation()\n {\n $response = $this->json('GET', $this->userEndpoint.'/prostoalex');\n\n // It should return a valid user json with all the basic attributes filled\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'created',\n 'id',\n 'karma',\n 'submitted',\n 'about',\n ])\n ->assertJsonFragment([\n 'id' => 'prostoalex'\n ]);\n }", "public function testCreateUser()\n {\n $this->visit('/Users/create')\n\t ->type('1', 'role_id')\n\t ->type('Daniel', 'firstname')\n\t ->type('Becerra', 'lastname')\n\t ->type('[email protected]', 'email')\n\t ->type('danielbecerrao', 'user')\n\t ->type('12345678', 'password')\n\t ->type('12345678', 'register')\n\t ->press('Crear')\n\t ->seePageIs('/Users');\n\n }", "public function test_it_creates_a_new_user()\n {\n $user = ['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook'];\n\n $this->json('POST', '/users', $user)\n ->seeJson($user);\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function testShowUser()\n {\n \t$user = factory(User::class)->create()''\n \t$response = $this->actingAs($user)->withSession(['Foo' => 'bar'])->get('/memes');\n \t$response->assertStatus(200);\n \n }", "public function testUserApiReturnsUsers()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $users = factory(User::class, 2)->create();\n\n // $this->json('GET', 'api/v1/users')\n // ->seeJsonStructure([\n // '*' => [\n // 'northstar_id', 'created_at', 'updated_at', 'role',\n // ]\n // ]);\n }", "public function testLoginRegister(){\n $user = User::find(1);\n $this->be($user);\n\n $response =$this->get(route('administracion'));\n $response->assertStatus(200);\n }", "public function test_can_view_profile_of_any_user()\n {\n // When i access his profile\n // Then i can see his name\n $user = create(User::class);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeText($user->name);\n }", "public function testIndexCreateUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@create'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->type('first_name', 'cowell@123')\n ->type('last_name', 'cowell@123')\n ->select('id_role', '3')\n ->press('Create')\n ->assertSee('Xong rồi');\n });\n }", "public function test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\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 testuserGet200()\n {\n $response = $this->runApp('GET', '//user/{id}');\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertContains('Success', (string)$response->getBody());\n }", "public function test_login_user_login_view()\n {\n $response = $this->get(route('login'));\n\n $response->assertSuccessful();\n\n $response->assertViewIs('auth.login');\n }", "public function testResponseJson() {\n $this->visit(\"/api/users/teste\")->seeJson();\n }", "public function testListUsers()\n {\n echo \"\\nTesting user listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/users\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function testAddUser(){\n $em = $this->getContainer()->get('doctrine')->getManager();\n\n $this->connect();\n $client = $this->makeClient();\n\n $crawler = $client->request('GET', '/admin/user/add');\n $response = $client->getResponse();\n\n $this->assertStatusCode(200, $client);\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n\n // Post user\n $crawler = $client->request('GET', '/');\n $button = $crawler->filter('a:contains(\"Admin\")')->eq(0)->link();\n $this->assertTrue($button != null);\n\n $crawler = $client->click($button);\n $button = $crawler->filter('a:contains(\"Utilisateur\")')->eq(0)->link();\n $this->assertTrue($button != null);\n\n// $form = $crawler->selectButton('Ajouter')->form();\n// $form->setValues([\n// 'userbundle_user[username]' => 'boura',\n// 'userbundle_user[email]' => '[email protected]',\n// 'userbundle_user[plainPassword]' => 'bdiallo'\n//\n// ]);\n// $client->submit($form);\n// $this->assertStatusCode('200', $client);\n\n // Verify count of user saved\n// $this->assertCount(2, $em->getRepository('UserBundle:User')->findAll());\n }", "public function testGetUserAction200(array $user)\n {\n self::$_client->request(\n Request::METHOD_GET,\n self::RUTA_API . '/' . $user['id']\n );\n $response = self::$_client->getResponse();\n\n self::assertEquals(Response::HTTP_OK, $response->getStatusCode());\n self::assertJson((string) $response->getContent());\n $user_aux = json_decode((string) $response->getContent(), true);\n self::assertEquals($user, $user_aux['user']);\n }", "public function test()\n {\n $this->getAuthenticatedUser();\n return response()->json(['data' => ['status' => 'OK']], 200);\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 }", "public function testSeeSingleUserTest()\n {\n $user = \\App\\User::firstOrFail();\n $response = $this->get('/users/'.$user->id);\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function test_users_edit_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function userAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ($loginUser) {\n header('Content-Type: application/json');\n http_response_code(200);\n echo json_encode(array(\n 'userId' => $loginUser->getId(),\n 'username' => $loginUser->getUsername(),\n 'authenticated' => true,\n 'userType' => $loginUser->getUserType(),\n 'emailAddress' => $loginUser->getEmailAddress(),\n 'firstName' => $loginUser->getFirstName(),\n 'lastName' => $loginUser->getLastName(),\n 'birthdate' => $loginUser->getBirthdate(),\n 'isVerified' => method_exists(($loginUser), 'isVerified') ? $loginUser->isVerified() : null,\n 'isEmailVerified' => method_exists(($loginUser), 'isEmailVerified') ? $loginUser->isEmailVerified() : null,\n 'status' => $loginUser->getStatus(),\n 'uuid' => $loginUser->getUUID(),\n // 'imageId' => $loginUser->getProfileImageId(),\n // 'coverImageType' => $loginUser->getProfileCoverImageType(),\n // 'coverImageId' => $loginUser->getProfileCoverImageId(),\n // 'coverPresetImageId' => $loginUser->getProfileCoverPresetImageId(),\n // 'coverTing' => $loginUser->getProfileCoverTint(),\n ));\n exit();\n } else {\n header('Content-Type: application/json');\n http_response_code(200);\n echo json_encode(array(\n 'authenticated' => false,\n ));\n exit();\n }\n }", "public function testIndexUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@user'))\n ->assertSee('FIRST NAME');\n });\n }", "public function testPostUpdateUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$user = Orchestra\\Model\\User::create(array(\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'Mior Muhammad Zaki',\n\t\t\t'password' => '123456',\n\t\t));\n\t\t$user->roles()->sync(array(2));\n\n\t\t$response = $this->call('orchestra::users@view', array($user->id), 'POST', array(\n\t\t\t'id' => $user->id,\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'crynobone',\n\t\t\t'password' => '345678',\n\t\t\t'roles' => array(2),\n\t\t));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::users'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$updated_user = Orchestra\\Model\\User::find($user->id);\n\n\t\t$this->assertEquals('[email protected]', $updated_user->email);\n\t\t$this->assertEquals('crynobone', $updated_user->fullname);\n\t\t$this->assertTrue(Hash::check('345678', $updated_user->password));\n\n\t\t$updated_user->delete();\n\t}", "public function testEnterCorrectData()\n {\n $user = User::factory()->create();\n \n $response = $this->call('POST', '/admin/signin', [\n 'email' => $user->email,\n 'password' => '123456',\n '_token' => csrf_token()\n ]);\n \n $this->assertEquals(200, $response->getStatusCode());\n\n \n\n }", "public function user_route()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testGetInfoUser()\n {\n $id = 1;\n $this->json('GET', \"api/user/get-info/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"data\" => [\n \"created_at\",\n \"email\",\n \"name\",\n \"id\",\n \"org_id\",\n \"updated_at\"\n ]\n ]);\n }", "public function user_route_api()\n {\n $this->withoutExceptionHandling();\n $response = $this->get('/api/test-user');\n\n $response->assertStatus(200);\n }", "public function testApiIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/api/comptes');\n\n $response->assertStatus(200)\n ->assertJson([\n\n 'comptes' => true,\n \n ]);\n }", "public function testUserApiReturnsResponse()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $this->json('GET', 'api/v1/users')\n // ->assertResponseStatus('200');\n }", "function loadCreateUser()\n {\n $this->get('/usuarios/nuevo')\n ->assertStatus(200)\n ->assertSee('Crear nuevo usuario');\n }", "public function testIndex(): void\r\n {\r\n $client = static::createClient();\r\n $userRepository = static::$container->get(UserDoctrineRepository::class);\r\n\r\n $testUser = $userRepository->getUserByEmail('[email protected]');\r\n \r\n // Symfony helper.\r\n $client->loginUser($testUser);\r\n\r\n $client->request('GET', '/admin');\r\n\r\n static::assertResponseIsSuccessful();\r\n }", "public function testUbicaciontracker()\n {\n // $response = $this->get('/');\n // $response->assertStatus(200);\n //$this->visit('buque/store');\n // $response = $this->get('/');\n // $this->assertTrue(true);\n $response = $this->withHeaders([\n 'X-Header' => 'Value',\n ])->json('POST', '/user', ['name' => 'Sally']);\n\n $response\n ->assertStatus(201)\n ->assertJson([\n 'created' => true,\n ]);\n }", "public function testUrlEditUsers()\n {\n $user = User::find(2);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($this->user)\n ->visit('/admin/users')\n ->click('.button-edit')\n ->assertSee('Update users')\n ->assertPathIs('/admin/users/'.$user->id.'/edit');\n });\n }", "public function testIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/admin/comptes');\n\n $response->assertStatus(200)\n ->assertViewIs('layouts.admin');\n }", "function loadUsersListPage()\n {\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Listado de usuarios')\n ->assertSee('Javier')\n ->assertSee('Francisco');\n }", "public function actionUser($request)\n {\n return $this->start()->uri(\"/api/user/action\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function testUserListForAdmin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'data' => true,\n ]);\n }", "public function testGetRequest()\n {\n $admin = $this->getAdminUser();\n $user = factory(\\App\\User::class)->create();\n $grade = factory(\\App\\Grade::class)->create();\n $userGrade = UserGrade::create([\n 'user_id' => $user->id,\n 'grade_id' => $grade->id\n ]);\n $response = $this->actingAs($user)->call('GET', \"/api/user/{$user->id}/grade\");\n $this->assertEquals(200, $response->status());\n }", "public function testEndPoint()\n {\n\n $user = Auth::loginUsingId(1);\n\n// $response = $this->actingAs($user)\n// ->get('dashboard/orders/create');\n $response = $this->get('dashboard/orders/create');\n\n $response->assertStatus(200);\n }", "public function testShowSuccessfully()\n {\n $this->seed(\\UserTableSeeder::class);\n\n $employer = User::query()->where('email', '[email protected]')->first();\n Passport::actingAs(\n $employer,\n ['employer']\n );\n\n $response = $this->get('https://api.belsaa.com/employer/employer');\n $response->assertStatus(200);\n $response->assertJsonStructure(['id', 'company_name', 'user_attributes' => ['bio', 'legal_document_url', 'office_photo_url']]);\n $response->assertJsonFragment(['id' => $employer->id]);\n }", "public function testItReturnsAUserByUserId()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users/{$user1->id}\")\n ->assertStatus(200)\n ->assertJson([\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n ]);\n }", "public function testSignupIndex()\n {\n $user = factory(User::class)->create(['drupal_id' => '100001', 'first_name' => 'Chloe']);\n $user2 = factory(User::class)->create(['drupal_id' => '100002', 'first_name' => 'Dave']);\n\n // For testing, we'll mock a successful Phoenix API response.\n $this->phoenixMock->shouldReceive('getSignupIndex')->with(['users' => ['100001', '100002']])->once()->andReturn([\n 'data' => [\n [\n 'id' => '243',\n 'user' => [\n 'drupal_id' => '100001',\n ],\n ],\n [\n 'id' => '44',\n 'user' => [\n 'drupal_id' => '100002',\n ],\n ],\n ],\n ]);\n\n $this->asUserUsingLegacyAuth($user)->withLegacyApiKeyScopes(['user'])->get('v1/signups?users='.$user->_id.','.$user2->_id);\n\n $this->assertResponseStatus(200);\n $this->seeJson();\n\n $this->seeJsonStructure([\n 'data' => [\n '*' => [\n 'user' => [\n 'id', 'first_name', 'last_initial', 'photo', 'country',\n ],\n ],\n ],\n ]);\n }", "public function test()\n {\n $userData = factory(User::class)->make()->toArray();\n $userData['password'] = $userData['password_confirmation'] = 'qweqweqwe';\n\n /**\n * @see \\App\\Http\\Controllers\\RegisterController::signUp()\n */\n $response = $this->post('/auth/sign-up', $userData);\n\n $response->assertResponseStatus(201);\n\n $user = User::where('email', $userData['email'])->first();\n\n $this->assertNotEmpty($user);\n\n /**\n * @see \\App\\Http\\Controllers\\LoginController::signIn()\n */\n $response = $this->post('/auth/sign-in', [\n 'email' => $user->email,\n 'password' => $userData['password'],\n ]);\n\n $response->assertResponseOk();\n\n $response->seeHeader('Authorization');\n }", "public function test_show_user_as_admin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($this->admin)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function testCreatingFirstUser()\n {\n $response = $this->postJson('users', [\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'password' => 'password'\n ]);\n\n $response->assertStatus(201);\n }", "public function viewAction()\n {\n $repo = $this->entityManager\n ->getRepository(Entity\\User::class);\n $id = $this->params()->fromRoute('id');\n $entity = $this->params()->fromRoute('entity', 'user');\n $user = $repo->getUser($id, $entity);\n return ['entity' => $user,'id' => $id ];\n }", "public function testVerUsuarios()\n {\n $user = User::all();\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($user[0])\n ->resize(1300, 1200)\n ->visit('/admin')\n ->clickLink('Usuarios')\n ->clickLink('Administrar usuarios')\n ->assertPathIs('/admin/usuarios')\n ->assertSee('Usuarios')\n ->pause(1000)//peticiones ajax\n ->waitForText('Siguiente')\n ->with('.table', function ($table) use ($user) {\n $table->assertSee($user[1]->email);\n });\n });\n }", "public function testSignupIndexUserInfo()\n {\n $user = factory(User::class)->create(['drupal_id' => '100003', 'first_name' => 'Name']);\n\n // For testing, we'll mock a successful Phoenix API response.\n $this->phoenixMock->shouldReceive('getSignupIndex')->with(['users' => ['100003']])->once()->andReturn([\n 'data' => [\n [\n 'user' => [\n 'drupal_id' => '100003',\n ],\n ],\n ],\n ]);\n\n $this->asUserUsingLegacyAuth($user)->withLegacyApiKeyScopes(['user'])->get('v1/signups?users='.$user->_id);\n $this->assertResponseStatus(200);\n $this->seeJson();\n\n $this->assertEquals('Name', $this->decodeResponseJson()['data'][0]['user']['first_name']);\n }", "public function testAccess() {\n\n $this->drupalGet('udb3/api/1.0/user');\n $this->assertResponse('403');\n\n }", "public function testShowUserWithoutAddresses()\n {\n $user = factory(User::class)->state('lecturer')->create();\n $response = $this->withHeaders([\n ])->getJson(\"/api/user/{$user->id}\", []);\n\n $response->assertStatus(200)\n ->assertJson([\"user\" => $user->toArray()]);\n }", "public function testUsersCanCreateAulas()\n {\n $response = $this->json('GET', 'aulas.index');\n $response\n ->assertStatus(201)\n ->assertExactJson([\n 'created' => true,\n ]);\n }", "public function testGetApiUser()\n {\n $token = $this->getAuthToken();\n /* @var TestResponse $response */\n $this->json(\n 'GET',\n '/api/user',\n [],\n [\n 'Content-Type: application/x-www-form-urlencoded',\n 'Cache-Control: no-cache',\n 'Authorization' => 'Bearer ' . $token . '',\n ],\n 'Get current user'\n ) ->assertStatus(200)\n ->assertJsonStructure(\n [\n 'data' => [\n 'id',\n 'email',\n 'profile',\n 'privacySettings',\n ],\n 'channel',\n ]\n );\n }", "public function test_product_view_test()\n {\n //crecion de usuario\n $user = new User();\n $user->name = 'amdin';\n $user->email = '[email protected]';\n $user->password = 'admin312';\n $user->save();\n\n //autenticacion de usuario\n Auth::loginUsingId(1);\n\n //comprobacion de autenticacion\n $this->assertAuthenticated();\n\n // Datos de un producto\n $data['dat'] = array(\n \"cod\" => \"2791\",\n \"name\" => \"Aceite 2000\",\n \"price\" => \"70000\",\n \"amount\" => \"20\",\n \"description\" => \"Aceite para motor\",\n );\n //Acceso a la funcion que permite agregar un producto\n $this->post(route('add_product'), $data);\n\n //llamado a la vista de productos\n $response = $this->get(route('view_product'));\n\n //comprobacion de visualizacion correcta por parte de el usuario\n $response->assertSee(['Gestión de productos','Agrega, actualiza o elimina registros de productos',\n 'ID','Código','Nombre','Valor Unidad','Cantidad','Descripción','Proveedor',\n \"1\",$data['dat']['cod'],$data['dat']['name'],$data['dat']['price'],$data['dat']['amount'],$data['dat']['description']\n ]);\n\n }", "public function testShowUserWithAddresses()\n {\n $user = factory(User::class)->state('administration_worker')->create();\n $response = $this->withHeaders([\n ])->getJson(\"/api/user/{$user->id}\", []);\n\n $response->assertStatus(200)\n ->assertJson([\"user\" => $user->toArray()])\n ->assertJsonPath(\"user.address.id\", $user->address_id)\n ->assertJsonPath(\"user.correspondal_address.id\", $user->correspondal_address_id);\n }", "public function testAdminCanSeeUserIndex()\n {\n $this->actingAs($this->admin_user);\n\n $response = $this->get(route('admin.users.index'));\n\n $response->assertStatus(200);\n }", "public function testPostRegistroSucesso()\n {\n\n $userData = [\n \"nome\" => \"Shang Chi\",\n \"sinopse\" => \"Quero assistir\",\n \"data_lancamento\" => \"10-12-2021\",\n \"nota\" => 10,\n \"maior_18\" => True,\n ];\n\n $this->json('POST', 'api/filmes', $userData, ['Accept' => 'application/json'])\n ->assertStatus(201)\n ->assertJsonStructure([\n \"user\" => [\n 'id',\n 'nome',\n 'data_lancamento',\n \"nota\",\n \"maior_18\",\n 'created_at',\n 'updated_at',\n ],\n ]);\n }", "public function testUserCanViewSensorList()\n {\n $user = User::factory()->create([\n 'password' => bcrypt($password = 'i-love-laravel'),\n ]);\n\n $response = $this->post('/login', [\n 'email' => $user->email,\n 'password' => $password,\n ]);\n\n $response->assertRedirect('/dashboard');\n $this->assertAuthenticatedAs($user);\n\n $response = $this->get('/sensor/list');\n\n $response->assertStatus(200);\n $response->assertSeeText('Sensors');\n }", "public function usersAction(){\n\n\n $team_users = $this->api()->search('team-user');\n $users = $this->api()->search('users');\n $view = new ViewModel(['users'=> $users, 'team_users'=>$team_users]);\n return $view;\n// $view->setVariable('response', $response);\n\n\n }", "public function testGetUserByUsernameAction200(array $user)\n {\n self::$_client->request(\n Request::METHOD_GET,\n self::RUTA_API . '/username/' . $user['username']\n );\n $response = self::$_client->getResponse();\n\n self::assertEquals(Response::HTTP_OK, $response->getStatusCode());\n self::assertJson((string) $response->getContent());\n $user_aux = json_decode((string) $response->getContent(), true);\n self::assertEquals($user, $user_aux['user']);\n }", "public function testExample()\n {\n \t$response = $this->json('POST', '/users', ['name' => 'Sally']);\n $response\n ->assertStatus(200)\n ->assertJson([\n 'created' => true,\n ]);\n }", "public function testGetSingleUserPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function testUserMeGet()\n {\n }", "public function testEditUsersSuccess()\n {\n $user = User::find(2);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($this->user)\n ->visit('/admin/users/'.$user->id.'/edit')\n ->resize(900, 1000)\n ->assertSee('Update users')\n ->type('name',$user->name)\n ->press('Submit')\n ->assertSee('Successfully updated user!')\n ->assertPathIs('/admin/users');\n });\n $this->assertDatabaseHas('users', [\n 'name' => $user->name]);\n }", "public function testIndexRoutedUser(): void\n {\n // given\n $expectedStatusCode = 302;\n $user = $this->createUser([User::ROLE_USER]);\n $this->logIn($user);\n\n // when\n $this->httpClient->request('GET', '/tag');\n $resultStatusCode = $this->httpClient->getResponse()->getStatusCode();\n\n // then\n $this->assertEquals($expectedStatusCode, $resultStatusCode);\n }", "public function test()\n {\n $data = [\n 'name' => 'Test user',\n 'email' => '[email protected]',\n 'password' => 'test123',\n ];\n\n\n $this->browse(function (Browser $browser) use ($data) {\n $browser->visit('/')\n ->assertSee('ZAREJESTRUJ SIĘ')\n ->clickLink('Zarejestruj się')\n ->screenshot('1.Register_form')\n ->type('name', $data['name'])\n ->type('email', $data['email'])\n ->type('password', $data['password'])\n ->type('password_confirmation', $data['password'])\n ->screenshot('2.Register_form_filled')\n ->press('Zarejestruj się')\n ->screenshot('3.Registred')\n ->assertSee('Witaj, Test user!')\n ->clickLink($data['name'])\n ->clickLink('Wyloguj')\n ->screenshot('4.Logout')\n ->clickLink('Logowanie')\n ->type('email', $data['email'])\n ->type('password', $data['password'])\n ->press('Logowanie')\n ->screenshot('5.Logged')\n ->assertSee('Witaj, Test user!')\n ;\n });\n }", "public function user_view(Request $request) {\n\n $user = User::find($request->id);\n\n if ($user) {\n\n $response_array = ['success'=>true, 'data'=>$user];\n\n return response()->json($response_array, 200); \n\n } else {\n\n $response_array = ['success'=>false, 'error_messages'=>tr('user_not_found')];\n\n return response()->json($response_array, 200); \n\n }\n\n }", "public function postShow()\n {\n $id_user = Input::get('id');\n $user = User::find($id_user);\n if (count($user)) {\n return Response::json(array('user' => $user,\n 'status' => 1));\n }\n return Response::json(array('messages' => 'El usuario no esta registrado',\n 'status' => 0));\n }", "public function testIndex()\n {\n $testingRoleName = 'user';\n\n /** @var User $user */\n $user = factory(User::class)->create();\n $user->attachRole($testingRoleName);\n\n $userResource = new UserResource($user);\n\n $userResponseJson = response()->json($userResource)->getData();\n\n $userRole = $userResponseJson->roles;\n\n $role = Role::findOrFail($userRole);\n\n $this->assertEquals($testingRoleName, $role->name);\n $this->assertEquals($user->id, $userResponseJson->id);\n $this->assertEquals($user->name, $userResponseJson->name);\n $this->assertEquals($user->email, $userResponseJson->email);\n $this->assertEquals($user->publish, $userResponseJson->publish);\n }", "public function testTokenViewPage()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.show', [$this->token->id_hash]));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.show');\n }", "public function testPostRequest()\n {\n $admin = $this->getAdminUser();\n $user = factory(\\App\\User::class)->create();\n $grade = factory(\\App\\Grade::class)->create();\n $data = [\n 'grade_id' => $grade->id\n ];\n $response = $this->actingAs($admin)->call('POST', \"/api/user/{$user->id}/grade/\", $data);\n $this->assertEquals(200, $response->status());\n }", "public function testLogAuthActionUsingPOST()\n {\n\n }", "public function testUserRegister()\n {\n $response = $this->get('/register')\n ->assertStatus(200)\n ->assertSee('Register');\n }" ]
[ "0.73160887", "0.71074474", "0.7040686", "0.7022389", "0.69954544", "0.68918324", "0.68818146", "0.6753285", "0.6733621", "0.67182714", "0.6715476", "0.6712797", "0.6709132", "0.66945577", "0.6652675", "0.66261744", "0.6593666", "0.65934837", "0.6523227", "0.65090525", "0.65017784", "0.64671576", "0.6437713", "0.64313865", "0.6429808", "0.6421168", "0.6418956", "0.6418199", "0.6409512", "0.6405269", "0.63932025", "0.6389339", "0.6370388", "0.63542795", "0.6340133", "0.6333087", "0.63272935", "0.6312322", "0.6308768", "0.630468", "0.62878764", "0.62835777", "0.6270915", "0.62664974", "0.62631416", "0.62480134", "0.62463415", "0.6244255", "0.6241124", "0.6234634", "0.6232991", "0.62273365", "0.62116355", "0.621154", "0.6200616", "0.61995757", "0.61930156", "0.6192732", "0.61689645", "0.6152367", "0.61451024", "0.6142751", "0.6140724", "0.613765", "0.6125273", "0.6106328", "0.60990626", "0.6096774", "0.6081889", "0.6080675", "0.6075009", "0.60703814", "0.6044455", "0.60389274", "0.60387546", "0.6036301", "0.60285705", "0.60280937", "0.60077626", "0.6006683", "0.5994144", "0.5987809", "0.5987766", "0.5983057", "0.59812117", "0.59727085", "0.5971536", "0.5968348", "0.59670854", "0.59661484", "0.5960619", "0.59592557", "0.5951996", "0.59516156", "0.59406614", "0.59395146", "0.5934111", "0.5927141", "0.5916179", "0.5913563" ]
0.6094983
68
Test Request POST (orchestra)/users/view/1 with multiple roles
public function testPostDeleteUserPageWithMultipleRoles() { $this->be($this->user); $user = Orchestra\Model\User::create(array( 'email' => '[email protected]', 'fullname' => 'Mior Muhammad Zaki', 'password' => '123456', )); $user->roles()->sync(array(2, 1)); $this->assertGreaterThan(0, $user->id); $user_id = $user->id; $response = $this->call('orchestra::users@delete', array($user_id)); $this->assertInstanceOf('Laravel\Redirect', $response); $this->assertEquals(302, $response->foundation->getStatusCode()); $this->assertEquals(handles('orchestra::users'), $response->foundation->headers->get('location')); $user = Orchestra\Model\User::find($user_id); $this->assertTrue(is_null($user)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testViewRole()\n {\n\n $item = factory(Role::class)->create();\n $response = $this->actingAs($this->makeAdmin())->get('/api/acl/roles/'.$item->id);\n $response->assertStatus(JsonResponse::HTTP_OK);\n\n\n }", "public function testPostAuthorizationRoles()\n {\n }", "public function testAdminCanViewTheRoleIndex()\n {\n $this->setupRoles();\n\n $response = $this\n ->actingAs($this->admin)\n ->get('/admin/roles');\n \n $response->assertStatus(200);\n $response->assertSee('Role1');\n $response->assertSee('Role2');\n }", "public function roleTest()\n {\n $response = $this->json('GET', '/v1/roles');\n $response->assertStatus(401);\n }", "function testGetRoles() {\n $u1 = User::getOneFromDb(['user_id' => 101], $this->DB);\n $u2 = User::getOneFromDb(['user_id' => 110], $this->DB);\n $u3 = new User(['user_id' => 50, 'username' => 'fjones', 'screen_name' => 'jones, fred', 'DB' => $this->DB]);\n $u4 = User::getOneFromDb(['user_id' => 109], $this->DB);\n\n $r1 = $u1->getRoles();\n $this->assertEqual(1,count($r1));\n $this->assertEqual('field user',$r1[0]->name);\n\n $r2 = $u2->getRoles();\n $this->assertEqual(1,count($r2));\n $this->assertEqual('manager',$r2[0]->name);\n\n $r3 = $u3->getRoles();\n $this->assertEqual(1,count($r3));\n $this->assertEqual('public',$r3[0]->name);\n\n $r4 = $u4->getRoles();\n $this->assertEqual(1,count($r4));\n $this->assertEqual('public',$r4[0]->name);\n }", "public function testPutUserRoles()\n {\n }", "public function test_add_user_roles()\n {\n $roles = [\n Role::firstOrCreate(['display_name' => Role::ACCOUNT_MANAGER])->id,\n Role::firstOrCreate(['display_name' => Role::CASHIER])->id,\n ];\n\n $this->put('users/'.$this->user->id, compact('roles'))\n ->assertRedirect(route_with_hash('settings.index', '#users'))\n ->assertSessionHas('flash_notification.message', 'User details updated');\n\n self::assertCount(2, $this->user->roles);\n }", "public function testRoleUsers()\n {\n }", "public function testThatGetRolesRequestIsFormattedProperly()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->getRoles( '__test_user_id__', [ 'per_page' => 5, 'page' => 1, 'include_totals' => 1 ] );\n\n $this->assertEquals( 'GET', $api->getHistoryMethod() );\n $this->assertStringStartsWith(\n 'https://api.test.local/api/v2/users/__test_user_id__/roles?',\n $api->getHistoryUrl()\n );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'per_page=5', $query );\n $this->assertContains( 'page=1', $query );\n $this->assertContains( 'include_totals=true', $query );\n\n $headers = $api->getHistoryHeaders();\n $this->assertEquals( 'Bearer __api_token__', $headers['Authorization'][0] );\n $this->assertEquals( self::$expectedTelemetry, $headers['Auth0-Client'][0] );\n }", "public function testPostAuthorizationRolesDefault()\n {\n }", "public function testIndex()\n {\n $testingRoleName = 'user';\n\n /** @var User $user */\n $user = factory(User::class)->create();\n $user->attachRole($testingRoleName);\n\n $userResource = new UserResource($user);\n\n $userResponseJson = response()->json($userResource)->getData();\n\n $userRole = $userResponseJson->roles;\n\n $role = Role::findOrFail($userRole);\n\n $this->assertEquals($testingRoleName, $role->name);\n $this->assertEquals($user->id, $userResponseJson->id);\n $this->assertEquals($user->name, $userResponseJson->name);\n $this->assertEquals($user->email, $userResponseJson->email);\n $this->assertEquals($user->publish, $userResponseJson->publish);\n }", "public function testThatAddRolesRequestIsFormattedProperly()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->addRoles( '__test_user_id__', [ '__test_role_id__' ] );\n\n $this->assertEquals( 'POST', $api->getHistoryMethod() );\n $this->assertEquals(\n 'https://api.test.local/api/v2/users/__test_user_id__/roles',\n $api->getHistoryUrl()\n );\n\n $headers = $api->getHistoryHeaders();\n $this->assertEquals( 'Bearer __api_token__', $headers['Authorization'][0] );\n $this->assertEquals( 'application/json', $headers['Content-Type'][0] );\n $this->assertEquals( self::$expectedTelemetry, $headers['Auth0-Client'][0] );\n\n $body = $api->getHistoryBody();\n $this->assertArrayHasKey( 'roles', $body );\n $this->assertCount( 1, $body['roles'] );\n $this->assertEquals( '__test_role_id__', $body['roles'][0] );\n }", "public function testGetUserRoles()\n {\n }", "public function testGetUserRoles()\n {\n }", "public function testPostAuthorizationRole()\n {\n }", "public function testSetRoleUsers()\n {\n }", "public function testGetAuthorizationRoleUsers()\n {\n }", "public function testGetAuthorizationRoles()\n {\n }", "public function testUserListForAdmin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'data' => true,\n ]);\n }", "public function testGettingRoles()\n {\n $this->assertEquals(['baz'], $this->principal->getRoles());\n }", "public function testSearchRoles()\n {\n }", "public function test_get_payload_for_users() {\n\n\t\t$roles = array( 'student', 'instructor' );\n\n\t\tforeach ( $roles as $role ) {\n\n\t\t\t$user_id = $this->factory->user->create( array( 'role' => $role ) );\n\n\t\t\t// Created.\n\t\t\t$webhook = LLMS_REST_API()->webhooks()->create( array(\n\t\t\t\t'delivery_url' => 'https://mock.tld/200',\n\t\t\t\t'topic' => $role . '.created',\n\t\t\t\t'status' => 'active',\n\t\t\t\t'user_id' => $this->factory->user->create( array( 'role' => 'administrator' ) ),\n\t\t\t) );\n\t\t\t$payload = LLMS_Unit_Test_Util::call_method( $webhook, 'get_payload', array( array( $user_id ) ) );\n\t\t\t$this->assertEquals( $user_id, $payload['id'] );\n\t\t\t$this->assertArrayHasKey( 'name', $payload );\n\n\t\t\t// Updated.\n\t\t\t$webhook = LLMS_REST_API()->webhooks()->create( array(\n\t\t\t\t'delivery_url' => 'https://mock.tld/200',\n\t\t\t\t'topic' => $role . '.updated',\n\t\t\t\t'status' => 'active',\n\t\t\t\t'user_id' => $this->factory->user->create( array( 'role' => 'administrator' ) ),\n\t\t\t) );\n\t\t\t$payload = LLMS_Unit_Test_Util::call_method( $webhook, 'get_payload', array( array( $user_id ) ) );\n\t\t\t$this->assertEquals( $user_id, $payload['id'] );\n\t\t\t$this->assertArrayHasKey( 'name', $payload );\n\n\t\t\t// Deleted.\n\t\t\t$webhook = LLMS_REST_API()->webhooks()->create( array(\n\t\t\t\t'delivery_url' => 'https://mock.tld/200',\n\t\t\t\t'topic' => $role . '.deleted',\n\t\t\t\t'status' => 'active',\n\t\t\t\t'user_id' => $this->factory->user->create( array( 'role' => 'administrator' ) ),\n\t\t\t) );\n\t\t\t$payload = LLMS_Unit_Test_Util::call_method( $webhook, 'get_payload', array( array( $user_id ) ) );\n\t\t\t$this->assertEquals( array( 'id' => $user_id ), $payload );\n\n\t\t}\n\n\t}", "public function testAllRoles()\n {\n }", "public function testPutAuthorizationRoleUsersAdd()\n {\n }", "public function unAuthenticated_user_can_see_roles()\n {\n $response = $this->get(route('role.index'));\n $response->assertRedirect('/login');\n }", "public function testAdminCanAddARole()\n {\n $permission = Permission::where('name', 'view_roles')->first();\n\n $params = [\n 'name' => $this->faker->name(),\n 'permissions' => [$permission->name],\n ];\n\n $response = $this\n ->actingAs($this->admin)\n ->post('/admin/roles', $params);\n\n $response->assertStatus(302);\n $response->assertSessionHasNoErrors();\n $response->assertRedirect('/admin/roles');\n $response->assertSessionHas('success', __('roles.success_create_message'));\n\n $role = Role::where('name', $params['name'])->first();\n $this->assertNotNull($role);\n $this->assertEquals($params['name'], $role->name);\n }", "public function test_user_can_view_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n factory(Box::class, 3)->create();\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 1, //Box doesn't matter\n 'role' => 'coach',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 2,\n 'role' => 'owner',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $this->actingAs($user);\n\n $invites = $user->invites();\n\n $this->assertEquals(3, $invites->count());\n\n $response = $this->get('/invites');\n\n $response->assertStatus(200);\n }", "#[Route('login', name: \"_user_login\", methods: ['POST'])]\n public function login(): JsonResponse\n {\n $user = $this->getUser();\n\n return $this->json([\n 'username' => $user->getUserIdentifier(),\n 'roles' => $user->getRoles()\n ]);\n }", "public function testDeleteUserRoles()\n {\n }", "public function test_update_user_roles()\n {\n $roles = [\n Role::firstOrCreate(['display_name' => Role::ACCOUNT_MANAGER])->id,\n Role::firstOrCreate(['display_name' => Role::CASHIER])->id,\n ];\n\n $this->user->syncRoles($roles);\n\n $branchManager = Role::firstOrCreate(['display_name' => Role::BRANCH_MANAGER])->id;\n\n $this->put('users/'.$this->user->id, ['roles' => [$branchManager]])\n ->assertRedirect(route_with_hash('settings.index', '#users'))\n ->assertSessionHas('flash_notification.message', 'User details updated');\n\n self::assertCount(1, $this->user->roles);\n }", "public function testGetRolesList(): void {\n $this->assertCount(5, UserRolesEnum::getRolesList(), \"1. The list doesn't contain the expected number of roles.\");\n $this->assertArrayHasKey(\"ROLE_ADMIN\", UserRolesEnum::getRolesList(), \"2. The list doesn't contain the admin role.\");\n $this->assertArrayHasKey(\"ROLE_AUTHOR\", UserRolesEnum::getRolesList(), \"3. The list doesn't contain the author role.\");\n $this->assertArrayHasKey(\"ROLE_MODERATOR\", UserRolesEnum::getRolesList(), \"4. The list doesn't contain the moderator role.\");\n $this->assertArrayHasKey(\"ROLE_SUPER_ADMIN\", UserRolesEnum::getRolesList(), \"5. The list doesn't contain the super admin role.\");\n $this->assertArrayHasKey(\"ROLE_USER\", UserRolesEnum::getRolesList(), \"6. The list doesn't contain the user role.\");\n $this->assertArrayNotHasKey(\"IS_AUTHENTICATED_FULLY\", UserRolesEnum::getRolesList(), \"7. The list hasn't to contain the authenticated fully role.\");\n $this->assertArrayNotHasKey(\"IS_AUTHENTICATED_REMEMBERED\", UserRolesEnum::getRolesList(), \"8. The list hasn't to contain the authenticated remembered role.\");\n }", "public function testForbiddenRoleRoute() {\n $createdUser = factory(User::class)->create();\n $createdRole = factory(Role::class)->create([\n 'name' => 'Admin',\n 'slug' => 'admin',\n ]);\n\n $foundRole = Role::findBySlug('admin');\n $foundUser = User::first();\n\n $foundUser->detachAllRoles();\n $foundUser->attachRole($foundRole);\n\n $this->actingAs($createdUser);\n\n\n $this->assertEquals($createdRole->id, $foundRole->id);\n $this->assertEquals($createdUser->name, $foundUser->name);\n\n $this->get('/admin/users')\n ->assertStatus(200)\n ->assertSee('I am an admin.');\n }", "public function actionUserRole ()\n\t\t{\n\t\t\t$userClass = $this->module->modelUser;\n\t\t\t$post = Yii::$app->request->post();\n\t\t\t$user = $userClass::findOne($post[ 'id' ]);\n\t\t\tif (!is_null($user))\n\t\t\t{\n\n\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} забрали права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $user->getRolesNames()) ]));\n\t\t\t\t$user->revokeAllRoles();\n\t\t\t\tif (is_array($post[ 'roles' ]))\n\t\t\t\t{\n\t\t\t\t\tforeach ($post[ 'roles' ] as $item)\n\t\t\t\t\t{\n\t\t\t\t\t\t$user->assignRole($item);\n\t\t\t\t\t}\n\t\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} добавили права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $post[ 'roles' ]) ]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tYii::$app->end();\n\t\t}", "public function rolesForUser();", "public function test_users_create_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testAddThreeRoles() {\n // Set-up a mock user.\n $account = $this->prophesizeEntity(UserInterface::class);\n // Mock hasRole.\n $account->hasRole('manager')->willReturn(FALSE)->shouldBeCalledTimes(1);\n $account->hasRole('editor')->willReturn(FALSE)->shouldBeCalledTimes(1);\n $account->hasRole('administrator')->willReturn(FALSE)->shouldBeCalledTimes(1);\n\n // Mock addRole.\n $account->addRole('manager')->shouldBeCalledTimes(1);\n $account->addRole('editor')->shouldBeCalledTimes(1);\n $account->addRole('administrator')->shouldBeCalledTimes(1);\n\n // Mock user roles.\n $manager = $this->prophesize(RoleInterface::class);\n $manager->id()->willReturn('manager');\n $editor = $this->prophesize(RoleInterface::class);\n $editor->id()->willReturn('editor');\n $administrator = $this->prophesize(RoleInterface::class);\n $administrator->id()->willReturn('administrator');\n\n // Test adding of three roles.\n $this->action\n ->setContextValue('user', $account->reveal())\n ->setContextValue('roles', [\n $manager->reveal(),\n $editor->reveal(),\n $administrator->reveal(),\n ])\n ->execute();\n\n $this->assertEquals($this->action->autoSaveContext(), ['user'], 'Action returns the user context name for auto saving.');\n }", "public function testApiLoad()\n {\n $response = $this->get($this->apiPath . '/roles', $this->createAuthHeaderToNormalUser());\n\n $response->assertStatus(200);\n $this->seeJsonStructure($response, [\n '*' => [\n 'id', 'slug', 'title'\n ]\n ]);\n\n //need to be at least admin\n $this->assertGreaterThanOrEqual(count($response->decodeResponseJson()), 1);\n }", "function roles(){\n\t\t$this->pageauth->setPrivileges('roles');\n\t\t\n\t\t// see if user has delete privileges\n\t\tif (!$this->pageauth->loginHasPrivileges('delete')) :\n\t\t\n\t\t\t$json['error'] = \"You do not have access to add or edit these records\";\n\t\t\techo json_encode($json);\n\t\t\texit();\n\t\t\n\t\telse:\n\t\t\t\n\t\t\t$id = $this->input->post('id');\n\t\t\n\t\t\t$response = $this->platform->post('apadmin/role/delete',array('id'=>$id));\n\t\t\t\n\t\t\tif($response['success']) :\n\t\t\t\t\n\t\t\t\t$json['success'] = $response['success'];\n\t\t\t\techo json_encode($json);\n\t\t\t\t\n\t\t\t\telse:\n\t\t\t\t\n\t\t\t\t$json['error'] = $response['error'];\n\t\t\t\techo json_encode($json);\n\t\t\t\t\n\t\t\tendif;\n\t\tendif;\n\t}", "public function test_admin_tribe_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Assignments', 'tribe_list']);\n $this->assertResponseCode(404);\n }", "public function getAdminRoles(Request $request)\n {\n $roles = $this->commonObj->getAll(\"Role\");\n $allRoles = [];\n foreach($roles as $role){\n $newRole[\"id\"] = $role->id; \n $newRole[\"name\"] = $role->name; \n $newRole[\"roles\"] = (object) array_merge(rolesModal(), (array) $role->roles); \n $allRoles[] = $newRole;\n }\n return jsonResponse('done', 200, $allRoles);\n }", "public function testRead()\n {\n\n $this->createDummyRole();\n\n $response = $this->call('POST', '/api/role', array(\n 'action' => $this->readAction,\n 'id' => 1,\n ));\n\n $response->assertSee($this->testRoleName);\n }", "public function testPostRoleCollection()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testRole()\n {\n }", "public function actionRoles()\n\t{\n\t\tYii::app()->user->rightsReturnUrl = array('authItem/roles');\n\t\t\n\t\t$dataProvider = new RAuthItemDataProvider('roles', array(\n\t\t\t'type'=>CAuthItem::TYPE_ROLE,\n\t\t\t'sortable'=>array(\n\t\t\t\t'id'=>'RightsRoleTableSort',\n\t\t\t\t'element'=>'.role-table',\n\t\t\t\t'url'=>$this->createUrl('authItem/sortable'),\n\t\t\t),\n\t\t));\n\n\t\t// Render the view\n\t\t$this->render('roles', array(\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'isBizRuleEnabled'=>$this->module->enableBizRule,\n\t\t\t'isBizRuleDataEnabled'=>$this->module->enableBizRuleData,\n\t\t));\n\t}", "public function testCreateWithRolesIsAuthenticated()\n {\n $token = new JavascriptWebToken('CREDENTIALS', 'PROVIDER', 'username', ['ROLE_1', 'ROLE_2']);\n\n $this->assertEquals('CREDENTIALS', $token->getCredentials());\n $this->assertEquals('PROVIDER', $token->getProviderKey());\n $this->assertEquals('username', $token->getUsername());\n /** @var Role[] $roles */\n $roles = $token->getRoles();\n $this->assertEquals(2, count($roles));\n $this->assertInstanceOf(Role::class, $roles[0]);\n $this->assertEquals('ROLE_1', $roles[0]->getRole());\n $this->assertInstanceOf(Role::class, $roles[1]);\n $this->assertEquals('ROLE_2', $roles[1]->getRole());\n $this->assertTrue($token->isAuthenticated());\n }", "public function test_users_edit_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function testGetAuthorizationRoleSubjectgrants()\n {\n }", "public function testReportsSkillv1reportsrolesroleId()\n {\n\n }", "public function test_users_create_authenticated_leader_shows_correct_view(){\n $this->signInLeader();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testIndex()\n {\n // serializing it back in indexAction().\n $client = new Client('http://svsjbshc1.stg.allegiantair.com:8580');\n $request = $client->get(\n 'otares/v2/api/lookups/CustomerRole'\n );\n\n $response = $request->send();\n $initialResult = $response->getBody(true);\n\n $client = static::createClient();\n $client->request(\n 'GET',\n 'customer-role',\n array(),\n array(),\n array('CONTENT_TYPE' => 'application/json')\n );\n\n $processedResult = $client->getResponse()->getContent();\n\n $this->assertJsonStringEqualsJsonString(\n $initialResult,\n $processedResult\n );\n\n $this->assertEquals(200, $response->getStatusCode());\n }", "function testUserRoles($d1, $d2) {\n\n\t\t// The public role (defined in initial db data)\n\t\t$pr = new stdClass;\n\t\t$pr->id = self::PUBLIC_ROLE_ID;\n\t\t$pr->isPublisher = false;\n\n\t\t// The editor role (defined in initial db data)\n\t\t$er = new \\Scrivo\\UserRole(self::$context);\n\t\t$er->isPublisher = true;\n\t\t$er->type = \\Scrivo\\Role::EDITOR_ROLE;\n\t\t$er->insert();\n\n\t\t// Create a user with the public role.\n\t\t$u1 = new \\Scrivo\\User(self::$context);\n\t\t$u1->userCode = new \\Scrivo\\Str(\"userrole1\");\n\t\t$u1->password = new \\Scrivo\\Str(\"\");\n\t\t$u1->insert();\n\t\t$u1->assignRoles(array($pr));\n\n\t\t// Create a user with the editor role.\n\t\t$u2 = new \\Scrivo\\User(self::$context);\n\t\t$u2->userCode = new \\Scrivo\\Str(\"userrole2\");\n\t\t$u2->password = new \\Scrivo\\Str(\"\");\n\t\t$u2->insert();\n\t\t$u2->assignRoles(array($er, $pr));\n\n\t\t// Load the edit user...\n\t\t$u3 = \\Scrivo\\User::fetch(self::$context, $u2->id);\n\n\t\t// ... and check its roles.\n\t\t$this->assertFalse($u3->roles[self::PUBLIC_ROLE_ID]->isPublisher);\n\t\t$this->assertTrue($u3->roles[$er->id]->isPublisher);\n\t}", "public function testSearchRolesWithUserCount()\n {\n }", "public function testViewSuccessForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t\t'return' => 'vars',\n\t\t];\n\t\t$expected = [\n\t\t\t'deferredSave' => [\n\t\t\t\t'Deferred' => [\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'employee_id' => '3',\n\t\t\t\t\t'internal' => false,\n\t\t\t\t\t'data' => [\n\t\t\t\t\t\t'changed' => [\n\t\t\t\t\t\t\t'EmployeeEdit' => [\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_DISTINGUISHED_NAME => 'CN=Суханова Л.Б.,OU=ОС,OU=Пользователи,DC=fabrikam,DC=com',\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_TITLE => 'Ведущий инженер',\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_DIVISION => 'Группа №1',\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCABgAGADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iiiigAooooAKK+If2tP+Cgv7Jv7FkOmj9oH4saZ4X13XLc3/h/wPpFpq/inx7r9uGaze6svCPhuxvb8aUHAB1jVlj0lWQqX3hBX4g+L/wDg5y+EGk/EC7tvBX7Pvj/4g/C9bYC21+51XSvAfiq11EXhP2r+ydYbWLPVtIvLUKWD/wDCP6ppS71kjctuUA/qcor+afwl/wAHOP7JeqX0Np4y+A/7Q/gu2mX5tT0+18BeMLe27Za1svF1jeEjtiz5Gcg1+yf7Kv7df7L/AO2fod9rX7PnxZ0LxncaNBa3PiPwjP8Aa9E8e+FRdOojHiLwfrEdlrNnbtnA1REfSSzKqOxGSAfYtFFFABRRRQAUUUUAFfK/7W37XXwZ/Yt+Dur/ABq+OGs6lp3hPTr+10Ow07QtMOr+KPFGu6rvGn+H/DeiiS2e/wBVnZCUjVwoWOQFhJhT9UV/NB/wc66PeXX7JnwC1uOWY2WkftH2Vvd2JIW3ubjVPht8QLOyuGHTKMZCDng4wBhiQD+Ur9uP9pq8/bB/au+M37RclnqGj2HjvxJaf8IroOr3dndan4e8DaFpGn+GvB+j3xs2Nmc2lp9uZrRiSfvfN0+U6Mk9TmigAr1r4B/G/wCIf7N/xg+Hvxs+Fev6loPjH4feJLTV7SWwuzajVtK+241jw1rC/cvPDfiOzzo2s6MQoBGCMdfJaKAP9Oz9hL9sXwL+3T+zt4W+PvgTSrvw3DrF3quheKPB2oX1tfap4K8ZaBdiy1jw5fXtotqmpqzfZNY0rVYsx6tpOrRTYjLhD9qV/Nb/AMGydnqsP7H/AMcr+6lWbS7v9pnVv7Hh+VfszWnw5+H9lqtyScHLEjkjJwRzuGP6UqACiiigAooooAK/AD/g45TQ7z/gnnLHfajptnr2nfHL4Zaz4d0++u7O21LVfst3qOkawNFtL3/S74Wekay15dixBBABdlBBP7/1/M3/AMHN3w0v/Ef7LvwI+KdrB51p8LPjldaXrrZGLbS/iP4Q1LRre8IxkAaxpOjWrE5BMgB9aAP4o6KKKACiiigD+8L/AINzY9DsP+CesNnZato17r2o/HP4nax4k06wurO61LSrm8vNOs9KXV7Gyzd6Q97pGiLeWgv1UgMdpIDg/v8AV/M5/wAGyfwwvvDn7LXx4+Kl1AIbX4p/Gu00fSGyM3WlfC/whp2i3F2R1AbWNX1m0VgqjKYyccf0x0AFFFFABRRRQAV84/tUfs2eBf2uPgB8Rv2ePiJNf2Xhj4kaKun3OraP9kGveHdSs72z1fR/EWjvdxXdqmraNrFnZ30T7MOVKBgJNx+jqZJ9xvpQB/lE/GP4Z618F/i38TvhF4igWHXfhZ4+8WeANQM9n9lW9ufDGr6lpC3gswOftv2P7bwMkr90YATziv6Gv+DjP9lzS/hB+1f4Q/aB8Ny2sOlftN+G9Xv/ABJoMGRdWvxG+HFnoGi6xq43DP2LxL4b1fw6o6AayNYZTgqT/PLQAV6P8HPhnrfxo+L/AMK/hB4dK/298TvH/hPwBo5g/wBKWyuvE+r6fpH2z7GRj/Q/tZvOQOGGc4584r+hv/g3I/Zf0v4v/tZ+MP2gfEc1rLpf7MnhyzuPDejEf6VdfEb4kWmvaNo+rgBgfsvhzw3ZeL93Ya1rfzZBoA/sV/ZT/Zt8B/sj/s//AAz/AGdfhwb+Xwl8M9EOkWmp6x9kbW/EOo3F5eavrPiLV2tkVZNW1nV7281eVthZWkCHAQEfSFMRNv8AQen/ANf/AD3p9ABRRRQAUUUUAFMk+430pJJBGMn/AD/n8K/Lz9tz/grH+yR+xZo/iPTfEfxI0Hxr8arKwvBoPwU8E3beJvFVzrn2O8OlW3i46Mz2XgfSTfx41W98S3dp5MRZ03lVoA/mI/4L9ftv/BL9rT4x/B/wR8E9W1nxJH+zofiz4W8d6xfeH9Z0PSj4x13WfCFldaRo51kWN7qx0hfB94by6bRSqncqlvvH+f2t7xR4o1jxt4m8V+MvEc3neI/GHiPxF4w16WDH2W71/wAT6xqOr6xeE4G/beXoJ5wMEDnIrBoAK/fr/ggP+298D/2TfjF8YPA/xp1jWfDiftFH4TeF/AWsadoOs65oA8Y6Fq/iGybSNY/sYXt3pP8AbFz4wtP7F1Z7EhySW46fgLW94X8U6x4I8T+FvG3hyY2fiPwh4j8P+MNCmuD/AMeWveGNY07V9G2g9CbyzY44J5B2gEgA/wBZ6NxIufwIqSvy0/Yj/wCCsn7JP7aOj+G9M8N/EPQvBHxqvNPtBr/wa8c3TeG/FUGumzQ6tZ+EP7YZLTxtpS3p2WL+HLu43xRh3w3A/UhH3f0Pr/8AX/z2oAfRRRQBVleKNCTJ5QiHnnjPyjJORzkeoFfj3+2L/wAFtv2Lv2TDqvh2x8X/APC/vivZD7Ofhx8GLu01+20m+O3daeL/AB1vfwh4aAO75RJrHiMAFR4bKkOf5KP+CgX/AAVj/ab/AG0fG/jXw5pXj3xJ8Mv2bzrWraR4R+E/hDVrzwvbav4Xtb37JZ3vxJ1iwUaz4w1nWgw1e9s9Xu/+EbKjA0UAZH5SGMxZ8qHyov8Anhakjv6bVbPcncB6jmgD9g/2wv8Agt5+23+1h/a/h3RvFNt+zx8K9RbyP+EF+EN3e22v6rphBDWfiP4kMbPxJq+c7LwaN/wjGifOw2YLAfj3/wAtJpussw+0TT8g3l7yRkZPBzn5cgk7cjJpfLf+83/kP/4mjy3/ALzf+Of/ABNABRR5b/3m/wDHP/iaPLf+83/jn/xNABRR5b/3m/8AHP8A4mjy3/vN/wCOf/E0AGR5kMsXE0Vz9pil6XlldtliT2UDjjIJIJILYr9g/wBjz/gt5+2z+ygdI8Paz4n/AOGifhbp5s4W8CfF66vLnX9M0wKyEeEviRm88SaUFBKqdbPibRgMYJZVA/Hzy3/vN/45/wDE0eXJ/eb8dmOOmcAHH0IOOhFAH+hj+x1/wW6/Yq/a0Gk+HL/xfL8Avi3qS/Z0+HPxhvLPQrXVr4bibTwh45yvhHxIAdv7syaN4jYfL/wjqAA1+xKzRFEkEgMcoHlnswIyMHqeP/r81/kiPGZYhFLD50X/ADyuScj7oxkcjIDZIyeQo2jIH6uf8E/f+Cs37Tn7GfjvwVoOs+O/EnxN/Zu/trS7Dxj8JfGN5e+J7fSfC91eCz1jWPhxe3n/ABOvDetaOD/a40j/AJFzVs5XSM5IAP/Z',\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'current' => [\n\t\t\t\t\t\t\t'EmployeeEdit' => [\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_TITLE => 'Зам. начальника отдела - главный специалист',\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_DIVISION => '',\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => '/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgAyADIAwERAAIRAQMRAf/EAG0AAAIDAQEBAAAAAAAAAAAAAAIDAAEEBQYIAQEBAQEBAAAAAAAAAAAAAAAAAQIDBBAAAgICAgIBBAIDAQAAAAAAAAECAxEEIQUxEiJBURMGMkJhUhQWEQEBAQEBAAAAAAAAAAAAAAAAAQIREv/aAAwDAQACEQMRAD8A+qQBn4AxbXhlHB3VywOVauQhfqBaiASiASQBIBiZQXsgLU0AxTQRbkUAyKBoAXECvUgrADK/IHS1PoRXZ1vCA2xAsCAVLwBh2Vwyjibi8gcuyPJUAogEoAF6AU4gBKSRAqe1GP1ARPsYL6lArtIfcBtfZQf1CNNe5GX1A0RsUgo0sgT0ApwIAcQCguQOjqLlEV2tbwgNkQLAgFSAx7K4YHG24+TSOZZDkAFEA1EAvUBVrUUBy9zcjBPkDgb3cxhn5EHE2P2HDfyAy/8Ao+f5Aadf9jy18gO1pd6pNfIqPQaXYxmlyFdei1SQGlLIEcAAcAJCHJB0NWPKCuxr+EQa4gWBAKkBlvXBRydqPko5tkOQgPQAlECpcIDmb+yoRfIHj+47T19uSDxXZ9xLL5Irz+x2k23yQZX2U8+QHU9rNPyOjtdd3Uk18i9R7Lp+5z6/Io9p1m+ppclHeosUkgHpZApwAuNfIG3Wj4IrqULgg1RAsCAVIDNeuCjmbMfJRgshyVAegE9AM+zL1iyDyvdbfqpcko8B3O3KTlhmbWuPK7asm2Tq8c+zWsf0J04RLVmvoOnFRommOnGzVVkWi9OPS9Tszi1yOpx7vpN9/HLNSpx7Tr9j2iuSo69XKKG+oBRhyBroiRXQpXBBoiBYEAqQCLlwUc69FGOceSoD0AqUcIDl9hLEWQeI7y1v2M1qR47bplZNmLW5CodPKf0MddJkx/r0mv4jp5Is/Xpf6l6nlnfQST/iOr5FDpJL+pOr5a6OulW1wJUuXoOr9oSRuVyse26i1tI6RivTazzFFRrSAKKA00oit1XggegLAgFMBNvgowXIoyyjyVA+gA2R4A4na8RZKrwvbrMmYrcjlU6inPwcrXbMd7Q6mMkuDHXWR1q+jg1/EdOBs/X4v+pes8ZbP1+P+pOtSEy6KK/qTrXGS/qVH6CVLkqnW9J+DpmuGo9L1PGDrHGx6rT/AIo2w3JcAEgNFJFbqiB6AgEAjARaUYrkUZ3HkqIogBbH4gcDt18WZrUeH7NfNnPTpmEacF7o5V6Mx6nrVHCMOjv68YNIsStDog14KyRbrQ+wWMd1EEnwZrccncpjyQscuVSUzpmuOo63WRw0dZXn1HqdJfFHSOdb1HgqLSA0VIitlZA9AQCARgJsKMlqKhDRREgAtXxIrz/bRzFma1I8T2Vb92c9O2Yya6akcq75jv6FzWDLbuauzwinHQhfwOpwu24dXjDdcRZHO2Je2SLxi/HmRqVjUdXr6sNHXNefUel04/FHWOFjfGPBpgSgA6uJFaq0QOQEAgEYCplGWxFCGioiACxcEWOL2VWYszXTLyPY62ZPg46ejMc+Gu1I512kdHVqksEb46uumiLxthJ4J1eJPLHTjNZW2VOM86GyKGGvyWMWOnpUYaO2XDcdzVhhI6x5tN8I8G3MaiENhEinwRAxAQCARgKsKM1hQiRUUgJKPBFjm71WUzFdMvNb+v8AJ8HLT04YYa69vByr0Ruo1l9iN8a41YIpkURTYwyEovwJmmS566+xAEaFksZ03a1WMHbLzbrq0QwkdY8+muCNOZiQQyKCmxIDAgEAjAVPwUZbWUIZUWgCa4IrHtV5TM1vLgb1PLOWo9GKwKtKRysejNbKUsGXWGyaQaB78k4p9UgzWqOMFZVKKCBjXlmpHPVbdeo65jzbroVQwjrHC0+KKyNAHEBsSAgIBAIwFWeCjJayhDfJQUQGLwQIvjlEqxxN6C5OdjrmuTPCkcq9OKZXYc69GaKVnAdIX+TkNcPpsDNjbXZwGLB+2Sxzp1Ucs3I4aroUVnWPPqtkI8G3OjwVlaAZEKZEgICAQCMBNhRjtZYEN8lBRYDUwFXPgg4u+/Jit5rhXzxI46ejFBC0516c073yZds1EnkOh9YStMJ4Dlqmwnyajjqt2vy0dcvNuuprrhHWOFrXFcFZXgorAQcUFMRAQEAgEYCbHwUYrmaGdvkqIpBR/kIE3W8Eo4+9LOTFWOFs5yzlXbNZ4yaZzsd86aap5Jx3zpphhk46ez48DiXQkxxy1o+rLZqRx1p0tVeDrHn1XUo8HSOda4sqCwUTABJAGiCwIBAKYCbfBRguZqIzSlyUV7gVKwz1Wa63glo5+w/bJijnXU5MVuVllQ0zNjpNLhBonHWbaq8jjfs+KbJxLs6FbY4xdNlFLNSOV06FMMGo52tlbwbjLTCZoNTAIAkAaAgEAgFSAz3Pgo597KMkpcl6isk6oZMzaM9iZnozThkgW6ckUuWrn6EWUP8Ayf4HGpoyGq/sTjXo+vWf2HE9NVWt/gcS1srpwVjp8YYKg0VDYSKHRmVTIyKGRYBoCwIBAKYGa7wBzryjK1yTqIkTqo4kC51kCZVEFKoA1UgCVCCjjrr7A6dChEOnQqSCGxiAXqUX6gWkUEmUHGRQ6Eih0WAQEAgFMDPd4A596IMzjyQFGIBehBTrACVQA/iILVYBqABxgAyMQDUQGKIBKIBegFOJRWAIkUOgUPgUGgIBAKkBntAxWrkyEeoBKJASiBfqBPQCvxoCfjQF/jAJQAJQANQAYogEogXgCmgBaAiQDIIodEoMogEAqQCLfBBjtRAnBASQBJAWkBaQBKIF+pRPUC1EAlEA1EAkgLwBTIBYEAiRQyJQ2JQQEAgFMBNpBjsRAogtAGkBeALSAJFF4AJIC0igkgLwBZBAKYAsCAWgGRKGIoICAQCMBNhBjtAQ2QEmQMQBAQAkUWgCSAJIosCZAgFkFMAWBACQBxKGIoICAQCMBNhBiuYGVy5IDhIB0QDyBMgEgDQBJAWUUBMgQAkBTAFgUASYDIsBkSggIBAI/ACLXwBz9iRBjlPkgbVLIGmL4ALIETAZEA0AQEZRWQJkC0ASAgAsAQImAyLAbEoMCAf/2Q==',\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'created' => '2017-11-16 10:12:44',\n\t\t\t\t\t'modified' => '2017-11-16 10:12:44',\n\t\t\t\t],\n\t\t\t\t'Employee' => [\n\t\t\t\t\t'id' => '3',\n\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_NAME => 'Суханова Л.Б.',\n\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_TITLE => 'Зам. начальника отдела - главный специалист',\n\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_MAIL => '[email protected]',\n\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID => 'dd518c55-35ce-4a5c-85c5-b5fb762220bf',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'fieldsLabel' => [\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => __dx('app_ldap_field_name', 'employee', 'Name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISPLAY_NAME => __dx('app_ldap_field_name', 'employee', 'Name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SURNAME => __d('cake_ldap_field_name', 'Surname'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_GIVEN_NAME => __d('cake_ldap_field_name', 'Given name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MIDDLE_NAME => __d('cake_ldap_field_name', 'Middle name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MAIL => __d('cake_ldap_field_name', 'E-mail'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SIP_PHONE => __d('cake_ldap_field_name', 'SIP telephone'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TELEPHONE_NUMBER => __d('app_ldap_field_name', 'Internal telephone'),\n\t\t\t\t'Othertelephone.{n}.value' => __d('app_ldap_field_name', 'Landline telephone'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MOBILE_TELEPHONE_NUMBER => __d('cake_ldap_field_name', 'Mobile telephone'),\n\t\t\t\t'Othermobile.{n}.value' => __d('app_ldap_field_name', 'Personal mobile telephone'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OFFICE_NAME => __d('cake_ldap_field_name', 'Office room'),\n\t\t\t\t'Department.value' => __d('cake_ldap_field_name', 'Department'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DIVISION => __d('cake_ldap_field_name', 'Subdivision'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TITLE => __d('cake_ldap_field_name', 'Position'),\n\t\t\t\t'Manager.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => __d('cake_ldap_field_name', 'Manager'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_BIRTHDAY => __d('cake_ldap_field_name', 'Birthday'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPUTER => __d('cake_ldap_field_name', 'Computer'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_EMPLOYEE_ID => __d('cake_ldap_field_name', 'Employee ID'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID => __d('cake_ldap_field_name', 'GUID'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISTINGUISHED_NAME => __d('cake_ldap_field_name', 'Distinguished name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => __d('cake_ldap_field_name', 'Photo'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPANY => __d('cake_ldap_field_name', 'Company name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_INITIALS => __d('cake_ldap_field_name', 'Initials'),\n\t\t\t\t'Employee.block' => __d('cake_ldap_field_name', 'Block'),\n\t\t\t],\n\t\t\t'fieldsConfig' => [\n\t\t\t\t'Employee.id' => [\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.department_id' => [\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.manager_id' => [\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID => [\n\t\t\t\t\t'type' => 'guid',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISTINGUISHED_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISPLAY_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_INITIALS => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SURNAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_GIVEN_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MIDDLE_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TITLE => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DIVISION => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TELEPHONE_NUMBER => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MOBILE_TELEPHONE_NUMBER => [\n\t\t\t\t\t'type' => 'telephone_name',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OFFICE_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MAIL => [\n\t\t\t\t\t'type' => 'mail',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => [\n\t\t\t\t\t'type' => 'photo',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPUTER => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_EMPLOYEE_ID => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPANY => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_BIRTHDAY => [\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SIP_PHONE => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.block' => [\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Department.value' => [\n\t\t\t\t\t'type' => 'department_name',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Othertelephone.{n}.value' => [\n\t\t\t\t\t'type' => 'telephone_description',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Othermobile.{n}.value' => [\n\t\t\t\t\t'type' => 'telephone_name',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Manager.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => [\n\t\t\t\t\t'type' => 'manager',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Subordinate.{n}' => [\n\t\t\t\t\t'type' => 'element',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t],\n\t\t\t'pageHeader' => __('Information of deferred save'),\n\t\t\t'headerMenuActions' => [\n\t\t\t\t[\n\t\t\t\t\t'fas fa-pencil-alt',\n\t\t\t\t\t__('Edit deferred save'),\n\t\t\t\t\t['controller' => 'deferred', 'action' => 'edit', '2'],\n\t\t\t\t\t['title' => __('Editing information of this deferred save')]\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'far fa-trash-alt',\n\t\t\t\t\t__('Delete deferred save'),\n\t\t\t\t\t['controller' => 'deferred', 'action' => 'delete', '2'],\n\t\t\t\t\t[\n\t\t\t\t\t\t'title' => __('Delete deferred save'), 'action-type' => 'confirm-post',\n\t\t\t\t\t\t'data-confirm-msg' => __('Are you sure you wish to delete this deferred save?')\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'fas fa-check',\n\t\t\t\t\t__('Approve deferred save data'),\n\t\t\t\t\t['controller' => 'deferred', 'action' => 'approve', '2'],\n\t\t\t\t\t[\n\t\t\t\t\t\t'title' => __('Approve deferred save data'), 'action-type' => 'confirm-post',\n\t\t\t\t\t\t'data-confirm-msg' => __('Are you sure you wish to approve this deferred save?'),\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'fas fa-times',\n\t\t\t\t\t__('Reject deferred save data'),\n\t\t\t\t\t['controller' => 'deferred', 'action' => 'reject', '2'],\n\t\t\t\t\t[\n\t\t\t\t\t\t'title' => __('Reject deferred save data'), 'action-type' => 'confirm-post',\n\t\t\t\t\t\t'data-confirm-msg' => __('Are you sure you wish to reject this deferred save?'),\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t],\n\t\t\t'breadCrumbs' => [\n\t\t\t\t[\n\t\t\t\t\tCakeText::truncate(__('Employees'), CAKE_THEME_BREADCRUMBS_TEXT_LIMIT),\n\t\t\t\t\t[\n\t\t\t\t\t\t'plugin' => null,\n\t\t\t\t\t\t'controller' => 'employees',\n\t\t\t\t\t\t'action' => 'index'\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\tCakeText::truncate('Суханова Л.Б.', CAKE_THEME_BREADCRUMBS_TEXT_LIMIT),\n\t\t\t\t\t[\n\t\t\t\t\t\t'3',\n\t\t\t\t\t\t'plugin' => null,\n\t\t\t\t\t\t'controller' => 'employees',\n\t\t\t\t\t\t'action' => 'view'\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\tCakeText::truncate(__('Deferred saves'), CAKE_THEME_BREADCRUMBS_TEXT_LIMIT),\n\t\t\t\t\t[\n\t\t\t\t\t\t'2',\n\t\t\t\t\t\t'plugin' => null,\n\t\t\t\t\t\t'controller' => 'deferred',\n\t\t\t\t\t\t'action' => 'view'\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t__('Viewing'),\n\t\t\t]\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'view',\n\t\t\t\t'2',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$result = $this->testAction($url, $opt);\n\t\t\t$this->excludeCommonAppVars($result);\n\t\t\t$this->assertData($expected, $result);\n\t\t}\n\t}", "public function test_authenticated_users_can_see_detailed_customer_list()\n {\n $this->actingAs(factory(User::class)->create());\n\n // If the route customers/detailedlist can be visited(i.e get), assert \"true\"\n $response = $this->get('/customers/detailedlist')->assertOk();\n\n }", "public function testShowUser()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/1');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n \"data\" => [\n \"id\",\n \"employee_code\",\n \"name\",\n \"email\",\n \"team\",\n \"role\",\n \"total_borrowed\",\n \"total_donated\"\n ]\n \n ])->assertStatus(Response::HTTP_OK);\n }", "public function testGetAuthorizationRole()\n {\n }", "public function postRoles(Request $request) {\n\n $data = $request->all();\n\n if ($data['checked']) {\n\n DB::delete('delete from role_users where user_id = ? and role_id = ?', [$data['user_id'], $data['role_id']]);\n\n return response()->json([\n 'error' => false,\n 'message' => 'deleted'\n ], 200);\n\n } else {\n\n RoleUser::create($data);\n\n return response()->json([\n 'error' => false,\n 'message' => 'added'\n ], 200);\n }\n }", "public function indexRoles()\n {\n\n $users = User::with('roles')\n ->whereNotIn('id', [1, auth()->user()->id])\n ->orderBy('created_at', 'asc')\n ->paginate(10);\n\n $roles = Role::all();\n\n return view('admin.roles.assign', compact('users', 'roles'));\n }", "public function displayRoles()\n { \n\n $user_data = $this->UserOrganisation_model->getAllByGet();\n foreach($user_data as $data){\n $email = $data->email;\n $roles = $this->UserOrganisation_model->findRole($data->id);\n if(count($roles)){\n foreach($roles as $role){\n $data = $role->name;\n $roleId = $role->pivot->role_id;\n $userId = $role->pivot->user_id;\n $arr_data = array('id'=>$roleId,'userId'=>$userId,'role'=>$data,'email'=>$email);\n $datas[]=$arr_data;\n }\n }else{\n $datas=$roles;\n }\n }\n return view('acl\\revoke_role', ['users' => $datas]);\n }", "public function test_users_edit_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function testViewDenyNotAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'logs',\n\t\t\t\t'action' => 'view',\n\t\t\t\t'1',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function assignRole($id, Request $request, listGenerates $list) {\n $user = $this->repo->find($id);\n $pag['nexid'] = $this->repo->next($id);\n $pag['preid'] = $this->repo->prev($id);\n // --- Ruoli Assegnati\n $ass = $this->listRoles($user);\n $roleAssArray = $ass->toArray();\n $roleAss = $this->repo->paginateArray($roleAssArray,4,$request->page_a,'page_a');\n // --- Ruoli ancora disponibili\n $roleDispArray = $this->repo->setModel(new Role())->all()->diff($ass)->toArray();\n $roleDis = $this->repo->paginateArray($roleDispArray,4,$request->page_b,'page_b');\n return \\View::make('users.assignRoleUser', compact('roleAss','roleDis','user','pag','list'));\n }", "public function testUserDetails() {\n\t\t// make new User and save it to the database\n\t\t$Role = Role::where('name', 'user')->first();\n\n\t\t// test home page 200 response code\n\t\t$this->visit('/home')\n\t\t\t->seePageIs('/home')\n\t\t\t->assertResponseOk();\n\n\t\t// check that User details are being displayed\n\t\t$this->visit('/home')->within('.body-content', function() use($Role) {\n\t\t\t$this->see($this->User->name)\n\t\t\t\t->see($this->User->email)\n\t\t\t\t->see(Language::trans('database.role-name-'.$Role->name));\n\t\t});\n\t}", "public function actionUserRole() {\n $model = new Configuration();\n $modules = $model->getModels();\n $modelArr = array();\n if (isset($_GET['id']) && $_GET['id'] != '') {\n $modelArr = $model->getUserRole($_GET['id']);\n }\n if (isset($_POST['UserRolesSearch'])) {\n if ($id = $model->saveUserRole()) {\n return $this->redirect(['index', 'fromRoles' => 1]);\n }\n }\n return $this->render('user-role', [\n 'model' => $modelArr,\n 'modules' => $modules\n ]);\n }", "public function index()\n {\n $roles = App\\User::find(1)->roles()->orderBy('name')->get();\n }", "public function testLoginRegister(){\n $user = User::find(1);\n $this->be($user);\n\n $response =$this->get(route('administracion'));\n $response->assertStatus(200);\n }", "public function testPutAuthorizationRoleUsersRemove()\n {\n }", "public function testViewSuccessForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t\t'return' => 'vars',\n\t\t];\n\t\t$result = $this->testAction('/admin/logs/view/1', $opt);\n\t\t$this->excludeCommonAppVars($result);\n\t\t$expected = [\n\t\t\t'log' => [\n\t\t\t\t'Log' => [\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '6',\n\t\t\t\t\t'employee_id' => '1',\n\t\t\t\t\t'data' => [\n\t\t\t\t\t\t'changed' => [\n\t\t\t\t\t\t\t'EmployeeEdit' => [\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_DISTINGUISHED_NAME => 'CN=Миронов В.М.,OU=12-05,OU=УИЗ,OU=Пользователи,DC=fabrikam,DC=com',\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_TITLE => 'Геолог',\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => '',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'current' => [\n\t\t\t\t\t\t\t'EmployeeEdit' => [\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_TITLE => 'Ведущий геолог',\n\t\t\t\t\t\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => '/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgAyADIAwERAAIRAQMRAf/EAG0AAAEFAQEBAAAAAAAAAAAAAAACAwQFBgEHCAEBAQEBAQAAAAAAAAAAAAAAAAECAwQQAAIBBAIDAAIDAQEBAAAAAAABAhEDBAUhEjFBIlETMhQGQmFiEQEBAQEBAAAAAAAAAAAAAAAAAQIREv/aAAwDAQACEQMRAD8A+p6lR0AqAVIrtQAAA5KVAGZ3UgiPcykvZE6jzzor2E6aexj+SnXVsY/kh0tZ0fyDpcc1fkdOnYZcX7C9Pwvp+yqejNMKWAAAAAAAAAg0yArpB0ACuog42BHvXVFBFXlZyjXkiVVZO0SryZ6yq8jb0r9DqIUt20/5DoVDd/8A0OiVb3Nf+idRIjtl+S9Onre3VfJer1Y4u0UqclalW+NlqSXJWk6E6oKWAAAAAAACCsgK7QDoBQiugNXZ0QFPsMtRT5IjL7DZ0b5M2sqS/sHJvk52nEC/kzfsno8q+9kXE/Jer5MrNmn5L1OJFrZS/I6nEqGzlTyOpw5HaST8l6cWWDtn2XJqVWp1my7U5NNNLi5CkkVU2MqoKUAAAAAAJCOgFCq7QgAOSfAEHMu9YsDJ7nO69uTNRjc7Ncpvk56qyI9pymzla3MpKxXJGPTXgxf18qeCyr5V17Cmn4Nys3KP+iaZes+TkYzL1PDr7onTwfx704yRqVLlptRmtNcnSVnja6vK7RXJoX1mdUiqfQUAAAAAcA7QAAAABFx0QFNs73WLIjB7zKdZcmarL3LjlcOOq3mLHAtdqHDVds5X2NipxXBnrp5PT16a8FlOIORq0/RuVOINzVc+DXU8mnrGvROnk1c17XonTyjvFcX4NSuespuDJwkjrmuNjY6fIfB1jDWYdysUaVOi+AroAAAAHEB0AAAABq86RAze5u0jIg893V6s2c9LFNa5uHDVdcxf62C4ONd40eLFURlpNjGLRqBE7EWbQxPEj+CrwxPEj+CVeIt3Fj+DPTiBkYqXosrnqI0IdZnbNcNRoNTNpo7xxrY6+dYo2LWD4ClAAAAACAAAAAAI+Q/lgZXeT+ZEo8928qzZy01Fdj/zOGnbK/wLiikcq6xc2MtJLknFSoZ0fyakU/HKi/ZpXXfiFMXL8SCPO9Fk4iJfaaEYqE19HXLhpbaz+SO+XGthrX8o6IubfgqlgAAAAcA6AAAAwIuS/lgZPeP5kZqsBtFWbOWm5Ffa4kcK7ZixsX3FGHSJCzWvZZA5bzpV8l4sTrGY37DciQ8p08gRb2Y17CUx/ddfJeMu/wBjsTjNEXWRvLlqLnWR+kdsuNjXa5fKOsZXFvwULAAAAA4B2oAAAcbAh5cvlkVkt3LiRi1qRhtlzNnHVdZECMeTlXWQ/GLoRuQrpI1F4ctwlULxYY8HwRUqUH1IIWRCRqJYi9ZVKzw9bUiJYmWIOqNRz1F7rY8o65cbGqwPCOsc7Ftb8FQsoAAAA4VAAAAHH4IqFmfxZKsZHdJ0kc9OuWLz19s46dZEOC5OVdZEu1bTDpIfjZRWuHIWUmDiZYgkE4ldY0CIt6ymDiP/AFuS9XhyFihGbEizbo0ajlqLnXx5R1y46jTYK4R1jlVpb8GmThUAAAAcKgAAADjCouTGsWZqxl9xZqpHPTplidlapJnHTtlVp0kc66xLsXEZdYmwkqFdIX2SAVG+kVLD0clP2GeFq4pBZHUkFd4DFO2aNmpHHS719vlHbMcNNFhwokdY5VYwXBpgsAAAADhUAV2hEAVxgM3o1TAotpYrFmK3KxO3xmm+DjqO2azd+DjI5WO2a7auUZl1lTbV7gjpKcd3gqm5XWVCrd11KJdq6QPq7wEtc/ZVlkc9VNxE5SR0kcNVpNda8HWRx1WgxoUSOkcqlxRUdAAAAASEdCuhAFcATNVQFdm2e0WSrGT2+HWvBy1HWVj9hj9ZM46jrmq1vqznXaU5C9QjpKc/eWNdc/bU0pcLiKJNu8RKeV6oYtPWX2ZqRy1V5rrNWjrI4arU6+zRI6SOVq4tRojbB4AAAAAASEAHagBVAA0QMXrdUBQ7PGTi+DFjcrFbjH6t8HHUdc1l8n5kzjXbNR/2mXWO/tZY3HVdZuNHYXSh6F5kZqRau1YcrVpgrtJG446rV6ux4OsjjqtNiWqJHSOdT4rgqFAAAAAACQgKAAA6AEUma4ArNhbTizNWMRvYJdjlqOuawuxmozZx07Zqt/fyYdZTkbqYdJTsZmo1KcjIp05G4GbT9m7yhHHVX2ruJyR1y4araamjSOscbWlxkuqNMpS8FAAAAAAAJqVlypQAAHSK6AmT4Iqs2FxKDJRhP9BfSUjnp0jz3a5C7vk4ads1TPJ+vJh0lPWsr/0vG5UqGQVvpxXwdK/sBm05ayefJY5aXuqy/pcnTLhpu9LkpqPJ2jla1mJcTijTKbF8BXQAAAAABs0wAAK6QFUFJlcSIGL2TFJ8gUG12EVF8kOvPf8AQbFPtyYrcrB7HK7TfJx1HbNVjuNsw6w9amw3Eu1JlaPqTAOzIldjdaZY56Wmuy6SXJ1y8+250Wd/Hk6xwtbfX5icVyaOra3fTXkKejNMKWmAAAAA2aYABWhFJlcSAj3cqMfYEDI2cYryQ6ps7dxin9BOsnuN8mpfQTrCbjbd2+TNalZu/ldpPk5WO2a5bnU52PRmpllVMukTrUA3w+ocA4TNJBKjznRmo5aPYuRSS5OuXl3Wq1Gw605Osea1s9btlRclOtBi7ROnIalWdjOjL2F6mW8hP2Guno3EwFKQV0BlyNOZMriQUzcyYr2Q6gZOxjFPkJ1SZ26jGv0E6zuf/oKV+gnWa2H+gbr9ETrMbHcylX6B1nMzOlJvkzWpUH+xz5M2Ouak2Mhfk52PRnSyx764MWO2asrF1UJx1lSP2KgXpm9eSReMWq+9kqvk1I4b07YyPrydZHk3V5gZbVOTcee1ocLZSjTkrPV5h7dqn0Fml3ibjx9FamlxjbVOnIbmllY2EZU5I1Km28mL9hepEbiYVCu5MY+zTmgZGxjGvIOqnL3MVX6InVBn73z9BnrNbDdt1+iJ1ns3aylXkJ1S5WdJ15IKjJyJOvIaitvXGRqIsr1GGpS7eVR+TNjrnSxxszxyZsds6W2Pl8LkxY7TSV/bVPJONekPJzeHyakc9aVt3O+vJuR59aO4uVWS5NyPPqtBg3qpFcauLF5pLkMJ1nLcfZTqwsbNxpyF6tMXcNU+itSrjE3Xj6DU0usTbJ05DU0trGwi15DfpRZe4ik/orHVDnbzz9EZtZ/N3TdfoidUeXtZSryE6p8jNlJvkiIN2637AhXm2FQL7I1FfeYbiFckFNq46hqVKsX2iWNzSzsZTS8mbHSbPyzOPJONe0LJy2/ZqRzulfPIbkakc7UzCvvsiudafXX+EHKrqze4DFPq+ELjkteyh63myT8gWGNspKnIXq4w9u1T6K1Kusbd0S+g16ZjL3TdfoHVNlbSUq8kZ6q7+ZJ15IIF6+2BGncbAblICPdfBFiBffkNxX3mGkOaqVTfQB2CaC9Sbc2icXpbuOg4vpHuNsrNphxdQiTjNqSKzV9gX6UIzV3YyOFyHOpCvBCldCHI3GA9bvtewJVvOcfZVSYbZx/6Kqku5zfsios8lv2QMyu1AanIBmUgESkRTFyQVCvsNRAurkNGXAoFbAUrYDigB3oDpLtgJdoBUIUYRPxptUCVbY950QYqdbnUjJ+LKhxMIV3oFInfp7Co88xr2VeI07rIGneCuftAHOoQlsgbkwpmbDSLdQVEnENG+hQpQIFKAQtQKFdADoAl2wBQAetRowixx6hip9ojKVAqHEwEzlwBFvXA0iyk2yqTckQRp3KBXI3QHYzqEKqAiRFNzCo9xBTE4hSOoUdQhSQC0ioV1AOoB0IDoUO248hE2xEjNTrSDKTEIVUoauSColx8lUmEasK//9k=',\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'created' => '2017-11-01 11:04:02',\n\t\t\t\t],\n\t\t\t\t'Employee' => [\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'block' => false,\n\t\t\t\t\t'name' => 'Миронов В.М.',\n\t\t\t\t\t'title' => 'Ведущий геолог',\n\t\t\t\t],\n\t\t\t\t'User' => [\n\t\t\t\t\t'id' => '6',\n\t\t\t\t\t'block' => false,\n\t\t\t\t\t'name' => 'Козловская Е.М.',\n\t\t\t\t\t'title' => 'Заведующий сектором',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'fieldsLabel' => [\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => __dx('app_ldap_field_name', 'employee', 'Name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISPLAY_NAME => __dx('app_ldap_field_name', 'employee', 'Name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SURNAME => __d('cake_ldap_field_name', 'Surname'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_GIVEN_NAME => __d('cake_ldap_field_name', 'Given name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MIDDLE_NAME => __d('cake_ldap_field_name', 'Middle name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MAIL => __d('cake_ldap_field_name', 'E-mail'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SIP_PHONE => __d('cake_ldap_field_name', 'SIP telephone'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TELEPHONE_NUMBER => __d('app_ldap_field_name', 'Internal telephone'),\n\t\t\t\t'Othertelephone.{n}.value' => __d('app_ldap_field_name', 'Landline telephone'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MOBILE_TELEPHONE_NUMBER => __d('cake_ldap_field_name', 'Mobile telephone'),\n\t\t\t\t'Othermobile.{n}.value' => __d('app_ldap_field_name', 'Personal mobile telephone'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OFFICE_NAME => __d('cake_ldap_field_name', 'Office room'),\n\t\t\t\t'Department.value' => __d('cake_ldap_field_name', 'Department'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DIVISION => __d('cake_ldap_field_name', 'Subdivision'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TITLE => __d('cake_ldap_field_name', 'Position'),\n\t\t\t\t'Manager.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => __d('cake_ldap_field_name', 'Manager'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_BIRTHDAY => __d('cake_ldap_field_name', 'Birthday'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPUTER => __d('cake_ldap_field_name', 'Computer'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_EMPLOYEE_ID => __d('cake_ldap_field_name', 'Employee ID'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID => __d('cake_ldap_field_name', 'GUID'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISTINGUISHED_NAME => __d('cake_ldap_field_name', 'Distinguished name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => __d('cake_ldap_field_name', 'Photo'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPANY => __d('cake_ldap_field_name', 'Company name'),\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_INITIALS => __d('cake_ldap_field_name', 'Initials'),\n\t\t\t\t'Employee.block' => __d('cake_ldap_field_name', 'Block'),\n\t\t\t],\n\t\t\t'fieldsConfig' => [\n\t\t\t\t'Employee.id' => [\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.department_id' => [\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.manager_id' => [\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID => [\n\t\t\t\t\t'type' => 'guid',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISTINGUISHED_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISPLAY_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_INITIALS => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SURNAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_GIVEN_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MIDDLE_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TITLE => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_DIVISION => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_TELEPHONE_NUMBER => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MOBILE_TELEPHONE_NUMBER => [\n\t\t\t\t\t'type' => 'telephone_name',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_OFFICE_NAME => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_MAIL => [\n\t\t\t\t\t'type' => 'mail',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_PHOTO => [\n\t\t\t\t\t'type' => 'photo',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPUTER => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_EMPLOYEE_ID => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_COMPANY => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_BIRTHDAY => [\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.' . CAKE_LDAP_LDAP_ATTRIBUTE_SIP_PHONE => [\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Employee.block' => [\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Department.value' => [\n\t\t\t\t\t'type' => 'department_name',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Othertelephone.{n}.value' => [\n\t\t\t\t\t'type' => 'telephone_description',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Othermobile.{n}.value' => [\n\t\t\t\t\t'type' => 'telephone_name',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t\t'Manager.' . CAKE_LDAP_LDAP_ATTRIBUTE_NAME => [\n\t\t\t\t\t'type' => 'manager',\n\t\t\t\t\t'truncate' => true,\n\t\t\t\t],\n\t\t\t\t'Subordinate.{n}' => [\n\t\t\t\t\t'type' => 'element',\n\t\t\t\t\t'truncate' => false,\n\t\t\t\t],\n\t\t\t],\n\t\t\t'pageHeader' => __('Information of log record'),\n\t\t\t'headerMenuActions' => [\n\t\t\t\t[\n\t\t\t\t\t'fas fa-undo-alt',\n\t\t\t\t\t__('Restore data from log'),\n\t\t\t\t\t['controller' => 'logs', 'action' => 'restore', '1'],\n\t\t\t\t\t[\n\t\t\t\t\t\t'title' => __('Restore data from log'), 'action-type' => 'confirm-post',\n\t\t\t\t\t\t'data-confirm-msg' => __('Are you sure you wish to restore this data from log?'),\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'far fa-trash-alt',\n\t\t\t\t\t__('Delete record of log'),\n\t\t\t\t\t['controller' => 'logs', 'action' => 'delete', '1'],\n\t\t\t\t\t[\n\t\t\t\t\t\t'title' => __('Delete record of log'), 'action-type' => 'confirm-post',\n\t\t\t\t\t\t'data-confirm-msg' => __('Are you sure you wish to delete this record of log?'),\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t],\n\t\t\t'breadCrumbs' => [\n\t\t\t\t[\n\t\t\t\t\tCakeText::truncate(__('Employees'), CAKE_THEME_BREADCRUMBS_TEXT_LIMIT),\n\t\t\t\t\t[\n\t\t\t\t\t\t'plugin' => null,\n\t\t\t\t\t\t'controller' => 'employees',\n\t\t\t\t\t\t'action' => 'index'\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\tCakeText::truncate('Миронов В.М.', CAKE_THEME_BREADCRUMBS_TEXT_LIMIT),\n\t\t\t\t\t[\n\t\t\t\t\t\t'1',\n\t\t\t\t\t\t'plugin' => null,\n\t\t\t\t\t\t'controller' => 'employees',\n\t\t\t\t\t\t'action' => 'view'\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\tCakeText::truncate(__('Logs'), CAKE_THEME_BREADCRUMBS_TEXT_LIMIT),\n\t\t\t\t\t[\n\t\t\t\t\t\t'1',\n\t\t\t\t\t\t'plugin' => null,\n\t\t\t\t\t\t'controller' => 'logs',\n\t\t\t\t\t\t'action' => 'view'\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t__('Viewing'),\n\t\t\t]\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}", "public function testReportsSkillv1reportsroleidusers()\n {\n\n }", "public function testViewDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'view',\n\t\t\t\t'1'\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function create()\n {\n $roles = Role::find([4,5,6]);\n return view('auth.auth-request', compact('roles'));\n }", "public function create(Request $request)\n {\n $request->user()->controlroles(['1','3','2','4']);\n \n }", "public function testDoctorWithDoctorRoleCanAccessDoctorDashboard()\n {\n $user = User::factory()->create();\n $user->roles()->attach(Role::where('name', 'doctor')->first());\n\n $this->actingAs($user);\n $response = $this->get('/doctor/home')->assertOk();\n }", "public function testAdminWithAdminRoleCanAccessAdminDashboard()\n {\n $user = User::factory()->create();\n $user->roles()->attach(Role::where('name', 'admin')->first());\n\n $this->actingAs($user);\n $response = $this->get('/admin/home')->assertOk();\n }", "public function testThatRemoveRolesRequestIsFormattedProperly()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->removeRoles( '__test_user_id__', [ '__test_role_id__' ] );\n\n $this->assertEquals( 'DELETE', $api->getHistoryMethod() );\n $this->assertEquals(\n 'https://api.test.local/api/v2/users/__test_user_id__/roles',\n $api->getHistoryUrl()\n );\n\n $headers = $api->getHistoryHeaders();\n $this->assertEquals( 'Bearer __api_token__', $headers['Authorization'][0] );\n $this->assertEquals( self::$expectedTelemetry, $headers['Auth0-Client'][0] );\n $this->assertEquals( 'application/json', $headers['Content-Type'][0] );\n\n $body = $api->getHistoryBody();\n $this->assertArrayHasKey( 'roles', $body );\n $this->assertCount( 1, $body['roles'] );\n $this->assertEquals( '__test_role_id__', $body['roles'][0] );\n }", "public function testAdminGetListadoAction()\n {\n $headers = $this->getHeaders('[email protected]');\n $client = static::createClient();\n $client->followRedirects();\n $client->request('GET', '/api/v1.0/usuarios', [], [], $headers);\n self::assertEquals(200, $client->getResponse()->getStatusCode());\n }", "public function indexRolesAction(){\n \n $entity = 'Jbig3\\Entity\\RolesEntity';\n $repositoryFunction = 'findAllRoles';\n $viewvar = 'roles';\n \n $repository = $this->em->getRepository($entity)->$repositoryFunction();\n $this->view->$viewvar = $repository;\n }", "public function index()\n {\n $page = request('page', 1);\n $pageSize = request('pageSize', 10);\n\n return $this->respond(User::with('roles')->paginate($pageSize, ['*'], 'page', $page));\n }", "public function index()\n {\n $id = Auth::id();\n $users = User::with(\"roles\")->get();\n\n return [\"data\" => $users];\n }", "public function testIndexCreateUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@create'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->type('first_name', 'cowell@123')\n ->type('last_name', 'cowell@123')\n ->select('id_role', '3')\n ->press('Create')\n ->assertSee('Xong rồi');\n });\n }", "public function test_admin_trained_member()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/MemberSkills', 'index']);\n $this->assertResponseCode(404);\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 }", "public function testGETRoute()\n {\n\n $response = $this->get('/api/role');\n\n $response->assertStatus(200);\n// $response->assertSee(\"Role management page\");\n }", "public function testCreate()\n {\n\n $this->createDummyPermission(\"1\");\n $this->createDummyPermission(\"2\");\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->createAction,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc,\n 'permissionCount' => $this->testPermissionCount,\n 'permission0' => 1,\n 'permission1' => 2\n ));\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc\n ]);\n\n $this->assertDatabaseHas('role_permission', [\n 'role_id' => 1,\n 'permission_id' => [1, 2]\n ]);\n }", "public function testGetUserAll()\n {\n $response = $this->request()->json('GET','/api/users');\n $response->assertStatus(200);\n }", "public function testSearchAdminsSuccessful()\n {\n $this -> withoutMiddleware();\n\n // Create users\n $this -> createUser($this -> userCredentials);\n $this -> createUser($this -> userCredentials2);\n $this -> createUser($this -> userCredentials3);\n\n $user = User::where('email',$this -> userCredentials)->first();\n $token = JWTAuth::fromUser($user);\n JWTAuth::setToken($token);\n\n // Search for users that exists\n $this -> call('GET','api/classes/admins/search',['string' => $this -> userCredentials[\"email\"]]);\n $this -> seeJson([\n 'email' => $this ->userCredentials[\"email\"]\n ]);\n $this -> dontSeeJson([\n 'email' => $this ->userCredentials2[\"email\"]\n ]);\n $this -> dontSeeJson([\n 'email' => $this ->userCredentials3[\"email\"]\n ]);\n\n // Search for user that does not exist\n $this -> call('GET','api/classes/admins/search',['string' => '[email protected]']);\n $this -> seeJson([]);\n }", "public function show_roles(){\n\t\t\n\t\t//Connection establishment, processing of data and response from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/manageRoles_api/all_role';\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\treturn $response;\t\t\n\t\t\n\t}", "public function test_admin_training_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/MemberSkills', 'training_programs']);\n $this->assertResponseCode(404);\n }", "public function testAdminCanUpdateARole()\n {\n $existRole = Role::factory()->create();\n $permission = Permission::where('name', 'view_roles')->first();\n\n $params = [\n 'name' => $this->faker->name(),\n 'permissions' => [$permission->name],\n ];\n $response = $this\n ->actingAs($this->admin)\n ->put('/admin/roles/'. $existRole->id, $params);\n\n $updatedRole = Role::find($existRole->id);\n $this->assertEquals($params['name'], $updatedRole->name);\n $this->assertEquals($existRole->id, $updatedRole->id);\n\n $response->assertStatus(302);\n $response->assertSessionHasNoErrors();\n $response->assertRedirect('/admin/roles');\n $response->assertSessionHas('success', __('roles.success_updated_message', ['name' => $existRole->name]));\n }", "public function test_admin_data_admin()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Account', 'index']);\n $this->assertResponseCode(404);\n }", "public function testCheckingRoles()\n {\n $this->assertTrue($this->principal->hasRole('baz'));\n $this->assertFalse($this->principal->hasRole('doesNotExist'));\n }", "public function testGetRoleCollection()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testPostAuthorizationSubjectDivisionRole()\n {\n }", "public function actionIndex() {\r\n\r\n $this->ensureAuthManagerDefined();\r\n\r\n //provide the oportunity for the use to abort the request\r\n $message = \"This command will create three roles: Owner, Member, and Reader\\n\";\r\n $message .= \" and the following permissions:\\n\";\r\n $message .= \"create, read, update and delete users\\n\";\r\n $message .= \"create, read, update and delete opviviendas\\n\";\r\n $message .= \"create, read, update and delete opreunidos\\n\";\r\n $message .= \"Would you like to continue?\";\r\n\r\n //check the input from the user and continue if \r\n //they indicated yes to the above question\r\n if ($this->confirm($message)) {\r\n //first we need to remove all operations, \r\n //roles, child relationship and assignments\r\n $this->_authManager->clearAll();\r\n\r\n //create the lowest level operations for users\r\n $this->_authManager->createOperation(\r\n \"createUser\", \"create a new user\");\r\n $this->_authManager->createOperation(\r\n \"readUser\", \"read user profile information\");\r\n $this->_authManager->createOperation(\r\n \"updateUser\", \"update a users information\");\r\n $this->_authManager->createOperation(\r\n \"deleteUser\", \"remove a user from a project\");\r\n\r\n //create the lowest level operations for projects\r\n $this->_authManager->createOperation(\r\n \"createOpViviendas\", \"create a new vivienda\");\r\n $this->_authManager->createOperation(\r\n \"readOpViviendas\", \"read vivienda information\");\r\n $this->_authManager->createOperation(\r\n \"updateOpViviendas\", \"update vivienda information\");\r\n $this->_authManager->createOperation(\r\n \"deleteOpViviendas\", \"delete a vivienda\");\r\n\r\n //create the lowest level operations for issues\r\n $this->_authManager->createOperation(\r\n \"createOpReunidos\", \"create a new reunidos\");\r\n $this->_authManager->createOperation(\r\n \"readOpReunidos\", \"read reunidos information\");\r\n $this->_authManager->createOperation(\r\n \"updateOpReunidos\", \"update reunidos information\");\r\n $this->_authManager->createOperation(\r\n \"deleteOpReunidos\", \"delete a reunidos\");\r\n\r\n //create the reader role and add the appropriate \r\n //permissions as children to this role\r\n $role = $this->_authManager->createRole(\"reader\");\r\n $role->addChild(\"readUser\");\r\n $role->addChild(\"readOpViviendas\");\r\n $role->addChild(\"readOpReunidos\");\r\n\r\n //create the member role, and add the appropriate \r\n //permissions, as well as the reader role itself, as children\r\n $role = $this->_authManager->createRole(\"member\");\r\n $role->addChild(\"reader\");\r\n $role->addChild(\"updateOpViviendas\");\r\n //$role->addChild(\"updateIssue\");\r\n //$role->addChild(\"deleteIssue\");\r\n\r\n //create the owner role, and add the appropriate permissions, \r\n //as well as both the reader and member roles as children\r\n $role = $this->_authManager->createRole(\"owner\");\r\n $role->addChild(\"reader\");\r\n $role->addChild(\"member\");\r\n $role->addChild(\"createUser\");\r\n $role->addChild(\"updateUser\");\r\n $role->addChild(\"deleteUser\");\r\n $role->addChild(\"createOpViviendas\");\r\n $role->addChild(\"updateOpViviendas\");\r\n $role->addChild(\"deleteOpViviendas\");\r\n $role->addChild(\"updateOpReunidos\");\r\n\r\n //provide a message indicating success\r\n echo \"Authorization hierarchy successfully generated.\\n\";\r\n }\r\n else\r\n echo \"Operation cancelled.\\n\";\r\n }", "function roles_get() {\n\n $result_set = $this->model_all->getTableDataInArray(\"app_roles\", array(\"id!=\" => \"1\"), \"id,role_name,short_form\");\n if (($result_set['total_rows']) > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"roles\"] = $result_set['records'];\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"Detais Not Found\";\n $this->response($result, 200);\n exit;\n }\n }", "public function testPutAuthorizationRolesDefault()\n {\n }", "public function usuarioRoles($usuario);", "public function test_authorized_user_can_access_the_user_route()\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n\n $response = $this->get('/user');\n\n $response->assertStatus(200);\n $response->assertJson(['data' => ['name' => $user->name, 'email' => $user->email]]);\n }", "public function testUserApiReturnsUsers()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $users = factory(User::class, 2)->create();\n\n // $this->json('GET', 'api/v1/users')\n // ->seeJsonStructure([\n // '*' => [\n // 'northstar_id', 'created_at', 'updated_at', 'role',\n // ]\n // ]);\n }", "public function test_users_edit_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }" ]
[ "0.7049755", "0.700122", "0.66408026", "0.655189", "0.6468906", "0.6441516", "0.6409138", "0.6399059", "0.63687295", "0.63232404", "0.6289401", "0.6283894", "0.6277959", "0.6277959", "0.6277286", "0.6261511", "0.6253791", "0.6221124", "0.6206624", "0.6126751", "0.608351", "0.60731804", "0.6071141", "0.6068159", "0.60558355", "0.6000857", "0.5986229", "0.59827095", "0.59136", "0.58957326", "0.5871541", "0.5859133", "0.582552", "0.5825365", "0.5822605", "0.5819359", "0.5814022", "0.5812725", "0.58107495", "0.58093846", "0.5788996", "0.57681483", "0.57561755", "0.57539517", "0.5753069", "0.5745265", "0.5738602", "0.5727497", "0.5724019", "0.5722476", "0.57039326", "0.5699579", "0.5699506", "0.5679552", "0.56678665", "0.5662252", "0.5661806", "0.5660978", "0.5659992", "0.56596196", "0.56463623", "0.56444645", "0.5642344", "0.5634223", "0.563177", "0.5631049", "0.5629657", "0.5626355", "0.56149", "0.5611346", "0.5610121", "0.56042355", "0.5601323", "0.559905", "0.55954754", "0.55924106", "0.5592163", "0.5585489", "0.5585422", "0.5583516", "0.55697936", "0.5566359", "0.55473745", "0.55437446", "0.5541849", "0.5536629", "0.5536541", "0.55314547", "0.55305916", "0.552825", "0.55270076", "0.55217135", "0.55204386", "0.5511736", "0.5498177", "0.5489426", "0.54886985", "0.54880476", "0.5487081", "0.54861593" ]
0.6986776
2
Menampilkan seluruh data category
public function index() { $categories = Category::all(); // Menampilkan seluruh data product dengan paginate (yang ditampilkan 32 products/halaman) $products = Product::with('galleries')->simplePaginate(16); return view('pages.category',compact('categories', 'products')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "public function show_rekapkat(){\n // load library to cek user session and level\n $this->pageauth->sess_auth();\n $this->load->model('pages/m_crud_forecast');\n $query = $this->m_crud_forecast->select_cat();\n echo \"<option>- PILIH -</option>\";\n foreach ($query->result() as $row){\n echo \"<option value='$row->cat_code'>\" . $row->cat_desc . \"</option>\";\n }\n }", "function showCategory()\n\t {\n\t\t\n\t\t $res=mysql_query(\"select * from category\");\n\t\t while($data=mysql_fetch_array($res))\n\t\t {\n\t\t\t\n\t\t\techo '<option value=\"'.$data['cat_id'].'\">'.$data['cat_title'].'</option>';\n\t\t }\n\t\t \n\t }", "public function categories()\n {\n $result = $this->dtbs->list('category');\n $data['info'] = $result;\n $this->load->view('back/categories/anasehife',$data);\n }", "function category(){\n\n\t\t\t$header['title']=\"Find Page\";//title\n\t\t\t$data=[];//dataa\n\t\t\t$sidebar['getUpdate'] = $this->_actionModel->getAllDataByUpdate_time();\n\t\t\t$keyword = $_GET['cat'] ?? '';//get key\n\t\t\t$keyword = trim($keyword);//cat bo khaong trong 2 dau\n\t\t\t$data['keyword'] = $keyword;// key-> value\n\n\t\t\t$page = $_GET['page'] ?? '';//tim $_page\n\t\t\t$page = (is_numeric($page) && $page >0) ? $page : 1;//kiem tra xem co phai so khong\n\t\t\t//Chu thich lau qa =.=\n\t\t\t\n\t\t\t$dataLink =[\n\t\t\t\t'c' => 'action',\n\t\t\t\t'm' => 'category',\n\t\t\t\t'page'=> '{page}',\n\t\t\t\t'cat' => $keyword\n\t\t\t];//giong o tren r`\n\t\t\t$links = $this->_actionModel->create_link_manga($dataLink);//tao links\n\t\t\t//die($links);//die ra coi thu DL thoi \n\n\t\t\t$manga=$this->_actionModel->getAllDataMangaByKeywordCategory($keyword);//cai ten noi len tat ca\n\n\t\t\t$panigate = panigation(count($manga), $page, 4,$keyword,$links);//panigate la phan trang r`\n\t\t\t$data['mangas'] = $this->_actionModel->getDataMangaByCategory($panigate['keyword'],$panigate['start'],$panigate['limit']);//lay manga theo category con gif\n\t\t\t//echo\"<pre/>\";print_r($data['mangas']);die();//die ra coi DL thoi xoa di lay j coi du lieu ?? !\n\t\t\t$data['panigation'] = $panigate['panigationHtml']; //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadHeader($header); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadActionPage($data); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadSidebarPage($sidebar); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadFooter(); //nhu o tren r` chu thich j` nua.\n\t\t}", "function showCategory()\r\n {\r\n }", "public function showCategory(){\n \t$form = M(\"categoryinfo\");\n \t$data = $form->select();\n \t$data = json_encode($data);\n \techo $data;\n \t//$this->display();\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 }", "function category_data()\n\t{\n\t\t$this->data['title'] \t= 'Portfolio Category Data';\n\t\t$this->data['category']\t= $this->portfolio_model->get_all_category();\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/category_data';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function AddCategorieToSelect($data){\n \n for ($i = 0; $i < sizeof($data); $i++) {\n $this->categorie_select->addMultiOption($data[$i]['Nome'], $data[$i]['Nome']);\n }\n\n }", "public function mostrar_categorias(){\n $conexion = Conexion();\n $sql=\"SELECT * from tbl_categoria\"; \n foreach ($conexion->query($sql) as $row){\n echo \"<option value='{$row ['id_categoria']}'>{$row ['nombre']}</option>\"; \n }\n }", "public function category(){\n\t\t$_error = \"Select Category\";\n\t\treturn $_error;\n\t}", "function select_category($type,$level='',$id=''){\r\n // level = 1 : gom ca cac danh sach chu de con\r\n global $mysql,$lang,$moshtml,$table_prefix;\r\n if($level=='' || !$level){\r\n $code[] = array(0,$lang['lang.cat_cat']);\r\n }\r\n if($id){\r\n $s = \"and id<> \".$id.\"\";\r\n }else{\r\n $s = '';\r\n }\r\n $q = $mysql->query(\"select id, title from \".$table_prefix.\"category where cfor='\".$type.\"' \".$s.\" and subid=0 order by corder ASC\");\r\n while($r=$mysql->fetch_array($q)){\r\n $total_sub = $mysql->num_rows($mysql->query(\"select id from \".$table_prefix.\"category where cfor='\".$type.\"' and subid=\".$r['id'].\"\"));\r\n $code[] = array($r['id'],\"-&nbsp;\".$r['title']);\r\n if($level!='' && $total_sub){\r\n $q2 = $mysql->query(\"select id, title from \".$table_prefix.\"category where cfor='\".$type.\"' and subid=\".$r['id'].\" order by corder ASC\");\r\n while($r2=$mysql->fetch_array($q2)){\r\n $code[] = array($r2['id'],'&nbsp;&nbsp;|--&nbsp;'.$r2['title']);\r\n }\r\n }\r\n }\r\nreturn $code;\r\n}", "public function AddCategorieToSelect($data)\n {\n for ($i = 0; $i < sizeof($data); $i++) {\n $this->categorie_select->addMultiOption($data[$i]['id_categoria'], $data[$i]['nome']);\n }\n }", "function kategoridokumen(){\n\t\tcek_session_admin();\n\t\t$data['record'] = $this->model_dokumen->kategori_dokumen();\n\t\t$this->load->view('administrator/mod_kategoridokumen/view_kategoridokumen',$data);\n\t}", "public function cat_select() {\n //formulate select query\n $sql = \"SELECT * FROM categories\"; \n //execute query \n return $this->db_query($sql);\n }", "public function category()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_index');\n $view->kategorie = $_GET['kategorie'];\n $view->title = 'Kategorie';\n $view->heading = 'Kategorie: '. $_GET['kategorie'];\n $view->vereine = $vereinRepository->getByCategory($view->kategorie);\n $view->display();\n }", "function getCategories($categoryId)\n{\n global $conn;\n \n $sql = \"SELECT CategoryID, Name FROM productcategory ORDER BY Name\";\n \n $statement = $conn->prepare($sql);\n $statement->execute();\n $records = $statement->fetchAll(PDO::FETCH_ASSOC);\n \n foreach ($records as $record)\n {\n echo \"<option value='\" .$record['CategoryID'].\"'\";\n \n if (isset($categoryId) AND $categoryId > 0 AND $categoryId == $record['CategoryID'])\n {\n echo \" selected \";\n }\n \n echo \">\".$record['Name'].\"</option>\";\n }\n}", "function getCategoryDataAction()\n {\n $siteId = $this->request->categoryId;\n $site = $this->category->findByPk($siteId);\n $this->set($site->toArray());\n $this->viewClass = \"JsonView\";\n }", "public function HM_CategoCuentas()\n {\n }", "public function category()\n {\n if ($this->session->userdata('role_id') == 2) {\n $data = [\n 'category' => $this->db->get('category')->result_array(),\n 'subcategory' => $this->db->get('slug')->result_array(),\n 'pesanan' => $this->db->get_where('pesanan', ['is_active' => 1, 'is_acc' => 0])->num_rows(),\n 'notif_pesanan' => $this->db->get_where('pesanan', ['is_active' => 1, 'is_acc' => 0])->result_array(),\n ];\n $this->load->view('admin/header');\n $this->load->view('admin/topbar', $data);\n $this->load->view('admin/category_v', $data);\n $this->load->view('admin/footer');\n } elseif ($this->session->userdata('role_id') == 1) {\n redirect('cp_admin/s_admin');\n } else {\n redirect('cp_admin/');\n }\n }", "public function categorylist($c){\n $this->cat_id = $c; \n }", "function showCategoryNames(){\n $this->load->model('pagesortingmodel');\n $data['groups'] = $this->pagesortingmodel->getAllCategories();\n $this->load->view('admin/create_categories',$data);\n }", "public function dropdown_kategori()\n {\n //Query untuk mengambil data kategori dan diurutkan berdasarkan nama kategori\n $sql = \"SELECT * FROM kategori ORDER BY nama_kategori\";\n $query = $this->db->query($sql);\n\n //Value default pada dropdown\n $value[''] = '-- CHOOSE --';\n //Menaruh data kategori ke dalam dropdown, value yang akan diambil adalah value id_kategori\n foreach ($query->result() as $row) {\n $value[$row->id_kategori] = $row->nama_kategori;\n }\n return $value;\n }", "public function categories()\n\t{\n $data['category'] = $this->uri->segment(3);\n \n //NO CATEGORY SELECTED\n if($data['category'] == NULL){\n $template_data['title'] = \"Categories\";\n $template_data['content'] = $this->load->view('player/categories', $data, true);\n $this->load->view('templates/main', $template_data);\n }else{ //CATEGORY SELECTED\n $template_data['title'] = ucfirst($data['category']);\n $template_data['content'] = $this->load->view('player/songs', $data, true);\n $this->load->view('templates/main', $template_data);\n } \n\t}", "public function AddData()\n {\n echo 'Создалась VirtualCategory - метод Data <br>';\n }", "function setup_cat()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'perms_view, def_view, id, name', 'from' => 'gallery_categories', 'where' => \"id={$this->ipsclass->input['cat']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $cat = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this category?\n if( ! $this->ipsclass->check_perms( $cat['perms_view'] ) )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); \n }\n\n return $cat;\n }", "public function loadCategoryOptionAction(){\n $ebookers_obj = new Ep_Ebookers_Managelist();\n //to call a functio to update themes//\n $result = $ebookers_obj->loadCategoryOption($this->_request->getParams());\n $options = '<option value=\"\">Select</option>';\n $i=0;\n while($result[$i]) {\n $options .= '<option value=\"' . $result[$i]['cat_id'] . '\">' . utf8_encode($result[$i]['category_name']) . '</option>';\n $i++;\n }\n echo $options;\n //unset($_REQUEST);\n exit;\n\n }", "public function read_kategori(){\n\n\t\t$sudah_login = $this->session->userdata('sudah_login');\n\t $data['role'] = $this->session->userdata('role');\n\t $data['jk'] = $this->session->userdata('jk');\n\t $data['email'] = $this->session->userdata('email');\n\t $data['fullname'] = strtoupper($this->session->userdata('fullname'));\n\t\t$data['kategori'] = $this->Video_model->get_list();\n\t\t$data['page'] = 'Data Kategori';\n\t\t$data['info'] = ' Anda dapat menambah,mengedit dan menghapus data kategori';\n\t\t$data['judul'] = ' Dakwah Islam | Data Kategori';\n\t\t$logo = $this->db->query('select * from setting_web where id_setting = \"9\"')->result_array();\n\t\t$data['logo'] = $logo;\n\t\t$logofav = $this->db->query('select * from setting_web where id_setting = \"10\"')->result_array();\n\t\t$data['logofav'] = $logofav;\n\n\t if (!$sudah_login) { // jika $sudah_login == false atau belum login maka akan kembali ke redirect yang di tuju\n\t redirect(base_url('Login'));\n\t } else { \n\t\t\t$this->load->view('superadmin/header',$data);\n\t\t\t$this->load->view('superadmin/read_kategori');\n\t\t\t$this->load->view('superadmin/footer');\n\t\t}\n\t}", "public static function category_box() {\n\t\t\t\n\t\t\tglobal $post;\n\t\t\tglobal $wpdb;\n\t\n\t\t\t$cat_list = $wpdb->get_results( \"SELECT re_int, re_title FROM \".$wpdb->prefix.self::$table_name);?>\n\t\t\t\n\t\t\t<label for=\"siteurl\">Select the appropriate Menu Category for this current dish.<br /></label>\n\t\t\t<p>\n\t\t\t\n\t\t\t\t<?php\n\t\t\t\t\tif(!empty($cat_list)){\n\t\t\t\t\t\techo \"<select style='width:200px' name='cat_id'>\";\n\t\t\t\t\t\tforeach($cat_list as $list => $val){\n\t\t\t\t\t\t\t$sel = \"\";\n\t\t\t\t\t\t\tif(isset($_GET['menucat']) && ($_GET['menucat'] == $val->re_int )) { \n\t\t\t\t\t\t\t\t$sel = ' selected=\"selected\"'; \n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$menucat = get_post_meta($post->ID, \"meta_menucat\", true);\n\t\t\t\t\t\t\t\tif($menucat == $val->re_int ) { $sel = ' selected=\"selected\"';} \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo \"<option value='\".$val->re_int.\"' \".$sel.\">\".$val->re_title.\"</option>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"</select>\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<a href='edit.php?post_type=menucategory-post&page=menu_listings'>Add Categories First.</a>\";\n\t\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t</p>\n\t\t\n\t\t\t<?php\n\t\t}", "public function action_cat()\n {\n $cat = $this->request->param('cat');\n $cat = mysql_real_escape_string ($cat);\n \n // Получаем список продукций\n // $category = ORM::factory('category')->where('cat_id', '=', $cat)->find();\n $category = ORM::factory('category')->where('path', '=', $cat)->find();\n\n if(!$category->loaded()){\n $this->redirect();\n }\n \n $count = $category->products->where('status', '<>', 0)->count_all();\n $pagination = Pagination::factory(array('total_items'=>$count,'items_per_page'=>2));\n $prods = array();\n $products = $category->products\n ->where('status', '<>', 0)\n ->limit($pagination->items_per_page)\n ->offset($pagination->offset)\n ->find_all();\n $prs = $category->products\n ->select('prod_cats.prod_id')\n ->where('status', '<>', 0)\n ->find_all();\n foreach ($prs as $p)\n {\n $prods[] = $p->prod_id;\n }\n if(count($prods))\n $brands = ORM::factory('brand')\n ->join('products')\n ->on('brand.brand_id', '=', 'products.brand_id')\n ->where('products.prod_id','in',$prods)\n ->group_by('brand.title')\n ->order_by('brand.title', 'ASC')\n ->find_all();\n \n \n \n //$products = $category->products->where('status', '!=', 0)->find_all();\n // $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/c' . $category->cat_id);\n $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/' . $category->path);\n $this->template->breadcrumbs = Breadcrumb::generate($this->breadcrumbs);\n \n $content = View::factory('/' . $this->theme . 'index/catalog/v_catalog_cat', array(\n 'products' => $products,\n 'cat' => $cat,\n 'pagination' =>$pagination,\n 'brands' =>$brands,\n \n ));\n \n // Выводим в шаблон\n \n $this->template->title = $category->title;\n $this->template->page_title = $category->title;\n $this->template->page_caption = $category->title;\n $this->template->center_block = array($content);\n $this->template->block_right = null; \n $filter = Filter::factory();\n $filter->loadFiltersOptions($category->cat_id);\n $this->template->filter = $filter->render();\n }", "public function index()\n {\n $data['row'] = $this->categorys_m->get();\n $this->template->load('template', 'product/category/category_data', $data);\n }", "public function category()\n\t{\n\t\t$data['catResult'] = $this->ProcurementModel->category();\n\t\t$data['pagename'] = \"category\";\n\t\t$data['category'] = \"master\";\n\t\t$data['active_menu'] = \"procurement\";\n\t\t$this->load->view('Director',$data);\n\n\t}", "public function displayCategories()\n {\n $query = $this->categoryModel->displayCategories();\n $this->showCategories = $query->fetchAll();\n }", "function CategorySelect($data)\n{\n switch ($data['Type']) {\n case 'Read':\n $response = ReadSelect($data);\n break;\n case 'Update':\n $response = UpdateSelect($data);\n break;\n case 'Delete':\n $response = DeleteSelect($data);\n break;\n }\n\n return $response;\n}", "function abl_droploader_get_image_cat_select() {\n\t\t$image_categories = getTree('root', 'image');\n\t\t//$image_categories_select = str_ireplace(\"\\n\", '', tag('<label for=\"image-category\">' . gTxt('image_category') . '</label>' . br .\n\t\t//\ttreeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' id=\"abl-droploader-image-cat-sel\" class=\"category\"'));\n\t\t//$alt_caption =\ttag('<label for=\"alt-text\">'.gTxt('alt_text').'</label>'.br.\n\t\t//\t\tfInput('text', 'alt', '', 'edit', '', '', 50, '', 'alt-text'), 'div', ' class=\"alt text\"').\n\t\t//\ttag('<label for=\"caption\">'.gTxt('caption').'</label>'.br.\n\t\t//\t\t'<textarea id=\"caption\" name=\"caption\"></textarea>'\n\t\t//\t\t, 'div', ' class=\"caption description text\"');\n\t\t$image_categories_select = str_ireplace(\"\\n\", '', tag(tag('<label for=\"image-category\">'.gTxt('image_category').'</label>'.br.\n\t\t\t\ttreeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' class=\"category\"'), 'div', ' id=\"abl-droploader-image-cat-sel\"'));\n\t\treturn $image_categories_select;\n\t}", "public function change()\n\t{\n\t\t$result = $this->helper_categories_model->getCategories();\n\t\t$this->template\n\t\t\t->title('您期望添加到哪个分类')\n\t\t\t->set_layout(FALSE)\n\t\t\t->set('data', $result)\n\t\t\t->build('admin/helper/change');\n\t}", "public function actionCategories() {\n \n $result = $cats = array();\n \n //find categories and information \n $cats = $this->query(\" select distinct x.category,y.name from project as x \n join category as y \n on x.category = y.category_id\n group by x.category \",FALSE,FALSE);\n \n\n //get category specific data \n foreach ($cats as $key=>$cat) {\n $category_id = $cat['category'];\n $result[$key] = array(\n 'id'=>$category_id,\n 'name'=>$cat['name'],\n 'data'=>array(),\n 'funded'=>$this->query(\" select sum(x.amount) as value from user_fund_project as x join project as y on x.project_id = y.id and x.status = 'SUCCESS' and y.category = {$category_id} \")\n );\n \n //RAISED\n $result[$key]['data'][] = $this->query(\" select 'RAISED' as field,sum(x.amount) as value from user_fund_project as x join project as y on x.project_id = y.id and x.status = 'SUCCESS' and y.category = {$category_id} \",FALSE,FALSE);\n //successful projects\n $result[$key]['data'][] = $success_projects = $this->query(\" select 'SUCCESSFUL PROJECTS ' as field, count(distinct id) as value from project where project_status= 'success' and category = {$category_id} \",FALSE,FALSE); \n //loved\n $result[$key]['data'][] = $this->query(\" select 'LOVED' as field,count(distinct x.user_id) as value from user_love_project as x \n join project as y \n on x.project_id = y.id\n where y.category = {$category_id} \",FALSE,FALSE);\n //UNSUCCESSFUL PROJECTS \n $result[$key]['data'][] = $this->query(\" select 'UNSUCCESSFUL PROJECTS' as field,count(*) as value from project as value where project_status!='SUCCESS' and category = {$category_id} \",FALSE,FALSE); \n// FIXED \n $result[$key]['data'][] = $this->query(\" select 'FIXED' as field,count(*) as value from project as value where funding_type='fixed' and category = {$category_id} \",FALSE,FALSE);\n// FLEXIBLE \n $result[$key]['data'][] = $this->query(\" select 'FLEXIBLE' as field,count(*) as value from project as value where funding_type='flexible' and category = {$category_id} \",FALSE,FALSE);\n// BACKERS \n $result[$key]['data'][] = $this->query(\" select 'BACKERS' as field,count(distinct x.user_id) as value from user_fund_project as x \n join project as y \n on x.project_id = y.id\n where y.category = {$category_id} \",FALSE,FALSE);\n// DRAFT (UNLAUNCHED)\n $result[$key]['data'][] = $this->query(\" select 'DRAFT (UNLAUNCHED)' as field,count(*) as value from project where project_status='draft' and category = {$category_id} \",FALSE,FALSE);\n// LIVE\n $result[$key]['data'][] = $this->query(\" select 'LIVE' as field,count(*) as value from project where publish_status='published' and category = {$category_id} \",FALSE,FALSE);\n //SUCCESS RATE\n $total_projects = $this->query(\" SELECT COUNT(*) FROM project where category = {$category_id} \");\n $success_percent = (int)(($success_projects[0]['value']/$total_projects)*100);\n $result[$key]['data'][] = array( \n array(\n 'field'=>'(%)SUCCESS RATE',\n 'value' =>$success_percent\n )\n );\n \n\n }\n \n //sorting result from most funded cat to least\n $funded = array();\n foreach ($result as $key => $row)\n {\n $funded[$key] = $row['funded'];\n }\n array_multisort($funded, SORT_DESC, $result);\n \n \n //pass array to front end \n $params =array(\n 'reportData'=>$result,\n );\n \n //render page \n $this->render('categories',$params);\n }", "public function generate_kategori_dropdown() {\n $this->db->select ('\n kategori.id_kategori_point,\n kategori.tingkat_kegiatan\n ');\n // Urut abjad\n $this->db->order_by('tingkat_kegiatan');\n $result = $this->db->get('kategori');\n \n // bikin array\n // please select berikut ini merupakan tambahan saja agar saat pertama\n // diload akan ditampilkan text please select.\n $dropdown[''] = 'Pilih';\n if ($result->num_rows() > 0) {\n \n foreach ($result->result_array() as $row) {\n // Buat array berisi 'value' (id kategori) dan 'nama' (nama kategori)\n $dropdown[$row['id_kategori_point']] = $row['tingkat_kegiatan'];\n }\n }\n return $dropdown;\n }", "public function showcategory() {\n // call to model function to get all category from db\n $result = $this->dash_model->showcategory();\n\n echo json_encode($result);\n }", "public function getCategory() {}", "public function mostrarID(){\n $conexion = Conexion();\n $sql=\"SELECT * from tbl_categoria\"; \n foreach ($conexion->query($sql) as $row){\n echo \"<option value='{$row ['id_categoria']}'>{$row ['id_categoria']}</option>\";\n }\n }", "function showSubCategory()\n\t {\n\t\t\n\t\t $prolist=new Actions();\n\t\t $res=$prolist->fetchAll(\"category\");\n\t\t\t\t\t\t\n\t\t $parentdata=mysql_query(\"select * from category where cat_par_id='0'\");\n\t\t while($parent_sub_cat=mysql_fetch_array($parentdata))\n\t\t {\n\t\t\techo '<option value=\"'.$parent_sub_cat['cat_id'].'\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.ucfirst($parent_sub_cat['cat_title']).'</option>';\n\t\t \t\t\t\n\t\t\t if(mysql_num_rows(mysql_query(\"select * from category where cat_par_id='\".$parent_sub_cat['cat_id'].\"'\"))>0)\n\t\t\t {\n\t\t\t\tActions::$r++;\n\t\t\t\tActions::viewCategory($parent_sub_cat['cat_id']);\n\t\t\t } \n\t\t\t \n\t\t }\t\t\t\t\t\t\n\t\t \n\t }", "function display_cat()\n {\n $this->Admin_model->procedure = 'GET_POST_CAT';\n\n $rs = $this->Admin_model->get_post();\n $data['rows'] = $rs;\n $this->load->view('display_posts_cat', $data);\n\n }", "function displayCategory()\r\n\t {\r\n\t \t$productId = JRequest::getVar('product_id');\r\n\t \t\r\n\t \t$model = $this->getModel('qrcode');\r\n\t \t$productList = $model->getProductByCategory();//Store product details based on category.\r\n\t \tob_clean();\r\n\t \t\r\n\t \techo \"<b>\".JText::_('COM_QRCODE_VIEW_DEFAULT_PRODUCT_LIST').\"</b>\";\r\n \r\n\t \t\t\t$options = array();\r\n $default = \"\";\r\n if($productId)\r\n {\r\n \t$default = $productId;\r\n }\r\n $options[] = JHTML::_('select.option', \"0\", JText::_('COM_QRCODE_VIEW_DEFAULT_DISPLAY_ALL'));\r\n foreach ($productList as $key=>$val) {\r\n $options[] = JHTML::_('select.option', $val['product_id'], $val['product_name']);\r\n }\r\n echo JHTML::_('select.genericlist', $options, 'qrcode', 'onchange=getProductId(this.value)','value', 'text', $default); \r\n exit();\r\n\t }", "function kategoriberita(){\n\t\tcek_session_admin();\n\t\t$data['record'] = $this->model_berita->kategori_berita();\n\t\t$this->load->view('administrator/mod_kategori/view_kategori2',$data);\n\t}", "public function traitementCategorie() {\n\n $this->data .= '<div class=\"boutique-droite\">';\n if(isset($_GET['categorie']))\n {\n $donnees = Database::query(\"SELECT id_produit,reference,titre,photo,prix FROM produit WHERE categorie=?\", array($_GET['categorie']));\n foreach($donnees as $key2 =>$produit)\n {\n $this->data .= '<div class=\"boutique-produit\">';\n $this->data .= \"<h3>$produit[titre]</h3>\";\n $this->data .= \"<a href=\\\"fiche_produit.php?id_produit=$produit[id_produit]\\\"><img src=\\\"$produit[photo]\\\" width=\\\"130\\\" height=\\\"100\\\" /></a>\";\n $this->data .= \"<p>$produit[prix] €</p>\";\n $this->data .= '<a href=\"fiche_produit.php?id_produit=' . $produit['id_produit'] . '\">Voir la fiche</a>';\n $this->data .= '</div>';\n }\n }\n $this->data .= '</div></div>';\n }", "public function categories(){\n \n $this->data['categories'] = $this->books_model->getAllCategories();\n $this->render('books/categories');\n }", "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 category($x){\n global $connect;\n $category = mysqli_query($connect,\"SELECT * FROM `category`\");\n while ($cate = mysqli_fetch_assoc($category)) {\n echo '<option value=\"'.$cate['categoryName'].'\" \n '.($x == $cate['categoryName']?'selected':'') .'>\n '.$cate['categoryName'].' \n </option>';\n }\n}", "public function ajax_get_category()\n {\n $cat_id = ee()->input->get('cat_id');\n $group_id = ee()->input->get('group_id');\n $status = ee()->input->get('publisher_view_status') ? ee()->input->get('publisher_view_status') : PUBLISHER_STATUS_OPEN;\n\n $data = array(\n 'cat_id' => $cat_id,\n 'status' => $status\n );\n\n $vars = ee()->publisher_helper->get_toolbar_options('category', $data, FALSE);\n\n $vars['cat_id'] = $cat_id;\n $vars['group_id'] = $group_id;\n $vars['data'] = ee()->publisher_category->get_translations($cat_id, $group_id, $status);\n $vars['save_url'] = ee()->publisher_helper_cp->mod_link('ajax_save_category', array(), TRUE);\n $vars['custom_fields'] = ee()->publisher_category->get_custom_fields($group_id);\n\n // Load core lang file so views are translated\n ee()->lang->loadfile('content');\n\n if (ee()->input->get('publisher_view_status'))\n {\n $data = ee()->load->view('category/edit_form', $vars, TRUE);\n }\n else\n {\n $data = ee()->load->view('category/edit', $vars, TRUE);\n }\n\n ee()->publisher_helper->send_ajax_response($data);\n }", "public function categoryAction()\n\t{\n\t\t$id = (int) $this->getRequest()->getParam('id');\n\t\t$this->view->category = $this->_blogService->findCategory($id);\n\t}", "public function catDisplay(){\n $query = \"SELECT * FROM shop_category\";\n $result = $this->db->select($query);\n\n return $result;\n }", "function categorianivel($padre)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM pages WHERE name!='' AND padre = %s\",\n\tGetSQLValueString($padre, \"int\"));\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\tif ($totalRows_ConsultaFuncion > 0) {\n\t\tdo {\n\t\t\t?> \n\t\t<div class=\"sub_cat\">\n\t\t\t<ul>\n\t\t\t\t<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $row_ConsultaFuncion['name']?></li>\n\t\t\t</ul>\n\t\t</div>\n\t<?php\n\t\t} while ($row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion));\n\t}\n\t\t \n\tmysqli_free_result($ConsultaFuncion);\n}", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "function existCategoryOption() {\n\n\tglobal $result;\n\n\tglobal $cat_name_id;\n\n\tselectRows('category', 'cat_id');\n\n while ($row = mysqli_fetch_array($result)) {\n \t\n\t\t$cat_id = $row['cat_id'];\n\n\t\t$cat_name = $row['cat_name'];\n\n\t\tif ($cat_id == $cat_name_id) {\n\t\t\t\n\t\t\techo \"<option selected value='{$cat_id}'>{$cat_name}</option>\";\n\n\t\t} else {\n\n\t\t\techo \"<option value='{$cat_id}'>{$cat_name}</option>\";\n\n\t\t}\n }\n\n}", "public function cat(){\n $cat_id = intval(I('get.cat_id'));\n if(!$cat_id){\n http_response_code(404);\n }\n\n $display = cookie('display');\n if($display) {\n if (!preg_match(\"/^list|grid$/\", $display)) {\n die('hack out');\n }else{\n if($display == 'list') {\n $this->assign('display', 1);\n }else{\n $this->assign('display', 0);\n }\n }\n }\n $this->assign('cat_id', $cat_id);\n $mbx = D('Admin/cat')->parentList($cat_id);\n if($mbx){\n $this->assign('mbx',$mbx);\n }\n\n $cat_in_nav = M('cat')->field('cat_id,cat_name')->where('show_in_nav=1')->select();\n $this->assign('cat_in_nav',$cat_in_nav);\n $his = array_reverse(session('history'),true);\n $this->assign('history',$his);\n $sale = M('goods')->field('goods_id,goods_name,thumb_img,shop_price,goods_number')->order('goods_number desc')->limit(10)->select();\n $this->assign('sale',$sale);\n $this->assign('cattree',D('Admin/Cat')->gettree());\n\n $this->assign('cat_name', M('cat')->field('cat_name')->find($cat_id)['cat_name']);\n\n $this->display();\n }", "public function getViewedCategory();", "public function chooseCategory(){\n $req = $this->db->query('SELECT * FROM p5_files_category');\n $req->setFetchMode(\\PDO::FETCH_CLASS | \\PDO::FETCH_PROPS_LATE, \n 'taekwondo\\model\\Category');\n return $req;\n }", "protected function _initCatagory()\r\n\t{\r\n\t\tMage::dispatchEvent('vendor_catalog_controller_category_init_before', array('controller_action' => $this));\r\n\t\t$categoryId = (int) $this->getRequest()->getParam('id', false);\r\n\t\tif (!$categoryId) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$category = Mage::getModel('vendorscategory/category')\r\n\t\t->load($categoryId);\r\n\t\tif (!Mage::helper('vendorscategory')->canShow($category)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!Mage::registry(\"vendor_id\") && !Mage::registry(\"vendor\") && !Mage::registry(\"current_vendor\")){\r\n\t\t\t//echo $category->getVendorId();exit;\r\n\t\t\t$vendorObj = Mage::getModel('vendors/vendor')->load($category->getVendorId());\r\n\r\n\t\t\t//var_dump($vendorObj->getData());exit;\r\n\t\t\tMage::register('vendor_id', $vendorObj->getVendorId());\r\n\t\t\tMage::register('vendor', $vendorObj);\r\n\t\t\tMage::register('current_vendor', $vendorObj);\r\n\t\t}\r\n\t\t\r\n\t\tMage::register('current_vendor_category', $category);\r\n\t\tMage::register('current_vendor_entity_key', $category->getPath());\r\n\t\ttry {\r\n\t\t\tMage::dispatchEvent(\r\n\t\t\t'vendor_catalog_controller_category_init_after',\r\n\t\t\tarray(\r\n\t\t\t'category' => $category,\r\n\t\t\t'controller_action' => $this\r\n\t\t\t)\r\n\t\t\t);\r\n\t\t} catch (Mage_Core_Exception $e) {\r\n\t\t\tMage::logException($e);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t\treturn $category;\r\n\t}", "function category() {\n // check session \n $this->check_session();\n \n // header data\n $header = $this->header_array('','','','Admin Category | Cytek Solutions Inc.','',base_url('admin/category'));\n // admin-navigation data\n $nav[\"page\"] = \"category\";\n $nav[\"inquiry\"] = $this->inquiry_model->pull_new_lead_cnt();\n // body data\n $body_data[\"categories\"] = $this->category_model->pull_categories();\n $body_data[\"subcategories\"] = $this->category_model->pull_subcategories();\n //view\n $this->load->view('header',$header);\n $this->load->view('admin-navigation',$nav);\n $this->load->view('category',$body_data);\n $this->load->view('script');\n $this->load->view('footer');\n }", "public function categories() {\n\n $this->load->model('Model_Bird_Wiki');\n $result['categories'] = $this->Model_Bird_Wiki->get_categories();\n\n if($result!=false) {\n $this->load->view('category_main', $result);\n }\n else {\n echo \"Something went wrong !\";\n }\n\n }", "public function edit_category($id)\n\t{\n\t\t$query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n $data['category']=$query; \n\t\t$data['title']=\"Dahboard || Great Wine Global\";\n $this->load->view('superpanel/header',$data);\n $this->load->view('superpanel/edit_categorie');\n $this->load->view('superpanel/footer');\n\t}", "public function get_categoria() {\n $conectar=parent::conexion();\n parent::set_names();\n $sql=\"SELECT * FROM tm_categoria WHERE est=1\";\n $sql=$conectar->prepare($sql);\n $sql->execute();\n // IMPORTANTE AGREGARLE EL PDO::FETCH_ASSOC PARA QUE HAGA BIEN LA CONSULTA\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n\n }", "public function getKategori()\n {\n $query = \"SELECT `tb_barang`.*, `tb_category`.`category`\n FROM `tb_barang` JOIN `tb_category`\n ON `tb_category`.`category` = `tb_barang`.`kategori`\n ORDER BY `tb_barang`.`kategori` ASC\";\n\n return $this->db->query($query)->result();\n }", "public function category(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Category';\n\t\t$data['categoryList'] = $this->common_model->get_all('fr_category', '');\n\t\t$this->set_layout('category/category_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}", "public function getCategory();", "public function getCategory();", "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 category(){\n\t\t$this->load->helper('url');\n\t\t$data['userLogin'] = $this->checkLogin();\n\t\tif($data['userLogin']){\n\t\t\t$data['user'] = $this->getUser();\n\t\t}\n\n\t\t$data['sidebar'] = $this->sidebar();\n\n\t\t$this->load->view('frontend/templates/header');\n\t\t$this->load->view('frontend/templates/navigation');\n\t\t$this->load->view('frontend/category', $data);\n\t\t$this->load->view('frontend/templates/sidebar');\n\t\t$this->load->view('frontend/templates/footer');\n\t}", "function getCategorySelection() {\n\t\tif($this->conf['hideCategorySelection'])\n return '';\n\n\t\t$this->getCategoryQuery();\n\n\t\t$select_fields = \t'tx_tdcalendar_categories.uid';\n\t\t$select_fields .=\t', tx_tdcalendar_categories.title';\n\t\t$select_fields .=\t', tx_tdcalendar_categories.color';\n\n\t\t$from_table =\t\t'tx_tdcalendar_categories';\n\n\t\t$where_clause = \t'1';\n\t\t$where_clause .= \t$this->enableFieldsCategories;\n\t\t$where_clause .= \t$this->getCategoryQuery();\n\n\t\t$where_clause .=\t$this->getPagesQuery('tx_tdcalendar_categories');\n\n\t\t$orderBy =\t\t\t'tx_tdcalendar_categories.uid';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t$select_fields,\n\t\t\t$from_table,\n\t\t\t$where_clause,\n\t\t\t$groupBy='',\n\t\t\t$orderBy,\n\t\t\t$limit=''\n\t\t);\n\n\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res) <= 1)\n\t\t\treturn '';\n\n\t\t$vars['category'] = 0;\n\n\t\t$cats = array();\n\t\t$cats[$this->pi_linkTP_keepPIvars_url($vars, $this->caching)] = $this->pi_getLL('allCats');\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\n\t\t\tif($this->conf['currCat']==$row['uid'])\n\t\t\t\t$sel=$row['title'];\n\t\t\t$vars['category']=$row['uid'];\n\t\t\t$cats[$this->pi_linkTP_keepPIvars_url($vars, $this->caching)] = $row['title'];\n }\n\n\t\treturn $this->selectInputOnChange('category', $cats, $sel ,\"document.location = '' + this.options[selectedIndex].value;\");\n\t}", "public function select_category(){\n $this->block_for_test();\n if($this->session->has_userdata('APPLICATION_ID')) {\n $APPLICATION_ID = $this->session->userdata('APPLICATION_ID');\n\n $user = $this->session->userdata($this->SessionName);\n $user = $this->User_model->getUserById($user['USER_ID']);\n\n $data['user'] = $user;\n $data['APPLICATION_ID'] = $APPLICATION_ID;\n $application = $this->Application_model->getApplicationByUserAndApplicationId($user['USER_ID'], $APPLICATION_ID);\n // prePrint($application);\n // if($application['PROGRAM_TYPE_ID'] == 1){\n // redirect(base_url('form/add_evening_category'));\n // exit();\n // }\n if($application['STATUS_ID']==FINAL_SUBMIT_STATUS_ID){\n redirect(base_url('form/application_form'));\n exit();\n }\n if($application['STATUS_ID']>FINAL_SUBMIT_STATUS_ID){\n redirect(base_url('form/dashboard'));\n }\n if ($application) {\n $form_data = $this->User_model->getUserFullDetailById($user['USER_ID'],$APPLICATION_ID);\n\n $degree_list = array(\n 'BACHELOR'=>array('PROGRAM_TYPE_ID'=>1,'DEGREE_ID'=>3),\n 'MASTER'=>array('PROGRAM_TYPE_ID'=>2,'DEGREE_ID'=>array(4,5,6))\n );\n\n //$form_data = json_decode($application['FORM_DATA'],true);\n $bool = false;\n $valid_qualification = null;\n if($application['PROGRAM_TYPE_ID']==$degree_list['BACHELOR']['PROGRAM_TYPE_ID']){\n // echo \"bach\";\n foreach ($form_data['qualifications'] as $qualification){\n if($qualification['DEGREE_ID'] ==$degree_list['BACHELOR']['DEGREE_ID']){\n $bool = true;\n $valid_qualification = $qualification;\n break;\n }\n }\n\n\n }\n else if($application['PROGRAM_TYPE_ID']==$degree_list['MASTER']['PROGRAM_TYPE_ID']){\n //echo \"master\";\n //4\n // prePrint($form_data['qualifications']);\n\n\n\n foreach ($form_data['qualifications'] as $k=>$qualification){\n if(in_array($qualification['DEGREE_ID'] ,$degree_list['MASTER']['DEGREE_ID'])){\n $bool = true;\n if($k==0){\n $valid_qualification = $qualification;\n }\n if($qualification['DEGREE_ID']>$valid_qualification['DEGREE_ID']){\n $valid_qualification = $qualification;\n }\n\n //break;\n }\n }\n }\n\n\n $form_fees = $this->Admission_session_model->getFormFeesBySessionAndCampusId($application['SESSION_ID'], $application['CAMPUS_ID']);\n\n if ($form_fees) {\n// $valid_upto = getDateCustomeView($application['ADMISSION_END_DATE'], 'd-m-Y');\n//\n// if ($application['ADMISSION_END_DATE'] < date('Y-m-d')) {\n// exit(\"Sorry your challan is expired..\");\n// }\n\n\n $data['profile_url'] =$this->profile;\n// $data['is_valid_qualification'] = $bool;\n// $data['form_data'] = $form_data;\n //$data['application'] = $application;\n if($bool&&$valid_qualification!=null){\n\n // $result = $this->Application_model->getMinorMappingByDisciplineId($valid_qualification['DISCIPLINE_ID']);\n\n\n\n $data['DISCIPLINE_ID'] = $valid_qualification['DISCIPLINE_ID'];\n\n $applicantsMinors = $this->Application_model->getApplicantsMinorsByApplicationIdAndDisciplineID($APPLICATION_ID,$valid_qualification['DISCIPLINE_ID']);\n $minorMappingIds = array();\n\n foreach ($applicantsMinors as $applicantsMinor)\n {\n $minorMappingIds[]=$applicantsMinor['MINOR_MAPPING_ID'];\n }\n\n if(count($minorMappingIds)==0){\n echo \"Please Must select Minor Subject\";\n $error = \"<div class='text-danger'> Please Must select Minor Subject</div>\";\n $alert = array('MSG'=>$error,'TYPE'=>'ALERT');\n $this->session->set_flashdata('ALERT_MSG',$alert);\n redirect(base_url('form/select_subject'));\n }\n\n $list_of_categoy = $this->Application_model->getApplicantCategory($APPLICATION_ID, $user['USER_ID']);\n $CHOOSEN_PROGRAM_LIST = $this->Application_model->getChoiceByUserAndApplicationAndShiftId($user['USER_ID'],$APPLICATION_ID,$MORNING_SHIFT=1);\n \n // $valid_program_list = $this->Prerequisite_model->getPrerequisiteByMinorMappingIdList($minorMappingIds);\n //$program_list = $this->Administration->getProgramByTypeID($application['PROGRAM_TYPE_ID']);\n //$data['VALID_PROGRAM_LIST'] =$valid_program_list;\n $data['list_of_category'] =$list_of_categoy;\n $data['CHOOSEN_PROGRAM_LIST'] =$CHOOSEN_PROGRAM_LIST;\n //$data['PROGRAM_LIST'] =$program_list;\n $data['PROGRAM_TYPE_ID'] =$application['PROGRAM_TYPE_ID'];\n $data['application'] =$application;\n $data['form_data'] =$form_data;\n // prePrint($valid_program_list);\n // prePrint($program_list);\n// exit();\n // $data['roll_no'] = $user['USER_ID'];\n $this->load->view('include/header', $data);\n $this->load->view('include/preloder');\n $this->load->view('include/side_bar', $data);\n $this->load->view('include/nav', $data);\n $this->load->view('select_category', $data);\n $this->load->view('include/footer_area', $data);\n $this->load->view('include/footer', $data);\n\n }else{\n redirect(base_url().\"candidate/add_inter_qualification\");\n echo \"Invalid Degree Please must add appropriate degree\";\n }\n // prePrint($application);\n\n\n\n } else {\n echo \"fees not found\";\n }\n\n } else {\n echo \"this application id is not associate with you\";\n }\n }else{\n echo \"Application Id Not Found\";\n }\n }", "public function dd_selreqcategory() {\n $reqtypeid = $this->input->post('sRequestID');\n $ddSelReqcategory = $this->Requestproc_mdl->selreqcategory($reqtypeid);\n //KONDISI JIKA REQUEST TYPENYA SAMA DENGAN 2/PROJECT MAKA ONCHANGE Tidak BELAKU-------------------/\n if ($reqtypeid == 2 || $reqtypeid == 5) {\n echo \"<select class='form-control' name='ReqCategoryID' id='ReqCategoryID' onchange='loadGridItemList()'>\";\n } else {\n echo \"<select class='form-control' name='ReqCategoryID' id='ReqCategoryID' onchange='loadGridItemList()'>\";\n }\n echo \"<option value='' disabled='' selected=''>--Select--</option>\";\n foreach ($ddSelReqcategory as $row) {\n if ($row->BudgetUsed != 0) {\n $RestofBudget = $row->BudgetValue - $row->BudgetUsed;\n } else {\n $RestofBudget = $row->BudgetValue - $row->BudgetUsed;\n }\n echo \"<option value='$RestofBudget>$row->BudgetCOA--$row->ReqCategoryID'>$row->BudgetCOA - $row->ReqCategoryName</option>\";\n// $options .= \"<option value='\" . $k->DivisionID . \"'>\" . $k->DivisionName . \"</option>\";\n }\n echo \"</select>\";\n// $this->load->view('procurement/popupitem_list.js.php');\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 function get_sub_category(){\r\n $this->datatables->select('s.cat_id,s.sub_cat_id,c.cat_name,s.sub_cat_name');\r\n $this->datatables->join( 'o-cakes_category c', 's.cat_id = c.cat_id', 'left' );\r\n $this->datatables->from('o-cakes_sub_cat s');\r\n $this->datatables->where('s.sub_cat_status',1);\r\n $result = $this->datatables->generate();\r\n echo $result;\r\n }", "function listCat()\n {\n session(['action' => 'listCat']);\n $list_cats = Product_cat::select('id', 'name', 'slug', 'created_at', 'parent_id')->get();\n $result = $this->data_tree($list_cats, 0, 0);\n\n //Duyệt từng ptu mảng $result\n foreach ($result as $k => $v) {\n //gán số lượng của tên danh mục = đếm số bản ghi có post_cat_id là id của danh mục\n $count_post[$v['name']] = Product::where('product_cat_id', $v['id'])->count();\n }\n return view('admin.product.cat', compact('result', 'list_cats', 'count_post'));\n }", "public function show(Category $categrory)\n {\n //\n }", "public function kategori()\n {\n //Query untuk mengambil semua data kategori dengan diurutkan berdasarkan nama kategori\n $query = $this->db->query(\"SELECT * FROM kategori ORDER BY nama_kategori\");\n return $query;\n }", "public function index($category, $id, $data);", "public function get_kategoriByFilter()\n\t{\n\t\t$this->kode_kategori \t= $this->input->post('kode_kategori');\n\n\t\t$this->db->select('kategori');\n\t\t$this->db->from('kategori');\n\t\t$this->db->where('kode', $this->kode_kategori);\n\t\t$query = $this->db->get();\n\t\treturn $query->row();\n\t}", "function category_select($table, $item_id) {\n echo \"<select name='category' id='item-cat'>\n <option value='0'>——</option>\";\n $result = mysql_query(\"SELECT name, id FROM Categories ORDER BY name ASC\");\n $result2 = mysql_query(\"SELECT category FROM $table WHERE id ='$item_id'\");\n while ( $row = mysql_fetch_row($result2) ) {\n $current = (htmlentities($row[0]));\n }\n while ( $row = mysql_fetch_row($result) ) {\n $category = (htmlentities($row[0]));\n $cat_id = (htmlentities($row[1]));\n echo \"<option value='$cat_id'\";\n if ($cat_id == $current) {\n echo \" selected\";\n }\n echo \">$category</option>\";\n }\necho \"</select>\";\n}", "public function kategori_tambah_proses()\n\t{\n\t\t// define array data for insert\n\t\t$indata = array(\n\t\t\t'nama_kategori' => $_POST['nama_kategori']\n\t\t);\n\t\t\n\t\t// insert execution\n\t\t$this->ModelsKedai->insert(\"kategori\",$indata);\n\t\t\n\t\t// goto kategori page\n\t\tredirect('administrator/kategori/1');\n\t}", "function showCategoryList(&$category_tree, $type_text, $level = 0) {\n\t$row_idx = 1;\n\t\n foreach ($category_tree as $category) {\n?>\n <tr class=\"row_style_<?php echo $row_idx; ?>\">\n\t\t\t<td></td>\n \t<td class=\"left\"><?php echo str_repeat('&nbsp;--', $level).'&nbsp;'.$category->name; ?></td>\n \t<td>\n \t <a href=\"#\" onclick=\"select_for_menu_item('<?php echo $type_text.' - '.$category->name; ?>', '<?php echo $category->id; ?>'); return false;\">\n \t <?php _e('Select'); ?></a>\n \t</td>\n </tr>\n<?php\n $row_idx = 1 - $row_idx;\n \n if (sizeof($category->slaves['ProductCategory']) > 0) {\n $level++;\n showCategoryList($category->slaves['ProductCategory'], $type_text, $level);\n $level--;\n }\n }\n}", "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 getCategory()\n {\n }", "function showCategory($category){\n \n //echo 'gathering datas about ' . $category;\n \n $exercices = getExerciceNames($category);\n\n require './views/category.php';\n\n }", "function fetch_category(){ \n\n\t $fetch_data = $this->crud_model->make_datatables_category(); \n\t $data = array(); \n\t foreach($fetch_data as $row) \n\t { \n\t $sub_array = array(); \n\t \n\t $sub_array[] = nl2br(substr($row->nom, 0,50)); \n\t $sub_array[] = nl2br(substr(date(DATE_RFC822, strtotime($row->created_at)), 0, 23)); \n\t \n\t \n\t $sub_array[] = '<button type=\"button\" name=\"update\" idcat=\"'.$row->idcat.'\" class=\"btn btn-warning btn-sm btn-circle update\"><i class=\"fa fa-edit\"></i></button>'; \n\t $sub_array[] = '<button type=\"button\" name=\"delete\" idcat=\"'.$row->idcat.'\" class=\"btn btn-danger btn-sm btn-circle delete\"><i class=\"fa fa-trash\"></i></button>'; \n\t $data[] = $sub_array; \n\t } \n\t $output = array( \n\t \"draw\" => intval($_POST[\"draw\"]), \n\t \"recordsTotal\" => $this->crud_model->get_all_data_category(), \n\t \"recordsFiltered\" => $this->crud_model->get_filtered_data_category(), \n\t \"data\" => $data \n\t ); \n\t echo json_encode($output); \n\t }", "function View_category($categoryid){\n $this->getDataTableScripts();\n $this->data['page_level_styles'] .= \"<link rel='stylesheet' type='text/css' href='\".getResource('js/ios-switch/switchery.css').\"' />\";\n $this->data['page_level_scripts'] .= \"<script src='\".getResource('js/ios-switch/switchery.js').\"'></script>\";\n $this->data['page_level_scripts'] .= \"<script src='\".getResource('js/ios-switch/ios-init.js').\"'></script>\";\n $today = date('d-m-Y');\n $this->db->order_by('t_materials.datecreated DESC');\n $this->db->select('t_materials.*,t_material_categories.material_category_name as category_name');\n $this->db->where('material_category_id',$categoryid);\n $this->db->where(\"'$today' <= t_materials.material_expiry_date\");\n $this->db->join('t_material_categories','t_material_categories.uniqueid = t_materials.material_category_id','left');\n $this->data['existing_materials'] = $this->Materials_model->get();\n $this->data['subview'] = 'Account/Materials/View_materials_category_page';\n $this->load->view('Account/_layout_main',$this->data);\n }", "function view_category(){\n\t\t\t$this->layout = 'mobilelayout';\n\t\t\tglobal $loguser;\n\t\t\tif(!$this->isauthorizedpersn())\n\t\t\t\t$this->redirect('/');\n\t\t\t\t\n\t\t\t$this->set('title_for_layout','Category Management');\n\t\t\t\n\t\t\t$main_catdata = $this->Category->find('all');\n\t\t\t//$super_sub_catdata = $this->Category->find('all',array('conditions'=>array('category_parent <>'=>0)));\n\t\t\t// $sub_sub_catdata = $this->Category->find('all',array('conditions'=>array('category_parent <>'=>0,'category_sub_parent <>'=>0)));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->paginate = array('conditions'=>array('Category.category_name <>'=>''),'limit'=>10,'order'=>array('Category.id'=>'desc'));\n\t\t\t$super_sub_catdata = $this->paginate('Category');\n\t\t\t$pagecount = $this->params['paging']['Category']['count'];\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->set('main_catdata',$main_catdata);\n\t\t\t$this->set('super_sub_catdata',$super_sub_catdata);\n\t\t\t$this->set('pagecount',$pagecount);\n\t\t\t// $this->set('sub_sub_catdata',$sub_sub_catdata);\n\t\t\t\n\t\t\t// echo \"<pre>\";print_r($sub_sub_catdata);die;\n\t\t}", "public function fetchCategory()\n {\n $output = '';\n $query = '';\n $this->load->model('user_model');\n if ($this->input->post('query')) {\n $query = $this->input->post('query');\n }\n $data = $this->user_model->fetch_category($query);\n $output .= '\n <div class=\"table-responsive\">\n <table class=\"table table-hover\">\n <tr bgcolor=\"white\">\n <th>Category</th>\n <th align=\"center\">View / Details / Edit</th>\n </tr>\n ';\n if ($data->num_rows() > 0) {\n foreach ($data->result() as $row) {\n $output .= '\n <tr>\n <td>' .strtoupper($name=str_replace('_', ' ', $row->category) ). '</td>\n <td align=\"center\">\n <form method=\"post\" action=\"'.base_url(\"login_controller/View_cat_details\").'\">\n <button class=\"btn btn-info\" style=\"width: 80px;\" type=\"submit\" name=\"Submit\" id=\"' . $row->category . '\" value=\"' . $row->category . '\"> View </a></button>\n </form>\n </td>\n </tr>\n ';\n }\n } else {\n $output .= '<tr>\n <td colspan=\"2\">No Data Found</td>\n </tr>';\n }\n $output .= '</table>';\n echo $output;\n }", "public function categoryAction(Request $request, $idCategory, $selectCategory, $page = 1)\n {\n\n /** access to article repository and category repository */\n $articleRepository = $this->getDoctrine()->getManager()->getRepository('AppBundle:Article');\n $categoryRepository = $this->getDoctrine()->getManager()->getRepository('AppBundle:Category');\n $analyticsRepository = $this->getDoctrine()->getManager()->getRepository('AppBundle:PopArticlesAnalyticsMonth');\n $userRepository = $this->getDoctrine()->getManager()->getRepository('UserBundle:User');\n $paginator = $this->get('mentobe_paginator');\n\n /** @var $lastArticles, $popularArticleOnSelectedCategory initialize the variables to use only if a category exist */\n $lastArticles = array();\n $popularArticleOnSelectedCategory = array();\n\n /** found the category by is name */\n $categories = $categoryRepository->findOneBy(array(\"id\" => $idCategory));\n $categoryName = $categories->getName();\n\n /** get last 4 publish articles */\n $lastArticles = $articleRepository->findBy(\n array(\"step\" => Article::PUBLICATION, \"category\" => $categories),\n array(\"date\" => \"desc\"),\n 4,\n 0\n );\n\n $popularArticleOnSelectedCategory = $articleRepository->getPopularArticleByCategory($categories);\n\n /** get total number for this category */\n $totalArticle = $articleRepository->getTotalArticleByCategory($categories);\n\n $totalDisplay = 10;\n $last = ceil($totalArticle / $totalDisplay);\n\n if ($last < 1)\n $last = 1;\n\n if ($page < 1)\n $page = 1;\n else if ($page > $last)\n {\n $page = $last;\n }\n\n $offset = ($page - 1) * $totalDisplay;\n\n /** get article depending on pagination */\n $articles = $articleRepository->getArticleByCategories($categories, Article::PUBLICATION, array(\"name\" => \"updatedAt\", \"pos\" => \"desc\"), $totalDisplay, $offset);\n\n $pagination = $paginator->getPagination($last, $page, \"categorie_article_pagination\", array('idCategory' => $idCategory, 'selectCategory' => $categoryName));\n\n return $this->render('FrontOfficeBundle::list.html.twig', array(\n \"menus\" => $categoryRepository->findAll(),\n \"articles\" => $articles,\n \"categoryName\" => $categoryName,\n 'popularArticles' => $articleRepository->getPopularArticle($analyticsRepository->getPopularArticle(4, 0)),\n 'pagination' => $pagination,\n 'lastArticles' => $lastArticles,\n 'mostCommentedArticles' => $articleRepository->mostCommentedArticles(),\n 'popularAuthors' => $userRepository->findById($analyticsRepository->getPopularAuthors(5, 0))\n ));\n }", "function getKategori() {\n return $this->db->get('kategori_kelas')->result();\n }", "public function show($categoria)\n {\n\n }", "public function ajaxCargarCategorias(){\n\n\t\t$item = \"id_area\";\n\t\t$valor = $this->id_area;\n\t\t\n\t\t$respuesta = ControladorCategorias::ctrMostrarCategoriasxArea($item, $valor);\n\t\n\t\t$categorias = '<option value=\"0\" id=\"editarListaCategoria\">Elige una Categoría</option>';\n\n\t\t\tforeach ($respuesta as $key => $res)\n\t\t\t{\n\t\t\t\t$categorias .= \"<option value='$res[id]'>$res[categoria]</option>\";\n\t\t\t}\n\t\techo $categorias ;\n\t}", "function affichercategories(){\r\n\t\t$sql=\"SElECT * From categorie\";\r\n\t\t$db = config::getConnexion();\r\n\t\ttry{\r\n\t\t$liste=$db->query($sql);\r\n\t\treturn $liste;\r\n\t\t}\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n }\t\r\n\t}", "function getCategoriesSelect()\n\t{\n\t\tglobal $con;\n\t\t\t\n\t\t//echo var_dump($con);\n\t\t$get_cats = \"select * from categories\";\n\t\t$run_cats = mysqli_query($con, $get_cats);\n\t\twhile ($row = mysqli_fetch_array($run_cats)){\n\t\t\t$id = $row['cat_id'];\n\t\t\t$title =$row['cat_title'];\n\n\t\t\techo \"<option value='$id'>$title</option>\";\n\t\t}\n\t}", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function getCategoryData()\n\t\t{\n\t\t\t$this->load->helper('pagination_helper');\n\t\t\t$pagination=Pagination_helper::getInstance();\n\t\t\t$data['limit']='5';\n\t\t\t$ajax= isset($_REQUEST['ajax']) ? $_REQUEST['ajax'] : '0';\n\t\t\t$data['page'] = isset($_REQUEST['page']) ? $_REQUEST['page'] : '1';\n\t\t\t$data['page'] =($data['page']==false) ? 1 : $data['page']; \n\t\t\t$data['offSet'] = ($data['page']>1) ? ($data['page']-1)* $data['limit'] : 0;\n\t\t\t\n\t\t\t$categoryId= $this->input->get_post('category_id');\n\t\t\t$userId= $this->input->get_post('user_id');\n\t\t\t\n\t\t\ttry{\n\t\t\t\tif($categoryId > 0 && $categoryId <= 9 ){\n\t\t\t\t\t$data = $this->userModel->getAllBets($categoryId,$userId,$data);\n\t\t\t\t\t$data['getAllBetsCount']=$this->userModel->getAllBetsCount($categoryId,$userId,$data);\n\t\t\t\t\t$this->_jsonData['status']=\"SUCCESS\";\n\t\t\t\t\t$this->_jsonData['message']=\"Bets Selected\";\n\t\t\t\t\t$this->_jsonData['data']=$data;\n\t\t\t\t}else{\n\t\t\t\t\t$this->_jsonData['status']=\"FAILURE\";\n\t\t\t\t\t$this->_jsonData['message']=\"Category Id is Missing\";\n\t\t\t\t}\n\t\t\t}catch(Exception $e){\n\t\t\t\t$this->_jsonData['status']=\"FAILURE\";\n\t\t\t\t$this->_jsonData['message']=\"Error Occured\";\n\t\t\t}\n\t\t\t\techo json_encode($this->_jsonData);\n\t\t\t$this->ServicesModel->createService($_REQUEST,$this->_jsonData,$_SERVER['SERVER_ADDR'],'getCategoryData',$_FILES);\n\n\t\t}", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "function categoryCheck($cond = array())\n\t{\n\t\t$select = 'addoncategory_id';\n\t\treturn $this->CI->AdminModel->getCondSelectedData($cond,$select,$this->tableName);\n\t}", "function set_categorie($categorie){\n if($categorie == \"vin\" || $categorie == \"eau\" || $categorie == \"jus\"){\n $this->categorie = $categorie;\n }else{\n $this->erreur(\"La categorie doit être : vin, eau ou jus. Or c'est : \".$categorie.\"<br>\");\n }\n }" ]
[ "0.6963823", "0.6900112", "0.6705225", "0.65624976", "0.6510386", "0.6508147", "0.6464682", "0.6419358", "0.6398445", "0.63874805", "0.63430744", "0.6338916", "0.6290483", "0.6285333", "0.6270289", "0.6247038", "0.622029", "0.62160194", "0.61948645", "0.61145735", "0.6076231", "0.6046449", "0.60340697", "0.6033138", "0.6032128", "0.60126144", "0.60053587", "0.597865", "0.59714234", "0.5966189", "0.59620804", "0.59601694", "0.5953871", "0.5947907", "0.5933848", "0.59334046", "0.5925255", "0.5920709", "0.5917709", "0.5912083", "0.59084994", "0.590511", "0.58871204", "0.58373904", "0.5836565", "0.5832475", "0.58229625", "0.5815115", "0.5813623", "0.58101046", "0.58093965", "0.58076376", "0.58039284", "0.5801489", "0.579912", "0.57922447", "0.5790858", "0.57813305", "0.5780483", "0.5778891", "0.57707787", "0.57595026", "0.57548106", "0.575336", "0.57527494", "0.57510656", "0.5750015", "0.5750015", "0.57496876", "0.5745809", "0.574446", "0.57356113", "0.57333326", "0.57278043", "0.57222044", "0.5710569", "0.5710552", "0.5710273", "0.57088554", "0.5700221", "0.56964344", "0.5693404", "0.5688741", "0.5687055", "0.56849515", "0.56813556", "0.56794167", "0.5674332", "0.56732553", "0.5671436", "0.5666462", "0.5663613", "0.5660271", "0.56579363", "0.56515807", "0.5643942", "0.56433207", "0.56428087", "0.5635935", "0.5634155", "0.5631024" ]
0.0
-1
menampilkan dari detail category yang dipilih mis: click "gadget" maka yang muncul untuk datanya / productnya hanya product yang memiliki category tsb (gadget)
public function detail(Request $request, $slug) { $categories = Category::all(); $category = Category::where('slug', $slug)->firstOrFail(); $products = Product::with('galleries')->where('categories_id', $category->id)->paginate(16); return view('pages.category', compact('categories', 'products')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function action_cat()\n {\n $cat = $this->request->param('cat');\n $cat = mysql_real_escape_string ($cat);\n \n // Получаем список продукций\n // $category = ORM::factory('category')->where('cat_id', '=', $cat)->find();\n $category = ORM::factory('category')->where('path', '=', $cat)->find();\n\n if(!$category->loaded()){\n $this->redirect();\n }\n \n $count = $category->products->where('status', '<>', 0)->count_all();\n $pagination = Pagination::factory(array('total_items'=>$count,'items_per_page'=>2));\n $prods = array();\n $products = $category->products\n ->where('status', '<>', 0)\n ->limit($pagination->items_per_page)\n ->offset($pagination->offset)\n ->find_all();\n $prs = $category->products\n ->select('prod_cats.prod_id')\n ->where('status', '<>', 0)\n ->find_all();\n foreach ($prs as $p)\n {\n $prods[] = $p->prod_id;\n }\n if(count($prods))\n $brands = ORM::factory('brand')\n ->join('products')\n ->on('brand.brand_id', '=', 'products.brand_id')\n ->where('products.prod_id','in',$prods)\n ->group_by('brand.title')\n ->order_by('brand.title', 'ASC')\n ->find_all();\n \n \n \n //$products = $category->products->where('status', '!=', 0)->find_all();\n // $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/c' . $category->cat_id);\n $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/' . $category->path);\n $this->template->breadcrumbs = Breadcrumb::generate($this->breadcrumbs);\n \n $content = View::factory('/' . $this->theme . 'index/catalog/v_catalog_cat', array(\n 'products' => $products,\n 'cat' => $cat,\n 'pagination' =>$pagination,\n 'brands' =>$brands,\n \n ));\n \n // Выводим в шаблон\n \n $this->template->title = $category->title;\n $this->template->page_title = $category->title;\n $this->template->page_caption = $category->title;\n $this->template->center_block = array($content);\n $this->template->block_right = null; \n $filter = Filter::factory();\n $filter->loadFiltersOptions($category->cat_id);\n $this->template->filter = $filter->render();\n }", "function showCategory()\r\n {\r\n }", "public function cat(){\n $cat_id = intval(I('get.cat_id'));\n if(!$cat_id){\n http_response_code(404);\n }\n\n $display = cookie('display');\n if($display) {\n if (!preg_match(\"/^list|grid$/\", $display)) {\n die('hack out');\n }else{\n if($display == 'list') {\n $this->assign('display', 1);\n }else{\n $this->assign('display', 0);\n }\n }\n }\n $this->assign('cat_id', $cat_id);\n $mbx = D('Admin/cat')->parentList($cat_id);\n if($mbx){\n $this->assign('mbx',$mbx);\n }\n\n $cat_in_nav = M('cat')->field('cat_id,cat_name')->where('show_in_nav=1')->select();\n $this->assign('cat_in_nav',$cat_in_nav);\n $his = array_reverse(session('history'),true);\n $this->assign('history',$his);\n $sale = M('goods')->field('goods_id,goods_name,thumb_img,shop_price,goods_number')->order('goods_number desc')->limit(10)->select();\n $this->assign('sale',$sale);\n $this->assign('cattree',D('Admin/Cat')->gettree());\n\n $this->assign('cat_name', M('cat')->field('cat_name')->find($cat_id)['cat_name']);\n\n $this->display();\n }", "public function category_details() {\n $cat_id = $this->uri->segment(4);\n $product_id = $this->uri->segment(3);\n\n $this->Trader_mdl->update_view_cnt($product_id, $cat_id);\n $data['image'] = $this->Trader_mdl->getImage($product_id, $cat_id);\n \n $data['product_id'] = $product_id;\n $data['cat_id'] = $cat_id;\n if ($cat_id == 1) {\n $data['query'] = $this->Trader_mdl->getproductcar($product_id, $cat_id);\n $data['car_img_qry'] = $this->Trader_mdl->fetch_car_imgs($product_id, $cat_id);\n } else if ($cat_id == 2) {\n $data['query'] = $this->Trader_mdl->getproductbike($product_id);\n $data['car_img_qry'] = $this->Trader_mdl->fetch_bike_imgs($product_id, $cat_id);\n } else if ($cat_id == 3) {\n $data['query'] = $this->Trader_mdl->mdl_noplate_details($product_id, $cat_id);\n } else if ($cat_id == 4) {\n $data['query'] = $this->Trader_mdl->mdl_vertu_details($product_id, $cat_id);\n $data['car_img_qry'] = $this->Trader_mdl->fetch_vertu_imgs($product_id, $cat_id);\n } else if ($cat_id == 5) {\n $data['query'] = $this->Trader_mdl->mdl_watch_details($product_id, $cat_id);\n $data['car_img_qry'] = $this->Trader_mdl->fetch_watch_imgs($product_id, $cat_id);\n } else if ($cat_id == 6) {\n $data['query'] = $this->Trader_mdl->mdl_mobileno_details($product_id, $cat_id);\n } else if ($cat_id == 7) {\n $data['query'] = $this->Trader_mdl->getproductboat($product_id, $cat_id);\n $data['car_img_qry'] = $this->Trader_mdl->fetch_boat_imgs($product_id, $cat_id);\n } else if ($cat_id == 8) {\n $data['query'] = $this->Trader_mdl->mdl_iphone_details($product_id, $cat_id);\n $data['car_img_qry'] = $this->Trader_mdl->fetch_iphone_imgs($product_id, $cat_id);\n } else if ($cat_id == 9) {\n $data['query'] = $this->Trader_mdl->getproductproperty($product_id, $cat_id);\n $data['car_img_qry'] = $this->Trader_mdl->fetch_prop_imgs($product_id, $cat_id);\n } else {\n \n }\n $data['recentqry'] = $this->Trader_mdl->recently_viewed();\n /* $data['cat_qry'] = $this->Trader_mdl->get_categories(); */\n\n $this->load->view('trader/trader_header');\n $this->load->view('trader/details_page_vw', $data);\n $this->load->view('trader/trader_footer');\n }", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "function category_detail($id)\n {\n try\n {\n \n # adjusting header & footer sections [Start]...\n $data = $this->data;\n parent::_set_title(\"::: COGTIME Xtian network :::\");\n parent::_set_meta_desc(\"::: COGTIME Xtian network :::\");\n parent::_set_meta_keywords(\"::: COGTIME Xtian network :::\");\n parent::_add_js_arr( array( 'js/lightbox.js',\n 'js/jquery.dd.js',\n 'js/jquery.form.js',\n 'js/jquery/JSON/json2.js',\n 'js/backend/manage_product_categories.js') );\n \n parent::_add_css_arr( array('css/dd.css',\n ) );\n # adjusting header & footer sections [End]...\n $data['top_menu_selected'] = 4;\n $data['submenu'] = 2;\n \n \n //empty the session\n $this->session->set_userdata('search_condition','');\n // fetching data\n $WHERE_COND = \" WHERE 1 \";\n $WHERE_COND.= \"AND i_parent_category={$id}\"; // set the parent id\n $this->session->set_userdata('search_condition',$WHERE_COND);\n $page=0;\n $order_by = \"`id` ASC \";\n \n $data['product_category_id'] = $id;\n \n $category_detail = $this->product_categories_model->get_by_id($id);\n \n $data['category_name'] = $category_detail['s_category_name'];\n \n \n ob_start();\n $this->product_sub_category_ajax_pagination();\n $data['result_content'] = ob_get_contents(); //pr($data['result_content']);\n ob_end_clean();\n \n \n # rendering the view file...\n $VIEW_FILE = \"admin/trade_center/product_categories/product_sub_categories.phtml\";\n parent::_render($data, $VIEW_FILE);\n }\n catch(Exception $err_obj)\n {\n show_error($err_obj->getMessage());\n }\n }", "public function traitementCategorie() {\n\n $this->data .= '<div class=\"boutique-droite\">';\n if(isset($_GET['categorie']))\n {\n $donnees = Database::query(\"SELECT id_produit,reference,titre,photo,prix FROM produit WHERE categorie=?\", array($_GET['categorie']));\n foreach($donnees as $key2 =>$produit)\n {\n $this->data .= '<div class=\"boutique-produit\">';\n $this->data .= \"<h3>$produit[titre]</h3>\";\n $this->data .= \"<a href=\\\"fiche_produit.php?id_produit=$produit[id_produit]\\\"><img src=\\\"$produit[photo]\\\" width=\\\"130\\\" height=\\\"100\\\" /></a>\";\n $this->data .= \"<p>$produit[prix] €</p>\";\n $this->data .= '<a href=\"fiche_produit.php?id_produit=' . $produit['id_produit'] . '\">Voir la fiche</a>';\n $this->data .= '</div>';\n }\n }\n $this->data .= '</div></div>';\n }", "function category(){\n\n\t\t\t$header['title']=\"Find Page\";//title\n\t\t\t$data=[];//dataa\n\t\t\t$sidebar['getUpdate'] = $this->_actionModel->getAllDataByUpdate_time();\n\t\t\t$keyword = $_GET['cat'] ?? '';//get key\n\t\t\t$keyword = trim($keyword);//cat bo khaong trong 2 dau\n\t\t\t$data['keyword'] = $keyword;// key-> value\n\n\t\t\t$page = $_GET['page'] ?? '';//tim $_page\n\t\t\t$page = (is_numeric($page) && $page >0) ? $page : 1;//kiem tra xem co phai so khong\n\t\t\t//Chu thich lau qa =.=\n\t\t\t\n\t\t\t$dataLink =[\n\t\t\t\t'c' => 'action',\n\t\t\t\t'm' => 'category',\n\t\t\t\t'page'=> '{page}',\n\t\t\t\t'cat' => $keyword\n\t\t\t];//giong o tren r`\n\t\t\t$links = $this->_actionModel->create_link_manga($dataLink);//tao links\n\t\t\t//die($links);//die ra coi thu DL thoi \n\n\t\t\t$manga=$this->_actionModel->getAllDataMangaByKeywordCategory($keyword);//cai ten noi len tat ca\n\n\t\t\t$panigate = panigation(count($manga), $page, 4,$keyword,$links);//panigate la phan trang r`\n\t\t\t$data['mangas'] = $this->_actionModel->getDataMangaByCategory($panigate['keyword'],$panigate['start'],$panigate['limit']);//lay manga theo category con gif\n\t\t\t//echo\"<pre/>\";print_r($data['mangas']);die();//die ra coi DL thoi xoa di lay j coi du lieu ?? !\n\t\t\t$data['panigation'] = $panigate['panigationHtml']; //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadHeader($header); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadActionPage($data); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadSidebarPage($sidebar); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadFooter(); //nhu o tren r` chu thich j` nua.\n\t\t}", "public function prod_list_by_category() {\n $url_cate = get_raw_app_uri();\n if (!empty($url_cate)) {\n $Product = new Product();\n $info = $Product->getProductByCategory($url_cate);\n $data['content'] = 'list_product'; \n $data['product'] = $info['product'];\n $data['paging'] = $info['paging'];\n $data['selected'] = $url_cate;\n \n //seo\n \n $Category = new ProductCategory();\n $list_cate = $Category->getCategoryByLink($url_cate);\n if ($list_cate->countRows() > 0){\n $list_cate->fetchNext();\n $data['title_page'] = $list_cate->get_prod_cate_name();\n $data['description'] = $list_cate->get_prod_cate_meta_description();\n $data['keywords'] = $list_cate->get_prod_cate_keywords();\n }else{\n $data['title_page'] = '';\n $data['description'] = '';\n $data['keywords'] = '';\n }\n \n $array_menus = array();\n $filter = array();\n $filter['parent_id'] = 0;\n Menu::getMenuTree($array_menus, $filter);\n $data['array_menus'] = $array_menus;\n \n $this->load->view('temp', $data);\n } else {\n redirect(Variable::getDefaultPageString());\n }\n }", "function category($title, $id, $page)\n {\n $sort = Input::get('sort');\n\n $aliexpressApi = new AliexpressAPI();\n\n $options = [\n \"sort\" => $sort,\n \"pageNo\" => $page\n ];\n if (Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort) == null) {\n Cache::put('aliCategory' . $id . '-' . $page . '-' . $sort, json_decode($aliexpressApi->getCategoryProducts($id,\n 39, \"USD\", App::getLocale(), $options)), Config::get('cache.storeAliHotProducts'));\n }\n $aliData = Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort);\n\n $similarCategories = $this->model->getSimilarCategory($id);\n $breadCramb = $this->model->getBreadCramb($id);\n $resultsAmount = isset($aliData->result->totalResults) ? $aliData->result->totalResults : 100;\n\n // pagination ( not the perfect of implementations, but it works )\n $totalPages = 100;\n $pagesAvailable = Util::getPaginationList($page, $totalPages);\n\n $categoryData = $this->makeCategoryData($page, $id, $title, $sort, $resultsAmount);\n\n // product forms action route base\n $productBaseRoute = \"/{$this->siteslug}/product\";\n $categoryBaseRoute = \"/{$this->siteslug}/category/$title/$id\";\n\n $paginationResult = Util::getLinksForPagination($pagesAvailable, \"category\", $title, $page, $this->siteslug, null, $id);\n\n $pages = $paginationResult['pages'];\n $pageNext = $paginationResult['pageNext'];\n\n if ($page == 1) {\n $pageForTitle = '';\n } else {\n $pageForTitle = ' ' . 'עמוד' . ' ' . $page;\n }\n /*if (is_null($categoryData['sort'])){\n $sortForTitle='';\n }else{\n $sortForTitle='-' . $categoryData['sort'];\n }*/\n // dd($categoryData);\n if (Lang::getLocale() == 'he') {\n $this->shopName = Lang::get('general.aliexpress');\n } elseif (Lang::getLocale() == 'en') {\n $this->shopName = 'aliexpress';\n };\n $this->title =$categoryData['title']. ' - ' . $breadCramb['category']. ' - ' . $this->shopName . ' - ' . $categoryData['page'] . ' - ' .'עליאקספרס' ;\n// $this->title = $categoryData['title'];\n $this->description = $categoryData['title'] . $pageForTitle . '- ' . \"עליאקספרס בעברית\" . ' - ' . \"שירות לקוחות בעברית,תשלום ללא כ.א בינלאומי,למעלה ממיליארד מוצרים בעברית\";\n return view(\"aliexpress.category\", [\n 'timerTime' => $this->timerTime,\n 'nextPageLink' => $pageNext,\n 'pageLinks' => $pages,\n 'pagination' => $pagesAvailable,\n 'categoryData' => $categoryData,\n 'productBase' => $productBaseRoute,\n 'categoryBase' => $categoryBaseRoute,\n 'aliData' => $this->model->parseCategoryData($aliData),\n 'categories' => $this->categories,\n 'siteslug' => $this->siteslug,\n 'breadCramb' => $breadCramb,\n 'title' => $this->title,\n 'description' => $this->description,\n 'page' => $page,\n 'similarCategories' => $similarCategories,\n ]);\n }", "public function sanphamdanhmucLuoi($category_id){\n\t\t\t$data = $this->getProductInHomeModel($category_id);\n\t\t\t//sử dungj chung 1 form View product\n\t\t\t$this->renderHTML(\"views/frontend/formProductView2.php\",array(\"data\"=>$data));\n\t\t}", "function do_viewCategory() { \n $category = KTUtil::arrayGet($_REQUEST, \"fCategory\", $this->category);\n \n $oRegistry =& KTAdminNavigationRegistry::getSingleton();\n $aCategory = $oRegistry->getCategory($category);\t\t\n \n $aItems = $oRegistry->getItemsForCategory($category);\n $this->aBreadcrumbs[] = array(\"name\" => $aCategory[\"title\"], \"url\" => KTUtil::ktLink('admin.php',$category));\n\n \n $this->oPage->title = _kt(\"DMS Administration\") . \": \" . $aCategory[\"title\"];\n $oTemplating =& KTTemplating::getSingleton();\n $oTemplate = $oTemplating->loadTemplate(\"kt3/admin_items\");\n $aTemplateData = array(\n \"context\" => $this,\n \"category\" => $aCategory,\n \"items\" => $aItems, \n \"baseurl\" => $_SERVER['PHP_SELF'],\n );\n return $oTemplate->render($aTemplateData);\t\t\t\t\n }", "protected function _getCategoryDataContent() {\n\n $categoryName = Mage::registry('current_category')->getName();\n $_cat = new Mage_Catalog_Block_Navigation();\n $curent_cat = $_cat->getCurrentCategory();\n $curent_cat_id = $curent_cat->getId();\n $parentId = Mage::getModel('catalog/category')->load($curent_cat_id)->getParentId();\n $parent = Mage::getModel('catalog/category')->load($parentId);\n $categorydaddy = $parent->getName();\n\n $category_id = Mage::getModel('catalog/layer')->getCurrentCategory()->getId();\n $category = Mage::getModel('catalog/category')->load($category_id);\n $products = Mage::getModel('catalog/product')\n ->getCollection()\n ->addAttributeToSelect('*')\n ->addCategoryFilter($category)\n ->addFieldToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)\n ->load();\n\n $cartsku = array();\n $data = array();\n $impression = [];\n $impressions = [];\n $count = 0;\n $end = 32;\n foreach ($products as $item) {\n $count++;\n $cartsku[] = $item->getSku();\n $impression['id'] = $item->getSku();\n $impression['name'] = $item->getName();\n $impression['brand'] = $item->getBrand();\n $impression['category'] = $categoryName;\n $impression['list'] = $categoryName;\n $impression['position'] = $count;\n $impressions[] = $impression;\n if ($count == $end) break;\n }\n\n $data['event'] = 'category';\n\n $google_tag_params = array();\n $google_tag_params['ecomm_pagetype'] = 'category';\n $google_tag_params['ecomm_category'] = $categoryName;\n $google_tag_params['ecomm_daddy'] = $categorydaddy;\n $google_tag_params['ecomm_prodid'] = $cartsku;\n $google_tag_params['impressions'] = $impressions;\n\n if($this->IsReturnedCustomer()){\n $google_tag_params['returnCustomer'] = 'true';\n }\n else {\n $google_tag_params['returnCustomer'] = 'false';\n }\n $data['google_tag_params'] = $google_tag_params;\n\n $data = array(\n 'event' => 'category',\n 'google_tag_params' => $google_tag_params\n );\n\n /* Facebook Conversion API Code */\n $custom_data = array(\n \"content_ids\" => $cartsku,\n \"content_type\" => \"product\",\n \"content_category\" => $categoryName,\n );\n $this->createFacebookRequest(\"ViewCategory\", [], [], $custom_data);\n /* End Facebook Conversion API Code */\n \n return $data;\n }", "function displayCategory()\r\n\t {\r\n\t \t$productId = JRequest::getVar('product_id');\r\n\t \t\r\n\t \t$model = $this->getModel('qrcode');\r\n\t \t$productList = $model->getProductByCategory();//Store product details based on category.\r\n\t \tob_clean();\r\n\t \t\r\n\t \techo \"<b>\".JText::_('COM_QRCODE_VIEW_DEFAULT_PRODUCT_LIST').\"</b>\";\r\n \r\n\t \t\t\t$options = array();\r\n $default = \"\";\r\n if($productId)\r\n {\r\n \t$default = $productId;\r\n }\r\n $options[] = JHTML::_('select.option', \"0\", JText::_('COM_QRCODE_VIEW_DEFAULT_DISPLAY_ALL'));\r\n foreach ($productList as $key=>$val) {\r\n $options[] = JHTML::_('select.option', $val['product_id'], $val['product_name']);\r\n }\r\n echo JHTML::_('select.genericlist', $options, 'qrcode', 'onchange=getProductId(this.value)','value', 'text', $default); \r\n exit();\r\n\t }", "public function show_category_home($slug_category_product){\n $cate_product = DB::table('tbl_category_product')->where('category_status','0')->orderby('category_id','desc')->get(); \n $brand_product = DB::table('tbl_brand')->where('brand_status','0')->orderby('brand_id','desc')->get(); \n $category_product=DB::table('tbl_category')->where('status','0')->orderby('id','desc')->get(); \n \n $category_menu=\"\";\n foreach ($category_product as $key => $cat) {\n $category_menu.=\"<div class='panel-heading'>\n <h4 class='panel-title'>\n <a data-toggle='collapse' data-parent='#accordian' href='#\".$cat->slug.\"'>\n <span class='badge pull-right'><i class='fa fa-plus'></i></span>\n \".$cat->name.\"\n </a>\n </h4>\n </div>\n <div id='\".$cat->slug.\"' class='panel-collapse collapse'>\n <div class='panel-body'>\n <ul>\";\n $sub_category = DB::table('tbl_category_product')->where([['category_status','0'],['id',$cat->id]])->orderby('category_id','desc')->get(); \n foreach ($sub_category as $key => $subcat) {\n $category_menu.=\" <li><a href='show-category-home/$subcat->slug_category_product'>\".$subcat->category_name.\"</a></li>\";\n }\n\n $category_menu.=\" </ul>\n \n \n </div>\n </div>\";\n } \n $category_by_id = DB::table('tbl_product')->join('tbl_category_product','tbl_product.category_id','=','tbl_category_product.category_id')->where([['tbl_category_product.slug_category_product',$slug_category_product],['tbl_product.product_status', '=', '0'],])->get();\n \n $category_name = DB::table('tbl_category_product')->where('tbl_category_product.slug_category_product',$slug_category_product)->limit(1)->get();\n\n return view('pages.category.show_category')->with('category',$cate_product)->with('brand',$brand_product)->with('category_by_id',$category_by_id)->with('category_name',$category_name)->with('category_menu',$category_menu);\n }", "public function productByCategoryAction()\n {\n $category = $this->route['category'];\n $vars['products'] = $this->model->getProductsByCategory($category);\n $this->view->render('Riding Gear', $vars);\n }", "function view_details_categitem($ids = null,$sprctnme = null,$subctnme=null){\n\t\t\t$this->layout = 'mobilelayout';\n\t\t\t\n\t\t\tglobal $loguser;\n\t\t\t\n\t\t\t// echo $ids.'<br />';\n\t\t\t// echo $sprctnme.'<br />';\n\t\t\t// echo $subctnme.'<br />';\n\t\t\t// echo $_REQUEST['ref'].'<br />';\n\t\t\t// die;\n\t\t\tif(!empty($_REQUEST['ref'])){\n\t\t\t\t$ref = $_REQUEST['ref'];\n\t\t\t}else{\n\t\t\t\t$ref = '';\n\t\t\t}\n\t\t\tif(empty($ref) && (!empty($subctnme) || !empty($sprctnme))){\n\t\t\t\t$this->redirect('browse/'.$ids);\n\t\t\t}\n\t\t\t\n\t\t\tif(empty($ids)){\n\t\t\t\t$this->Session->setFlash('You url is not valid ');\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t\t\n\t\t\t$item_datas = $super_cat_datas = array();\n\t\t\t$spit = explode('~',$ids);\n\t\t\t// echo \"<pre>\";print_r($spit);\n\t\t\t$this->set('title_for_layout',$spit[1]);\n\t\t\t\n\t\t\tif($ref == 'sub_cat_titles' && !empty($subctnme)){\n\t\t\t\t$super_cat_datas = $this->Category->findByCategoryUrlname($subctnme);\n\t\t\t\t// echo \"<pre>\";print_r($super_cat_datas);\n\t\t\t\t$sprcatids = $super_cat_datas['Category']['category_sub_parent'];\n\t\t\t\t$sub_catid = $super_cat_datas['Category']['id'];\n\t\t\t\t\n\t\t\t\t$catdatas = $this->Category->find('all',array('conditions'=>array('category_parent'=>$spit[0],'Category.category_sub_parent'=>$sprcatids)));\n\t\t\t\t\n\t\t\t}else if($ref == 'super_sub_cat_titles' && !empty($sprctnme)){\n\t\t\t\t$super_cat_datas = $this->Category->findByCategoryUrlname($sprctnme);\n\t\t\t\t$sprcatids = $super_cat_datas['Category']['id'];\n\t\t\t\t\n\t\t\t\t$catdatas = $this->Category->find('all',array('conditions'=>array('category_parent'=>$spit[0],'Category.category_sub_parent'=>$sprcatids)));\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$super_cat_datas = $this->Category->find('all',array('conditions'=>array('category_parent'=>$spit[0])));\n\t\t\t\t$catdatas = $this->Category->find('all',array('conditions'=>array('category_parent'=>$spit[0],'Category.category_sub_parent'=>0)));\n\t\t\t}\n\t\t\t\n\t\t\t/* if(!empty($super_cat_datas)){\n\t\t\t\tforeach($super_cat_datas as $sprcat){\n\t\t\t\t\t$sprcatids[] = $sprcat['Category']['id'];\n\t\t\t\t}\n\t\t\t} */\n\t\t\t$this->loadModel('Item');\n\t\t\t// $item_datas = $this->Item->find('all',array('conditions'=>array('Item.category_id'=>$spit[0],'Item.super_catid'=>$sprcatids)));\n\t\t\tif($ref == 'sub_cat_titles' && !empty($subctnme)){\n\t\t\t\t$item_datas = $this->Item->find('all',array('conditions'=>array('Item.category_id'=>$spit[0],'Item.super_catid'=>$sprcatids,'Item.sub_catid'=>$sub_catid)));\n\t\t\t\t\n\t\t\t}else if($ref == 'super_sub_cat_titles' && !empty($sprctnme)){\n\t\t\t\t$item_datas = $this->Item->find('all',array('conditions'=>array('Item.category_id'=>$spit[0],'Item.super_catid'=>$sprcatids)));\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$item_datas = $this->Item->find('all',array('conditions'=>array('Item.category_id'=>$spit[0])));\n\t\t\t}\n\t\t\t\n\t\t\t// echo \"<pre>\";print_r($catdatas);die;\n\t\t\t// echo \"<pre>\";print_r($item_datas);die;\n\t\t\t\n\t\t\t\n\t\t\t$this->set('super_cat_datas',$super_cat_datas);\n\t\t\t$this->set('item_datas',$item_datas);\n\t\t\t$this->set('catdatas',$catdatas);\n\t\t\t$this->set('ids',$ids);\n\t\t\t$this->set('caturl',$spit[1]);\n\t\t\t$this->set('ref',$ref);\n\t\t\t$this->set('subctnme',$subctnme);\n\t\t\t$this->set('sprctnme',$sprctnme);\n\t\t\t\n\t\t\t// die; \n\t\t}", "function other_product_catalog($cid, $cpath, $COLLAPSABLE) {\n global $categories_string3, $languages_id, $level, $categories;\n\n $selectedPath = array();\n // Get all of the categories on this level\n\n\n /* Added for Discount pharmacy hide and show on 2nd feb 2012 */\n $category_query_raw = \"\";\n\n if(isset($_SESSION['customer_id']) && !empty($_SESSION['customer_id'])) {\t\n \n\t\t$customer_group_id = tep_get_customers_access_group($_SESSION['customer_id']);\t\n\t \n\t //$customer_group_id = array(\"G\",\"0\");\n\t\t\n } else {\n \n\t\t$customer_group_id = array(\"G\",\"0\");\n\t\t\n }\n \n $category_query_raw .= tep_get_access_sql('c.products_group_access', $customer_group_id);\n\n/* Added for Discount pharmacy hide and show on 2nd feb 2012 /end */\n\n \n \n /* Default Modified for Discount pharmacy hide and show on 2nd feb 2012 */\n\n /*if(!$_SESSION['sppc_customer_group_id']) {\n $customer_group_id = 'G';\n } else {\n $customer_group_id = $sppc_customer_group_id;\n }*/\n \n /* Default Modified for Discount pharmacy hide and show on 2nd feb 2012 */\n\n \n \n $categories_query = tep_db_query(\"SELECT c.categories_id, cd.categories_name, c.parent_id \n from \" . TABLE_CATEGORIES . \" c,\n \" . TABLE_CATEGORIES_DESCRIPTION . \" cd \n WHERE c.parent_id = '25' \n and c.categories_id = cd.categories_id \n and cd.language_id='\" . $languages_id .\"' \n $category_query_raw order by sort_order, cd.categories_name\");\n \n while ($categories = tep_db_fetch_array($categories_query)) {\n if ($categories[$level]['parent_id'] == \"\") { $categories[$level]['parent_id'] = 0; }\n $categories[$level]['categories_id'] = $categories[$level]['parent_id'] + 1;\n // Add category link to $categories_string3\n for ($a=1; $a < $level[$categories]['categories_id']; $a++) {\n $categories_string3 .= \"&nbsp;&nbsp;\";\n }\n\t\n $categories_string3 .= '<li><a href=\"';\n $cPath_new = $cpath;\n if ($categories[$level]['parent_id'] > 0) {\n $cPath_new .= \"_\";\n }\n $cPath_new .= $categories['categories_id'];\n // added for CDS CDpath support\n $CDpath = (isset($_SESSION['CDpath'])) ? '&CDpath=' . $_SESSION['CDpath'] : ''; \n $cPath_new_text = \"cPath=\" . $cPath_new . $CDpath;\n $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);\n $categories_string3 .= '\">';\n if ($_GET['cPath']) {\n $selectedPath = split(\"_\", $_GET['cPath']);\n }\n if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '<b>'; }\n //if ($categories[$level]['categories_id'] == 1) { $categories_string3 .= '<u>'; }\n $categories_string3 .= tep_db_output($categories['categories_name']);\n if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string3 .= ' ->'; }\n //if ($categories[$level]['categories_id'] == 1) { $categories_string3 .= '</u>'; }\n if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '</b>'; }\n $categories_string3 .= '</a></li>';\n \n \n // If I have subcategories, get them and show them\n if (tep_has_category_subcategories($categories['categories_id'])) {\n if ($COLLAPSABLE) {\n if (in_array($categories['categories_id'], $selectedPath)) {\n other_product_catalog($categories['categories_id'], $cPath_new, $COLLAPSABLE);\n }\n } else { \n other_product_catalog($categories['categories_id'], $cPath_new, $COLLAPSABLE); \n }\n }\n\t\n }\n \n}", "public function listing($category=''){\n\t$data = '';\n\t$view_file_name = 'product_listing_view';\n\t/*echo '<pre>';\n\tprint_r($this->config->item('denim_array'));\n\techo '</pre>';\n\texit;*/\n\t$data['main_arr'] = $this->config->item($category.'_array');\n\t//echo $data['main_arr'];exit;\n\t$data['category'] = $category;\n\tif($category==\"kids\"){\n\t\t$view_file_name = 'product_listing_view_kids';\n\t}\n\t$data['view_file_name'] = $view_file_name;\n\t$this->template->load_root_view($view_file_name , $data);\n}", "function tep_show_category($counter) {\r\n\r\n// BoF - Contribution Category Box Enhancement 1.1\r\n global $tree, $categories_string, $cPath_array, $cat_name;\r\n\r\n for ($i=0; $i<$tree[$counter]['level']; $i++) {\r\n $categories_string .= \"&nbsp;&nbsp;\";\r\n }\r\n $cPath_new = 'cPath=' . $tree[$counter]['path'];\r\n if (isset($cPath_array) && in_array($counter, $cPath_array) && $cat_name == $tree[$counter]['name']) { //Link nicht anklickbar, wenn angewählt\r\n $categories_string .= '<a style=\"color:#874b5a;text-decoration:none\" href=\"';\r\n $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '\">';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t //Link nicht anklickbar, wenn angewählt\r\n } else {\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //Link nicht anklickbar, wenn angewählt\r\n $categories_string .= '<a href=\"';\r\n $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '\">';\r\n }\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //Link nicht anklickbar, wenn angewählt\r\n\r\n if (isset($cPath_array) && in_array($counter, $cPath_array)) {\r\n $categories_string .= '<b>';\r\n }\r\n\r\n if ($cat_name == $tree[$counter]['name']) {\r\n $categories_string .= '<span class=\"errorText\">';\r\n }\r\n\r\n// display category name\r\n $categories_string .= '<img src=\"'. DIR_WS_IMAGES .'m25.gif\" align=\"absmiddle\" border=0 hspace=\"5\" vspace=\"0\">' . $tree[$counter]['name'];\r\n\r\n\t\tif ($cat_name == $tree[$counter]['name']) {\r\n\t\t\t$categories_string .= '</span>';\r\n }\r\n\r\n if (isset($cPath_array) && in_array($counter, $cPath_array)) {\r\n $categories_string .= '</b>';\r\n }\r\n// \tEoF Category Box Enhancement\r\n\r\n $categories_string .= '</a>';\r\n\r\n if (SHOW_COUNTS == 'true') {\r\n $products_in_category = tep_count_products_in_category($counter);\r\n if ($products_in_category > 0) {\r\n $categories_string .= '&nbsp;(' . $products_in_category . ')';\r\n }\r\n }\r\n\r\n $categories_string .= '<br>';\r\n\r\n if ($tree[$counter]['next_id'] != false) {\r\n\t\t$categories_string .= '<div style=\"height:5px; line-height:5px; background: url('.DIR_WS_IMAGES .'m26.gif) center repeat-x;\"></div>';\r\n tep_show_category($tree[$counter]['next_id']);\r\n }\r\n }", "public function productBySubCategoryAction()\n {\n $category = $this->route['category'];\n $vars['products'] = $this->model->getProductsBySubCategory($category);\n $this->view->render('Riding Gear', $vars);\n }", "public function sanphamdanhmucDoc($category_id){\n\t\t\t$data = $this->getProductInHomeModel($category_id);\n\t\t\t//sử dungj chung 1 form View product\n\t\t\t$this->renderHTML(\"views/frontend/formProductView3.php\",array(\"data\"=>$data));\n\t\t}", "function show_categories($sub_action, $id){\r\n global $sql, $rs, $ns, $aj;\r\n $text = \"<div style='border : solid 1px #000; padding : 4px; width :auto; height : 200px; overflow : auto; '>\\n\";\r\n if($category_total = $sql -> db_Select(\"link_category\")){\r\n $text .= \"<table class='fborder' style='width:100%'>\r\n <tr>\r\n <td style='width:5%' class='forumheader2'>&nbsp;</td>\r\n <td style='width:75%' class='forumheader2'>\".LCLAN_59.\"</td>\r\n <td style='width:20%; text-align:center' class='forumheader2'>\".LCLAN_60.\"</td>\r\n </tr>\";\r\n while($row = $sql -> db_Fetch()){\r\n extract($row);\r\n\r\n $text .= \"<tr>\r\n <td style='width:5%; text-align:center' class='forumheader3'>\".($link_category_icon ? \"<img src='\".e_IMAGE.\"link_icons/$link_category_icon' alt='' style='vertical-align:middle' />\" : \"&nbsp;\").\"</td>\r\n <td style='width:75%' class='forumheader3'>$link_category_name<br /><span class='smalltext'>$link_category_description</span></td>\r\n <td style='width:20%; text-align:center' class='forumheader3'>\r\n \".$rs -> form_button(\"submit\", \"category_edit_{$link_category_id}\", LCLAN_9, \"onclick=\\\"document.location='\".e_SELF.\"?cat.edit.$link_category_id'\\\"\").\"\r\n\r\n \".$rs -> form_open(\"post\", e_SELF,\"\",\"\",\"\",\" onsubmit=\\\"return confirm_('cat',$link_category_id)\\\"\").\"\r\n \".$rs -> form_button(\"submit\", \"category_delete_{$link_category_id}\", LCLAN_10).\"\r\n \".$rs -> form_close().\"\r\n\r\n </td>\r\n </tr>\\n\";\r\n }\r\n// \".$rs -> form_button(\"submit\", \"category_delete_{$link_category_id}\", LCLAN_10, \"onclick=\\\"confirm_('cat', '$link_category_id');\\\"\").\"\r\n $text .= \"</table>\";\r\n }else{\r\n $text .= \"<div style='text-align:center'>\".LCLAN_69.\"</div>\";\r\n }\r\n $text .= \"</div>\";\r\n $ns -> tablerender(LCLAN_70, $text);\r\n\r\n unset($link_category_name, $link_category_description, $link_category_icon);\r\n\r\n $handle=opendir(e_IMAGE.\"link_icons\");\r\n while ($file = readdir($handle)){\r\n if($file != \".\" && $file != \"..\"){\r\n $iconlist[] = $file;\r\n }\r\n }\r\n closedir($handle);\r\n\r\n if($sub_action == \"edit\"){\r\n if($sql -> db_Select(\"link_category\", \"*\", \"link_category_id ='$id' \")){\r\n $row = $sql -> db_Fetch(); extract($row);\r\n }\r\n }\r\n\r\n $text = \"<div style='text-align:center'>\r\n \".$rs -> form_open(\"post\", e_SELF.\"?cat\", \"linkform\").\"\r\n <table class='fborder' style='width:auto'>\r\n <tr>\r\n <td class='forumheader3' style='width:30%'><span class='defaulttext'>\".LCLAN_71.\"</span></td>\r\n <td class='forumheader3' style='width:70%'>\".$rs -> form_text(\"link_category_name\", 50, $link_category_name, 200).\"</td>\r\n </tr>\r\n <tr>\r\n <td class='forumheader3' style='width:30%'><span class='defaulttext'>\".LCLAN_72.\"</span></td>\r\n <td class='forumheader3' style='width:70%'>\".$rs -> form_text(\"link_category_description\", 60, $link_category_description, 200).\"</td>\r\n </tr>\r\n <tr>\r\n <td class='forumheader3' style='width:30%'><span class='defaulttext'>\".LCLAN_73.\"</span></td>\r\n <td class='forumheader3' style='width:70%'>\r\n \".$rs -> form_text(\"link_category_icon\", 60, $link_category_icon, 100).\"\r\n <br />\r\n <input class='button' type ='button' style='cursor:hand' size='30' value='\".LCLAN_80.\"' onclick='expandit(this)' />\r\n <div style='display:none'>\";\r\n while(list($key, $icon) = each($iconlist)){\r\n $text .= \"<a href='javascript:addtext2(\\\"$icon\\\")'><img src='\".e_IMAGE.\"link_icons/\".$icon.\"' style='border:0' alt='' /></a> \";\r\n }\r\n $text .= \"</div></td>\r\n </tr>\r\n\r\n <tr><td colspan='2' style='text-align:center' class='forumheader'>\";\r\n if($id){\r\n $text .= \"<input class='button' type='submit' name='update_category' value='\".LCLAN_74.\"'>\r\n \".$rs -> form_button(\"submit\", \"category_clear\", LCLAN_81).\r\n $rs -> form_hidden(\"link_category_id\", $id).\"\r\n </td></tr>\";\r\n }else{\r\n $text .= \"<input class='button' type='submit' name='create_category' value='\".LCLAN_75.\"' /></td></tr>\";\r\n }\r\n $text .= \"</table>\r\n \".$rs -> form_close().\"\r\n </div>\";\r\n\r\n $ns -> tablerender(LCLAN_75, $text);\r\n }", "function category() {\n // check session \n $this->check_session();\n \n // header data\n $header = $this->header_array('','','','Admin Category | Cytek Solutions Inc.','',base_url('admin/category'));\n // admin-navigation data\n $nav[\"page\"] = \"category\";\n $nav[\"inquiry\"] = $this->inquiry_model->pull_new_lead_cnt();\n // body data\n $body_data[\"categories\"] = $this->category_model->pull_categories();\n $body_data[\"subcategories\"] = $this->category_model->pull_subcategories();\n //view\n $this->load->view('header',$header);\n $this->load->view('admin-navigation',$nav);\n $this->load->view('category',$body_data);\n $this->load->view('script');\n $this->load->view('footer');\n }", "function shopay_product_cat_sec( $shopay_product_cat_info ) {\n $cat_name = $shopay_product_cat_info->name;\n $cat_slug = $shopay_product_cat_info->slug;\n $cat_id = $shopay_product_cat_info->term_id;\n $thumbnail_id = get_term_meta( $cat_id, 'thumbnail_id', true );\n if ( empty( $thumbnail_id ) ) {\n return;\n }\n?>\n <div class=\"category-content wow fadeInUp\">\n <?php $cat_link = get_term_link( $cat_id, 'product_cat' ); ?>\n <figure class=\"category-thumb\">\n <a href=\"<?php echo esc_url( $cat_link ); ?>\">\n <?php \n echo'<div class=\"category-image\">';\n echo wp_get_attachment_image( $thumbnail_id , 'thumbnail' );\n echo'</div>';\n ?> \n </a>\n </figure>\n\n <h4 class=\"category-title small-font\">\n <a href=\"<?php echo esc_url( $cat_link ); ?>\"><?php echo esc_html( $cat_name ); ?></a>\n </h4>\n </div><!-- .category-content -->\n<?php\n }", "public function categoryproductDisplay($bran_id){\n $result= $this->categoryProduct($bran_id);\n\n if($result == \"PRODUCTS_NOT_FOUND\"){\n echo(\"NO_PRODUCT_FOUND_UNDER_CATEGORY\");\n }\n else{\n foreach($result as $categoryProduct){\n echo('<div class=\"col-lg-6\">'.\n \n '<div class=\"d-block d-md-flex listing vertical\">'.\n '<a href=\"#\" class=\"img d-block\" style=\"background-image: url('.$categoryProduct[\"product_mainimg\"].')\"></a>'.\n '<div class=\"lh-content\">'.\n '<a href=\"#\" class=\"bookmark\"><span class=\"icon-heart\"></span></a>'.\n '<h3><a href=\"#\">'.$categoryProduct[\"product_title\"].'</a></h3>'.\n '<address>'.$categoryProduct[\"post_time\"].'</address>'.\n '<p class=\"mb-0\">'.\n '<span class=\"review\">$'.$categoryProduct[\"product_price\"].'.00</span>'.\n '</p>'.\n '</div>'.\n '</div>'.\n\n '</div>');\n }\n }\n \n }", "public function show_category_home($category_id) {\n $cate_product = DB::table('tbl_category_product')->where('category_status','0')->orderby('category_id','desc')->get(); // sắp xếp category_id\n \n $category_by_id = DB::table('tbl_product')->join('tbl_category_product','tbl_product.category_id','=','tbl_category_product.category_id')->where('tbl_product.category_id',$category_id)->get();\n $filter = DB::table('tbl_product')->where('product_status','0')->orderby('product_id','desc')->limit(2)->get();\n return view('pages.shop_c')->with('category',$cate_product)->with('category_by_id',$category_by_id)->with('filter',$filter);\n \n }", "function getCatProd(){\n\tif(isset($_GET['category'])){ //category wise product show korbe\n\n\t\t$cat_id=$_GET['category']; //getting the category selected from the user\n\t\tglobal $con;\n\t$get_cat_pro = \"select * from products where product_category='$cat_id'\"; //matching the selected category with the database\n\n\t$run_cat_pro = mysqli_query($con, $get_cat_pro);\n\n\t$count_cat=mysqli_num_rows($run_cat_pro); // it will count whether there are products associated with the category or not...\n\tif($count_cat==0){\n\t\techo\"<h2>Sorry, there is no product in this category. </h2>\";\n\t\texit(); \n\t}\n\n\twhile($row_cat_pro = mysqli_fetch_array($run_cat_pro)){\n\t\t$pro_id=$row_cat_pro['product_id'];\n\t\t$pro_title=$row_cat_pro['product_title'];\n\t\t$pro_category=$row_cat_pro['product_category'];\n\t\t$pro_price=$row_cat_pro['product_price'];\n\t\t$pro_image=$row_cat_pro['product_image'];\n \t\t//'?pro_id=$pro_id' =this is used for passing the id of the product to the next page\n\t\techo\"\n\t\t<div id='single_product'>\n\t\t<h3>$pro_title</h3>\n\t\t<img src='admin_area/product_images/$pro_image' width='200' height='200'/>\n\t\t<br>\n\t\t<p><i>TK: $pro_price</i></p>\n\t\t<br>\n\t\t<a href='details.php?pro_id=$pro_id'> <button style='background-color: #f44336; /* Green */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t border: none;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t color: white;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t padding: 5px 3px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t float:left;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t text-align: center;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t text-decoration: none;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t display: inline-block;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t margin: 5px 2px;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t cursor: pointer;\n\t\t\t\t\t\t\t\t\t\t\t\t'>Details</button></a> \n\n\t\t<a href='home.php?pro_id=$pro_id'><button style='background-color: #4CAF50; /* Green */\n border: none;\n color: white;\n padding: 5px 3px;\n float:right;\n text-align: center;\n text-decoration: none;\n display: inline-block;\n margin: 5px 2px;\n cursor: pointer;'>Add to Cart</button></a>\n\t\t</div>\n\t\t\";\n\n}}}", "public function show($slug_parent, $slug_child = FALSE)\n {\n $category_main = new Category();\n $category_main->where( array('slug' => $slug_parent, 'parent_id' => 0) )->get();\n\n // Instance a new category description\n $category_description = new Category_Description();\n\n // Check if the category exists\n if( !$category_main->exists() ) redirect( site_url('site/galatea_404') );\n\n // Define product class\n $products = new Item();\n\n // Define sidebar sub-categories\n $sidebar_sub_categories = new Category();\n\n // Define category\n $category_description->where('parent_id', $category_main->id);\n\n // Define breadcrumbs\n $breadcrumbs['breadcrumbs'] = array(\n\n // Main page\n array(\n 'href' => base_url(),\n 'name' => 'Home',\n ),\n\n // Main category\n array(\n 'href' => base_url(\"categoria/{$category_main->slug}/\"),\n 'name' => $category_main->name,\n ),\n\n );\n\n // The child category was sent?\n if($slug_child)\n {\n $category_sub = new Category();\n $category_sub->where( array('slug' => $slug_child, 'parent_id' => $category_main->id) )->get();\n\n // Breadcrumb sub-category address\n $breadcrumbs['breadcrumbs'][] = array(\n 'href' => base_url(\"categoria/{$category_main->slug}/\" . $category_sub->slug),\n 'name' => $category_sub->name,\n );\n\n // The child category exists?\n if( $category_sub->exists() ) {\n\n // Define product category\n $products->where_related_category('id', $category_sub->id);\n\n // Define sidebar category\n $sidebar_sub_categories->where('parent_id', $category_main->id);\n\n // Define the main category\n $category_name = $category_main->name;\n\n // Deifine actual main category for main menu\n $category_main_actual = $category_main->id;\n\n // Define the actual sub-category for sidebar\n $this->category_actual = $category_sub->id;\n\n // Define sub-category\n $category_description->where('child_id', $category_sub->id);\n\n }else{\n\n // Define sub-category\n $category_description->where('child_id', 0);\n\n }\n\n }else{\n\n // Define parent category name\n $category_name = $category_main->name;\n\n // Define sub-categories\n $sub_categories = new Category();\n $sub_categories->where('parent_id', $category_main->id)->get();\n\n // Get all products that have the sub-category\n $products->where_related_category('parent_id', $category_main->id);\n\n // Unset variable\n unset($sub_categories);\n\n // Deifine actual main category for main menu\n $category_main_actual = $category_main->id;\n\n // Define sidebar category\n $sidebar_sub_categories->where('parent_id', $category_main->id);\n\n // Define sub-category\n $category_description->where('child_id', 0);\n\n }\n\n // Define only products that is effectively a \"product\" and is activated\n $products->where( array('status' => 1, 'type' => 2) );\n\n //ORDER\n if( $this->input->get('order') ) {\n //order by price\n if ($this->input->get('order') == 'price_asc') {\n $products->order_by('production_price', 'asc');\n }else{\n $products->order_by('production_price', 'desc');\n }\n\n }else{\n $products->order_by(\"create_date\", \"desc\");\n }\n\n //FILTER\n if( $this->input->get('filter') )\n {\n // Voted (favorites)\n if( $this->input->get('filter') == 'favorites' and $this->session->userdata('id') )\n $products->where_related('item_vote', 'user_id', $this->session->userdata('id'));\n\n //LAST 30 DAYS NEWS\n if($this->input->get('filter') == 'news') {\n $last30days = date('Y-m-d', strtotime(date('Y-m-d') . '-30 days'));\n $products->where('create_date >', $last30days);\n }\n }\n\n $category_url = \"categoria/{$category_main->slug}\";\n\n if( isset($category_sub) ) {\n $category_url .= \"/{$category_sub->slug}\";\n $category['image'] = $category_sub->image;\n $category['href'] = $category_sub->link_address ? $category_sub->link_address : '#';\n }else{\n $category['image'] = $category_main->image;\n $category['href'] = $category_main->link_address ? $category_main->link_address : '#';\n $category_sub = FALSE;\n }\n\n $categories = new Category();\n\n // Get category description\n $category_description->get();\n\n // Variables to the view\n {\n $toview['breadcrumbs'] = $this->load->view('site/common/breadcrumbs', $breadcrumbs, TRUE);\n $toview['category_main'] = $category_main;\n $toview['category_sub'] = $category_sub;\n $toview['categories'] = $categories->where('parent_id', 0)->get();\n $toview['category_url'] = $category_url = isset($category_url) ? $category_url : FALSE;\n $toview['category'] = $category;\n $toview['category_actual'] = $this->category_actual;\n $toview['category_name'] = $category_name;\n $toview['products'] = $products->get();\n $toview['sub_categories'] = $sidebar_sub_categories->get();\n $toview['category_main_actual'] = $category_main_actual;\n $toview['title'] = $category_description->title;\n $toview['metas'] = meta('description', $category_description->description);\n }\n\n $this->load->view('site/common/header/main', $toview);\n $this->load->view('site/common/header/categories', $toview);\n $this->load->view('site/category', $toview);\n $this->load->view('site/common/footer/main', $toview);\n\n }", "public function show_category_home($category_id){\n $all_banner=DB::table('tbl_banner')->where('banner_status','1')->orderby('banner_id','ASC')->get();\n $cate_product=DB::table('tbl_category_product')->where('category_status','0')->orderby('category_id','desc')->get();\n $brand_product=DB::table('tbl_brand')->where('brand_status','0')->orderby('brand_id','desc')->get();\n $cate_id = DB::table('tbl_product')->join('tbl_category_product','tbl_product.category_id','=','tbl_category_product.category_id')->where('tbl_product.category_id',$category_id)->limit(6)->get();\n $name_cate=DB::table('tbl_category_product')->where('tbl_category_product.category_id',$category_id)->get();\n return view('pages.category.show_category')->with('category',$cate_product)->with('brand',$brand_product)->with('cate_id',$cate_id)->with('name_cate',$name_cate)->with('all_banner',$all_banner);\n }", "public function categories()\n {\n $result = $this->dtbs->list('category');\n $data['info'] = $result;\n $this->load->view('back/categories/anasehife',$data);\n }", "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 view_category(){\n\t\t\t$this->layout = 'mobilelayout';\n\t\t\tglobal $loguser;\n\t\t\tif(!$this->isauthorizedpersn())\n\t\t\t\t$this->redirect('/');\n\t\t\t\t\n\t\t\t$this->set('title_for_layout','Category Management');\n\t\t\t\n\t\t\t$main_catdata = $this->Category->find('all');\n\t\t\t//$super_sub_catdata = $this->Category->find('all',array('conditions'=>array('category_parent <>'=>0)));\n\t\t\t// $sub_sub_catdata = $this->Category->find('all',array('conditions'=>array('category_parent <>'=>0,'category_sub_parent <>'=>0)));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->paginate = array('conditions'=>array('Category.category_name <>'=>''),'limit'=>10,'order'=>array('Category.id'=>'desc'));\n\t\t\t$super_sub_catdata = $this->paginate('Category');\n\t\t\t$pagecount = $this->params['paging']['Category']['count'];\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->set('main_catdata',$main_catdata);\n\t\t\t$this->set('super_sub_catdata',$super_sub_catdata);\n\t\t\t$this->set('pagecount',$pagecount);\n\t\t\t// $this->set('sub_sub_catdata',$sub_sub_catdata);\n\t\t\t\n\t\t\t// echo \"<pre>\";print_r($sub_sub_catdata);die;\n\t\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}", "function category($categoryName, $categoryId, $page)\n {\n $sort = Input::get('sortOrder') == null ? \"BestMatch\" : Input::get('sortOrder');\n $checkedInput = $this->checkedChecked(Input::get());\n $breadCramb = $this->model->getBreadCramb($categoryId);\n\n $filterUrl = $this->generateFilterUrl(Input::get());\n $ebayData = $this->model->getProductsByCategory(\n $categoryId, 42, $page, Input::get(), $sort\n );\n $similarCategories = $this->model->getSimilarCategory($categoryId);\n $filterData = $this->model->getFiltersForCategory($categoryId);\n\n $resultsAmount = $ebayData->totalEntries;\n if ($ebayData->totalPages > 100) {\n $totalPages = 100;\n } else {\n $totalPages = $ebayData->totalPages;\n }\n $pagesAvailable = Util::getPaginationList($page, $totalPages);\n $paginationResult = Util::getLinksForPagination($pagesAvailable, \"category\", $categoryName, $page, $this->siteslug, $filterUrl, $categoryId);\n $filtersForTitle = $this->model->getFiltersForTitle($checkedInput);\n $pages = $paginationResult['pages'];\n $pageNext = $paginationResult['pageNext'];\n\n $categoryData['page'] = $page;\n $categoryData['id'] = $categoryId;\n $categoryData['title'] = $categoryName;\n $categoryData['totalResults'] = $resultsAmount;\n\n if ($page == 1) {\n $pageForTitle = '';\n } else {\n $pageForTitle = ' ' . 'עמוד' . ' ' . $page;\n }\n// $this->title = $categoryData['title'] . ' ' . $filtersForTitle . $pageForTitle . '- ' . \"אמזון בעברית\" . ' - ' . 'צי\\'פי קניות ברשת';\n /*if (is_null($sort)) {\n $sortForTitle = '';\n } else {\n $sortForTitle = '-' . $sort;\n }*/\n if (Lang::getLocale() == 'he') {\n $this->shopName = Lang::get('general.amazon');\n } elseif (Lang::getLocale() == 'en') {\n $this->shopName = 'amazon';\n };\n //dd($filtersForTitle);\n $this->title = $categoryData['title'] . ' - ' . $breadCramb['category'] . $filtersForTitle . ' - ' . $categoryData['page'] . ' - ' . $this->shopName;\n $this->description = $categoryData['title'] . ' ' . $filtersForTitle . $pageForTitle . '- ' . \"אמזון בעברית\" . ' - ' . \"שירות לקוחות בעברית,תשלום ללא כ.א בינלאומי,למעלה ממיליארד מוצרים בעברית\";\n //dd($categoryData);\n $productBaseRoute = \"/{$this->siteslug}/product\";\n return view(\"ebay.category\", [\n 'pagination' => $pages,\n 'pageNext' => $pageNext,\n 'categoryData' => $categoryData,\n 'categories' => $this->categories,\n 'productBase' => $productBaseRoute,\n 'siteslug' => $this->siteslug,\n 'ebayData' => $ebayData->products,\n 'filterData' => $filterData,\n 'checkedInput' => $checkedInput,\n 'breadCramb' => $breadCramb,\n 'title' => $this->title,\n 'description' => $this->description,\n 'page' => $page,\n 'similarCategories' => $similarCategories,\n ]);\n }", "public function category(){\n\t\t$this->load->helper('url');\n\t\t$data['userLogin'] = $this->checkLogin();\n\t\tif($data['userLogin']){\n\t\t\t$data['user'] = $this->getUser();\n\t\t}\n\n\t\t$data['sidebar'] = $this->sidebar();\n\n\t\t$this->load->view('frontend/templates/header');\n\t\t$this->load->view('frontend/templates/navigation');\n\t\t$this->load->view('frontend/category', $data);\n\t\t$this->load->view('frontend/templates/sidebar');\n\t\t$this->load->view('frontend/templates/footer');\n\t}", "function wi_shop_link_markup(){\n\trequire_once \"components/shop_components/shop_catagory_markup.php\";\n\t $args = array(\n\t\t 'taxonomy' => 'product_cat',\n\t\t 'hide_empty' => true,\n\t\t 'meta_key' => 'thumbnail_id'\n\t );\n\t$categories = get_terms($args );\n\n\t//echo print_r($categories);\n\t$display = \"<section class='homepage-shop-link'>\";\n\t$display .= \"<h1>Find your darkness</h1>\";\n\techo $display;\n//\techo print_r(woocommerce_get_product_subcategories());\n\n\tforeach($categories as $category){\n\t\t//get_object_vars($category) ;\n\t\tshop_catagory($category);\n\t}\n \techo \"</section>\";\n\n //echo print_r(get_theme_mod(\"wi_hero_background_image\"));\n\n}", "public function getProductInHome($category_id){\n\t\t\t$data = $this->getProductInHomeModel($category_id);\n\t\t\t//sử dungj chung 1 form View product\n\t\t\t$this->renderHTML(\"views/frontend/formProductView.php\",array(\"data\"=>$data));\n\t\t}", "function fetch_certain_categoty($connection, $restaurant_id, $category) {\n\t$item_query = \" SELECT t.id, ct.category_name, t.name, t.price, t.size, t.ingredients, t.picture\n\t\t\t\t\tFROM category_item ct, item t\n\t\t\t\t\tWHERE ct.category_name = '\". $category . \"'\n\t\t\t\t\tAND ct.restaurant_id = '\". $restaurant_id . \"'\n\t\t\t\t\tAND t.id = ct.item_id\n\t\t\t\t\t\";\n\t$items_results = $connection->query($item_query);\n\t$categories = fetch_restaurant_category_item($connection, $restaurant_id);\n\tif (is_string($categories)) {\n\t\techo $categories;\n\t\techo \"you will be redirected soon :)\";\n\t\tsleep(2);\n\t\theader(\"Location: restaurants.php\");\n\t}else{\n\t\t$save_my_categories = array();\n\t\tif(is_array($categories) || is_object($categories)){\n\t\t\tforeach ($categories as $i => $my_array) {\n\t\t\t\tforeach ($my_array as $key => $value) {\n\t\t\t\t\t// key of the categories\n\t\t\t\tif($key == 6) // notice that this should be changed based on the number of attribues in the sql\n\t\t\t\t\tarray_push($save_my_categories, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$my_categories = array_unique($save_my_categories);\n\t}\n\t\n\t?>\n\t<section class=\"menu_list mt-60 mb-60\" style=\"margin-top: 5%;\">\n\t <div class=\"container\">\n\t\t<div class=\"row\">\n\t\t <div class=\"col-xl-12\">\n\t\t\t <div class=\"section-title text-center mb-60\">\n\t\t\t\t <h4>our menu</h4>\n\t\t\t </div>\n\t\t </div>\n\t\t</div>\n\n\t\t<div class=\"row\">\n\t\t <div class=\"tab-content col-xl-12\" id=\"myTabContent\">\n\t\t\t <div class=\"tab-pane fade active show\" id=\"breakfast\" aria-labelledby=\"breakfast-tab\">\n\t\t\t\t<div class=\"col-lg-3\" style=\"float: left;\">\n\t\t\t\t\t<nav class=\"list1\">\n\t\t\t\t <h3>Categories</h3>\n\t\t\t\t\t\t<form method=\"get\">\n\t\t\t\t\t\t \t<?php foreach ($my_categories as $value) {\n\t\t\t\t\t\t\t\t echo \"<a href='restaurant_category.php?restaurant_id=$restaurant_id&category=$value' class=\\\"list-group-item\\\" > $value</a>\";\n\t\t\t\t\t\t\t\t header(\"Resfresh:0\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t ?>\n\t\t\t\t\t </form>\n\t\t\t\t </nav>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"col-lg-8\" style=\"float: right;\">\n\t\t\t\t\t<?php \n\t\t\t\t\t\tif (mysqli_num_rows($items_results) > 0) {\n\t\t\t\t\t\t\t\twhile ($row = mysqli_fetch_array($items_results) ) { \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(isset($_SESSION[\"user_email\"])) { \n\t\t\t\t\t\t\t\t\t\t?>\n\n \t\t\t\t\t\t\t\t<form method=\"POST\" action=\"cart.php\">\n\t\t\t\t\t\t\t\t\t<div class=\"single_menu_list\">\n\t\t\t\t\t\t\t\t\t\t <img name=\"src\" src=\"http://infinityflamesoft.com/html/restarunt-preview/assets/img/menu/menu-3.jpg\" alt=\"\">\n\t\t\t\t\t\t\t\t\t\t <div class=\"menu_content\">\n\t\t\t\t\t\t\t\t\t\t\t <h4><?php echo $row[\"name\"] ?>\n\t\t\t\t\t\t\t\t\t\t\t <span><?php echo \"AED{$row[\"price\"]} / {$row[\"size\"]}\"?></span></h4>\n\t\t\t\t\t\t\t\t\t\t\t <p name=\"ingredients\"><?php echo \"{$row[\"ingredients\"]}\" ?> </p>\n\t\t\t\t\t\t\t\t\t\t\t <input type=\"submit\" name=\"add\" class=\"btn btn-ouline-btn\" value=\"add item\" />\n\t\t\t\t\t\t\t\t\t\t\t <!-- Since i cant ruin the webpage design i will save all the data in hidden inputs-->\n\t\t\t\t\t\t\t\t\t\t\t <!-- dont do that in a real product, this pasta code goes for a uni project only -->\n\t\t\t\t\t\t\t\t\t\t\t <input type=\"hidden\" name=\"name\" value=\"<?php echo $row[\"name\"] ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t <input type=\"hidden\" name=\"id\" value=\"<?php echo $row[\"id\"] ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t <input type=\"hidden\" name=\"price\" value=\"<?php echo $row[\"price\"] ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t <input type=\"hidden\" name=\"quantity\" value=\"1\" />\n\t\t\t\t\t\t\t\t\t\t\t <input type=\"hidden\" name=\"size\" value=\"<?php echo $row[\"size\"] ?>\" />\n\t\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\t\t\t\t \t</form>\n\t\t\t\t\t\t <?php\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<div class=\"single_menu_list\">\n\t\t\t\t\t\t\t\t\t\t <img name=\"src\" src=\"http://infinityflamesoft.com/html/restarunt-preview/assets/img/menu/menu-3.jpg\" alt=\"\">\n\t\t\t\t\t\t\t\t\t\t <div class=\"menu_content\">\n\t\t\t\t\t\t\t\t\t\t\t <h4><?php echo $row[\"name\"] ?>\n\t\t\t\t\t\t\t\t\t\t\t <span><?php echo \"AED{$row[\"price\"]} / {$row[\"size\"]}\"?></span></h4>\n\t\t\t\t\t\t\t\t\t\t\t <p name=\"ingredients\"><?php echo \"{$row[\"ingredients\"]}\" ?> </p>\n\t\t\t\t\t\t\t\t\t\t\t <a href=\"login.php\"> add to cart </a>\n\t\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\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ?>\n\n\t\t\t\t</div> <!-- row 6 -->\n\n\t\t\t </div>\n\t\t </div>\n\t\t</div> <!-- End of row -->\n\t </div>\n </section>\n <?php\n}", "function shophead_index()\n {\n $this->layout = 'admin_layout'; \n $this->set('title','Product Items Management');\n App::Import(\"Model\",\"ProductCategory\");\n $this->ProductCategory=new ProductCategory();\n $categories_list = $this->ProductCategory->find('list', array('conditions' => array('ProductCategory.is_deleted' => 0), 'fields' => array('ProductCategory.id', 'ProductCategory.name')));\n $this->set('categories_list', $categories_list);\n\t\t$Category_join = array('table' => 'product_sub_categories', 'alias' => 'ProductSubCategory', 'type' => 'inner', 'conditions' => array('ProductItem.product_sub_category_id =ProductSubCategory.id'));\t\t\n $conditions = array('ProductItem.is_deleted' => 0);\n if (!empty($this->request->data)) {\n \n if ($this->request->data['ProductItem']['product_sub_category_id'] != \"\") {\n $conditions['ProductItem.product_sub_category_id'] = $this->request->data['ProductItem']['product_sub_category_id'];\n $this->request->params['named']['ProductItem.product_sub_category_id'] = $this->request->data['ProductItem']['product_sub_category_id'];\n }\n if ($this->request->data['ProductItem']['product_category_id'] != \"\") {\n $conditions['ProductItem.product_category_id'] = $this->request->data['ProductItem']['product_category_id'];\n $this->request->params['named']['ProductItem.product_category_id'] = $this->request->data['ProductItem']['product_category_id'];\n }\n } else {\n if (isset($this->request->params['named']['ProductItem.product_category_id']) && $this->request->params['named']['ProductItem.product_category_id'] != \"\") {\n $conditions['ProductItem.product_category_id'] = $this->request->params['named']['ProductItem.product_category_id'];\n $this->request->data['ProductItem']['product_category_id'] = $this->request->params['named']['ProductItem.product_category_id'];\n }\n if (isset($this->request->params['named']['ProductItem.product_sub_category_id']) && $this->request->params['named']['ProductItem.product_sub_category_id'] != \"\") {\n $conditions['ProductItem.product_sub_category_id'] = $this->request->params['named']['ProductItem.product_sub_category_id'];\n $this->request->data['ProductItem']['product_sub_category_id'] = $this->request->params['named']['ProductItem.product_sub_category_id'];\n }\n }\n \n $this->paginate = array(\n 'recursive' => 0,\n 'limit' => LIMIT,\n 'fields'=> array('ProductSubCategory.name as catname,ProductItem.id,ProductItem.name,ProductItem.sort_order,ProductItem.created,ProductItem.status,ProductItem.updated,ProductItem.product_sub_category_id'),\n 'conditions' => $conditions,\n 'order' => array(\n 'ProductItem.sort_order' => 'Asc'\n ),\n 'joins'=>array($Category_join)\n );\n\t\t\n\t\t\n $result = $this->paginate('ProductItem');\n\t\t//pr($result);\n $this->set('result', $result);\n }", "public function stepCategory()\n {\n global $rlSmarty, $rlCategories, $page_info, $account_info, $sError, $config;\n\n parent::step();\n\n $GLOBALS['rlHook']->load('addListingGetCats');\n\n // Define allowed types\n $allowed_type_keys = $account_info['Abilities'];\n\n // \"Individual add listing page\" mode\n if ($page_info['Key'] != 'add_listing') {\n $individual_type_key = substr($page_info['Key'], 3);\n\n if (in_array($individual_type_key, $allowed_type_keys)) {\n $allowed_type_keys = array($individual_type_key);\n } else {\n $sError = true;\n }\n }\n\n // Adapt listing types array\n $allowed_types = $GLOBALS['rlListingTypes']->adaptTypes($allowed_type_keys);\n $rlSmarty->assign_by_ref('allowed_types', $allowed_types);\n\n // Existing membership plan mode\n $this->existingMembershipHandler($account_info);\n\n // Remove unnecessary steps\n if (!$this->singleStep) {\n unset($this->steps['photo'], $this->steps['checkout']);\n }\n }", "public function prod_detail($url_link = null) {\n if (!empty($url_link)) { // neu link khong ton tai hay bi trong\n\n $Product = new Product();\n $Image = new Image();\n $Product_tmp = $Product->getProductByLink($url_link);\n $Product_tmp->fetchFirst();\n $data['product'] = $Product_tmp;\n\n if ($Product_tmp->countRows() > 0) {\n $data['image'] = $Image->getListImageByListId($Product_tmp->get_product_id_prod_image());\n } else {\n $data['image'] = '';\n }\n\n // menu tree \n $array_menus = array();\n $filter = array();\n $filter['parent_id'] = 0;\n Menu::getMenuTree($array_menus, $filter);\n \n \n $data['description'] = $Product_tmp->get_product_short_description();\n $data['keywords'] = $Product_tmp->get_product_keywords();\n $data['title_page'] = $Product_tmp->get_product_name();\n \n $data['selected'] = '';\n $data['array_menus'] = $array_menus;\n $data['content'] = 'prod_details';\n $this->load->view('temp', $data);\n \n } else {\n redirect(Variable::getDefaultPageString());\n }\n }", "function getProductListWithFilter($results6, $category_id)\n{\n if (!empty($category_id)) {\n foreach ($results6 as $key => $value) {\n echo '<div id = \"product\"><a href =\"index.php?action=product&id=' . $value['product_id'] . '\">' . $value['name'] . ' ' .\n $value['model'] . '<br><img src=' . $value['picture'] . '><br><br>' . $value['price'] . '</a><br><br></div>';\n }\n }\n}", "public function categoryAction()\n\t{\n\t\t$id = (int) $this->getRequest()->getParam('id');\n\t\t$this->view->category = $this->_blogService->findCategory($id);\n\t}", "function getCategory(){\n // this function for get all categories to categories.php page\n try{\n global $con;\n $query = $con->prepare(\"SELECT * FROM categories\");\n $query->execute();\n while($result = $query->fetch(PDO::FETCH_ASSOC)){\n $cat_id = $result[\"cat_id\"];\n $cat_icon = $result[\"cat_icon\"];\n $cat_title = $result[\"cat_title\"];\n $cat_desc = $result[\"cat_desc\"];\n $class = \"col-md-6 col-lg-4\";\n if($cat_title == \"اخرى\"){\n $class = \"col-md-12 col-lg-8\";\n }\n echo \"\n <div class='$class'>\n <a href='ads.php?cat_id=$cat_id&page=1'>\n <div class='item'>\n <div class='img-box'>\n <img src='Layout/Images/icons/$cat_icon' class='img-responsive' alt='$cat_icon'>\n </div>\n <h4>$cat_title</h4>\n <p>$cat_desc</p>\n </div>\n </a>\n </div>\n \";\n }\n }\n catch(PDOException $e){\n echo $e->getMessage();\n }\n}", "private function items_category($page_name, $showroom, $category_id)\n {\n # get the parent to determine the view.\n if(!is_object($showroom))\n $showroom = ORM::factory('showroom', $showroom);\n \n # get the category \n $category = ORM::factory('showroom_cat')\n ->where(array(\n 'fk_site' => $this->site_id,\n 'showroom_id' => $showroom->id,\n ))\n ->find($category_id);\n if(!$category->loaded)\n return '<div class=\"not_found\">Invalid category</div>';\n \n # get any sub categories ...\n $sub_cats = ORM::factory('showroom_cat')\n ->where(array(\n 'fk_site' => $this->site_id,\n 'showroom_id' => $showroom->id,\n 'lft >=' => \"$category->lft\",\n 'lft <=' => \"$category->rgt\",\n ))\n ->find_all();\n \n # create array from the cat and sub_cats\n $cat_ids = array();\n foreach($sub_cats as $cat)\n $cat_ids[] = $cat->id;\n \n # get all the items.\n $items = ORM::factory('showroom_cat_item')\n ->where(array(\n 'fk_site' => $this->site_id,\n ))\n ->in('showroom_cat_id', $cat_ids)\n ->find_all();\n if(0 == $items->count())\n return '<div class=\"not_found\">No items. Check back soon!</div>';\n \n $view = new View(\"public_showroom/display/$showroom->view\");\n \n # do view stuff\n if('gallery' == $showroom->view)\n {\n # request javascript file\n $view->request_js_files('lightbox/lightbox.js');\n # parse the params.\n $params = explode('|',$showroom->params);\n $view->columns = (isset($params[1]) AND is_numeric($params[1]))\n ? $params[1]\n : 2;\n $view->thumb_size = (isset($params[2]) AND is_numeric($params[2]))\n ? $params[2]\n : 75;\n }\n\n # get the path to this category\n $path = ORM::factory('showroom_cat')\n ->where(array(\n 'fk_site' => $this->site_id,\n 'showroom_id' => $showroom->id,\n 'lft <' => $category->lft,\n 'rgt >' => $category->rgt,\n 'local_parent !='=> 0\n ))\n ->orderby(array('lft' => 'asc'))\n ->find_all();\n \n $view->path = $path;\n $view->category = $category;\n $view->sub_categories = Tree::display_tree('showroom', $sub_cats, $page_name);\n $view->page_name = $page_name;\n $view->img_path = $this->assets->assets_url();\n $view->items = $items;\n return $view;\n }", "public function category($slug)\n {\n $cate = Category::where(['slug' => $slug])->first();\n //2 . chứa tên danh mục cha và sản phẩm theo danh mục (gồm cả SP thuộc cha và con)\n $data = [];\n\n foreach ($this->categories as $category) {\n if ($category->id == $cate->id ) { // lấy danh mục cha\n\n $categoryIds = []; // biến chưa id của danh mục , cha / con\n\n $categoryIds[] = $category->id;\n\n foreach ($this->categories as $categoryChild1) {\n if ($categoryChild1->parent_id == $category->id) {\n $categoryIds[] = $categoryChild1->id;\n\n foreach ($this->categories as $categoryChild2) {\n if ($categoryChild2->parent_id == $categoryChild1->id) {\n $categoryIds[] = $categoryChild2->id;\n }\n }\n }\n }\n\n // SQL query dữ liệu sản phẩm của cả cha/con\n $products = Product::where(['is_active' => 1])\n ->whereIn('category_id' , $categoryIds)\n ->limit(40)\n ->orderBy('id', 'desc')\n ->orderBy('position', 'asc')\n ->get();\n\n\n $data = [\n 'name' => $category->name,\n 'products' => $products ,// toàn bộ sản phẩm gồm cả cha / con\n ];\n\n\n }\n }\n\n return view('frontend.category',['data' => $data]);\n }", "public function show_category_home($id){\n\n $cate_product = DB::table('category_product')->where('category_status','1')->orderby('category_id', 'desc')->get();\n $brand_product = DB::table('brand')->where('brand_status','1')->orderby('brand_id', 'desc')->get();\n // $all_product = DB::table('products')->where('product_status','1')->orderby('product_id', 'desc')->limit(4)->get();\n \n $category_by_id = DB::table('products')->join('category_product','products.category_id','=','category_product.category_id')->where('products.category_id',$id)->get();\n\n $category_name = DB::table('category_product')->where('category_product.category_id',$id)->limit(1)->get(); //limit 1 lay san pham dau tien, first(1) lay ra dong dau tien\n \n return view('page.category.show_category')\n ->with('category',$cate_product)\n ->with('brand',$brand_product)\n ->with('category_by_id',$category_by_id)\n ->with('category_name',$category_name);\n }", "public function showCategory(){\n \t$form = M(\"categoryinfo\");\n \t$data = $form->select();\n \t$data = json_encode($data);\n \techo $data;\n \t//$this->display();\n }", "function getCatPro(){\n global $db;\n if (isset($_GET['cat'])) {\n $cat_id= $_GET['cat'];\n $get_cat_pro = \"SELECT * FROM products where cat_id='$cat_id'\";\n $run_cat_pro = mysqli_query($db, $get_cat_pro);\n $count = mysqli_num_rows($run_cat_pro);\n if ($count==0) {\n echo \"<h2>No Products found in this category!</h2>\";\n }\n while ($row_cat_pro=mysqli_fetch_array($run_cat_pro)) {\n $pro_id = $row_cat_pro['product_id'];\n $pro_title = $row_cat_pro['product_title'];\n $pro_cat = $row_cat_pro['cat_id'];\n $pro_brand = $row_cat_pro['brand_id'];\n $pro_desc = $row_cat_pro['product_desc'];\n $pro_price = $row_cat_pro['product_price'];\n $pro_image = $row_cat_pro['product_img1'];\n\n echo \"\n <div id='single_product'>\n <h3 style='padding-bottom:3px;' >$pro_title</h3>\n <img src='admin_area/product_images/$pro_image' width='180' height='180' /><br/>\n <p><b>Price: $pro_price</b></p>\n <a href='details.php?pro_id=$pro_id' style='float:left;'>Details</a>\n <a href='index.php?add_cart=$pro_id'><button style='float:right;'>Add to Cart</button></a>\n </div>\n \";\n }\n }\n }", "public function product_detail() {\n global $product;\n WC_Gokeep_JS::get_instance()->product_detail( $product );\n }", "function wc_marketplace_category() {\n global $wmp;\n $wmp->output_report_category();\n }", "public function viewAction()\n {\n $alias = $this->route['alias'];\n $category = R::findOne('category', 'alias = ?', [$alias]);\n\n $curr = \\ishop\\App::$app->getProperty('currency');\n\n if(!$category){\n throw new \\Exception('Страница не найдена', 404);\n }\n\n // 2. breadcrumbs & ids for all children categories\n $breadcrumbs = Breadcrumbs::getBreadcrumbs($category->id);\n $cat_model = new Category();\n $ids = $cat_model->getIds($category->id);\n $ids = $ids ? ($ids . $category->id) : $category->id;\n $filterData['categoryIds'] = $ids;\n\n // 3. get product sort parameters\n $productsSort = App::$app->getProperty('productsSort');\n $sort = self::productSort();\n $productSortDB = self::productSortDB();\n $productsPerPage = App::$app->getProperty('productsPerPage');\n $perpage = self::getProductPerpage();\n $productsMode = self::getProductMode();\n\n // 4. filters for products\n $filter = null; $sql_part = '';\n if(!empty($_GET['filter']))\n {\n new \\app\\widgets\\filter\\Filter($filterData);\n $filter = Filter::getFilter();\n\n if($filter){\n $countGroups = Filter::countGroups($filter);\n $sql_part = \"AND product.id IN (\n SELECT attribute_product.product_id\n FROM attribute_product \n LEFT JOIN attribute_value ON attribute_value.id = attribute_product.attr_id\n LEFT JOIN attribute_group ON attribute_group.id = attribute_value.attr_group_id\n WHERE attribute_product.attr_id IN ({$filter})\n GROUP BY attribute_product.product_id\n HAVING COUNT(DISTINCT attribute_value.attr_group_id) = {$countGroups}\n )\";\n }\n\n $filter = explode(',', $filter);\n }\n\n $filterPrice = null;\n if(!empty($_GET['minPrice']) && $_GET['maxPrice'])\n {\n $minPrice = round($_GET['minPrice'] / $curr['value']);\n $maxPrice = round($_GET['maxPrice'] / $curr['value']);\n $sql_part .= \" AND product.price >= {$minPrice} AND product.price <= {$maxPrice} \";\n }\n\n // 5. find total (with filters) & get pagination\n $page = isset($_GET['page']) ? (int)$_GET['page'] : 1;\n $total = R::count('product', \"category_id IN ($ids) AND status = 'visible' $sql_part\");\n $pagination = new Pagination($page, $perpage, $total);\n $start = $pagination->getStart();\n\n $products = R::getAll(\"SELECT product.*, GROUP_CONCAT(product_base_img.img SEPARATOR ',') AS base_img FROM product \n LEFT JOIN product_base_img ON product_base_img.product_id = product.id\n WHERE product.category_id IN ($ids) AND product.status = 'visible' $sql_part\n GROUP BY product.id ORDER BY $productSortDB LIMIT $start, $perpage\");\n\n if($products){\n for ($z=0; $z<count($products); $z++){\n $getProductSizes = R::getAll(\"SELECT GROUP_CONCAT(attribute_value.value) AS value\n FROM attribute_value\n LEFT JOIN attribute_product ON attribute_value.id = attribute_product.attr_id\n WHERE attribute_product.product_id = {$products[$z]['id']} AND attribute_value.attr_group_id = 6\");\n $products[$z]['sizes'] = $getProductSizes[0]['value'];\n }\n }\n\n $sizes = R::findAll(\"attribute_value\", 'attr_group_id = ? ', [6]);\n\n $productRangeCount = ($perpage*($pagination->currentPage-1)+1) .\" - \". ($perpage*($pagination->currentPage-1) + count($products));\n\n\n $filterPrice = R::getRow(\"SELECT MIN(price) AS minPrice, MAX(price) AS maxPrice\n FROM `product` \n WHERE category_id IN($ids) AND status = 'visible'\");\n\n $filterData['minPrice'] = round($filterPrice['minPrice'] * $curr['value']);\n $filterData['maxPrice'] = round($filterPrice['maxPrice'] * $curr['value']);\n\n if($this->isAjax())\n {\n $categoryViews['products'] = $this->loadViews('products', compact('products'));\n $categoryViews['productPagination'] = $this->loadViews('product_pagination', compact( 'pagination', 'total', 'productRangeCount'));\n $filterObj = new \\app\\widgets\\filter\\Filter($filterData);\n $categoryViews['productFilter'] = $filterObj->run();\n\n echo json_encode($categoryViews, true);\n die;\n }\n\n $title = $category->meta_title ? $category->meta_title : $category->title;\n $this->setMeta( $title.' - интернет магазин MegaShop Demo', $category->description, $category->keywords);\n $this->set(compact('breadcrumbs', 'category', 'products',\n 'pagination', 'total', 'perpage', 'productsPerPage', 'sizes',\n 'productsSort', 'sort', 'productRangeCount', 'productsMode', 'filterData'));\n\n }", "public function category($slug)\n {\n $catId = Product::where('product_name',$slug)->first();\n\n if($catId !=null){\n return $this->findCat($catId,$slug);\n }else{\n $count = WishList::select('id')->where('user_id',auth()->user()->id ?? '')->count();\n $count1 = Cart::select('id')->where('user_id',auth()->user()->id ?? '')->count();\n $cart = Cart::where('user_id',auth()->user()->id ?? '')->get();\n $categories = Category::with('get_child_category')->where('status',1)->get();\n $ads = AdManager::all();\n $orders = Orders::where('user_id',auth()->user()->id ?? '')->get();\n $setting = Settings::first();\n\n $cat = Category::where('slug',$slug)->first();\n $category = ChildCategory::where('slug',$slug)->with('get_category:id,cover')->first();\n $sub_category = SubChildCategory::where('slug',$slug)->with('get_category:id,cover')->first();\n\n if($cat != null){\n $products = Product::where('category_id',$cat->id)->with(['get_product_avatars','get_attribute' => function ($query) {\n $query->whereNotNull('product_id')->get();\n }])->get();\n $product = $cat->get_product()->with('get_brand')->selectRaw('distinct(brand_id)')->get();\n $productSize = Product::where('category_id',$cat->id)->with('get_product_avatars','get_attribute')->get();\n $attributes = Attribute::all();\n }elseif($category != null) {\n $products = Product::where('child_category_id',$category->id)->with(['get_product_avatars','get_attribute' => function ($query) {\n $query->whereNotNull('product_id')->get();\n }])->get();\n $attributes = Attribute::all();\n $product = $category->get_product()->with('get_brand')->selectRaw('distinct(brand_id)')->get();\n $productSize = Product::where('child_category_id',$category->id)->with(['get_product_avatars','get_attribute' => function ($query) {\n $query->whereNotNull('size')->get();\n }])->get();\n }elseif($sub_category !=null){\n $products = Product::where('sub_child_category_id',$sub_category->id)->with(['get_product_avatars','get_attribute' => function ($query) {\n $query->whereNotNull('product_id')->get();\n }])->get();\n $product = $sub_category->get_product()->with('get_brand')->selectRaw('distinct(brand_id)')->get();\n $productSize = Product::where('sub_child_category_id',$sub_category->id)->with(['get_product_avatars','get_attribute' => function ($query) {\n $query->whereNotNull('size')->get();\n }])->get();\n $attributes = Attribute::all();\n }\n\n return view('layouts.frontend.category_list',[\n 'ads'=>$ads,\n 'categories'=>$categories,\n 'count'=>$count,\n 'count1'=>$count1,\n 'cart'=>$cart,\n 'orders'=>$orders,\n 'setting'=>$setting,\n 'cat'=>$cat,\n 'category'=>$category,\n 'sub_category'=>$sub_category,\n 'products'=>$products ?? null,\n 'product'=>$product ?? null,\n 'productSize'=>$productSize ?? null,\n 'attributes'=>$attributes ?? null\n ]);\n }\n }", "public function bannerAction()\n {\n $brand = $this->route['brand'];\n $category = $this->route['category'];\n $vars['products'] = $this->model->getProductsByCategoryAndBrand($category,$brand);\n $this->view->render('Riding Gear', $vars);\n }", "function View_category($categoryid){\n $this->getDataTableScripts();\n $this->data['page_level_styles'] .= \"<link rel='stylesheet' type='text/css' href='\".getResource('js/ios-switch/switchery.css').\"' />\";\n $this->data['page_level_scripts'] .= \"<script src='\".getResource('js/ios-switch/switchery.js').\"'></script>\";\n $this->data['page_level_scripts'] .= \"<script src='\".getResource('js/ios-switch/ios-init.js').\"'></script>\";\n $today = date('d-m-Y');\n $this->db->order_by('t_materials.datecreated DESC');\n $this->db->select('t_materials.*,t_material_categories.material_category_name as category_name');\n $this->db->where('material_category_id',$categoryid);\n $this->db->where(\"'$today' <= t_materials.material_expiry_date\");\n $this->db->join('t_material_categories','t_material_categories.uniqueid = t_materials.material_category_id','left');\n $this->data['existing_materials'] = $this->Materials_model->get();\n $this->data['subview'] = 'Account/Materials/View_materials_category_page';\n $this->load->view('Account/_layout_main',$this->data);\n }", "public function paramsAction() {\n\n$product_collection = Mage::getModel('catalog/category')->load(3)->getProductCollection();\n\n// Now let's loop through the product collection and print the ID of every product \nforeach($product_collection as $product) {\n // Get the product ID\n\n$product_id = $product->getId();\n\n // Load the full product model based on the product ID\n\n$full_product = Mage::getModel('catalog/product')->load($product_id);\n\n // Now that we loaded the full product model, let's access all of it's data\n\n // Let's get the Product Name\n\n $product_name = $full_product->getName();\n\n // Let's get the Product URL path\n\n $product_url = $full_product->getProductUrl();\n\n // Let's get the Product Image URL\n\n $product_image_url = $full_product->getImageUrl();\n\n // Let's print the product information we gathered and continue onto the next one\n\n echo $product_name;\n\n echo $product_image_url;\n}\n }", "public function category()\n\t{\n\t\t$crud = $this->generate_crud('blog_categories');\n\t\t$crud->columns('title');\n\t\t$this->mPageTitle = 'Blog Categories';\n\t\t$this->mViewData['crud_note'] = modules::run('adminlte/widget/btn', 'Sort Order', 'blog/category_sortable');\n\t\t$this->render_crud();\n\t}", "public function brandcategoriespost()\n\t\t{\n\t\t\t$logger = Logger::getLogger(__CLASS__);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$taskCode = \"brandcategories\";\n\t\t\t\t$this->LogAccess($taskCode);\n\t\t\t\t$authResult = $this->Authorize($taskCode);\n\t\t\t\tif ($authResult == \"LOGIN\")\n\t\t\t\t{\n\t\t\t\t\treturn $this->view->outputJson(Constants::$LOGIN, \"\", \"\");\n\t\t\t\t}\n\t\t\t\t$commandObject = new CommandObject();\n\t\t\t\t$commandObject->setParameter(\"Name\", $_POST[\"brandcategories_txtName\"]);\n\t\t\t\t$commandObject->setParameter(\"SortExpression\", $_POST[\"brandcategories_hdnSortExpression\"]);\n\t\t\t\t$commandObject->setParameter(\"SortDirection\", $_POST[\"brandcategories_hdnSortDirection\"]);\n\t\t\t\t$commandObject->setParameter(\"PageSize\", $_POST[\"brandcategories_txtPageSize\"]);\n\t\t\t\t$commandObject->setParameter(\"PageIndex\", $_POST[\"brandcategories_hdnPageIndex\"]);\n\t\t\t\t$commandObjectRequest = new CommandObject();\n\t\t\t\t$commandObjectRequest->DeSerialize(RequestStateHelper::GetRequestState(\"CommandObject\", $_POST[\"rstate\"]));\n\t\t\t\tif ($this->IsCommandObjectDirty($commandObjectRequest, $commandObject))\n\t\t\t\t{\n\t\t\t\t\t$commandObject->setParameter(\"PageIndex\", \"0\");\n\t\t\t\t}\n\t\t\t\t$brandCategoryBO = new BrandCategoryBO($this->_UserInfo);\n\t\t\t\t$paginatedList = $brandCategoryBO->SearchBrandCategory($commandObject->getParameter(\"Name\"), $commandObject->getParameter(\"SortExpression\"), $commandObject->getParameter(\"SortDirection\"),$commandObject->getParameter(\"PageSize\"),$commandObject->getParameter(\"PageIndex\"));\n\t\t\t\t$paginatedList->SetRequestState(\"ContextName\", \"brandcategories\");\n\t\t\t\t$paginatedList->SetRequestState(\"ModalIndex\", \"3\");\n\t\t\t\t$paginatedList->setRequestStateDictionary(RequestStateHelper::SetRequestState(\"CommandObject\", $commandObject->Serialize(), $paginatedList->getRequestStateDictionary()));\n\t\t\t\t$paginatedList->SetRequestState(\"UpdateTarget\", \"brandcategory/Updatebrandcategorie\");\n\t\t\t\t$this->model = $paginatedList;\n\t\t\t\tob_start();\n\t\t\t\tinclude('views/brandcategory/_brandcategoryselectioncontrol.php');\n\t\t\t\t$output = ob_get_contents();\n\t\t\t\tob_end_clean();\n\t\t\t\treturn $this->view->outputJson(Constants::$OK, $output, \"\");\n\t\t\t}\n\t\t\tcatch (Exception $ex)\n\t\t\t{\n\t\t\t\t$logger->error($ex->getMessage());\n\t\t\t}\n\t\t}", "public function ajax_get_category()\n {\n $cat_id = ee()->input->get('cat_id');\n $group_id = ee()->input->get('group_id');\n $status = ee()->input->get('publisher_view_status') ? ee()->input->get('publisher_view_status') : PUBLISHER_STATUS_OPEN;\n\n $data = array(\n 'cat_id' => $cat_id,\n 'status' => $status\n );\n\n $vars = ee()->publisher_helper->get_toolbar_options('category', $data, FALSE);\n\n $vars['cat_id'] = $cat_id;\n $vars['group_id'] = $group_id;\n $vars['data'] = ee()->publisher_category->get_translations($cat_id, $group_id, $status);\n $vars['save_url'] = ee()->publisher_helper_cp->mod_link('ajax_save_category', array(), TRUE);\n $vars['custom_fields'] = ee()->publisher_category->get_custom_fields($group_id);\n\n // Load core lang file so views are translated\n ee()->lang->loadfile('content');\n\n if (ee()->input->get('publisher_view_status'))\n {\n $data = ee()->load->view('category/edit_form', $vars, TRUE);\n }\n else\n {\n $data = ee()->load->view('category/edit', $vars, TRUE);\n }\n\n ee()->publisher_helper->send_ajax_response($data);\n }", "function editAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\t\n\t\t$redirectUrl = $this->getRedirectUrl();\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t$error \t\t= array();\n\t\t\t$success \t= array();\n\t\t\t$contents \t= '';\n\t\t\t$formData \t= array();\n\t\t\t //Truyen du lieu hien co vao form\n\t\t\t$formData['fbulkid'] = array();\n\t\t\t$formData['fid'] = $myProductCat->id;\n\t\t\t$formData['fname'] = $myProductCat->name;\n\t\t\t$formData['forder'] = $myProductCat->order;\n\t\t\t$formData['fparentid'] = $myProductCat->parentid;\n\t\t\t$formData['fenable'] = $myProductCat->enable;\n\t\t\t$formData['fseourl'] = $myProductCat->seoUrl;\n\t\t\t$formData['fseotitle'] = $myProductCat->seoTitle;\n\t\t\t$formData['fseokeyword'] = $myProductCat->seoKeyword;\n\t\t\t$formData['fseodescription'] = $myProductCat->seoDescription;\n\t\t\t\n\t\t\tif(!empty($_POST['fsubmit']))//truong hop da nhan nut submit\n\t\t\t{\n if($_SESSION['productcategoryEditToken']==$_POST['ftoken'])//kiem tra token\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->editActionValidator($formData, $error))//kiem tra du lieu co hop le hay khong\n {\n //Cac thong tin khong ngon ngu:\n $myProductCat->order = (int)$formData['forder'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname']), true);\n //Cac thong tin lien quan ngon ngu: \n $myProductCat->name = $formData['fname']; \n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n \n if($myProductCat->updateData())//cap nhat database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succUpdate']);\n $this->registry->me->writelog('ProductCategoryedit', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n }\n else\n {\n $error[] = $this->registry->lang['controller']['errUpdate']; \n }\n }\n }\n $_SESSION['productcategoryEditToken'] = Helper::getSecurityToken();//Tao token moi\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t\t\t$this->registry->smarty->assign(array(\t'formData' \t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'subcategories' => $myProductCat->getSub(true),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'=> $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'success'\t=> $success,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'edit.tpl');\n\t\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategorylist',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_edit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t\t$this->registry->smarty->assign(array('redirect' => $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t}\n\t}", "public function categorylist($c){\n $this->cat_id = $c; \n }", "function displayCategory($catid)\n\t{\n\t\t$sql = \"SELECT category_id,category_name FROM category_table where category_parent_id=0\";\n\t\t\n\t\t$query = new Bin_Query();\n\t\t\n\t\t$query->executeQuery($sql);\n\n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql1='select * from products_table where product_id='.$id;\t\t\n\t\t\t$obj1=new Bin_Query();\t\t\t\n\t\t\t$obj1->executeQuery($sql1);\t\t\t\t\t\t\n\t\t\t$category=$obj1->records[0]['category_id'];\n\t\t\t\n\t\t\n\t \t}\n\t\t\n\t\treturn Display_DManageProducts::displayCategory($query->records,$category);\t\n\t}", "public function category()\n\t{\n\t\t$data['catResult'] = $this->ProcurementModel->category();\n\t\t$data['pagename'] = \"category\";\n\t\t$data['category'] = \"master\";\n\t\t$data['active_menu'] = \"procurement\";\n\t\t$this->load->view('Director',$data);\n\n\t}", "public function show_rekapkat(){\n // load library to cek user session and level\n $this->pageauth->sess_auth();\n $this->load->model('pages/m_crud_forecast');\n $query = $this->m_crud_forecast->select_cat();\n echo \"<option>- PILIH -</option>\";\n foreach ($query->result() as $row){\n echo \"<option value='$row->cat_code'>\" . $row->cat_desc . \"</option>\";\n }\n }", "function getProd(){\n\tif(!isset($_GET['category'])){ //category wise product show korbe\n\n\t\tif(!isset($_GET['type'])){ //type wise product show korar jonno \n\n\tglobal $con;\n\t$get_pro = \"select * from products order by RAND() LIMIT 0,8\";\n\n\t$run_pro = mysqli_query($con, $get_pro);\n\n\twhile($row_pro = mysqli_fetch_array($run_pro)){\n\t\t$pro_id=$row_pro['product_id'];\n\t\t$pro_title=$row_pro['product_title'];\n\t\t$pro_category=$row_pro['product_category'];\n\t\t$pro_price=$row_pro['product_price'];\n\t\t$pro_image=$row_pro['product_image'];\n\t\t\n\t\t//'?pro_id=$pro_id' =this is used for passing the id of the product to the next page\n\t\techo\"\n\t\t<div id='single_product'>\n\t\t<h3>$pro_title</h3>\n\t\t\n\t\t\n\t\t<br>\n\t\t<a href='details.php?pro_id=$pro_id'> \n\t\t\t\t\t\t\t\t\t\t\t\t<img src='admin_area/product_images/$pro_image' width='200' height='200'/></a> \n\n\n<br>\n\t\t<p><i>TK: $pro_price</i></p>\n\n\n\t\t<button style='background-color: #4CAF50; /* Green */\n border: none;\n color: white;\n padding: 5px 3px;\n float:center;\n text-align: center;\n text-decoration: none;\n display: inline-block;\n margin: 5px 2px;\n cursor: pointer;'>Available</button>\n\t\t</div>\n\t\t\";\n\t}\n}\n}}", "public function index(){\n $category=$this->input->get(\"category\");\n $content[\"categories\"] = $this->AuctionCategories->getAllCategories();\n if($category==NULL){\n $content[\"AllAuctions\"]=$this->Auction->getActiveAuctions();\n }else{\n $content[\"AllAuctions\"]=$this->Auction->getAuctionByCategoryName($category);\n \n \n }\n $content[\"selected\"]=$category;\n $this->loadPageLayout(\"pages/Shop.php\",$content);\n }", "public function shipment_category_new_func($category,$subcategory=null)\n\n\t{\n\n\n\n\t\t$data['related_company']=$this->shipping->select_data('shipping_related_website');\n\n\t\t$data['equipment_category']=$this->shipping->select_data('equipment_category');\n\n\t\t$data['truck_trailer']=$this->shipping->select_data('shipping_truck_trailer');\n\n\t\t$data['category_id']=$category;\n\n\t\t$data['subcategory_id']=$subcategory;\n\n\t\t$this->load->view('shipment/shipment-category-new',$data);\n\n\t}", "function biller_category() {\n\t\t$records = $this -> conn -> get_table_row_byidvalue('biller_category', 'biller_category_status', 1);\n\t\tif (!empty($records)) {\n\t\t\tforeach ($records as $v) {\n\t\t\t\t$biller_category_id = $v['biller_category_id'];\n\t\t\t\t$biller_category_name = $v['biller_category_name'];\n\t\t\t\t// frnd mobile number\n\t\t\t\t$biller_category_logo = biller_category_logo . $v['biller_category_logo'];\n\t\t\t\t$posts[] = array('biller_category_id' => $biller_category_id, \"biller_category_name\" => $biller_category_name, 'biller_category_logo' => $biller_category_logo);\n\t\t\t}\n\t\t\t$post = array('status' => 'true', 'biller_category' => $posts);\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Coming soon\");\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function productByCategory($id)\n {\n \t\n }", "public function index(){\n\n\t\t$data['category'] = $this->get_category();\n\t\tview_loader($data,'seller/add_product');\n\t}", "public function productDetailsAction()\n {\n $vars['productId'] = $this->route['id'];\n $vars['product'] = $this->model->getById($vars['productId']);\n $vars['colors'] = $this->model->getAvailableColors($vars['productId']);\n $this->view->render('Riding Gear', $vars);\n }", "public function view_product(){\r\n\t\tif ($this->checkLogin('A') == ''){\r\n\t\t\tredirect('admin');\r\n\t\t}else {\r\n\t\t\t$this->data['heading'] = 'View Product';\r\n\t\t\t$product_id = $this->uri->segment(4,0);\r\n\t\t\t$condition = array('id' => $product_id);\r\n\t\t\t$this->data['product_details'] = $this->product_model->get_all_details(PRODUCT,$condition);\r\n\t\t\tif ($this->data['product_details']->num_rows() == 1){\r\n\t\t\t\t$this->data['catList'] = $this->product_model->get_cat_list($this->data['product_details']->row()->category_id);\r\n\t\t\t\t$this->load->view('admin/product/view_product',$this->data);\r\n\t\t\t}else {\r\n\t\t\t\tredirect('admin');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function showCategory()\n\t {\n\t\t\n\t\t $res=mysql_query(\"select * from category\");\n\t\t while($data=mysql_fetch_array($res))\n\t\t {\n\t\t\t\n\t\t\techo '<option value=\"'.$data['cat_id'].'\">'.$data['cat_title'].'</option>';\n\t\t }\n\t\t \n\t }", "function kategoriberita(){\n\t\tcek_session_admin();\n\t\t$data['record'] = $this->model_berita->kategori_berita();\n\t\t$this->load->view('administrator/mod_kategori/view_kategori2',$data);\n\t}", "function getProducts(){\n\n\t\n\tif(!isset($_GET['cat'])){\n\t\tif(!isset($_GET['brand'])){\n\n\n\tglobal $con;\n\n\t$get_product = \"select * from products order by RAND() LIMIT 0,6\";\n\t$run_product = mysqli_query($con, $get_product);\n\n\twhile($row_pro=mysqli_fetch_array($run_product)){\n\t\t//make an array\n\t\t$id = $row_pro['product_id'];\n\t\t$category = $row_pro['product_category'];\n\t\t$brand = $row_pro['product_brand'];\n\t\t$title = $row_pro['product_title'];\n\t\t$price = $row_pro['product_price'];\n\t\t$image = $row_pro['product_image'];\n\n\t\techo \"\n\n\t\t\t<div id = 'singleprod'>\n\n\t\t\t\t<h2>$title</h2>\n\t\t\t\t\n\t\t\t\t<img src='Admin/product_images/$image' width='200' height='200' />\n\n\t\t\t\t<p><b> Ksh $price</b></p>\n\n\t\t\t\t<a href = 'details.php?product_id=$id' style='float:left'>Details</a>\n\t\t\t\t\n\t\t\t\t<a href = 'index.php?add_cart=$id'><button style='float:right'>Add to cart</button></a>\n\n\n\t\t\t</div>\n\n\n\t\t\";\n//pass a variable to display the details...that is url/get variable 'details.php\n\n\n\n\t}\n}\n}\n}", "public function bikecateraseAction(){\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_selBikeCat.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_cntBikeCat.php');\n\t\t\n\t\t$p = $this -> getRequest() -> getParams();\n\t\t$lang = $this -> lang;\n\t\t\n\t\t$bikeCatID = null;\n\t\tif (isset($p['bcid'])){\n\t\t\t$bikeCatID = $p['bcid'];\n\t\t}\n\t\t\n\t\tif ($bikeCatID != null){\n\t\t\t\t\n\t\t\t//erase bike cat completely\n\t\t\tif (isset($p['bikeCatErase2'])){\n\t\t\t\t$p['bikeCatID'] = $bikeCatID;\n\t\t\t\t$this -> erasebikecatAction($p);\n\t\t\t}\n\t\t\t\t\n\t\t\t$bikeCat = db_selBikeCat(array('bikeCatID'=>$bikeCatID));\n\t\t\tif (($bikeCat != false) && is_array($bikeCat) && (count($bikeCat) > 0)){\n\t\t\t\t$bikeCat = $bikeCat[0];\n\t\t\t\t\n\t\t\t\t//select all bike advertisment which reference to this bike cat\n\t\t\t\t$cntBikeCat = db_cntBikeCat(array('bikeCat'=>$bikeCat['bikeCatID']\n\t\t\t\t\t\t\t\t\t\t\t\t//, 'p' => true\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif ($cntBikeCat != false){\n\t\t\t\t\t$cntBikeCat = $cntBikeCat[0];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this -> view -> bikeCat = $bikeCat;\n\t\t\t\t$this -> view -> cntBikeCat = $cntBikeCat;\n\t\t\t}else{\n\t\t\t\t$this -> view -> error = $lang['AERR_36'];\n\t\t\t\t$this -> _forward('bikecat');\n\t\t\t}\n\t\t}else{\t\t\t\n\t\t\t$this -> view -> error = $lang['AERR_36'];\n\t\t\t$this -> _forward('bikecat');\n\t\t}\n\t}", "public function couponlistcategory(Request $request, $category, $page=0 )\n\t{\n\t\t$data['show'] = true;\n\t\t// dd($category);\n\t\tif ($request->has('show')) \n\t\t{ \n\t\t\t$data['show'] = false;\t\t\t\t\t\n\t\t}\n\n\t\tif(!empty($request->input('type')) && $request->input('type') != \"all\" )\n\t\t{\n\t\t\t$data['type'] = urldecode($request->input('type'));\n\t\t}\n\n\t\tif(!empty($category ))\n\t\t{\n\t\t\t$category = explode(\"-coupons.html\", $category )[0];\n\t\t\t$data['category'] = helper::decode_url( $category );\n\t\t\t// dd($data);\n\t\t}\n\t\t\n\t\tif(!empty($request->input('vendor_name')))\n\t\t{\n\t\t\t$vendor_name = str_replace(\"-\", \" \", $request->input('vendor_name') );\n\n\t\t\tif(is_array($vendor_name))\n\t\t\t{\n\t\t\t\t$data['vendor_name'] = implode(\",\",$vendor_name);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['vendor_name'] = $vendor_name;\n\t\t\t}\t\t\n\t\t}\n\t\t$token \t\t= $request->session()->get('_token');\n\t\t$session_id = preg_replace(\"/[^0-9,.]/\", '', $token );\n\n\t\tif( !empty( $session_id ) && is_numeric( $session_id ) )\n\t\t{\n\t\t\t$data['session_id'] = $session_id;\n\t\t}\n\n\t\t$data['rows'] \t\t\t= 30;\n $data['page'] \t\t\t= $page;\n\t\t$data['from'] \t\t\t= ( $data['page'] * $data['rows'] );\n\t\t$data['term'] \t\t = json_encode($data);\n\t\t// dd($data);\n\t\t$searchAPI \t\t\t\t= composer_url( 'deals.php' );\n\t\t$result\t\t\t \t\t= file_get_contents($searchAPI.'?query='.urlencode($data['term'])); \t\n \t\n \t// Category Meta Description..\n \t$meta = @file_get_contents(\"cat_meta.json\");\n\t\tif( $meta )\n\t\t{\n\t\t\t$meta = json_decode( $meta );\n\t\t\tif( isset( $meta->{$data['category']}) )\n\t\t\t{\n\t\t\t\t$data['catmeta'] = $meta->{$data['category']};\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['catmeta'] = \"\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['catmeta'] = \"\";\n\t\t}\n\n\t\tif(empty($result))\n\t\t{\n\t\t\techo \"Server Down\";exit;abort(404);\n\t\t}\n\n\t\t$result \t\t\t\t= json_decode($result)->return_txt;\n\t\t// dd($result);\n\t\t$data['product'] \t\t= $result->hits->hits;\n\t\t$data['product_count']\t= $result->hits->total;\n\t\t$facets \t\t\t\t= $result->aggregations;\n\t\t// $facet['left']['cats']\t= $facets->category->buckets;\n\t\t$facet['left']['vendors']= $facets->vendor_name->buckets;\n\t\t$data['facet'] = $facet;\n\t\t$data['ajax'] \t\t\t= $request->input('ajax');\n // dd($data);\n\n\t\t//Ajax filter and json response..\n if( $request->input('ajax') == \"true\" )\n {\n \t$json['coupons'] \t= (string)view('v1.coupon_listing',$data);\n\t\t\t$json['coupons'] \t= preg_replace( '/(\\v)+/', '', $json['coupons'] );\n\t\t\t$json['coupons'] \t= str_replace(\"\\t\", \"\", $json['coupons']);\n\t\t\t$json['total'] \t\t= $data['product_count'];\n\t\t\t$json['facet'] \t\t= $facets->category->buckets;\n\t\t\t$json['vendors']\t= $facets->vendor_name->buckets;\n\t\t\techo json_encode( $json );exit;\n }\n else\n {\n \treturn view('v1.coupon_listing',$data);\n }\n\t}", "function getPro()\r\n{\r\n global $db;\r\n if(!isset($_GET['cat']))\r\n {\r\n if(!isset($_GET['brand']))\r\n { \r\n\r\n $get_products =\"select * from products order by product_id desc\";\r\n $run_products =mysqli_query($db, $get_products);\r\n while ($row_products=mysqli_fetch_array($run_products))\r\n {\r\n $pro_id=$row_products['product_id'];\r\n $pro_title=$row_products['product_title'];\r\n $pro_cat=$row_products['cat_id'];\r\n $pro_brand=$row_products['brand_id'];\r\n $pro_desc=$row_products['product_desc'];\r\n $pro_price=$row_products['product_price'];\r\n $pro_image=$row_products['product_img1'];\r\n \r\n echo \"\r\n \r\n <a href='details.php?pro_id=$pro_id' style='text-decoration:none;color:black;'><div class='card_pro'>\r\n <img src='admin_area/product_images/$pro_image' height='220px;'>\r\n <div class='card_pro-text'><b>$pro_title</b><br>\r\n <div class='pro_desc'>$pro_desc</div>\r\n <div class='sub-heading1'><b>Rs.$pro_price</b></div>\r\n <div>\r\n <a href='index1.php?add_cart=$pro_id'><button class='add_cart_button button1'></i>ADD TO CART</button></a>\r\n </div>\r\n \r\n </div>\r\n <div class='clear-containers'></div>\r\n </div>\r\n </a>\r\n \";\r\n \r\n }\r\n\r\n }\r\n\r\n }\r\n}", "function getCategoryDataAction()\n {\n $siteId = $this->request->categoryId;\n $site = $this->category->findByPk($siteId);\n $this->set($site->toArray());\n $this->viewClass = \"JsonView\";\n }", "function listCat()\n {\n session(['action' => 'listCat']);\n $list_cats = Product_cat::select('id', 'name', 'slug', 'created_at', 'parent_id')->get();\n $result = $this->data_tree($list_cats, 0, 0);\n\n //Duyệt từng ptu mảng $result\n foreach ($result as $k => $v) {\n //gán số lượng của tên danh mục = đếm số bản ghi có post_cat_id là id của danh mục\n $count_post[$v['name']] = Product::where('product_cat_id', $v['id'])->count();\n }\n return view('admin.product.cat', compact('result', 'list_cats', 'count_post'));\n }", "public function swc_homepage_product_categories_view_more() {\n\t\t$url = get_theme_mod( 'swc_homepage_category_more_url', '' );\n\n\t\tif ( '' != $url ) {\n\t\t\techo '<p class=\"clearfix view-more\"><a href=\"' . esc_url( $url ) . '\" class=\"button alt alignright\">' . __( 'View more product categories', 'storefront-woocommerce-customiser' ) . '</a></p>';\n\t\t}\n\t}", "function getCatPro() {\n\n if(isset($_GET['cat'])){\n\n\n\n $cat_id = $_GET['cat'];\n\n\n global $con;\n\n $run_cat_pro = mysqli_query($con,\"SELECT * FROM products WHERE product_cat = '$cat_id'\");\n\n\n\n $count_cats = mysqli_num_rows($run_cat_pro);\n\n if($count_cats == 0) {\n\n echo \"<div class='no-cat'>\n\n <h1> We're sorry! There are currently no products with that category. :(</h1>\n\n </div>\";\n } else {\n\n while($row_cat_pro = mysqli_fetch_array($run_cat_pro)) {\n\n $pro_id = $row_cat_pro['product_id'];\n $pro_cat = $row_cat_pro['product_cat'];\n $pro_brand = $row_cat_pro['product_brand'];\n $pro_title = $row_cat_pro['product_title'];\n $pro_price = $row_cat_pro['product_price'];\n $pro_image = $row_cat_pro['product_image'];\n\n echo \"\n <div class='single-product cf'>\n\n <h4><a href='#'>$pro_title</a></h4>\n <a href='details.php?pro_id=$pro_id'><img src='admin/product_images/$pro_image' /></a>\n <p>\n Price: $ $pro_price\n </p>\n\n <a href='index.php?add_cart=$pro_id'><button>Add To Cart</button></a>\n </div>\n\n \";\n\n }\n }\n }\n }", "public function categoryCard(){\n $table = \"category\";\n $results = $this->getSixrecords($table);\n foreach($results as $sbtable){\n \n echo('<div class=\"col-sm-6 col-md-4 mb-4 mb-lg-0 col-lg-2\">'.\n '<a href=\"http://localhost/drive/category.php?category='.$sbtable[\"category_id\"].'\" class=\"popular-category h-100\">'.\n '<span class=\"caption mb-2 d-block\">'.$sbtable[\"category_name\"].'</span>'.\n '</a>'.\n '</div>');\n }\n}", "function dokan_store_category_menu( $seller_id, $title = '' ) { ?>\n <aside class=\"widget dokan-category-menu\">\n <h3 class=\"widget-title\"><?php echo $title; ?></h3>\n <div id=\"cat-drop-stack\">\n <?php\n global $wpdb;\n\n $categories = get_transient( 'dokan-store-category-'.$seller_id );\n\n if ( false === $categories ) {\n $sql = \"SELECT t.term_id,t.name, tt.parent FROM $wpdb->terms as t\n LEFT JOIN $wpdb->term_taxonomy as tt on t.term_id = tt.term_id\n LEFT JOIN $wpdb->term_relationships AS tr on tt.term_taxonomy_id = tr.term_taxonomy_id\n LEFT JOIN $wpdb->posts AS p on tr.object_id = p.ID\n WHERE tt.taxonomy = 'product_cat'\n AND p.post_type = 'product'\n AND p.post_status = 'publish'\n AND p.post_author = $seller_id GROUP BY t.term_id\";\n\n $categories = $wpdb->get_results( $sql );\n set_transient( 'dokan-store-category-'.$seller_id , $categories );\n }\n\n $args = array(\n 'taxonomy' => 'product_cat',\n 'selected_cats' => ''\n );\n\n $walker = new Dokan_Store_Category_Walker( $seller_id );\n echo \"<ul>\";\n echo call_user_func_array( array(&$walker, 'walk'), array($categories, 0, array()) );\n echo \"</ul>\";\n ?>\n </div>\n </aside>\n<?php\n}", "function dataSubCategory( $parentcategory, $gcntyn=false ){\n\n\tglobal $db, $sess;\n\n\t$arrfileurl = explode('/',$_SERVER['SCRIPT_FILENAME']);\n\tif(in_array(\"m\", $arrfileurl) || in_array(\"m2\", $arrfileurl)){\n\t\t$hidden = \"hidden_mobile=0\";\n\t} else {\n\t\t$hidden = \"hidden=0\";\n\t}\n\t# 카테고리 정보\n\tfor ($i=0;$i<2;$i++){\n\t\t$length = strlen($parentcategory) + 3;\n\t\t$query = \"\n\t\tselect\n\t\t\tcategory,catnm,sort,level,level_auth\n\t\tfrom\n\t\t\t\".GD_CATEGORY.\"\n\t\twhere\n\t\t\tcategory like '$parentcategory%'\n\t\t\tand length(category)=$length\n\t\t\";\n\t\tif ($GLOBALS[ici_admin] === false) $query .= \"and \".$hidden;\n\t\t$res = $db->query($query);\n\n\t\tif ($db->count_($res)) break;\n\t\telse if ($length>6) $parentcategory = substr($parentcategory,0,-3);\n\t}\n\n\t// 상품 개수 추출 및 상품분류 연결방식 전환 여부에 따른 처리\n\tif ( $gcntyn == true && _CATEGORY_NEW_METHOD_ === false ){\n\t\tif ($GLOBALS[ici_admin] === false) $where[] = \"a.\".$hidden;\n\t\t$where[] = \"a.category like '$parentcategory%'\";\n\t\t$where[] = \"open\";\n\t\tif ($GLOBALS['tpl']->var_['']['connInterpark']) $where[] = \"b.inpk_prdno!=''\";\n\n\t\t$query = \"\n\t\tselect\n\t\t\tleft(category,$length),count(distinct a.goodsno)\n\t\tfrom\n\t\t\t\".GD_GOODS_LINK.\" a,\n\t\t\t\".GD_GOODS.\" b\n\t\twhere\n\t\t\ta.goodsno = b.goodsno\n\t\t\tand \".implode(\" and \", $where).\"\n\t\tgroup by left(category,$length)\n\t\t\";\n\t\t$res2 = $db->query($query);\n\t\twhile ($data2=$db->fetch($res2)) $gcnt[$data2[0]] = $data2[1];\n\t}\n\n\t### 데이타 조작\n\t$i = 0;\n\twhile ($data=$db->fetch($res)){\n\t\t// 상품 개수 추출 및 상품분류 연결방식 전환 여부에 따른 처리\n\t\tif ($gcntyn == true && _CATEGORY_NEW_METHOD_ === true) {\n\t\t\t$where\t= array();\n\t\t\tif ($GLOBALS[ici_admin] === false) $where[] = \"gl.hidden=0\";\n\t\t\t$where[] = \"gl.category = '\".$data['category'].\"'\";\n\t\t\t$where[] = \"g.open = '1'\";\n\t\t\tif ($GLOBALS['tpl']->var_['']['connInterpark']) $where[] = \"g.inpk_prdno!=''\";\n\n\t\t\t$query = \"\n\t\t\tSELECT\n\t\t\t\tCOUNT(g.goodsno) as cnt\n\t\t\tFROM\n\t\t\t\t\".GD_GOODS.\" g\n\t\t\tINNER JOIN\n\t\t\t\t\".GD_GOODS_LINK.\" gl ON g.goodsno = gl.goodsno\n\t\t\tWHERE\n\t\t\t\t\".implode(\" AND \", $where).\"\n\t\t\t\";\n\n\t\t\t$res2 = $db->query($query);\n\t\t\twhile ($data2=$db->fetch($res2, 1)) $gcnt[$data['category']] = $data2['cnt'];\n\t\t}\n\n\t\t$member_auth = false;\n\t\tif($data['level']){//권한 설정되어 있는지 체크\n\t\t\tswitch($data['level_auth']){//권한체크\n\t\t\t\tcase '1': //모두숨김\n\t\t\t\t\tif( (!$sess['level'] ? 0 : $sess['level']) >= $data['level'] ) $member_auth = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: $member_auth = true; break;\n\t\t\t}\n\t\t}\n\t\telse $member_auth = true;\n\n\t\tif($member_auth){\n\t\t\t$data['gcnt'] = $gcnt[ $data['category'] ];\n\t\t\t$cate[$data[sort]][] = $data;\n\t\t}\n\t}\n\n\t### 배열 순서 재정의\n\tif ($cate) $cate = resort($cate);\n\n\treturn $cate;\n}", "function browse_main()\n {\n $db = DataAccess::getInstance();\n if (!$this->seller_configuration_data) {\n if (!$this->get_seller_configuration_data()) {\n return false;\n }\n }\n\n $sql = \"select * from \" . $this->categories_table . \" where parent_id = 0 order by display_order,category_name\";\n $result = $this->db->Execute($sql);\n //echo $sql.\"<br>\\n\";\n if (!$result) {\n //$this->body .=$sql.\" is the query<br>\\n\";\n $this->error_message = \"<span class=\\\"error_message\\\">\" . $this->messages[10364] . \"</span>\";\n return false;\n } elseif ($result->RecordCount() > 0) {\n $this->body .= \"<table cellpadding=3 cellspacing=1 border=0 width=100% valign=top>\\n\\t\";\n $this->body .= \"<tr>\\n\\t<td valign=top class=\\\"back_to_normal_browsing\\\">\n\t\t\t\t<a href=\" . $this->configuration_data['classifieds_url'] . \"?a=5&b=\" . $this->site_category . \" class=\\\"back_to_normal_browsing\\\">\";\n $this->body .= $this->messages[10001] . \"</a></td>\\n<tr>\\n\";\n\n switch ($this->seller_configuration_data->MODULE_NUMBER_OF_COLUMNS) {\n case 1:\n $column_width = \"100%\";\n break;\n case 2:\n $column_width = \"50%\";\n break;\n case 3:\n $column_width = \"33%\";\n break;\n case 4:\n $column_width = \"25%\";\n break;\n case 5:\n $column_width = \"20%\";\n break;\n } //end of switch\n $column_width = floor(100 / $this->seller_configuration_data->MODULE_NUMBER_OF_COLUMNS) . '%';\n while ($row = $result->FetchRow()) {\n $categories [$row['category_name']] ['category_id'] = $row['category_id'];\n $categories [$row['category_name']] ['category_image'] = $row['category_image'];\n $categories [$row['category_name']] ['category_count'] = $row['category_count'];\n $categories [$row['category_name']] ['auction_category_count'] = $row['auction_category_count'];\n $categories [$row['category_name']] ['category_name'] = $row['category_name'];\n $categories [$row['category_name']] ['category_description'] = $row['description'];\n if (isset($sub_categories[$row['category_name']] ['sub_categories'])) {\n $categories[$row['category_name']] ['sub_categories'] = $sub_categories [$row['category_name']] ['sub_categories'];\n } else {\n $categories [$row['category_name']] ['sub_categories'] = 'na';\n }\n }\n\n $category_count = 0;\n if ($this->seller_configuration_data->ALPHA_ACROSS_COLUMNS) {\n foreach ($categories as $show_category) {\n if (! ($category_count % $this->seller_configuration_data->MODULE_NUMBER_OF_COLUMNS)) {\n $this->body .= \"<tr>\\n\\t\";\n }\n\n //display the sub categories of this category\n $this->body .= \"<td valign=top width=\" . $column_width . \"><a href=\" . $this->configuration_data['classifieds_file_name'] . \"?a=25&b=\" . $show_category['category_id'] . \"&c=\" . $browse_type . \">\";\n if ((strlen(trim($show_category['category_image'])) > 0) && ($this->seller_configuration_data->DISPLAY_CATEGORY_IMAGE)) {\n $this->body .= \"<img src=\\\"\" . geoTemplate::getUrl('', $show_category['category_image']) . \"\\\" hspace=2 vspace=0 border=0 align=left>\";\n }\n\n $this->body .= \"<span class=\\\"browsing_subcategory_name\\\">\" . $show_category['category_name'] . \"</span>\";\n if ($this->seller_configuration_data->DISPLAY_CATEGORY_COUNT) {\n $this->body .= \"<span class=\\\"browsing_subcategory_count\\\">(\" . $this->get_seller_category_count($db, $show_category['category_id']) . \")</span>\";\n }\n if ($this->seller_configuration_data->DISPLAY_CATEGORY_DESCRIPTION) {\n $this->body .= \"</a><br><span class=\\\"browsing_subcategory_description\\\">\" . $show_category['category_description'] . \"</span>\";\n }\n $this->body .= \"</td>\";\n\n $category_count++;\n if (! ($category_count % $this->seller_configuration_data->MODULE_NUMBER_OF_COLUMNS)) {\n $this->body .= \"</tr>\";\n }\n }\n } else {\n // Data variables\n $total = count($categories);\n $num_cols = $this->seller_configuration_data->MODULE_NUMBER_OF_COLUMNS;\n $categories_x = array_values($categories); // convert associative to numeric array\n // computational variables\n $num_rows = ceil($total / ($num_cols)); // get the number of items per column (max)\n\n $cats = array();\n $current = 0;\n\n for ($x = 0; $x < $num_cols; $x++) { //go through each column\n for ($y = 0; $y < $num_rows; $y++,$current++) {\n if (($current) >= $total) {\n break (2);//done building\n }\n $cats[$y][$x] = $categories_x[$current];\n }\n }\n foreach ($cats as $col_num => $row) {\n $this->body .= \"<tr>\\n\\t\";\n foreach ($row as $row_num => $show_category) {\n $this->body .= \"<td valign=top width=\" . $column_width . \"><a href=\" . $this->configuration_data['classifieds_file_name'] . \"?a=25&b=\" . $show_category['category_id'] . \"&c=\" . $browse_type . \">\";\n if ((strlen(trim($show_category['category_image'])) > 0) && ($this->seller_configuration_data->DISPLAY_CATEGORY_IMAGE)) {\n $this->body .= \"<img src=\\\"\" . geoTemplate::getUrl('', $show_category['category_image']) . \"\\\" hspace=2 vspace=0 border=0 align=left>\";\n }\n $this->body .= \"<span class=\\\"browsing_subcategory_name\\\">\" . $show_category['category_name'] . \"</span>\";\n if ($this->seller_configuration_data->DISPLAY_CATEGORY_COUNT) {\n $this->body .= \"<span class=\\\"browsing_subcategory_count\\\">(\" . $this->get_seller_category_count($db, $show_category['category_id']) . \")</span>\";\n }\n if ($this->seller_configuration_data->DISPLAY_CATEGORY_DESCRIPTION) {\n $this->body .= \"</a><br><span class=\\\"browsing_subcategory_description\\\">\" . $show_category['category_description'] . \"</span>\";\n }\n $this->body .= \"</td>\";\n }\n $this->body .= \"</tr>\\n\\t\";\n }\n }\n $this->body .= \"</table>\\n\";\n return true;\n } else {\n $this->body .= \"<table cellpadding=5 cellspacing=1 border=0 valign=top>\\n\\t\";\n $this->body .= \"<tr class=\\\"no_categories_yet\\\">\\n\\t<td valign=top>\" . $this->messages[10371] . \"</td>\\n</tr>\\n\";\n $this->body .= \"</table>\\n\";\n return true;\n }\n }", "function getSideBarCategory(){\n // this function for get all categories exist in sidebar components\n try{\n global $con;\n // query select for get all categories\n $query = $con->prepare(\"SELECT * FROM categories\");\n $query->execute();\n // if we have cat_id then go inside condition\n if(isset($_GET['cat_id'])){\n if($_GET['cat_id'] == 'all'){\n echo \"\n <li class='active'><a href='ads.php?cat_id=all&page=1'>كل الأقسام</a></li>\n \";\n }\n else{\n echo \"\n <li class=''><a href='ads.php?cat_id=all&page=1'>كل الأقسام</a></li>\n \";\n }\n while($result = $query->fetch(PDO::FETCH_ASSOC)){\n // Initialize Variables\n $cat_id = $result[\"cat_id\"];\n $cat_title = $result[\"cat_title\"];\n if($_GET['cat_id'] == $cat_id){\n echo \"\n <li class='active'><a href='ads.php?cat_id=$cat_id&page=1'>$cat_title</a></li>\n \";\n }\n else{\n echo \"\n <li class=''><a href='ads.php?cat_id=$cat_id&page=1'>$cat_title</a></li>\n \";\n }\n }\n }\n else{\n echo \"\n <li class=''><a href='ads.php?cat_id=all&page=1'>كل الأقسام</a></li>\n \";\n while($result = $query->fetch(PDO::FETCH_ASSOC)){\n $cat_id = $result[\"cat_id\"];\n $cat_title = $result[\"cat_title\"];\n echo \"\n <li class=''><a href='ads.php?cat_id=$cat_id&page=1'>$cat_title</a></li>\n \";\n }\n }\n }\n catch(PDOException $e){\n echo $e->getMessage();\n }\n}", "function getIndexCategory(){\n // Get all categories to index.php\n try{\n global $con;\n // query select for get just 6 categories from categories table\n $query = $con->prepare(\"SELECT * FROM categories LIMIT 6\");\n $query->execute();\n while($result = $query->fetch(PDO::FETCH_ASSOC)){\n // Initialize Variables\n $cat_id = $result[\"cat_id\"];\n $cat_icon = $result[\"cat_icon\"];\n $cat_title = $result[\"cat_title\"];\n $cat_desc = $result[\"cat_desc\"];\n echo \"\n <div class='category-item col-md-6 col-lg-4'>\n <div class='content'>\n <div class='img-box'>\n <img src='Layout/Images/icons/$cat_icon' class='img-responsive' alt='$cat_icon'>\n </div>\n <div class='info'>\n <h4>$cat_title</h4>\n <p>$cat_desc</p>\n <a class='btn btn-primary' href='ads.php?cat_id=$cat_id&page=1'>عرض القسم</a>\n </div>\n </div>\n </div>\n \";\n }\n }\n catch(PDOException $e){\n echo $e->getMessage();\n }\n}", "function shophead_edit($category_id = \"\")\n {\n $this->layout = 'admin_layout';\n\n\t\tApp::import('Model', 'ProductCategory');\n\t\t$this -> ProductCategory = new ProductCategory();\n\t\t\n $id = base64_decode($category_id);\n // pr($id);\n $this->loadModel('ProductSubCategory');\n\t\t$this -> set('categories', $this -> ProductCategory -> find('list', array('fields' => array('ProductCategory.id', 'ProductCategory.name'), 'conditions' => array('ProductCategory.status' => 1,'ProductCategory.is_deleted'=>0))));\n $this->set('subcategories',$this->ProductSubCategory->find('list',array('fields'=>array('ProductSubCategory.id','ProductSubCategory.name'),'conditions'=>array('ProductSubCategory.status'=>1,'ProductSubCategory.is_deleted'=>0))));\n $data = $this->ProductItem->find('first', array('conditions' => array('ProductItem.id' => $id)));\n if (!empty($data)) {\n $sub_categories_list = $this->ProductSubCategory->find('list', array('conditions' => array('ProductSubCategory.id' => $data['ProductItem']['product_sub_category_id']), 'fields' => array('ProductSubCategory.id', 'ProductSubCategory.name')));\n $this->set('sub_categories_list', $sub_categories_list);\n if (!empty($this->request->data)) {\n $this->request->data = Sanitize::clean($this->request->data, array('encode' => false));\n $this->ProductItem->set($this->request->data); \n if ($this->request->data['ProductItem']['name'] == $data['ProductItem']['name']) {\n unset($this->request->data['ProductItem']['name']);\n }\n if ($this->ProductSubCategory->validates()) {\n if ($this->ProductItem->save($this->request->data)) {\n $this->Session->write('flash', array(EDIT_RECORD, 'success'));\n $this->redirect(array('controller' => 'ProductItems', 'action' => 'index'));\n } else {\n $this->Session->write('flash', array(FAILURE_MSG, 'failure'));\n $this->redirect(array('controller' => 'ProductItems', 'action' => 'index'));\n }\n }\n }\n $this->request->data = $data;\n } else {\n $this->redirect(array('controller' => 'ProductSubCategories', 'action' => 'index'));\n }\n }", "function get_lowcat($product_id)\n {\n \t\t $database =& JFactory::getDBO();\n \t\t //najde kategoriu druhej alebo mensej urovne viac menej nahodne\n \t\t $sql = \"SELECT #__vm_category.category_id FROM #__vm_product_category_xref, #__vm_category, #__vm_category_xref WHERE #__vm_category_xref.category_child_id=#__vm_product_category_xref.category_id AND #__vm_category.category_publish='Y' AND #__vm_category.category_id=#__vm_category_xref.category_child_id and #__vm_category_xref.category_parent_id <> 0 AND #__vm_product_category_xref.product_id = '\".$product_id.\"' \";\n \t \n\t\t\t$database->setQuery($sql);\n\t\t\t\n\t\t\t//$res = $database->loadResult();\n\t\t\t$resA = $database->loadAssocList();\n\t\t\tif (!empty($resA))\n\t\t\t{\n\t\t\tforeach ($resA as $res)\n\t\t\t{\n\t\t\t \n\t\t\t {\n\t\t\t $arr = array();\n\t\t\t $cats = $this->build_cats($res['category_id'], $arr);\n\t\t\t //$x = end($cats);\n\t\t\t //var_dump($x);\n\t\t\t if (!empty($cats))\n\t\t\t // if (end($cats)!='262') IF YOU USE A CATEGORY SUCH AS LATEST PRODUCTS\n\t\t\t {\n\t\t\t //var_dump($res['category_id']); die();\n\t\t\t return $res['category_id'];\n\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t\t//echo $product_id.'...cat...'.$res['category_id']; die();\n\t\t\t// nechame novinky ak inde nie je\n\t\t\treturn $res['category_id'];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif (!isset($res) || ($res==false))\n\t\t\t{\n\t\t\t // ak podkategoria neexistuje, najde top kategoriu\n\t\t\t \t$sql = \"SELECT #__vm_category.category_id FROM #__vm_product_category_xref, #__vm_category, #__vm_category_xref WHERE #__vm_category_xref.category_child_id=#__vm_product_category_xref.category_id AND #__vm_category.category_publish='Y' AND #__vm_category.category_id=#__vm_category_xref.category_child_id AND #__vm_product_category_xref.product_id = '$product_id' LIMIT 0,1\";\n\t\t\t \t$database->setQuery($sql);\n\t\t\t\t$res = $database->loadResult();\n\t\t\t\treturn $res;\n\t\t\t}\n\n\t\t\treturn 0;\n\n }", "public function showcategory() {\n // call to model function to get all category from db\n $result = $this->dash_model->showcategory();\n\n echo json_encode($result);\n }", "function showSubCatFeaturedItemsElse()\n\t{\n\t\t $output='<div class=\"head_text\" id=\"head_text\">Products</div>\n \t\t<div id=\"product_tbbg\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t \t\t<tr><td>&nbsp;</td></tr>\n\t\t\t <tr><td class=\"product_tbbg1\"><font color=\"orange\"><b>No featured product found for this category</b></font></td></tr>\n\t\t\t <tr><td>&nbsp;</td></tr></table></div>';\n\t\treturn $output;\n\t\t\t \n\t}", "function plan_category_listing() {\n\t\t$operator_id = $_REQUEST['operator_id'];\n\t\t$recharge_category = $_REQUEST['recharge_category'];\n\t\t//1 mobile, 2-dth\n\t\tif (!empty($recharge_category)) {\n\t\t\t$records = $this -> conn -> get_table_field_doubles('plan_category', 'plan_recharge_category_id', $recharge_category, 'plan_category_status', 1);\n\t\t\t$plan_category_id_default = $records[0]['plan_category_id'];\n\n\t\t\t//$records = $this -> conn -> get_table_row_byidvalue('plan_category', 'plan_recharge_category_id', $recharge_category);\n\t\t\tforeach ($records as $v) {\n\t\t\t\t$plan_category_id = $v['plan_category_id'];\n\t\t\t\t$plan_category_name = $v['plan_category_name'];\n\t\t\t\t$arr[] = array('plan_category_id' => $plan_category_id, 'plan_category_name' => $plan_category_name);\n\t\t\t}\n\n\t\t\t$records_plan = $this -> conn -> join_four_table_new_with_three_field('recharge_plan', 'operator_list', 'recharge_category', 'plan_category', 'recharge_operator_id', 'operator_id', 'recharge_category_id', 'recharge_category_id', 'plan_category_id', 'plan_category_id', 'recharge_plan`.' . '`recharge_category_id', $plan_category_id_default, 'recharge_operator_id', $operator_id, 'recharge_plan`.' . '`recharge_category_id', $recharge_category, 'rechage_amount');\n\t\t\tforeach ($records_plan as $v) {\n\t\t\t\t$recharge_category_id = $v['recharge_category_id'];\n\t\t\t\t$plan_category_id = $v['plan_category_id'];\n\n\t\t\t\t$plan_category_name = $v['plan_category_name'];\n\t\t\t\t$category_name = $v['category_name'];\n\t\t\t\t$operator_name = $v['operator_name'];\n\t\t\t\t$recharge_amount = $v['rechage_amount'];\n\t\t\t\t$recharge_data_pack = $v['recharge_data_pack'];\n\t\t\t\t$recharge_activation_code = $v['recharge_activation_code'];\n\t\t\t\t$recharge_talktime = $v['recharge_talktime'];\n\t\t\t\t$recharge_dth_channel = $v['recharge_dth_channel'];\n\t\t\t\t$recharge_validity = $v['recharge_validity'];\n\t\t\t\t$recharge_desc = strip_tags(html_entity_decode($v['recharge_desc'], ENT_QUOTES, 'UTF-8'));\n\n\t\t\t\t$arr111[] = array('recharge_category_id' => $recharge_category_id, 'category_name' => $category_name, 'plan_category_id' => $plan_category_id, 'plan_category_name' => $plan_category_name, 'operator_name' => $operator_name, 'recharge_amount' => $recharge_amount, 'recharge_data_pack' => $recharge_data_pack, 'recharge_talktime' => $recharge_talktime, 'recharge_validity' => $recharge_validity, 'dth_channel' => $recharge_dth_channel, 'recharge_desc' => $recharge_desc, 'recharge_activation_code' => $recharge_activation_code, 'default_plan_category' => $plan_category_id_default);\n\t\t\t}\n\t\t\t$post = array('status' => \"true\", \"plan_category\" => $arr, \"recharge_details\" => $arr111);\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", 'message' => 'missing parameter', 'recharge_category' => $recharge_category);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function kategoridokumen(){\n\t\tcek_session_admin();\n\t\t$data['record'] = $this->model_dokumen->kategori_dokumen();\n\t\t$this->load->view('administrator/mod_kategoridokumen/view_kategoridokumen',$data);\n\t}", "function product_category($param1 = '', $param2 = '')\n\t{\n\t\tif ($this->session->userdata('admin_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login');\n\t\tif ($param1 == 'create') {\n\t\t\t$data['name'] = $this->input->post('name');\n\t\t\t$data['description'] = $this->input->post('description');\n\t\t\t$this->db->insert('category', $data);\n\t\t\t$this->session->set_flashdata('flash_message', translate('data_added_successfully'));\n\t\t\tredirect(base_url() . 'index.php?admin/product_category', 'refresh');\n\t\t}\n\t\tif ($param1 == 'edit') {\n\t\t\t$data['name'] = $this->input->post('name');\n\t\t\t$data['description'] = $this->input->post('description');\n\t\t\t$this->db->where('category_id', $param2);\n\t\t\t$this->db->update('category', $data);\n\t\t\t$this->session->set_flashdata('flash_message', translate('informations_updated'));\n\t\t\tredirect(base_url() . 'index.php?admin/product_category', 'refresh');\n\t\t}\n\t\tif ($param1 == 'delete') {\n\t\t\t$this->db->where('category_id', $param2);\n\t\t\t$this->db->delete('category');\n\t\t\t$this->session->set_flashdata('flash_message', translate('data_deleted'));\n\t\t\tredirect(base_url() . 'index.php?admin/product_category', 'refresh');\n\t\t}\n\t\t$page_data['page_name'] = 'product_category';\n\t\t$page_data['page_title'] = translate('product_categories');\n\t\t$page_data['categories'] = $this->db->get('category')->result_array();\n\t\t$this->load->view('backend/index', $page_data);\n\t}", "function showMainCatLanding($arr)\n\t{\n\t\t$output='<div class=\"quickview_border\" style=\"margin-top:14px;\">\n\t\t<div class=\"heading1\"><span class=\"headingTXT\">Sub Categories</span></div>\n\t\t<div style=\"padding:15px 0 5px 0\">\n \t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">';\n\t\t$loop=0;\n\t\t$cnt= count($arr);\n\t\tfor($i=0;$i<$cnt;$i++)\n\t\t{\n\t\t\tif($loop==3)\n\t\t\t{\n\t\t\t\t$output.='</tr>';\n\t\t\t\t$loop=0;\n\t\t\t}\t\t\n\t\t\tif($loop==0)\n\t\t\t\t$output.='<tr>';\n\t\t\t\n\t\t\t\n\n\t\t\tif(trim($arr[$i]['image'])!='')\n\t\t\t{\n\t\t\t\t$img=explode('/',$arr[$i]['image']);\n\t\t\t\t$thumb=''.$_SESSION['base_url'].'/uploadedimages/caticons/'.$img[2];\n\t\t\t\t$img=(file_exists($thumb)) ? '<img src=\"'.$thumb.'\" width=\"'.THUMB_WIDTH.'\" border=\"0\" />' :\n\t\t\t\t\t'<img src=\"'.$_SESSION['base_url'].'/images/noimage1.jpg\" width=\"'.THUMB_WIDTH.'\" border=\"0\" />';\n\t\t\t}\n\t\t\telse\n\t\t\t\t$img='<img src=\"'.$_SESSION['base_url'].'/images/noimage1.jpg\" width=\"'.THUMB_WIDTH.'\" border=\"0\" />';\n\t\t\t\n\t\t\t$output.='<td id=\"product_tbbg\">\n\t\t\t<table width=\"100%\" border=\"0\" align=\"left\" cellpadding=\"2\" cellspacing=\"2\">\n\t\t\t\t<tr><td align=\"center\">\n\t\t\t\t\t\t<a href=\"'.$_SESSION['base_url'].'/index.php?do=featured&action=showfeaturedproduct&subcatid='.$arr[$i]['subcatid'].'\">'.$img.'</a>\n\t\t\t\t</td></tr>\n\t\t\t\t<tr><td class=\"featureTXT\">\n\t\t\t\t\t<div align=\"center\"><a href=\"'.$_SESSION['base_url'].'/index.php?do=featured&action=showfeaturedproduct&subcatid='.$arr[$i]['subcatid'].'\" class=categoriesList>'.$arr[$i]['SubCategory'].'</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t</td></tr>\n\t\t\t</table>';\n\t\t\t$loop++;\n\t\t}\n\t\treturn $output.='</table></div></div>';\t\n\t}", "public function productcategory($id,$slug=null,$url='page',$page=0){\n\t\t$data \t\t\t\t\t\t= $this->data;\n\t\t$data['menu'] \t\t\t\t= 'news';\n\t\t$data['categoryproduct'] \t= CategoryProductModel::desc()->get();\n\n\t\t$category \t\t\t\t\t= CategoryProductModel::find($id);\n\t\t$data['selected_category'] \t= $category;\n\n\t\t$data['category'] \t\t\t= CategoryBlogModel::desc()->get();\n\t\t$data['tag'] \t\t\t\t= TagModel::desc()->get();\n\t\t$data['popular_news'] \t\t= BlogModel::notDraft()->take(4)->orderBy('view','desc')->get();\n\t\t$data['events']\t\t\t\t= EventPromoModel::notDraft()->take(4)->desc()->get();\n\n\t\tif(!$category){\n\t\t\tredirect('error');\n\t\t\treturn;\n\t\t}\n\n\t\tif($url==\"page\"){\n\n\t\t\tif(!is_numeric($page)){\n\t\t\t\t$page \t= 0;\n\t\t\t}\n\n\t\t\t$name \t\t\t\t\t\t= (null != $this->input->get('q')) ? $this->input->get('q') : '';\n\n\t\t\t$paginate\t\t\t\t\t= new Aksa_pagination;\n\t\t\t$data['page']\t\t\t\t= $page;\n\t\t\t\n\t\t\t$data['total']\t\t= ProductModel::notDraft()->where('name', 'LIKE', '%'.$name.'%')->where('id_category',$category->id);\n\t\t\t$data['product']\t= ProductModel::notDraft()->where('name', 'LIKE', '%'.$name.'%')->where('id_category',$category->id);\n\n\t\t\t$data['total'] \t\t\t\t= $data['total']->get();\n\t\t\t$data['product'] \t\t\t= $data['product']->take(6)->skip($page*6)->desc()->get();\n\n\t\t\t$data['pagination'] \t\t= $paginate->paginate(base_url('main/categoryproduct/'.$category->id.'/'.seo($category->name).'/page/'),5,6,count($data['total']),$page);\n\t\t\techo $this->blade->nggambar('website.product.index',$data);\n\t\t\treturn;\n\t\t}\n\t}", "public function indexAction()\n {\n $catform = new campuswisdom_Form_Category();\n $this->view->form = $catform;\n $this->view->db = new campuswisdom_Model_DbTable_Classifieds();\n $catid = $this->_getParam('catid');\n $session = new Application_Model_Session();\n \t$session->startSession();\n //check if category has been selected from dropdown\n if($this->getRequest()->isPost()){\n //get category id or name\n \t$request = $this->getRequest();\n //validate form\n if($catform->isValid($request->getPost())){\n \t$value = $catform->getValues();\n $catid = $value['Category'];\n //query db for businesses under cat id\n $classifieds = new campuswisdom_Model_DbTable_Classifieds();\n $category = new campuswisdom_Model_DbTable_Categories();\n //all classifieds\n if($value['Category'] == 0){\n \t$list = $classifieds->fetchAll('offline = 0', 'title DESC');\n \t}else{\n \t//category selected\n $list = $classifieds->getCategorized($catid);\n\t\t\t\t}\n $this->view->category_name = $category->getName($catid);\n $this->view->user_id = $session->getUserId();\n $pagination = new Application_Model_ZendPagination(10);\n if(!empty($list)){\n \t$this->view->classifieds = $pagination->paginate($list,$this->_getParam('page'));\t\n \t}else{\n \t$this->view->classifieds = $list;\n \t}\n \t\t}\n \t}else{\n //use catid passed as get param\n if(!empty($catid)){\n\t //query db for businesses under cat id\n\t $classifieds = new campuswisdom_Model_DbTable_Classifieds();\n\t $category = new campuswisdom_Model_DbTable_Categories();\n\t \t$pagination = new Application_Model_ZendPagination();\n\t $pagination->setItemCount(10);\n\t $list = $classifieds->getCategorized($catid);\n\t if(!empty($list)){\n\t \t$this->view->classifieds = $pagination->paginate($list, $this->_getParam('page'));\t\n\t\t\t\t}else{\n\t \t\t$this->view->classifieds = $list;\t\n\t\t\t\t}\n\t\t\t\t\t$this->view->user_id = $session->getUserId();\n\t \t$this->view->category_name = $category->getName($catid); \n\t \t}else{\n\t \t\t//query db for businesses under cat id\n\t $classifieds = new campuswisdom_Model_DbTable_Classifieds();\n\t $category = new campuswisdom_Model_DbTable_Categories();\n\t \t$pagination = new Application_Model_ZendPagination();\n\t $pagination->setItemCount(10);\n\t $list = $classifieds->fetchAll('offline = 0', 'title DESC');\n\t if(!empty($list)){\n\t \t$this->view->classifieds = $pagination->paginate($list, $this->_getParam('page'));\t\n\t\t\t\t}else{\n\t \t\t$this->view->classifieds = $list;\t\n\t\t\t\t}\n\t\t\t\t$this->view->user_id = $session->getUserId();\n\t $this->view->category_name = $category->getName($catid);\n\t \t}\n \t}\n }", "protected function _initCatagory()\r\n\t{\r\n\t\tMage::dispatchEvent('vendor_catalog_controller_category_init_before', array('controller_action' => $this));\r\n\t\t$categoryId = (int) $this->getRequest()->getParam('id', false);\r\n\t\tif (!$categoryId) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$category = Mage::getModel('vendorscategory/category')\r\n\t\t->load($categoryId);\r\n\t\tif (!Mage::helper('vendorscategory')->canShow($category)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!Mage::registry(\"vendor_id\") && !Mage::registry(\"vendor\") && !Mage::registry(\"current_vendor\")){\r\n\t\t\t//echo $category->getVendorId();exit;\r\n\t\t\t$vendorObj = Mage::getModel('vendors/vendor')->load($category->getVendorId());\r\n\r\n\t\t\t//var_dump($vendorObj->getData());exit;\r\n\t\t\tMage::register('vendor_id', $vendorObj->getVendorId());\r\n\t\t\tMage::register('vendor', $vendorObj);\r\n\t\t\tMage::register('current_vendor', $vendorObj);\r\n\t\t}\r\n\t\t\r\n\t\tMage::register('current_vendor_category', $category);\r\n\t\tMage::register('current_vendor_entity_key', $category->getPath());\r\n\t\ttry {\r\n\t\t\tMage::dispatchEvent(\r\n\t\t\t'vendor_catalog_controller_category_init_after',\r\n\t\t\tarray(\r\n\t\t\t'category' => $category,\r\n\t\t\t'controller_action' => $this\r\n\t\t\t)\r\n\t\t\t);\r\n\t\t} catch (Mage_Core_Exception $e) {\r\n\t\t\tMage::logException($e);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t\treturn $category;\r\n\t}", "public function viewproduct()\n {\n // if(!in_array('viewDisease', $this->permission)) {\n // redirect('dashboard','refresh');\n // }\n\n $company_currency = $this->company_currency();\n // get all the category\n $category_data = $this->model_category->getChildCategoryData();\n\n $result = array();\n\n foreach ($category_data as $k => $v) {\n $result[$k]['category'] = $v;\n $result[$k]['disease'] = $this->model_disease->getDiseaseBySubCat($v['id']);\n }\n\n // based on the category get all the disease\n\n $html = '<!-- Main content -->\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <title>Disease List</title>\n <!-- Tell the browser to be responsive to screen width -->\n <meta content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\" name=\"viewport\">\n <!-- Bootstrap 3.3.7 -->\n <link rel=\"stylesheet\" href=\"'.base_url('assets/bower_components/bootstrap/dist/css/bootstrap.min.css').'\">\n <!-- Font Awesome -->\n <link rel=\"stylesheet\" href=\"'.base_url('assets/bower_components/font-awesome/css/font-awesome.min.css').'\">\n <link rel=\"stylesheet\" href=\"'.base_url('assets/dist/css/AdminLTE.min.css').'\">\n </head>\n <body>\n\n <div class=\"wrapper\">\n <section class=\"invoice\">\n\n <div class=\"row\">\n ';\n foreach ($result as $k => $v) {\n $html .= '<div class=\"col-md-6\">\n <div class=\"product-info\">\n <div class=\"category-title\">\n <h1>'.$v['category']['name'].'</h1>\n </div>';\n\n if(count($v['disease']) > 0) {\n foreach ($v['disease'] as $p_key => $p_value) {\n $html .= '<div class=\"product-detail\">\n <div class=\"product-name\" style=\"display:inline-block;\">\n <h5>'.$p_value['name'].'</h5>\n </div>\n <div class=\"product-price\" style=\"display:inline-block;float:right;\">\n <h5>'.$company_currency . ' '.$p_value['price'].'</h5>\n </div>\n </div>';\n }\n }\n else {\n $html .= 'N/A';\n }\n $html .='</div>\n\n </div>';\n }\n\n\n $html .='\n </div>\n </section>\n <!-- /.content -->\n </div>\n </body>\n </html>';\n\n echo $html;\n }" ]
[ "0.67073005", "0.65685195", "0.64595586", "0.644266", "0.6437281", "0.6375869", "0.63281405", "0.6307287", "0.62947136", "0.62830794", "0.62630016", "0.62303585", "0.6149787", "0.6116529", "0.60994035", "0.609341", "0.60553974", "0.60150194", "0.5992517", "0.59861267", "0.5973493", "0.5973458", "0.59525687", "0.5951713", "0.5929315", "0.59177846", "0.59107476", "0.5898236", "0.58952755", "0.58772254", "0.58728796", "0.5861894", "0.5852865", "0.58511543", "0.58294004", "0.58270454", "0.58226556", "0.58195305", "0.5801541", "0.5801536", "0.5786151", "0.57724565", "0.5766728", "0.5765394", "0.5755206", "0.5740374", "0.57359415", "0.57330877", "0.5712928", "0.5711806", "0.56951", "0.5691672", "0.56795603", "0.5679149", "0.5678045", "0.5675236", "0.5669483", "0.56690073", "0.5663199", "0.56552905", "0.5647608", "0.56444967", "0.56397045", "0.5635656", "0.5628337", "0.5622051", "0.5621599", "0.5618713", "0.5618048", "0.56160533", "0.5608676", "0.5606808", "0.56016475", "0.55981815", "0.5596915", "0.5593071", "0.55913633", "0.5591117", "0.55875844", "0.5582645", "0.558064", "0.5574512", "0.5572086", "0.5568964", "0.55580497", "0.5557403", "0.55571187", "0.55550784", "0.5552933", "0.55516", "0.55509955", "0.5550921", "0.5548766", "0.5547432", "0.55432373", "0.5540286", "0.5532951", "0.5532163", "0.55248207", "0.5522319", "0.5521799" ]
0.0
-1
Make a function that checks to see if "email" is empty, if so, gives error, then if not empty, itchecks to see if it's a valid format, then... equal to the $_SESSIONS['email'] variable.
function add_email($email) { $_SESSION['error'] = array(); if(empty($_POST['email'])) { $_SESSION['error'][] = "<p>Email cannot be empty.</p>"; // echo "this is empty"; } elseif(!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { $_SESSION['error'][] = "The email address you entered, " . $_POST['email'] .", is NOT a valid email address! Please re-enter a valid email address."; } else { $query = "INSERT INTO emails (email, created_at, updated_at) VALUES('{$email}', NOW(), NOW())"; // echo $query."<br>"; run_mysql_query($query); } // ____________________________ if(count($_SESSION['error'])>0) { header('Location: index.php'); die(); } else { $_SESSION['email'] = $_POST['email']; header('Location: success.php'); die(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmailFormValues($session){\r\n\t\tif (!empty($_POST[$session]) && !preg_match( '/(galery_users|galery_photos|galery_superusers|DELETE|DROP|TABLE)/', $_POST[$session]) && filter_var($_POST[$session], FILTER_VALIDATE_EMAIL)) {\r\n\t\t\t$return = $_POST[$session];\r\n\t\t} else {\r\n\t\t\t$return = null;\r\n\t\t}\r\n\r\n\t\treturn $return;\r\n\t}", "function valider_mail($email){\t\n\t\t$_SESSION['form_email'] = $email; //sauvegarder les données du champ en session, en cas de retour en arriére.\n\t\n\t\tif(!preg_match('/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*\\.([a-zA-Z])+$/', $email)) //expression régulière\n\t\t{\n\t\t\t$_SESSION['erreurform'] = true;\n\t\t\t$_SESSION['erreurform_email'] = '<red>E-mail non valide! ex: [email protected]</red>';\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t$_SESSION['erreurform_email'] = '';\n\t\t}\n\n\t}", "function estaLogueado() {\n return isset($_SESSION[\"email\"]);\n }", "function checker($email,$passe){\n$link=connecter_db();\n$requete=sprintf(\"select * from users where email='%s' and passe = '%s'\",$email,$passe);\n$resultat=mysqli_query($link,$requete) or die(\"Erreur selection de l'utilisateur\");\n $ligne=mysqli_fetch_assoc($resultat);\n \n if(empty($ligne)){\n header(\"location:login.php?cn=no\");\n exit();\n }else{\n\n $_SESSION['email']=$ligne['email'];\n $_SESSION['passe']=$ligne['passe'];\n $_SESSION['nom']=$ligne['nom'];\n\n }\n\n}", "function check_email($data){\n if(isset($data)){\n $sanitized = filter_var($data, FILTER_SANITIZE_EMAIL);\n if (filter_var($sanitized, FILTER_VALIDATE_EMAIL)){\n $data = $sanitized;\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = strip_tags($data);\n $data = htmlentities($data);\n return $data;\n } \n }\n}", "function isEmail($email){\n \n if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n \n header(\"Location: ..\\Graduate_form.html?error=\"); \n \n }else{\n return $value;\n }\n}", "function validateProfile() {\nif (strlen($_POST['first_name']) == 0 || strlen($_POST['last_name']) == 0\n || strlen($_POST['email']) == 0 || strlen($_POST['headline']) == 0\n || strlen($_POST['summary']) == 0) {\n return \"All values are required\";\n }\n\nif (strpos($_POST['email'], \"@\") === false) {\n return \"Email address must contain @\";\n }\nreturn true;\n}", "function authenticate_user($email_a, $passcode){\r\n\t//QUERY DATABASE/ACTIVE DIRECTORY TO SEE IF USER IS VALID\r\nif ($email == \"insert valid email b4 testing\") {\r\n\t/*** set a form token ***/\r\n\t$form_token = md5( uniqid('auth', true) );\r\n\t/*** set the session form token ***/\r\n\t$_SESSION['form_token'] = $form_token;\r\n\t$_SESSION['email_a'] = $email_a;\r\n\t$_SESSION['start_timestamp'] = date('Y-m-d HH:mm:s');\r\n\t$code = \"valid\";\r\n}else{\r\n\t$code = \"invalid\";\r\n\t}\r\necho return $code \"We were unable to validate your information, Please try again\";\r\n /*RETURNED TO CALLING CODE */\r\n\t}", "function validate_email() {\n # Check Value is an Email Address\n if ($this->check_email_address($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Email\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for email address ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Blank String\n return \"\";\n }\n }", "function error_email ($email)\n{\n $error_array = array();\n\n if (fetch_bool(\"email\", $email))\n array_push($error_array, \"error email already in use\");\n if (!preg_match(\"/^\\ *[!-~]{2,20}@[!-~]{2,20}\\.[!-~]{2,20}\\ *$/i\", $email))\n array_push($error_array, \"invalide email\");\n return($error_array);\n}", "function SignIn() { \n \t session_start();\n //starting the session for user profile page \n if(!empty($_POST['email'])) //checking the 'user' name which is from Sign-In.html, is it empty or have some text \n { echo \"fds\";\n $query = mysql_query(\"SELECT * FROM WebsiteUsers where email = '$_POST[email]' AND pass = '$_POST[pass]'\") or die(mysql_error()); \n if(mysql_num_rows($query)>0){\n $row = mysql_fetch_array($query) or die(mysql_error());\n echo mysql_num_rows($query). \"Asd\";\n if($row['status'] == 2) \n \t { \n \t\t\t$_SESSION['email'] = $row['email'];\n $_SESSION['churchName'] = $row['churchName'];\n $_SESSION['name'] = $row['name'];\n $_SESSION['church_id'] = $row['userID'];\n\n \t\techo \"SUCCESSFULLY LOGIN TO USER PROFILE PAGE...\"; \n header(\"Location: home.php\");\n }\n else\n {\n \t\techo \"pending acceptance or deleted / invalid credentials\";\n header(\"Location: sign_in.html\"); \n }\n }\n else{\n echo \" TEST pending acceptance or deleted / invalid credentials\";\n header(\"Location: sign_in.html\"); \n }\n }\n }", "function emailOk ($email) {\r\n return filter_var($email, FILTER_VALIDATE_EMAIL);\r\n }", "private function validate_email($value)\n\t{\n\t\t$value = trim($value);\n\t\t// empty user name is not valid\n\t\tif ($value) {\n\t\t\t$p_field_valid = validator_helper::validate_email($value);\n\t\t\t//since the validator function returns FALSE if invalid or the value if valid,\n\t\t\t//it's safer to check explicitly for not FALSE)\n\t\t\tif (!$p_field_valid === FALSE) {\n\t\t\t\t//echo \"p_field_valid: \" . $p_field_valid . \"<br>\";\n\t\t\t\treturn 1; // valid\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn 0; /* invalid characters */\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t return 0; /* field empty */\n\t\t}\n\t\n\t}", "function Validateform($email)\n{\n if ($email == null || $email == '') {\n return false;\n } else return true;\n}", "function checkEmail($email){\n global $conn;\n\n # Checks the Email Form\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\n header('Location: ../View/Registration.php?error=unvalidemail');\n exit();\n\n } else {\n\n $email = mysqli_real_escape_string($conn, $email);\n\n # Checks the Database if the Email aready exists\n $sql = \"SELECT * from user WHERE email = '\" . $email . \"';\";\n $table = mysqli_query($conn, $sql);\n\n if (mysqli_num_rows($table) < 1) {\n\n return $email;\n } else {\n\n header('Location: ../View/Registration.php?error=emailgiven');\n exit();\n }\n }\n}", "function validate_email($email){\n\t\n\tif(empty($email)){\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\tif(count(explode('@',$email)) != 2){\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\telse {\n\t\t\n\t\t$words = explode('@',$email);\n\t\t\t$second = $words[1];\n\t\t\tif(count(explode('.',$email)) != 2){\n\t\t\t\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\t\n\t}\n\t\treturn true;\n\t\n\t\n}", "public function validateLogin() {\n $email = valOr($_REQUEST,'email','');\n $password = valOr($_REQUEST,'pwd','');\n\n $stmt = $this->hcatServer->dbh->prepare(\"select * from hcat.user where email=:email\");\n $stmt->bindValue(':email', $email, PDO::PARAM_STR);\n $stmt->execute();\n $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n $_SESSION['email']='';\n $_SESSION['uid']=0;\n\n $message = '';\n if (sizeof($rows)==1) {\n $hash = $rows[0]['pwdhash'];\n if ( password_verify ( $password , $hash )) {\n $_SESSION['email']=$email;\n $_SESSION['uid']=$rows[0]['uid'];\n $this->hcatServer->setLogin();\n\n } else {\n $message = 'Bad password';\n }\n\n } else {\n $message = 'Bad email';\n }\n\n\n $_SESSION['message']=$message;\n return ($_SESSION['email']!='');\n }", "function Process($email, $password)\n {\n $check = ValidateInput($email, $password);\n if ($check != \"\")\n {\n // display errors and put the previous data into the form\n echo \"<p id='errors'>$check</p>\";\n DisplayForm($email);\n return;\n }\n \n // now we can assume that the user has entered the correct username and password\n $_SESSION[\"email\"] = $email; // only ever set when the user is logged in\n header(\"Location:friendslist.php\");\n }", "function process_login_email($login_array_input = NULL){\n\t\tif(!isset($login_array_input) OR count($login_array_input) != 2)\n\t\t\treturn false;\n\t\t\t$email = $login_array_input[0];\n\t\t\t$password = $login_array_input[1];\n\t\t\t$query = $this->db->query(\"SELECT * FROM ci_user WHERE email= '\".$email.\"' and active = 0 LIMIT 1\");\n\t\t\tif ($query->num_rows() > 0)\n\t\t\t{\n\t\t\t\t$row = $query->row();\n\t\t\t\t$user_id = $row->id;\n\t\t\t\t$user_pass = $row->password;\n\t\t\t\t$user_salt = $row->salt;\n\t\t\t\tif($this->CI_encrypts->encryptUserPwd($password,$user_salt) === $user_pass){\n\t\t\t\t\t$this->session->set_userdata('logged_user_email', $user_id);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\treturn false;\n\t}", "public function _check_email_exists($email = ''){\n\t\t\n\t}", "function validEmail($email)\r\n {\r\n\r\n $email = str_replace(' ', '', $email);\r\n return !empty($email);\r\n }", "function check_user_info()\n{\n $feedback = array ();\n \n // validating the input\n if (!empty($_POST['user_name'])\n && strlen($_POST['user_email']) <= 64\n && filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)\n && check_no_digit($_POST['user_lastname'], false)\n && strlen($_POST['user_lastname']) <= 64\n && check_no_digit($_POST['user_firstname'], false)\n && strlen($_POST['user_firstname']) <= 64\n && check_no_digit($_POST['user_nationality'], false)\n && check_no_digit($_POST['user_gender'], false)\n && check_and_valid_date($_POST['user_birthday'], False) \n && (!is_it_futur ($_POST['user_birthday']))) {\n $feedback['status'] = true;\n $_SESSION['feedback'] = $feedback;\n return true; \n } elseif (empty($_POST['user_email'])) {\n $feedback['msg'] = \"Email cannot be empty\";\n } elseif (strlen($_POST['user_email']) > 64) {\n $feedback['msg'] = \"Email cannot be longer than 64 characters\";\n } elseif (!filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {\n $feedback['msg'] = \"Your email address is not in a valid email format\";\n } elseif (!check_no_digit($_POST['user_lastname'], false)){\n $feedback['msg'] = \"Your lastname doesn't match the field requirements\";\n } elseif (strlen($_POST['user_lastname']) > 64) {\n $feedback['msg'] = \"Your Lastname cannot be longer than 64 characters or \n shorter than 2 characters\";\n } elseif (!check_no_digit($_POST['user_firstname'], false)){\n $feedback['msg'] = \"Your firstname doesn't match the field requirements\";\n } elseif (strlen($_POST['user_firstname']) > 64) {\n $feedback['msg'] = \"Firstname cannot be longer than 64 characters\";\n } elseif (!check_and_valid_date($_POST['user_birthday'], 0)){\n $feedback['msg'] = \"Your birthday doesn't match the field requirements\n - mm/dd/yyyy - or is not a valid date\";\n } elseif (is_it_futur($_POST['user_birthday'], 0)){\n $feedback['msg'] = \"You probably would not be using this website \n if you were not born :).\";\n } elseif (!check_no_digit($_POST['user_nationality'], false)){\n $feedback['msg'] = \"Your nationality doesn't match the field requirements\";\n } elseif (!check_no_digit($_POST['user_gender'], false)){\n $feedback['msg'] = \"Your gender is incorrect\";\n } else {\n $feedback['msg'] = \"An unknown error occurred.\";\n }\n $feedback['status'] = false;\n $_SESSION['feedback'] = $feedback;\n // default return\n return false;\n}", "function verificarExistenciaVariavel($email)\n{\n if(isset($email) && !empty($email)){\n verificarEmail($email);//Chamando a função para verificar se o e-mail está corrreto\n }else {\n echo \"Você esqueceu de preencher o email!\";\n }\n}", "function login($post){\n global $email_regex;\n global $password_regex;\n global $_SESSION;\n $pairs = [\n [$post[\"email\"], $email_regex],\n [$post[\"password\"], $password_regex]\n ];\n\n if (all_valid($pairs)){\n if(db_user_exists($post[\"email\"], $post[\"password\"])){\n /* set data so we can use this later */\n $res = db_get_user($post[\"email\"], $post[\"password\"]);\n $_SESSION[\"email\"] = $res[\"email\"];\n $_SESSION[\"firstname\"] = $res[\"fname\"];\n $_SESSION[\"lastname\"] = $res[\"lname\"];\n $_SESSION[\"userid\"] = $res[\"id\"];\n return true;\n }\n }\n else {\n return false;\n }\n}", "function validateEmail(&$errors, $field_list, $field_name, $enteredEmail)\n{\n\t$EmailPat = '/^[a-zA-Z0-9]+@[a-zA-Z0-9]+\\.[a-zA-Z]{2,4}$/'; //email regex pattern \n\tif (!isset($field_list[$field_name])|| empty($field_list[$field_name])) //checks if fields empty\n\t\t$errors[$field_name] = ' Required';\n\telse if (!preg_match($EmailPat, $field_list[$field_name])) //checks if the entered email matchs the regex format\n\t\t$errors[$field_name] = ' Invalid';\n\telse { //checks if the email has been used by another user\n\t\t$pdo = new PDO('mysql:host=mysql.ahtomsk.com;dbname=brisfi', 'brisfi_user', 'test1234');\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\n\t\ttry\t{\n\t\t\t$query = $pdo->prepare(\"SELECT * \".\n\t\t\t\t\t\t\t\t\"FROM users \".\n\t\t\t\t\t\t\t\t\"WHERE email = '$enteredEmail'\");\n\t\t\t$query->execute();\n\t\t}\n\t\tcatch (PDOException $e) \n\t\t{\n\t\t\techo $e->getMessage();\n\t\t}\n\n\t\t$rowCount = $query->rowCount();\n\n\t\tif($rowCount > 0){\n\t\t$errors[$field_name] = ' Email already in use';\n\t\t}\n\t}\n}", "function funcs_isValidEmail($email){\n\tif (!isset($email) || (empty($email) && $email!=0) \n\t\t\t|| !preg_match('/^[a-z0-9_\\-\\.]+@[a-z0-9\\-]+\\.[a-z0-9\\-\\.]+$/i',trim($email))){\n\t\treturn false;\n\t}else{\n\t\treturn true;\n\t}\n}", "function validateEmail($field)\n\t{\n //Make sure field is not blank\n if ($field == \"\") return \"Please specify an email address.\\\\n\";\n //Return an error if invalid input\n if (!filter_var($field, FILTER_VALIDATE_EMAIL)) return \"Invalid email address given.\\\\n\";\n\t\treturn \"\";\n\t}", "function isValidEmail($var) {\n //Returns error message for an invalid email\n\n //Check for unsafe characters\n $msg = isSantizeString($var);\n if ($msg != \"\") {\n return $msg;\n }\n\n if (filter_var($var, FILTER_VALIDATE_EMAIL)) {\n return \"\";\n } else {\n return \"Invalid Email\";\n }\n}", "function set_message($msg)\n{\n if (!empty($msg)) {\n $_SESSION['message'] = $msg;\n } else {\n $msg = \"\";\n }\n}", "private function checkSignIn () {\n\n if (!empty($_POST)) {\n if (!isset($_POST['nickname']) || empty($_POST['nickname'])) {\n $_SESSION['errors']['nickname'] = \"Veuillez remplir le champ 'nickname' pour finaliser votre inscription.\";\n }\n else {\n $this->nickname = htmlentities($_POST['nickname']);\n }\n\n if (!isset($_POST['birthdate']) || empty($_POST['birthdate'])) {\n $_SESSION['errors']['birthdate'] = \"Veuillez indiquez votre dâte de naissance pour finaliser votre inscription.\";\n }\n else {\n $this->birthdate = htmlentities($_POST['birthdate']);\n }\n\n if (!isset($_POST['email']) || empty($_POST['email'])) {\n $_SESSION['errors']['email'] = \"Veuillez indiquez une adresse e-mail pour finaliser votre inscription.\";\n }\n else if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) {\n $_SESSION['errors']['validateMail'] = \"Veuillez indiquez une adresse e-mail au format e-mail tel que : '[email protected]' pour finaliser votre inscription.\";\n }\n else if ($this->checkMail($_POST['email'])) {\n $_SESSION['errors']['email'] = \"L'adresse e-mail indiquée est déjà utilisé par un autre utilisateur. Veuillez en choisir une autre pour finaliser votre inscription.\";\n }\n else if (empty($_POST['validateMail'])) {\n $_SESSION['errors']['validateMail'] = \"Veuillez indiquez votre adresse e-mail une seconde fois pour finaliser votre inscription.\";\n }\n else if ($_POST['email'] !== $_POST['validateMail']) {\n $_SESSION['errors']['validateMail'] = \"Veuillez indiquez deux adresse e-mail identiques pour finaliser votre inscription.\";\n }\n else {\n $this->email = htmlentities($_POST['email']);\n }\n\n if (empty($_POST['location'])) {\n $_SESSION['errors']['location'] = \"Veuillez indiquez votre adresse pour finaliser l'inscription.\";\n } else {\n $this->location = htmlentities($_POST['location']);\n }\n\n if (empty($_POST['phone'])) {\n $_SESSION['errors']['phone'] = \"Veuillez indiquez votre numero de phone pour finaliser l'inscription.\";\n }\n else {\n $this->phone = htmlentities($_POST['phone']);\n }\n\n if (empty($_POST['password'])) {\n $_SESSION['errors']['password'] = \"Veuillez indiquez un mot de passe pour finaliser votre inscription\";\n }\n else if (strlen($_POST['password']) < 8) {\n $_SESSION['errors']['password'] = \"Votre mot de passe doit contenir au minimum 8 caractères pour finaliser votre inscription.\";\n }\n else if (empty($_POST['passwordConfirm'])) {\n $_SESSION['errors']['passwordConfirm'] = \"Veuillez indiquez un mot de passe pour finaliser votre inscription\";\n }\n else if ($_POST['password'] != $_POST['passwordConfirm']) {\n $_SESSION['errors']['password'] = \"Veuillez indiquez deux mots de passes identiques pour finaliser votre inscription.\";\n }\n else {\n $this->password = UtilsClass::hash($_POST['password']);\n }\n\n if (empty($_POST['username'])) {\n $_SESSION['errors']['username'] = \"Veuillez remplir le champs login pour poursuivre votre inscription\";\n }\n else if (UsersClass::checkLogin($_POST['username'])) {\n $_SESSION['errors']['username'] = \"Le login indiqué est déjà utilisé par un autre utilisateur. Veuillez en choisir un autre pour finaliser votre inscription.\";\n }\n else {\n $this->username = htmlentities($_POST['username']);\n }\n }\n }", "function validate_email($email)\n{\n\tglobal $db, $lang;\n\n\tif ($email != '')\n\t{\n\t\tif (preg_match('/^[a-z0-9&\\'\\.\\-_\\+]+@[a-z0-9\\-]+\\.([a-z0-9\\-]+\\.)*?[a-z]+$/is', $email))\n\t\t{\n\t\t\t$sql = \"SELECT ban_email\n\t\t\t\tFROM bb_banlist\";\n\t\t\tif ($result = $db->sql_query($sql))\n\t\t\t{\n\t\t\t\tif ($row = $db->sql_fetchrow($result))\n\t\t\t\t{\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\t$match_email = str_replace('*', '.*?', $row['ban_email']);\n\t\t\t\t\t\tif (preg_match('/^' . $match_email . '$/is', $email))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$db->sql_freeresult($result);\n\t\t\t\t\t\t\t$banned_email = (preg_match('#[\\*]#', $row['ban_email'])) ? preg_replace('#[\\*\\?@]#', '', $row['ban_email']) : $row['ban_email'];\n\t\t\t\t\t\t\treturn array('error' => true, 'error_msg' => sprintf($lang['Email_banned'], $banned_email));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\twhile($row = $db->sql_fetchrow($result));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\n\t\t\t$sql = \"SELECT user_email\n\t\t\t\tFROM bb_users\n\t\t\t\tWHERE user_email = '\" . str_replace(\"\\'\", \"''\", $email) . \"'\";\n\t\t\tif (!($result = $db->sql_query($sql)))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, \"Couldn't obtain user email information.\", \"\", __LINE__, __FILE__, $sql);\n\t\t\t}\n\n\t\t\tif ($row = $db->sql_fetchrow($result))\n\t\t\t{\n\t\t\t\treturn array('error' => true, 'error_msg' => $lang['Email_taken']);\n\t\t\t}\n\t\t\t$db->sql_freeresult($result);\n\n\t\t\treturn array('error' => false, 'error_msg' => '');\n\t\t}\n\t}\n\n\treturn array('error' => true, 'error_msg' => $lang['Email_invalid']);\n}", "function set_message($message){\r\n if(!empty($message)){\r\n $_SESSION['message'] = $message;\r\n }else{\r\n $message = \"\";\r\n }\r\n}", "function loginUser($conn, $username, $pwd){\n $emailExist = emailExist($conn, $username);\n\n if($emailExist === false) {\n header(\"location: ../login.php?error=wronglogin\" );\n exit();\n } \n\n $pwdHashed = $emailExist[\"passwords\"]; \n $checkPwd = password_verify($pwd, $pwdHashed);\n if ($checkPwd === false) {\n header(\"location: ../login.php?error=wronglogin\" );\n }\n else if ($checkPwd === true) \n {\n session_start();\n $_SESSION[\"userID\"] = $emailExist[\"userID\"];\n $_SESSION[\"email\"] = $emailExist[\"email\"];\n header(\"location: ../index.php?error=none\" );\n exit(); \n } \n}", "public static function email($email, $field){\n\t\t\tif(!empty($email)){\n\t\t\t\tif(!filter_var($email, FILTER_VALIDATE_EMAIL)){\n\t\t \tSession::set('error-email', 'Please enter a valid email address.');\n\t\t \treturn true;\n\t\t }\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function auth_check_login($email, $password) {\n\t//database query\n\t$query = \"SELECT * \"\n\t\t\t\t. \"FROM users \"\n\t\t\t\t. \"WHERE email = '\".addslashes($email).\"' or ID = '\".addslashes($email).\"'\";\n\t$result = run_sql($query);\n\t$db_field = mysql_fetch_assoc($result);\n\n\t//if query returns a result\n\tif(mysql_num_rows($result)){\n\t\t$result_password = mysql_result($result, 0, \"password\");\n\t\t$result_user = mysql_result($result, 0, \"email\");\n\t\t$result_firstname = mysql_result($result, 0, \"first_name\");\n\t\t$result_location = mysql_result($result, 0, \"location\");\n\t\t$result_lastname = mysql_result($result, 0, \"last_name\");\n\t\t$userid = mysql_result($result, 0, \"ID\");\n\t\n\t\t//if email and corresponding password are valid\n\t\tif(($email == $result_user || $email == $userid) && ($password == $result_password)){\n\t\t\t//sets session variables\n\t\t\t$_SESSION['id'] = $userid;\n\t\t\t$_SESSION['email'] = $email;\n\t\t\t$_SESSION['firstname'] = $result_firstname;\n\t\t\t$_SESSION['location'] = $result_location;\n\t\t\t$_SESSION['lastname'] = $result_lastname;\n\t\t\t$_SESSION['username'] = $result_firstname . \" \" . $result_lastname;\n\t\t\t$_SESSION['active'] = true;\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function set_message($msg, $alert_type) {\n\n if(!empty($msg)) {\n $_SESSION['message'] = $msg;\n $_SESSION['alert'] = $alert_type;\n }\n else {\n $msg = \"\";\n $alert_type = \"\";\n }\n\n}", "function emailValidation($email)\n\t{\n\t\tif (!filter_var($email, FILTER_VALIDATE_EMAIL))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\treturn 1;\n \t}", "function isValidEmail($email) // used in admin_configuration.php, contact-submit.php, user-forgot-password.php, user-register.php, user-resend-activation.php\r\n\r\n{\r\n\r\n\tif (filter_var($email, FILTER_VALIDATE_EMAIL)) {\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\telse {\r\n\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n}", "function validate_email($email){\n return filter_var($email, FILTER_VALIDATE_EMAIL) ? true : false;\n}", "private function check_login(){\n if (isset($_SESSION['email'])){\n $this->email=$_SESSION['email'];\n\t\t\t$this->role=$_SESSION['role'];\n\t\t\t$this->id=$_SESSION['id'];\n $this->signed_in=true;\n }\n else{\n unset($this->email);\n $this->signed_in=false;\n }\n }", "function get_profile_email($email){\r\n\t\r\n}", "function validateEmail($string){\n\tif($string == '') {return 'Email is required! </br>';}\n\tif(!preg_match(\"/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/\", $string)){\n\t\treturn 'Email is invalid </br>';\n\t}\n\treturn '';\n}", "protected function checkSession($args) {\n\n if ($args['ent_user_type'] == '' || $args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 15);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], $args['ent_user_type']);\n\n if (is_array($returned))\n return $returned;\n else\n return $this->_getStatusMessage(73, 15);\n }", "function colocar_mensaje($mensaje){\n \n if(!empty($mensaje)){\n\n \t$_SESSION['mensaje'] = $mensaje;\n }else{\n \n $mensaje = '';\n\n }\n\n}", "public static function checkLogin()\n {\n global $cont;\n $email = $_POST['email'];\n $password = SHA1($_POST['password']);\n $user = $cont->prepare(\"SELECT `email` FROM `users` WHERE `email` = ? AND `password` = ? LIMIT 1\"); \n $user->execute([$email , $password]);\n $adminData = $user->fetchObject();\n\n session_start();\n if(empty($adminData))\n {\n $_SESSION['error'] = \"Email or Password is Invaliad\";\n header(\"location:../login.php\");\n }\n else\n {\n $_SESSION['email'] = $adminData->email; \n header(\"location:../index.php\");\n }\n }", "function checkEmail($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function admin_login()\n{\n global $email;\n if (isset($_POST['admin_signin'])) {\n #escaping characters and sql injections\n $email = escape_string($_POST['email']);\n $password = md5(escape_string($_POST['password']));\n #checking for empty fields\n if (empty($email) || empty($password)) {\n set_message('Fill all fields');\n }\n #checking if email ans password is found in the database\n else {\n $admin_Check = query(\"SELECT * FROM `admin` WHERE admin_email = '$email' AND admin_password = '$password' LIMIT 1\");\n #confirming query\n confirm($admin_Check);\n if (mysqli_num_rows($admin_Check) == 0) {\n set_message('Invalid Email or Password');\n } else {\n $_SESSION['admin'] = $email;\n redirect_page(\"admin.php?dashboard\");\n }\n }\n }\n}", "function checkLoggedIn(){\n if (session_status()!==PHP_SESSION_ACTIVE) {\n session_start();\n }\n if(!isset($_SESSION['EMAIL'])){\n return false;\n }else return true;\n }", "function clean_email($email = \"\")\n\t{\n\t\t$email = trim($email);\n\t\t\n\t\t$email = str_replace( \" \", \"\", $email );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check for more than 1 @ symbol\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( substr_count( $email, '@' ) > 1 )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n \t$email = preg_replace( \"#[\\;\\#\\n\\r\\*\\'\\\"<>&\\%\\!\\(\\)\\{\\}\\[\\]\\?\\\\/\\s]#\", \"\", $email );\n \t\n \tif ( preg_match( \"/^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,4})(\\]?)$/\", $email) )\n \t{\n \t\treturn $email;\n \t}\n \telse\n \t{\n \t\treturn FALSE;\n \t}\n\t}", "function validate_email($string)\r\n\t{\r\n\t\t//We use the built in filter_var function to validate the email.\r\n\t\t//filter_var returns either the filtered data or false, which means we\r\n\t\t//can simply return the answer of the function! simple!\r\n\t\treturn filter_var($string, FILTER_VALIDATE_EMAIL);\r\n\t}", "function checkTextFormValues($session){\r\n\t\tif ($session == \"imageName\" && strlen($_POST[$session]) > 50) {\r\n\t\t\t$_POST[$session] = null;\r\n\t\t} elseif ($session == \"description\" && strlen($_POST[$session]) > 500) {\r\n\t\t\t$_POST[$session] = null;\r\n\t\t} elseif ($session == \"author\" && strlen($_POST[$session]) > 50) {\r\n\t\t\t$_POST[$session] = null;\r\n\t\t}\r\n\r\n\t\tif (!empty($_POST[$session]) && is_string($_POST[$session]) && !preg_match( '/(galery_users|galery_photos|galery_superusers|DELETE|DROP|TABLE)/', $_POST[$session])) {\r\n\t\t\t$return = $_POST[$session];\r\n\t\t} else {\r\n\t\t\t$return = null;\r\n\t\t}\r\n\r\n\t\treturn $return;\r\n\t}", "function is_email($value)\r\n{\r\n\treturn preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i', $value);\r\n}", "public function check_email() {\n\n\t\t$email = Input::post('email');\n \n\t\tif(is_string($email)) {\n\t\t\t\n\t\t\t$this->_password_reset->_unlocked_me($email);\n\t\t\t$row = $this->_password_reset->_validate_email($email);\n\t\t\t$res = $this->_password_reset->getData($email);\n\t\t\t$_res = $this->_password_reset->_check_if_reg($email);\n\t\t\t$ques = $this->_question->getquestion($res['question_id']);\n\n\t\t\tif($row > 0) {\n\t\t\t\tif($_res > 0) {\n\t\t\t\t\tif($res['status'] != 0) {\n\t\t\t\t\t\t$_arr = array('msg' =>Constant::EMAIL_CONFIRM, 'question' => $ques['security_question']);\n\t\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_arr = array('msg' =>Constant::LOCKED);\n\t\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_arr = array('msg' =>Constant::NOT_REGISTERED);\n\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\t\texit;\n\t\t\t}\n\n\t\t} else {\n\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\texit;\n\t\t}\n\t}", "function invalidEmail($email) {\n $result;\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n $result = true;\n } else {\n $result = false;\n }\n return $result;\n }", "function is_email($email){\n return (filter_var($email, FILTER_VALIDATE_EMAIL) !== false);\n}", "function check_email($email) \r\n{ \r\n\t$emailArray = preg_split('//', $email); \r\n $atSign = false; \r\n $dotSign = false; \r\n $badCharacter = false; \r\n $validEmail = true; \r\n\tif (in_array (\"@\", $emailArray)) \r\n\t{ \r\n \t$atSign = true; \r\n } \r\n if (in_array (\".\", $emailArray)) \r\n\t{ \r\n \t$dotSign = true; \r\n } \r\n\t$badCharactersArray = array('#', '$', '%', '(', ')', '&', '!'); // Add your own bad \r\n\tfor ($i = 0; $i < sizeof($badCharactersArray); $i++) \r\n\t{ \r\n\t\tif (in_array ($badCharactersArray[$i], $emailArray)) \r\n \t{ \r\n \t\t$badCharacter = true; \r\n \t} \r\n\t} \r\n\tif ((!$atSign) or (!$dotSign) or ($badCharacter)) \r\n \t$validEmail = false; \r\n}", "function check_email ($email)\n{\n return (preg_match ('/^[-!#$%&\\'*+\\\\.\\/0-9=?A-Z^_{|}~]+' . '@' . '([-0-9A-Z]+\\.)+' . '([0-9A-Z]){2,4}$/i', trim($email)));\n}", "public function email_check($email)\n {\n session_check();\n $user_id = $this->uri->segment(3);\n $user_id = empty($user_id) ? $this->session->userdata('user_id') : $user_id;\n if($this->uri->segment(2) == 'add' || $this->uri->segment(2) == 'Add')\n $user_id = 0;\n if($this->users_model->isemailexist($email, $user_id))\n {\n $this->form_validation->set_message('email_check', $this->lang->line('validation_email_exist'));\n return FALSE;\n }\n return TRUE; \n }", "function userEmailTaken($email){\r\n\t $email = mysql_real_escape_string($email);\r\n if(!get_magic_quotes_gpc()){\r\n $email = addslashes($email);\r\n }\r\n $q = \"SELECT email FROM users WHERE email = '$email'\";\r\n $result = mysql_query($q, $this->connection);\r\n return (mysql_numrows($result) > 0);\r\n }", "function Process($email, $profilename, $password, $confirmpassword)\n {\n $check = ValidateInput($email, $profilename, $password, $confirmpassword);\n if ($check != \"\")\n {\n // display errors and put the previous data into the form\n echo \"<p id='errors'>$check</p>\";\n DisplayForm($email, $profilename);\n return;\n }\n\n // we can now safely assume that the data is valid\n AddUser($email, $profilename, $password);\n $_SESSION[\"email\"] = $email; // will only ever be set if there is an active loggged in session\n header(\"Location:friendslist.php\");\n }", "function check_email ($email) {\n\t\n if (preg_match ('/^[-!#$%&\\'*+\\\\.\\/0-9=?A-Z^_{|}~]+' . '@' . '([-0-9A-Z]+\\.)+' . '([0-9A-Z]){2,4}$/i', trim ($email))) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n}", "function check_email($email) {\r\n\r\n if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\r\n return true;\r\n }\r\n return false;\r\n}", "function createSession($userEmailAddress,$userType){\n $_SESSION['userEmailAddress'] = $userEmailAddress;\n $_SESSION['userType']=$userType;\n}", "function is_email($email)\n{\n return filter_var($email, FILTER_VALIDATE_EMAIL);\n}", "function creaAvviso($msg){\nif(!empty($msg)){\n $_SESSION['messaggio'] = $msg;\n}else{\n $msg = \" \";\n}\n}", "function verify_email($email) // Colorize: green\n { // Colorize: green\n return isset($email) // Colorize: green\n && // Colorize: green\n is_string($email) // Colorize: green\n && // Colorize: green\n filter_var($email, FILTER_VALIDATE_EMAIL); // Colorize: green\n }", "function sanitize_email($email)\n {\n }", "function find_email($email)\n\t{\n\n\tpassword_recovery();\n\n\n\t}", "function getUserEmail(){\n\t//follow this example, add session variable to the sql select statement using a where clause\n\t$result = queryDB(\"Select * from user limit 1\");\n\t$row = mysql_fetch_array($result);\n\techo $row['email'];\n\treturn $row['email'];\n}", "function isEmail($email) {\nreturn(preg_match(\"/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i\",$email));\n}", "private function isEmailValid($email)\n {\n //We could handle email format validation here\n }", "function invalidEmail($email) {\n $result;\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n $result = true;\n }\n else {\n $result = false;\n }\n return $result;\n}", "function parse_email($input) {\n\n // TODO TEST\n\n $input = trim($input);\n if (!$input) return false;\n\n if (preg_match('/^\\s*(([A-Z0-9._%+-]+)@([A-Z0-9.-]+\\.[A-Z]{2,4}))\\s*$/i', $input, $m)) {\n return array(\n 'email' => $m[1],\n 'user' => $m[2],\n 'domain' => $m[3]\n );\n } else {\n return false;\n }\n\n }", "function verifyemail() {\n\t$a = array(\n\t 'status' => 'system-error'\n\t);\n\n\t// raw inputs\n\t$taint_si = isset($_POST['si']) ? $_POST['si'] : 0;\n\t$taint_tic = isset($_POST['tic']) ? $_POST['tic'] : 0;\n\t$taint_pword = isset($_POST['pword']) ? $_POST['pword'] : 0;\n\n\t// validate inputs\n\t$si = validateToken($taint_si);\n\t$tic = validateTic($taint_tic);\n\t$pword = validatePword($taint_pword);\n\n\t// validate parameter set\n\tif (!$si || !$tic || !$pword) {\n\t\tLog::write(LOG_WARNING, 'attempt with invalid parameter set');\n\t\treturn $a;\n\t}\n\n\t// get db connection\n\t$conn = getConnection();\n\tif (!$conn) {\n\t\treturn $a;\n\t}\n\n\t// read token and user table\n\t$result = getUserByToken($conn, $si);\n\tif (!$result) {\n\t\treturn $a;\n\t}\n\n\t// get fields\n\t$row = pg_fetch_array($result, 0, PGSQL_ASSOC);\n\t$userid = $row['id'];\n\t$hashpassword = $row['hashpassword'];\n\t$auth = $row['auth'];\n\t$hashtic = $row['hashtic'];\n\t$oldemail = $row['email'];\n\n\t// verify user authentication state\n\tif (!isUserEmailPending($auth)) {\n\t \tLog::write(LOG_NOTICE, 'attempt to verify email on user not auth=email-pending');\n\t\treturn $a;\n\t}\n\n\t// verify the password\n\t$boo = verifyPassword($pword, $hashpassword);\n\tif (!$boo) {\n\t\tLog::write(LOG_NOTICE, 'attempt with invalid password');\n\t\treturn $a;\n\t}\n\n\t// verify the tic from the email\n\t$boo = verifyTic($tic, $hashtic);\n\tif (!$boo) {\n\t\tLog::write(LOG_NOTICE, 'attempt with invalid tic');\n\t\treturn $a;\n\t}\n\n\t// update user record\n\t$auth = DB::$auth_verified;\n\t$name = 'verify-email';\n\t$sql = \"update accounts.user set email=newemail, newemail='', auth=$1, hashtic=null, tmhashtic=null where id = $2\";\n\t$params = array($auth, $userid);\n\t$result = execSql($conn, $name, $sql, $params, true);\n\tif (!$result) {\n\t\treturn false;\n\t}\n\n\t// send security notice\n\t$boo = sendAuthenticationEmail($oldemail, 'changedemail', '');\n\tif (!$boo) {\n\t\t$a['status'] = 'send-email-failed';\n\t\treturn $a;\n\t}\n\n\t// success\n\t$a['status'] = 'ok';\n\t$a['auth'] = $auth;\n\treturn $a;\n}", "function email_validation($str)\n{\n return preg_match(\"/.+@.+/\", $str);\n}", "function email_validation($toemail) \n\t{ \n\t\t$param_array = func_get_args();\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - PARAMETER LIST : ', $param_array);\n\t\t\t\n\t\tif($_SERVER['REMOTE_ADDR'] != \"127.0.0.1\")\n\t\t{\n\t\t\n\t\tglobal $HTTP_HOST; \n\t\t\n\t\t$result = array(); \n\t\t\n\t\t$result[0]=true; \n\t\t\n\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t/* this regular expression is not allowing some of the domain names like .name etc., so we check for one @ symbol and \n\t\tatleast 1 \".\" symbol in email id.\n\t\tif (!eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $toemail)) \n\t\t{ \t\t\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\t\t\n\t\t}\n\t\t*/\n\t\t\n\t\t//remove the name from the email\n\t\t\n\t\t$earr = explode(\"<\", $toemail);\n\t\t\n\t\tif(count($earr) == 2 && strlen(trim($earr[1])) > 0)\n\t\t\t$email = substr(trim($earr[1]),0,-1);\n\t\telse\n\t\t\t$email = trim($earr[0]);\n\t\t\n\t\t$eml_arr = explode(\"@\",$email);\n\t\t$result[0]=false; \n\t\t\n\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\tif(count($eml_arr) == 2 && strlen(trim($eml_arr[0])) > 0 && strlen(trim($eml_arr[1])) > 0)\n\t\t{\n\t\t\t$domain_arr = explode(\".\",$eml_arr[1]);\n\t\t\tif(count($domain_arr) > 1 && strlen(trim($domain_arr[0])) > 0 && strlen(trim($domain_arr[1])) > 0)\n\t\t\t{\n\t\t\t\t$result[0]=true; \n\t\t\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(1==2)\n\t\t{//need not check by communicating to email server...\n\t\t\n\t\tlist ( $username, $domain ) = split (\"@\",$toemail); \n\t\t\n\t\tif (getmxrr($domain, $MXHost)) \n\t\t{\t\t\n\t\t\t$connectaddress = $MXHost[0];\n\t\t}\n\t\telse \n\t\t{\t\t\n\t\t\t$connectaddress = $domain;\n\t\t} \n\t\t//echo \"Connect address : \" . $connectaddress . \"<br>\";\n\t\t//echo \"Domain Name : \" . $domain . \"<br>\";\n\t\t$connect = fsockopen ( $connectaddress, 25 ); \n\t\t\n\t\tif ($connect) \n\t\t{\t\t\n\t\t\tif (ereg(\"^220\", $Out = fgets($connect, 1024))) \n\t\t\t{ \n\t\t\t\n\t\t\t fputs ($connect, \"HELO $HTTP_HOST\\r\\n\"); \n\t\t\t \n\t\t\t $out = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t $this->from_email = $GLOBALS['site_config']['admin_email'];\n\t\t\t \n\t\t\t $from = $this->from_email;\n\t\t\t \n\t\t\t fputs ($connect, \"MAIL FROM: <{$from}>\\r\\n\"); \n\t\t\t \n\t\t\t $from = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t fputs ($connect, \"RCPT TO: <{$toemail}>\\r\\n\"); \n\t\t\t \n\t\t\t $to = fgets ($connect, 1024); \n\t\t\t \n\t\t\t fputs ($connect, \"QUIT\\r\\n\"); \n\t\t\t \n\t\t\t fclose($connect); \n\t\t\t \n\t\t\t if (!ereg (\"^250\", $from) || !ereg ( \"^250\", $to )) \n\t\t\t { \n\t\t\t \n\t\t\t\t $result[0]=false; \n\t\t\t\t \n\t\t\t\t $result[1]=\"Server rejected address\"; \n\t\t\t\t \n\t\t\t\t} \n\t\t\t} \n\t\t\t\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$result[0] = false; \n\t\t\t\t\n\t\t\t\t$result[1] = \"No response from server\"; \n\t\t\t\t\n\t\t\t } \n\t\t\t \n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"Can not connect E-Mail server.\"; \n\t\t\t\n\t\t\t//return $result; \n\t\t} \n\t\t\n\t\t}\n\t\t\n\t\tif(!$result[0])\n\t\t{\n\n\t\t\t$ttext = \"\";\n\t\t\t$ttext .= \"<table border=0 cellpadding=3 cellspacing=1 align=center width=90%>\";\n\t\t\t$ttext .= \"<tr align=left><td><strong>Error Message</strong></td><td>\" . $result[1] . \" (\" . $toemail . \")\" . \"</td></tr>\";\n\t\t\t$ttext .= \"</table>\";\n\n\t\t\t$GLOBALS['logger_obj']->error('<br>METHOD email::email_validation() - Return Value : ', $ttext,'email');\n\n\t\t}\n\t}\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - Return Value : ', $result);\n\t\treturn $result; \n\t\t\n\t}", "function invalidEmail($email){\n $result = true;\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)){\n $result = true;\n }\n else{\n $result = false;\n }\n return $result;\n}", "function invalidEmail($str =null){\n if ($str) {\n if (filter_var($str, FILTER_VALIDATE_EMAIL)) {\n echo \"is valid<br>\";\n return false;\n } else {\n echo(\"is not a valid email address<br>\");\n return true;\n }\n }\n}", "function usuarioLogueado() {\n if (estaLogueado()) {\n return traerPorEmail($_SESSION[\"usuarioLogueado\"]);\n }\n else {\n return NULL;\n }\n}", "function isValidEmail($email)\n {\n if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n return true;\n }\n else {\n return false;\n echo \"Email Id Is Not Valid\";\n }\n }", "function check_email_exist(){\n //TODO syntize the query\n $this->SQL = \"SELECT id,private_name,family_name ,email,password FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n \n \n if ( !empty( $this->results[0]['email'] ) ){\n //found mail - check password\n \n if ($this->results[0]['password'] === $this->params['password']){\n \n $this->success_login();\n \n \n } else {\n // if password incorrect\n $this->results =array( 'results'=>'fail');\n \n }\n \n \n } else {\n //didnt found email \n $this->results =array( 'results'=>'fail');\n \n }\n return $this->results;\n \n }", "private function emailAtLogin() {}", "function consultarEmailUsuario(){\n global $conexion, $data;\n $email = $data[\"email\"];\n $resultado = mysqli_query($conexion,\"SELECT * FROM usuario WHERE usu_email='$email'\");\n echo validarError($conexion, false, $resultado);\n }", "function validarEmail($email){\r\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)){\r\n return false;\r\n }\r\n return true;\r\n}", "function sEmail( $email )\r\n\t\t{\r\n\t\t return filter_var( $email, FILTER_SANITIZE_EMAIL );\r\n\t\t \r\n\t\t}", "function isEmail($field_data) \n{ \n\t$fields_ok=preg_match(\"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\" , $field_data); \n\treturn $fields_ok; \n}", "function isEmail($email)\n{\n return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;\n}", "function s2_is_valid_email($email)\n{\n $return = ($hook = s2_hook('fn_is_valid_email_start')) ? eval($hook) : null;\n if ($return != null)\n return $return;\n\n if (strlen($email) > 80)\n return false;\n\n return preg_match('/^(([^<>()[\\]\\\\.,;:\\s@\"\\']+(\\.[^<>()[\\]\\\\.,;:\\s@\"\\']+)*)|(\"[^\"\\']+\"))@((\\[\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\])|(([a-zA-Z\\d\\-]+\\.)+[a-zA-Z]{2,}))$/', $email);\n}", "function isValidEmail($email){\n return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;\n}", "function validate($data, $field){\n\t\tswitch($field){\n\t\t\tcase 'email': {\n\t\t\t\tif(!empty($data)){\n\t\t\t\t\tif(!filter_var($data, FILTER_VALIDATE_EMAIL)){\n\t\t\t\t\t\treturn \"Invalid email address.\";\n\t\t\t\t\t}//if\n\t\t\t\t}else{\n\t\t\t\t\treturn \"Email address is required.\";\n\t\t\t\t}//ifelse\n\t\t\t\treturn \"\";\n\t\t\t}//case email\n\n\t\t\tdefault: break;\n\n\t\t}//switch statement\n\t}", "function validEmail($email)\n {\n //using filter_var function we can check for valid email\n return !empty($email) && filter_var($email, FILTER_VALIDATE_EMAIL);\n }", "function teacher_logged_in()\r\n{\r\n\r\n if (isset($_SESSION['SSN']) && !empty($_SESSION['SSN'])) {\r\n\r\n\r\n return true;\r\n } else {\r\n\r\n return false;\r\n }\r\n\r\n\r\n}", "function EmailValidation($email)\n{ \n $email = htmlspecialchars(stripslashes(strip_tags($email)));\n if(preg_match(\"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\",$email))\n {\n /*$domain = explode('@', $email);\n $domain = $domain[1];\n if(!checkdnsrr($domain,'MX'))\n {\n //return false;\n return true;\n }*/\n return true;\n }\n else\n {\n return false;\n }\n}", "function emailfil($emal){\n $email = 'leon@sin castilla.com';\n\n if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n echo 'email '.$email.' correcto';\n }else{\n echo 'email '.$email.' incorrecto';\n }\n}", "public function check_email( $email )\n\t{\n\t\t// Check the e-mail address\n\t\t$user_email = apply_filters( 'user_registration_email', $email );\n\t\tif (! is_email( $user_email ) ) {\n\t\t\t$this->errors['email'] = apply_filters( \"{$this->prefix}/create_object/error/email_invalid\", $this->settings['strings']['email_invalid'] );\n\t\t\t$user_email = '';\n\t\t} elseif ( email_exists( $user_email ) ) {\n\t\t\t$this->errors['email'] = apply_filters( \"{$this->prefix}/create_object/error/email_exists\", $this->settings['strings']['email_exists'] );\n\t\t}\n\t\treturn $user_email;\n\t}", "function validate($userType=''){\n if(isset($_SESSION['user'])){\n return $_SESSION['user'];\n }else{\n return false;\n }\n }", "function check_email_input($param){\n $mess = '';\n if (empty($param)) {\n $mess = \"Không được bỏ trống\";\n }\n else if (!preg_match(\"/([\\w\\-]+\\@[\\w\\-]+\\.[\\w\\-]+)/\",$param)) {\n $mess = \"Sai định dạng email\";\n }\n else{\n $mess = \"Hợp lệ\";\n }\n return $mess;\n}", "function inicie_sesion(){\n return (isset($_SESSION['usuario'])&&$_SESSION['usuario']!=''&&isset($_SESSION['session_key']));\n}", "function email_is_valid($email) {\n return filter_var($email, FILTER_VALIDATE_EMAIL);\n }", "function checkEmail($email){\n\t\t\t\t$email=trim(strip_tags($email));\n\t\t\t\tif(get_magic_quotes_gpc()==false)\n\t\t\t\t{\n\t\t\t\t\t$email=mysql_real_escape_string($email);\t\n\t\t\t\t}\n\t\t\t\t$sql=\"SELECT * FROM emailmarketing WHERE Email='$email'\";\n\t\t\t\t$kq=mysql_query($sql) or die(mysql_error());\n\t\t\t\tif(mysql_fetch_row($kq)>=1)\n\t\t\t\t\treturn 0;\n\t\t\t\telse return 1;\n\t\t\t}" ]
[ "0.73945117", "0.70329946", "0.640697", "0.6397327", "0.6369221", "0.63215655", "0.63172865", "0.63019985", "0.6290979", "0.6282262", "0.6238725", "0.61821014", "0.6170504", "0.6158191", "0.61272043", "0.61235005", "0.61222655", "0.6100007", "0.60615546", "0.6048403", "0.60392636", "0.6031679", "0.60147756", "0.60067356", "0.6002888", "0.5972433", "0.5966964", "0.5957752", "0.5935218", "0.593155", "0.59064525", "0.5902591", "0.58796656", "0.5859975", "0.58464533", "0.58413476", "0.5840664", "0.5837668", "0.5818738", "0.5811812", "0.58002704", "0.5798613", "0.57968277", "0.5796062", "0.5793996", "0.5792176", "0.5786777", "0.57837987", "0.5777682", "0.5777112", "0.5771062", "0.5769228", "0.5768066", "0.57663697", "0.57484806", "0.5747994", "0.57469594", "0.57320017", "0.57307845", "0.5729661", "0.5726249", "0.57134265", "0.5708901", "0.57071626", "0.57070875", "0.5704651", "0.5698054", "0.5693574", "0.5691623", "0.5688081", "0.56799126", "0.5677735", "0.56755066", "0.5674397", "0.56722075", "0.56535274", "0.5653286", "0.56319565", "0.5629503", "0.5627772", "0.5627634", "0.56275254", "0.5625232", "0.56238854", "0.5621939", "0.56157", "0.5612832", "0.5602338", "0.560055", "0.559563", "0.55886906", "0.5588116", "0.55860394", "0.55841076", "0.5582475", "0.55783415", "0.55750537", "0.5572518", "0.5570504", "0.55693734" ]
0.69157875
2
/ Return the vertex of the given string. We check the VertexList as it was generated when words were inserted into the datastructure.
function findWord($String){ foreach($vertexList as $v){ if($v->word === $String) return $v; } return NULL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InsertIntoTrie($vertexPointer,$wordString){\n\t\t$edgeLocation = 0;\t\t\t\t\t\t\t//counter to find edge position\n\n\t\t/*\n\t\t\tCheck if the character is within the alphabet range, 0 - 25, if it is \n\t\t\ta character that is not an alphabet, it will be a bigger or smaller value;\n\t\t*/\n\t\tif(($wordString[0] - 97) < 0 || ($wordString[0] - 97 > 25) )\n\t\t\t$edgeLocation = 26;\n\t\telse\n\t\t\t$edgeLocation = ($wordString[0]-97);\n\n\t\t//return if the word if it has a character not in the alphabet.\n\t\tif($edgeLocation == 26)\n\t\t\treturn;\n\n\t\t/*\n\t\t\tIf the edge doesnt exist for that pointer, make it,\n\t\t\tassign it, and point to it\n\t\t*/\n\t\tif($vertexPointer->edges[$edgeLocation] == NULL){\n\t\t\t$vertexPointer->edges[$edgeLocation] = new Edge($wordString[0]);\n\t\t\t$vertexPointer->edgeP[] = $edgeLocation;\n\t\t\t$vertexPointer->edges[$edgeLocation]->child = new Vertex($vertexPointer . $wordString[0]);\n\t\t}\n\n\t\t/*\n\t\t\tIf it is the last character in the word then this is the end of the word,\n\t\t\tso set the flag as true and find the neighbors as well as put this vertex\n\t\t\tback into the vertexList for lter use with breadthFirstSearch\n\t\t*/\n\t\t$nextVertex = $vertexPointer->edges[$edgeLocation]->child;\n\n\t\tif(strlen($wordString) == 1){\n\t\t\tfindNeighbor($nextVertex,$root,$nextVertex->word,0);\n\t\t\t$vertexList[] = $nextVertex;\n\t\t\t$nextVertex->end = true;\n\t\t}//otherwise keep inserting into the trie\n\t\telse\n\t\t\tInsertIntoTrie($vertexPointer->edges[$edgeLocation]->child,substr($wordString,1,strlen($wordString)));\n\n\t}", "public function getEdgeSource(EdgeInterface $edge): VertexInterface;", "function findNeighbor($Vertex_forWho,$Vertex_finder,$word,$differenceCount){\n\t\t//since some words like car had r as the end but cars had the r and s as end\n\t\t//this function kept breaking, because this was my base case, but to save myself\n\t\t// a headache i split them up into word sized tries\n\n\t\t//if the end of the word is met, then if the difference is only 1 push it back\n\t\t//as an edge to both finder and for who.\n\n\t\tif($Vertexfind->end == true){\n\t\t\tif($differenceCount == 1){\n\t\t\t\t$Vertex_forWho->neighbors[] = $Vertex_finder;\n\t\t\t\t$Vertex_finder->neighbors[] = $Vertex_forWho;\n\t\t\t}\n\t\t}//if the word is still 1 character long, check its edges and find the neighbors for it\n\t\telse if(strlen($word) == 1){\n\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\telse\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t}\n\t\t}//for any wordzie bigger than 1, add all the neighbors\n\t\telse if(strlen($word) > 1){\n\t\t\tif($differenceCount > 1)\n\t\t\t\treturn;\n\t\t\telse if($differenceCount == 0){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 0);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($differenceCount == 1){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testVertexFormat()\n {\n $db = new Connection([\n 'host' => 'localhost',\n 'port' => 8182,\n 'graph' => 'graph',\n 'username' => $this->username,\n 'password' => $this->password,\n ]);\n $db->message->registerSerializer(static::$serializer, TRUE);\n $db->open();\n $result = $db->send(\"g.V(1)\");\n $vertex = [\n 0 => [\n \"id\" => 1,\n \"label\" => \"vertex\",\n \"properties\" => [\n \"name\" => [\n 0 => [\n \"id\" => 0,\n \"value\" => \"marko\",\n \"label\" => \"name\",\n ],\n ],\n \"age\" => [\n 0 => [\n \"id\" => 2,\n \"value\" => 29,\n \"label\" => \"age\",\n ],\n ],\n ],\n \"type\" => \"vertex\",\n ],\n ];\n $this->ksortTree($vertex);\n $this->ksortTree($result);\n $this->assertEquals($vertex, $result, \"vertex property wasn't as expected\");\n }", "protected function findVertex($type, $key)\n {\n return $this->context->getGraphContext()->findVertex($type, $key);\n }", "public function getEdgeTarget(EdgeInterface $edge): VertexInterface;", "abstract public function getVerticesStart();", "public function addCandidateToGraph(Candidate $candidate) : Vertex\n {\n $id = $candidate->getId();\n if ($this->graph->hasVertex($id)) {\n $vertex = $this->graph->getVertex($id);\n } else {\n $vertex = $this->graph->createVertex($id);\n $vertex->setAttribute(self::CANDIDATE_ATTRIBUTE_NAME, $candidate);\n }\n return $vertex;\n }", "function point_is_on_vertex($point)\n{\n $vertices = $this->vertices;\n\n foreach ($vertices as $vertex)\n {\n if ($point === $vertex)\n {\n return true;\n }\n }\n\n return false;\n}", "function find_min_vertex($v1,$vertices,$distance_table){\n $min = INF;\n $min_i = 0;\n\n foreach($vertices as $v2){\n $d = distance_lookup($v1,$v2,$distance_table);\n if($d < $min){\n $min = $d;\n $min_i = $v2;\n }\n }\n return array($min_i,$min);\n\n}", "public function testCanCreateVertexId()\n {\n $graph = new Graph();\n $vertex = $graph->createVertex(11);\n $this->assertInstanceOf('\\Fhaculty\\Graph\\Vertex', $vertex);\n $this->assertEquals(11, $vertex->getId());\n }", "public function getVertices()\n {\n $vertices = array();\n $map = $this->getDistanceMap();\n foreach ($this->vertex->getGraph()->getVertices()->getMap() as $vid => $vertex) {\n if (isset($map[$vid])) {\n $vertices[$vid] = $vertex;\n }\n }\n\n return new Vertices($vertices);\n }", "function dijkstra(Graph $graph, $startIndex) {\n // init spt bool array to mark visited vertices\n // init dist array to mark distance between vertices from start\n // init parent array to all -1\n // set start dist to 0\n // set traverse ptr to start index\n // while not all vertices are visited\n // put index into spt\n // get edges of index\n // loop through all edges of this index\n // if distance to reach this vertex is bigger than this index dist + current weight\n // set this vertex dist to this index dist + current weight\n // set parent of this vertex to index\n // advance to next edge\n // loop through all vertices\n // if stored dist is bigger than current vertex dist\n // set dist to new smaller dist\n // set index to the smaller dist\n $spt = array_fill(0, $graph->getVerticeCount(), False);\n $dist = array_fill(0, $graph->getVerticeCount(), PHP_INT_MAX);\n $parent = array_fill(0, $graph->getVerticeCount(), -1);\n\n $dist[$startIndex] = 0;\n $index = $startIndex;\n\n while (in_array(False, $spt)) {\n $spt[$index] = True;\n $curr = $graph->getEdges()[$index];\n while (!empty($curr)) {\n if ($dist[$curr->data] > $dist[$index] + $curr->weight) {\n $dist[$curr->data] = $dist[$index] + $curr->weight;\n $parent[$curr->data] = $index;\n }\n $curr = $curr->next;\n }\n $minDist = PHP_INT_MAX;\n for ($i=0; $i < $graph->getVerticeCount(); $i++) { \n if (!$spt[$i] && $minDist > $dist[$i]) {\n $minDist = $dist[$i];\n $index = $i;\n }\n }\n }\n return $parent;\n}", "public function addVertex($id) {\n\t\tif(!isset($this->inAdjacents[$id])) {\n\t\t\t$this->inAdjacents[$id] = array();\n\t\t}\n\t\t\n\t\tif(!isset($this->outAdjacents[$id])) {\n\t\t\t$this->outAdjacents[$id] = array();\n\t\t}\n\t}", "public function getVerticesEdge()\n {\n $ret = array();\n foreach ($this->edges as $edge) {\n if ($edge->hasVertexStart($this)) {\n $ret []= $edge->getVertexToFrom($this);\n } else {\n $ret []= $edge->getVertexFromTo($this);\n }\n }\n\n return new Vertices($ret);\n }", "abstract public function hasVertexStart(Vertex $startVertex);", "static function isGraph($str) {\n return ctype_graph($str);\n }", "public function getLineString()\n {\n // todo: if these dont exist throw runtimeexception\n $path = [];\n\n foreach($this->input('vertices') as $item) {\n list($lat, $lng) = explode(\",\", $item);\n $path[] = trim(\"{$lng} {$lat}\");\n }\n\n return implode(\",\", $path);\n }", "public static function fromString(string $string): static;", "public function getVerticesEdgeFrom()\n {\n $ret = array();\n foreach ($this->getEdgesIn() as $edge) {\n $ret []= $edge->getVertexFromTo($this);\n }\n\n return new Vertices($ret);\n }", "public function testCanCreateVertex()\n {\n $graph = new Graph();\n $vertex = $graph->createVertex();\n $this->assertInstanceOf('\\Fhaculty\\Graph\\Vertex', $vertex);\n }", "function breadthFirstSearch($startVertex){\n\t\t$startVertex->visited = true;\n\t\t$Q = new SplQueue();\n\t\t$Q->push($startVertex);\n\t\twhile(!$Q->empty()){\n\t\t\t$x = new Vertex();\n\t\t\t$x = $Q->front(); $Q->pop();\n\t\t\tforeach($x->neighbors as $VertexPtr){\n\t\t\t\tif($VertexPtr->visited == false){\n\t\t\t\t\t$VertexPtr->visited = trie;\n\t\t\t\t\t$VertexPtr->pred = $x;\n\t\t\t\t\t$Q->push($VertexPtr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "static function segword($str) {\n\t\t$segObj = new Segmentation();\n\t\t$sc = $segObj->_getSegClient();\n $sc->SetLimits(0, 1, 1);\n\t\t$searchRes = $segObj->queryViaValidConnection($str, 'goods_id_dist');\n\t\tif( $searchRes == false ) {\n\t\t\treturn false;\n\t\t}\n\t\t//var_dump($searchRes['words']);\n\t\t//return array_keys( $searchRes['words'] );\n\t\tif (!empty($searchRes['words'])) {\n\t\t\treturn array_keys($searchRes['words']);\n\t\t}\n\t\telse {\n\t\t\treturn array();\n\t\t} \n\t}", "private function translate($string) {\n $vowels = \"a,e,i,o,u\";\n $arrVowels = explode(',', $vowels);\n\n //find consonants\n $consonants = \"b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,y,z\";\n $arrCons = explode(',', $consonants);\n\n //find the first letter, second, third for clusters\n $first = substr($string, 0, 1);\n $second = substr($string, 1, 1);\n $third = substr($string, 2, 1);\n\n\n //check if first letter is a vowel\n foreach($arrVowels as $check){\n if($check == $first){\n //if first letter is a vowel, add \"ay\"\n $pigLatin = $string . \"ay\";\n return $pigLatin;\n }\n }\n\n //check if first letters are consonants\n $cluster = $first;\n foreach($arrCons as $value){\n if($second == $value ){\n $cluster .= $second;\n foreach($arrCons as $value){ \n if($third == $value){\n $cluster .= $third;\n }\n }\n } \n }\n $pigLatin = str_replace($cluster, '', $string) . $cluster . \"ay\";\n return $pigLatin;\n }", "abstract public function getVertexToFrom(Vertex $startVertex);", "public function lex(string $string): TokenStreamInterface;", "function fsgs_local_navigation_get_string($string) {\n $title = $string;\n $text = explode(',', $string, 2);\n if (count($text) == 2) {\n // Check the validity of the identifier part of the string.\n if (clean_param($text[0], PARAM_STRINGID) !== '') {\n // Treat this as atext language string.\n $title = get_string($text[0], $text[1]);\n }\n } \n return $title;\n}", "protected function createLineStringZ(): LineStringEntity\n {\n return $this->createLineString([\n new Point(2, 5),\n new Point(3, 6),\n new Point(12, 8),\n new Point(10, 10),\n new Point(13, 11),\n ]);\n }", "public function insertString($string, $index) {\n if ($string != null && strlen($string)) {\n $value = $string{0};\n $child = null;\n if (isset($this->children[$value])) {\n $child = $this->children[$value];\n }\n else {\n $child = new PrefixTreeNode();\n $this->children[$value] = $child;\n }\n\n $remainder = substr($string, 1);\n $child->indexes[] = $index;\n $child->insertString($remainder, $index);\n }\n }", "protected function createNodeLineString(): LineStringEntity\n {\n return $this->createLineString([\n new Point(0, 0),\n new Point(1, 0),\n new Point(0, 1),\n new Point(1, 1),\n new Point(0, 0),\n ]);\n }", "public static function getParent($version_str) {\r\n $version = new Version($version_str);\r\n \r\n if($version->isSupportBranch()) {\r\n return '';\r\n } elseif($version->isReleaseBranch() || $version->isBuild()) {\r\n $parent_version = new Version(implode(Version::SEPARATOR, array($version->N, Version::PLACEHOLDER, Version::PLACEHOLDER)));\r\n return $parent_version->__toString();\r\n } elseif($version->isRelease()) {\r\n $parent_version = new Version(implode(Version::SEPARATOR, array($version->N, $version->M, Version::PLACEHOLDER)));\r\n return $parent_version->__toString();\r\n }\r\n }", "abstract public function getVertexFromTo(Vertex $endVertex);", "private function getVerticesNeighbor(Vertex $vertex)\n {\n $vertices = array();\n foreach ($vertex->getEdges() as $edge) {\n if (!$edge instanceof EdgeUndirected) {\n throw new UnexpectedValueException('Directed edge encountered');\n }\n $vertices[] = $edge->getVertexToFrom($vertex);\n }\n return new Vertices($vertices);\n }", "function fiftyone_degrees_get_node_index_in_string($node, $useragent_bytes, $headers)\n{\n $characters = fiftyone_degrees_get_node_characters($node, $headers);\n $char_count = count($characters);\n $final_index = $char_count - 1;\n $ua_count = count($useragent_bytes);\n for ($index = 0; $index < $ua_count - $char_count; $index++) {\n for ($node_index = 0, $target_index = $index; \n $node_index < $char_count && $target_index < $ua_count; \n $node_index++, $target_index++) {\n\n if ($characters[$node_index] != $useragent_bytes[$target_index])\n break;\n else if ($node_index == $final_index)\n return $index;\n }\n }\n return -1;\n}", "public function addNode($string) {\r\n $id = $this->stringToIdentifier($string);\r\n\r\n if ($id == null) {\r\n $id = ++$this->nodeCount;\r\n\r\n $this->stringToIdentifier[$string] = $id;\r\n $this->identifierToString[$id] = $string;\r\n $this->inLinks[$id] = array();\r\n $this->outLinks[$id] = array();\r\n }\r\n }", "public function getVertices ()\n\t{\n\t\treturn $this->vertices;\n\t}", "public static function lower_case($string) {\n\n // if required, convert Greek charset into lower case\n if (Config::getInstance() -> IS_GREEK) {\n\t\t\tforeach(Entities::$uppertolowergreek as $char => $rep) {\n \t\t$string = preg_replace(\"/\".$char.\"/i\", $rep, $string);\n \t}\n }\n\n // if required, convert Cyrillic charset into lower case\n if (Config::getInstance() -> IS_CYRILLIC) {\n\t\t\tforeach(Entities::$uppertolowercyrillic as $char => $rep) {\n \t\t$string = preg_replace(\"/\".$char.\"/i\", $rep, $string);\n \t}\n }\n\n return (strtr($string, \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"abcdefghijklmnopqrstuvwxyz\"));\n\n\t}", "public function string(){\n try {\n // Sparql11query.g:586:3: ( STRING_LITERAL1 | STRING_LITERAL2 | STRING_LITERAL_LONG1 | STRING_LITERAL_LONG2 ) \n // Sparql11query.g: \n {\n if ( ($this->input->LA(1)>=$this->getToken('STRING_LITERAL1') && $this->input->LA(1)<=$this->getToken('STRING_LITERAL_LONG2')) ) {\n $this->input->consume();\n $this->state->errorRecovery=false;\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n throw $mse;\n }\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public static function string_to_level($str)\n {\n $string_to_level = array_flip(static::$__level_to_string);\n if (array_key_exists($str, $string_to_level))\n return $string_to_level[$str];\n else\n return -1;\n }", "function findPath($StringX, $StringY){\n\t\t$Start = findWord($StringY);\n\n\t\t/*Check if the word given by the user even exist in the dictionary*/\n\t\tif($Start == NULL){\n\t\t\tprint($Start);print(\" does not exist in the dictionary!\");\n\t\t}\n\n\t\t$End = findWord($StringY);\n\n\t\t/*Check to see if second word given even exists in the dictionary*/\n\t\tif($End == NULL){\n\t\t\tPrint($End);print(\" does not exist in the dictionary!\");\n\t\t}\n\n\t\t/* Run breadth first search on the start vertex*/\n\t\tbreadthFirstSearch($Start);\n\n\t\t/*We will traverse backwards on the list from breadfirstSearch to find the path*/\n\t\twhile($End->pred != NULL){\n\t\t\t/*If the predecessor for end is NULL means there is no neighbor for this word*/\n\t\t\tif($End->pret == NULL){\n\t\t\t\tprint(\"No Path Found!\");\n\t\t\t}\n\t\t\t/*Otherwise print out as it traverses*/\n\t\t\tprint($end->word.\" -> \");$End = $End->pred;\n\t\t}\n\t\tprint($End->word);\n\t}", "public function detectFromString( $string )\n {\n }", "public static function getAlphabeticalPosition(string $str)\n {\n $arr = str_split('abcdefghijklmnopqrstuvwxyz');\n $v = array_search(strtolower($str), $arr);\n if ($v !== false) {\n return $v + 1;\n }\n return 0;\n }", "public function testFailDuplicateVertex()\n {\n $graph = new Graph();\n $graph->createVertex(33);\n $graph->createVertex(33);\n }", "protected function bb_verticale($arguments = array()) {\n\t\tif (isset($arguments['verticale'])) {\n\t\t\t$letter = $arguments['verticale'];\n\t\t} else {\n\t\t\t$letter = $this->parseArray(array('[/groep]'), array());\n\t\t}\n\t\ttry {\n\t\t\t$verticale = VerticalenModel::get($letter);\n\t\t\treturn '<a href=\"/verticalen#' . $verticale->letter . '\">' . $verticale->naam . '</a>';\n\t\t} catch (Exception $e) {\n\t\t\treturn 'Verticale met letter=' . htmlspecialchars($letter) . ' bestaat niet. <a href=\"/verticalen\">Zoeken</a>';\n\t\t}\n\t}", "function length(string $string): int\n{\n $length = grapheme_strlen($string);\n\n if (null === $length || false === $length) {\n throw new Exception\\InvalidArgumentException('$string is node made of grapheme clusters.');\n }\n\n return $length;\n}", "final public function notifyVertexTagChange(IVertex $vertex)\n\t\t\t{\n\t\t\t\tassert(FALSE);\n\t\t\t\t$this->checkVertexValidity($vertex)->checkVertexExistenceByTag($vertex->getOldTag())->checkVertexNonexistenceByTag($vertex->getTag());\n\t\n\t\t\t\t$this->removeVertexByTag($vertex->getOldTag());\n\n\t\t\t\t$this->checkVertexValidity($tag);\n\t\n\t\t\t\t$this->vertices[$vertex->getTag()] = $vertex;\n\t\n\t\t\t\treturn $this;\n\t\t\t}", "private function firstLower($string) {\n $first = strtolower($string{0});\n $string = substr($string, 1);\n return $first . $string;\n }", "public function generate_tree($string)\r\n\t{\r\n\t\tunset($this->current);\r\n\t\tunset($this->stack);\r\n\t\t\r\n\t\t$this->current = array();\r\n\t\t$this->stack = array(array('content' => &$this->current));\r\n\t\t\r\n\t\t$this->pre_parse($string);\r\n\t\t\r\n\t\treturn $this->current;\r\n\t}", "public static function s($string){\n return self::convertStringToCheck($string);\n }", "protected function createLineStringX(): LineStringEntity\n {\n return $this->createLineString([\n new Point(8, 15),\n new Point(4, 8),\n ]);\n }", "function local_navigation_get_string($string) {\n $title = $string;\n $text = explode(',', $string, 2);\n if (count($text) == 2) {\n // Check the validity of the identifier part of the string.\n if (clean_param($text[0], PARAM_STRINGID) !== '') {\n // Treat this as atext language string.\n $title = get_string($text[0], $text[1]);\n }\n }\n return $title;\n}", "public function addGeopoint($str_name)\n {\n return $this->addField($str_name, self::FIELD_GEOPOINT);\n }", "public function analyse($string)\n {\n $this->addData(\"text\", $string);\n return $this->request();\n }", "public function stringToIdentifier($string) {\r\n if (!is_string($string))\r\n return null;\r\n \r\n if (!isset($this->stringToIdentifier[$string]))\r\n return null;\r\n \r\n return $this->stringToIdentifier[$string];\r\n }", "protected function createRingLineString(): LineStringEntity\n {\n return $this->createLineString([\n new Point(0, 0),\n new Point(1, 0),\n new Point(1, 1),\n new Point(0, 1),\n new Point(0, 0),\n ]);\n }", "public static function getFirstWord($string) {\n $words = static::getWords($string);\n return $words[0];\n }", "public function inLinksByString($string) {\r\n $id = $this->stringToIdentifier($string);\r\n return $this->inLinksById($id);\r\n }", "abstract public function getVerticesTarget();", "public function toLowerCase()\n {\n $str = UTF8::strtolower($this->str, $this->encoding);\n\n return static::create($str, $this->encoding);\n }", "protected function createLineStringC(): LineStringEntity\n {\n return $this->createLineString([\n new Point(2, 0),\n new Point(12, 10),\n ]);\n }", "function lcfirst( $str ) {\r\n $str[0] = strtolower($str[0]);\r\n return (string)$str;\r\n }", "public function adjacent(int $vertex)\n {\n // validate the vertex\n Digraph::validateVertex($vertex, $this->getVertices());\n // return the adjacent vertices to it\n return $this->adjacencyList[$vertex];\n }", "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}", "public function geomFromText($text) {\r\n $text = mb_strtolower($text, mb_detect_encoding($text));\r\n $text = preg_replace('/<!\\[cdata\\[(.*?)\\]\\]>/s','',$text);\r\n\r\n // Load into DOMDOcument\r\n $xmlobj = new DOMDocument();\r\n @$xmlobj->loadXML($text);\r\n if ($xmlobj === false) {\r\n throw new Exception(\"Invalid KML: \". $text);\r\n }\r\n\r\n $this->xmlobj = $xmlobj;\r\n try {\r\n $geom = $this->geomFromXML();\r\n } catch(InvalidText $e) {\r\n throw new Exception(\"Cannot Read Geometry From KML: \". $text);\r\n } catch(Exception $e) {\r\n throw $e;\r\n }\r\n\r\n return $geom;\r\n }", "public static function lower_ent($string) {\n\t\tforeach(Entities::$uppertolowerent as $char => $rep) {\n $string = preg_replace(\"/\".$char.\"/i\", $rep, $string);\n\t\t}\n return ($string);\n }", "function getLetterCase($string) {\r\n\t\t// uppercase 65-90\r\n\t\t// lowercase 97-122\r\n\t\t$is_uppercase = true;\r\n\t\t$is_lowercase = true;\r\n\t\t$string_length = strlen($string);\r\n\t\t$counter = 0;\r\n\t\twhile($counter < $string_length) {\r\n\t\t\t$char = $string[$counter];\r\n\t\t\tif(ord($char) >= 65 && ord($char) <= 90) {\r\n\t\t\t\t$is_lowercase = false;\r\n\t\t\t} elseif(ord($char) >= 97 && ord($char) <= 122) {\r\n\t\t\t\t$is_uppercase = false;\r\n\t\t\t} else {\r\n\t\t\t\treturn \"unknown\";\r\n\t\t\t}\r\n\t\t\t$counter++;\r\n\t\t}\r\n\t\tif($is_uppercase) {\r\n\t\t\treturn \"upper\";\r\n\t\t}\r\n\t\tif($is_lowercase) {\r\n\t\t\treturn \"lower\";\r\n\t\t}\r\n\t\treturn \"mixed\";\r\n\t}", "function getLine()\r\n {\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\t$sLine = trim($this->referString[$this->currentLine]);\r\n\t\t\t\t$this->currentLine++;\r\n\t\t\t} while ($this->currentLine < count($this->referString) && !$sLine);\r\n\t\t\treturn $sLine;\r\n }", "public function getVertTranslation($try)\n {\n return $this->getTranslation(0, $try);\n }", "private function createLinestring($data)\n {\n if (!$this->getOption(Shapefile::OPTION_FORCE_MULTIPART_GEOMETRIES) && $data['geometry']['numparts'] == 1) {\n $data['geometry'] = $data['geometry']['parts'][0];\n $Geometry = new Linestring();\n } else {\n $Geometry = new MultiLinestring();\n }\n $Geometry->initFromArray($data['geometry']);\n if (!$this->getOption(Shapefile::OPTION_IGNORE_GEOMETRIES_BBOXES)) {\n $Geometry->setCustomBoundingBox($data['bbox']);\n }\n return $Geometry;\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 lcfirst( $str ) {\n\t\t$str[0] = strtolower($str[0]);\n\t\treturn (string)$str;\n\t}", "function low($str) {\n\t\treturn strtolower($str);\n\t}", "public function first(string $str) {\n\n }", "protected function createLineStringA(): LineStringEntity\n {\n return $this->createLineString([\n new Point(0, 0),\n new Point(10, 10),\n ]);\n }", "function sefencode($string)\n{\n\treturn titleToLocation($string);\n}", "public static function fromString(int $index, string $string): self\n {\n return new self(\n $index,\n \\T_STRING,\n $string\n );\n }", "public static function segmentsFirst($str, $delimiter, $count = 1)\n {\n $p = -1;\n while ($count-- && $p !== false) {\n $p = strpos($str, $delimiter, $p + 1);\n }\n if ($p === false) {\n return $str;\n }\n return substr($str, 0, $p);\n }", "function lcfirst($str) {\n return (string)(strtolower(substr($str, 0, 1)).substr($str, 1));\n }", "function parsepointstring($string) {\n\t$coords = array_map(\"floatVal\", explode(\" \", preg_replace('%^.*\\((.*)\\)$%', '\\1', $string)));\n\treturn array_reverse($coords);\n}", "private function addTagFromString($string){\n\t\t$tag = explode(' ',$string);\n\t\t$tagname = array_shift($tag);\n\t\t$this->_known_tags[$tagname] = implode(' ',$tag);\n\t}", "public function dayIndex($str)\n\t{\n\t\t$str = preg_replace(\"/[^A-Z]/i\",\"\", trim($str));\n\t\tif (isset($this->dayTokenMap[$str]))\n\t\t{\n\t\t\treturn $this->dayTokenMap[$str];\n\t\t}\n\t\treturn 0;\n\t}", "function getnext($str){\n $i = 1;\n $j = 0;\n $next[1] = 0;\n while ($i < strlen($str)-1){\n if($j == 0 || $str[$i] == $str[$j]){\n ++$i;\n ++$j;\n $next[$i] = $j;\n }else{\n $j = $next[$j];\n }\n }\n print_r($next);\n }", "public function fromString(string $string);", "private function lcfirst($str)\n {\n $str[0] = strtolower($str[0]);\n return (string)$str;\n }", "public function lowerCaseFirst()\n {\n $first = UTF8::substr($this->str, 0, 1, $this->encoding);\n $rest = UTF8::substr(\n $this->str, 1, $this->length() - 1,\n $this->encoding\n );\n\n $str = UTF8::strtolower($first, $this->encoding) . $rest;\n\n return static::create($str, $this->encoding);\n }", "public function lookupVenue($lat, $long, $string) {\n $params = array('ll' => \"$lat,$long\", 'query' => $string);\n $ret = $this->get('venues/search', $params);\n return $ret['response'];\n }", "protected function createStraightLineString(): LineStringEntity\n {\n return $this->createLineString([\n new Point(0, 0),\n new Point(2, 2),\n new Point(5, 5),\n ]);\n }", "public function Generate($str = '')\n {\n $trees = $this->parser->Parse($str);\n $segments = [];\n foreach ($trees as $tree) {\n $segments[] = $this->ProcessTree($tree);\n }\n return $segments;\n }", "public function findFirstPosition()\n {\n $string = readline(\"Please enter a string to find the first position of character 'a' (ex: mystringwitha) : \");\n $str = \"\\n\\n Input String: \" . $string;\n \n // as per current requirement, desired character was a\n // we can make this character dynamic as method will work in both ways\n $position = $this->getPosition($string, 'a');\n $str .= \"\\n Character Position: \" . $position;\n return $str;\n }", "public function getStringAlgorithm() {}", "public function getIdentifier($str, $return = 'object')\n {\n $roles = $this->getData('registry')->getRegistry();\n\n foreach ($roles as $k => $v) {\n if ($v->getId() == $str || $k == $str) {\n if ($return === 'object') {\n return $v;\n } else {\n return $v->getIdentifier();\n }\n }\n }\n\n return false;\n }", "public function highlight($string) {\n\t\t// cache comments\n\t\t$string = $this->cacheComments($string);\n\t\t\n\t\t// cache quotes\n\t\t$string = $this->cacheQuotes($string);\n\t\t\n\t\t// encode html\n\t\t$string = StringUtil::encodeHTML($string);\n\t\t\n\t\t// do highlight\n\t\t$string = $this->highlightOperators($string);\n\t\t$string = $this->highlightKeywords($string);\n\t\t$string = $this->highlightNumbers($string);\n\t\t\n\t\t// insert and highlight quotes\n\t\t$string = $this->highlightQuotes($string);\n\t\t\n\t\t// insert and highlight comments\n\t\t$string = $this->highlightComments($string);\n\t\t\n\t\treturn $string;\n\t}", "public function getVertices()\n {\n // return the amount\n return $this->vertices;\n }", "function mGRAPH(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$GRAPH;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:201:3: ( 'graph' ) \n // Tokenizer11.g:202:3: 'graph' \n {\n $this->matchString(\"graph\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function executeGabow($graph, $root){\n\n //input string that will be converted to the input file for wmatch\n $input = \"\";\n //initialize total number of edges. Will be used in line 1 of the input file\n $totaledges = 0;\n\n //initialize total number of vertices. Will be used in line 1 of the input file\n $vertices = count($graph);\n\n //create some complementary arrays to convert the position of the cysteines\n //(label) to an index that will be used in the input file for wmatch\n $keys = array_keys($graph);\n sort($keys,SORT_NUMERIC);\n for($i=0;$i<$vertices;$i++){\n $index[$keys[$i]] = $i+1;\n }\n\n //for each vertex, add its edges with respective weightes to the input file\n for($i=0;$i<$vertices;$i++){\n \n //unset variables to avoid it from carrying garbage\n if(isset($matches))unset($matches);\n if(isset($edges))unset($edges);\n if(isset($edgeskeys))unset($edgeskeys);\n\n //given one vertex, find all the possible edges\n $matches = $graph[$keys[$i]];\n for($j=0;$j<count($matches);$j++){\n //indexes are the cysteine positions converted into an integer that\n //will be interpreted by the wmatch executable and values are the\n //edge weights\n $edges[$index[$matches[$j]]] += 1;\n }\n\n //add to total edges\n $totaledges += count($edges);\n\n //mount vertex info to populate the vertex line in the input file\n $vertex = $index[$keys[$i]];\n $label = $keys[$i];\n $edgeskeys = array_keys($edges);\n //#edges label 0 0 \\n\\n\n $input .= count($edgeskeys).\" \".$label.\" 0 0 \\n\\n\";\n\n //for each vertex, calculate the possible edges with its respective weight\n //hold edge weights on array values\n ksort($edges,SORT_NUMERIC);\n //hold edge indexes on array values\n sort($edgeskeys,SORT_NUMERIC);\n for($k=0;$k<count($edges);$k++){\n //#index #weight \\n\\n\n $input .= $edgeskeys[$k].\" \".$edges[$edgeskeys[$k]].\" \\n\\n\";\n }\n }\n\n //calculate final number of edges. divide by 2 because are edges are duplicated\n //i.e. 142-292 and 292-142 are the same S-S bond\n //totaledges needs to be a natural number\n if($totaledges%2 > 0){\n $totaledges--;\n }\n $totaledges = $totaledges/2;\n //first line of input file: carries total number of vertices and edges\n //#vertices #edges U \\n\\n\n $input = $vertices.\" \".$totaledges.\" U \\n\\n\".$input.\"\\n\";\n\n //prepare file paths\n $path = $root.\"/gabow/\".$vertices.$totaledges.\"U\";\n\n if($_ENV['OS'] == \"Windows_NT\"){\n $path = str_replace(\"/\", \"\\\\\", $path);\n }\n\n $extensionIN = \".in\";\n $extensionOUT = \".out\";\n\n //delete old files if they exist\n if(file_exists($path.$extensionIN)){\n unlink($path.$extensionIN);\n }\n\n //save input string to input file\n file_put_contents($path.$extensionIN, $input);\n\n //write command to be executed to run wmatch executable\n $command = \"\";\n if($_ENV['OS'] == \"Windows_NT\"){\n $command = $root.\"/gabow/wmatch.exe \".\n $path.$extensionIN.\" > \".$path.$extensionOUT;\n $command = str_replace(\"/\", \"\\\\\", $command);\n }\n else{\n $command = $root.\"/gabow/./wmatch \".\n $path.$extensionIN.\" > \".$path.$extensionOUT;\n }\n \n //execute command\n exec($command);\n\n //delete files created\n if(file_exists($path.$extensionIN)){\n unlink($path.$extensionIN);\n }\n if(file_exists($path.$extensionOUT)){\n //read output file to output string\n $output = file_get_contents($path.$extensionOUT);\n unlink($path.$extensionOUT);\n }\n\n /*OLD CODE\n //extract maximum weighted match results\n $results = array();\n if($_ENV['OS'] == \"Windows_NT\"){\n $output = str_replace(\"\\r\\n\", \" \", $output);\n $results = explode(\" \", trim($output));\n }\n else{\n for($l=0;$l<strlen($output);$l++){\n $value = substr($output, $l, 1);\n if(strlen(trim($value)) > 0){\n $results[] = $value;\n }\n }\n }\n */\n \n //extract results\n $output = trim($output);\n $output = str_replace(\"\\r\\n\", \" \", $output);\n $output = str_replace(\"\\t\", \" \", $output);\n $output = str_replace(\"\\n\", \" \", $output);\n $output = str_replace(\"\\r\", \" \", $output);\n $results = explode(\" \", $output);\n\n //create an array with all chosen V-E-V (vertex-edge-vertex) combinations\n for($i=0;$i<count($results);$i+=2){\n //dilsufide bond: i.e. 142-292\n $bond = $keys[$results[$i]-1].\"-\".$keys[$results[$i+1]-1];\n //reverse disulfide bond to avoid creating duplicated disulfide bonds\n $reversebond = $keys[$results[$i+1]-1].\"-\".$keys[$results[$i]-1];\n $exist = false;\n //if disulfide bond already exists, skip without creating a duplicate\n if(count($bonds) > 0){\n $exist = array_search($reversebond, $bonds);\n }\n //if disulfide bond is new, add to S-S bonds array\n if($exist === false && $results[$i] != \"0\" && $results[$i+1] != \"0\"){\n $bonds[] = $keys[$results[$i]-1].\"-\".$keys[$results[$i+1]-1];\n }\n }\n\n //return final array with selected disulfide bonds according to Gabow's\n //algorithm to solve maximum weighted matching problems\n return $bonds;\n }", "public static function toInfinitive($string)\n {\n\t\t$string= strtolower($string);\n\t\tif(self::isInfinitive($string))\n\t\t\treturn $string;\n\t\t\n if(isset(self::$exceptions[$string]))\n\t\t{\n\t\t\treturn self::$exceptions[$string];\n\t\t}\n\t\tif(self::isAPosibility($string))\n\t\t{\n\t\t\treturn $string;\n\t\t}\n\n foreach(self::$flections as $pattern=>$result)\n {\n $pattern= $pattern.'i';\n if(preg_match($pattern, $string))\n\t\t\t{\n\t\t\t\t$tmpWord= preg_replace($pattern, $result, $string);\n\t\t\t\tif(self::isInVerbList($tmpWord))\n\t\t\t\t\treturn $tmpWord;\n\t\t\t}\n }\n\t\treturn false;\n }", "public function direct(String $string)\n {\n return strtolower($string->getValue());\n }", "function mSTRING_LITERAL1(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$STRING_LITERAL1;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:412:3: ( '\\\\'' ( options {greedy=false; } : ~ ( '\\\\u0027' | '\\\\u005C' | '\\\\u000A' | '\\\\u000D' ) | ECHAR )* '\\\\'' ) \n // Tokenizer11.g:413:3: '\\\\'' ( options {greedy=false; } : ~ ( '\\\\u0027' | '\\\\u005C' | '\\\\u000A' | '\\\\u000D' ) | ECHAR )* '\\\\'' \n {\n $this->matchChar(39); \n // Tokenizer11.g:414:3: ( options {greedy=false; } : ~ ( '\\\\u0027' | '\\\\u005C' | '\\\\u000A' | '\\\\u000D' ) | ECHAR )* \n //loop18:\n do {\n $alt18=3;\n $LA18_0 = $this->input->LA(1);\n\n if ( (($LA18_0>=$this->getToken('0') && $LA18_0<=$this->getToken('9'))||($LA18_0>=$this->getToken('11') && $LA18_0<=$this->getToken('12'))||($LA18_0>=$this->getToken('14') && $LA18_0<=$this->getToken('38'))||($LA18_0>=$this->getToken('40') && $LA18_0<=$this->getToken('91'))||($LA18_0>=$this->getToken('93') && $LA18_0<=$this->getToken('65535'))) ) {\n $alt18=1;\n }\n else if ( ($LA18_0==$this->getToken('92')) ) {\n $alt18=2;\n }\n else if ( ($LA18_0==$this->getToken('39')) ) {\n $alt18=3;\n }\n\n\n switch ($alt18) {\n \tcase 1 :\n \t // Tokenizer11.g:415:5: ~ ( '\\\\u0027' | '\\\\u005C' | '\\\\u000A' | '\\\\u000D' ) \n \t {\n \t if ( ($this->input->LA(1)>=$this->getToken('0') && $this->input->LA(1)<=$this->getToken('9'))||($this->input->LA(1)>=$this->getToken('11') && $this->input->LA(1)<=$this->getToken('12'))||($this->input->LA(1)>=$this->getToken('14') && $this->input->LA(1)<=$this->getToken('38'))||($this->input->LA(1)>=$this->getToken('40') && $this->input->LA(1)<=$this->getToken('91'))||($this->input->LA(1)>=$this->getToken('93') && $this->input->LA(1)<=$this->getToken('65535')) ) {\n \t $this->input->consume();\n\n \t }\n \t else {\n \t $mse = new MismatchedSetException(null,$this->input);\n \t $this->recover($mse);\n \t throw $mse;}\n\n\n \t }\n \t break;\n \tcase 2 :\n \t // Tokenizer11.g:421:7: ECHAR \n \t {\n \t $this->mECHAR(); \n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop18;\n }\n } while (true);\n\n $this->matchChar(39); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function str_before($search, $string)\n {\n return str::before($search, $string);\n }", "public function lowercase(string $string): string\n {\n return mb_convert_case($string, MB_CASE_LOWER, 'UTF-8');\n }" ]
[ "0.6127832", "0.5182932", "0.50650734", "0.49142325", "0.48696193", "0.4787186", "0.47306758", "0.46597344", "0.46086466", "0.46070713", "0.4604379", "0.45610985", "0.45403656", "0.45290583", "0.4510492", "0.45053533", "0.44351512", "0.4429602", "0.44199654", "0.43603408", "0.43572843", "0.43550017", "0.43528074", "0.4320858", "0.43087655", "0.43045", "0.42908597", "0.42855713", "0.4282487", "0.42575312", "0.42557046", "0.42518646", "0.42386615", "0.4236699", "0.42233363", "0.4222641", "0.4217514", "0.42071807", "0.4203252", "0.41381648", "0.41363257", "0.4123798", "0.4107284", "0.41058668", "0.41054416", "0.41015822", "0.40901718", "0.4085394", "0.40827656", "0.4079297", "0.4076373", "0.4071981", "0.4065336", "0.40540063", "0.40461072", "0.40455407", "0.40435827", "0.4042787", "0.40415433", "0.40351737", "0.40342787", "0.40313205", "0.40310243", "0.40215218", "0.4003389", "0.39960125", "0.39932412", "0.39907423", "0.39870146", "0.39819476", "0.397597", "0.39743847", "0.3969627", "0.3951801", "0.3943325", "0.39318085", "0.39054346", "0.389996", "0.38997066", "0.3897978", "0.38925204", "0.38855818", "0.38837576", "0.38827154", "0.38787562", "0.38660744", "0.38659778", "0.3864323", "0.38555226", "0.38516545", "0.38515761", "0.3851263", "0.38476026", "0.3846837", "0.38467023", "0.3844908", "0.38338158", "0.3824434", "0.38190532", "0.38159958" ]
0.6587067
0
/ Saftey measure to reset predecesor so that it does not screw up with the algorithm.
function resetPred(){ foreach($vertexList as $v){ $v->visited = false; $v->pret = NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset()\n\t{\n\t\t$this->is_running = FALSE;\n\t\t$this->counter = 0;\n\t}", "protected function _reset()\n {\n $this->_scheduleAdaptiveResize = false;\n $this->_cropPosition = 0;\n parent::_reset();\n }", "public function reset()\n {\n $this->_setRay();\n }", "function reset()\n {\n }", "public function resetInitial()\n {\n // drop column\n DB::query()->selectRaw('SET SQL_SAFE_UPDATES = 0;');\n QueryProfile::query()->where('initial_avg_position', '!=', 0)->update(['initial_avg_position' => 0]);\n QueryProfile::query()->where('initial_ctr_value', '!=', 0)->update(['initial_ctr_value' => 0]);\n QueryProfile::query()->where('initial_impressions', '!=', 0)->update(['initial_impressions' => 0]);\n DB::query()->selectRaw('SET SQL_SAFE_UPDATES = 1;');\n }", "public function Reset(){\r\n\t\t$this->points = 0;\r\n\t }", "protected function _resetPreVariables()\n\t{\n\t\t$this->_nuked = false;\n\t\t$this->_oldPre = array();\n\t\t$this->_curPre =\n\t\t\tarray(\n\t\t\t\t'title' => '',\n\t\t\t\t'size' => '',\n\t\t\t\t'predate' => '',\n\t\t\t\t'category' => '',\n\t\t\t\t'source' => '',\n\t\t\t\t'group_id' => '',\n\t\t\t\t'reqid' => '',\n\t\t\t\t'nuked' => '',\n\t\t\t\t'reason' => '',\n\t\t\t\t'files' => '',\n\t\t\t\t'filename' => ''\n\t\t\t);\n\t}", "protected function reset() {}", "protected function reset() {}", "protected function reset() {}", "public function reset()\n {\n $this->values[self::_EXCAVATE] = null;\n }", "abstract public function reset();", "abstract public function reset();", "abstract public function reset();", "public function reset() {\n\t\t\t$this->p = 0;\n\t\t\t$this->line = 1;\n\t\t\t$this->charPositionInLine = 0;\n\t\t\t$this->markDepth = 0;\n\t\t}", "private function _preLoadReset() {\n\t\t$this->_amountProcessedLines = $this->_amountReadLines = 0;\n\t\t$this->_linesInvalidSize = $this->_lines = [];\n\t}", "public function reset()\n {\n $this->values[self::_RSEED] = null;\n $this->values[self::_LOOTS] = array();\n }", "public function before_optimize() {\n\t\t$this->processed_trash_count = 0;\n\t\t$this->processed_akismet_count = 0;\n\t}", "public function preDown()\n {\n }", "function smallreset()\r\n{\r\n\tstart();\r\n\tstop();\r\n}", "function reset();", "function reset();", "function reset();", "function reset();", "public function reset()\n {\n $this->values[self::_USE_TIMES] = null;\n $this->values[self::_REWARDS] = array();\n $this->values[self::_TIMES] = null;\n }", "abstract public function getReset();", "public function reset()\n {\n $this->values[self::_CUR_STAGE] = null;\n $this->values[self::_RESET_TIMES] = null;\n $this->values[self::_HEROES] = array();\n $this->values[self::_STAGES] = array();\n $this->values[self::_HIRE_HERO] = null;\n }", "public function reset()\n {\n $this->values[self::_REWARDS] = array();\n }", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset(){}", "public function reset()\n {\n }", "public function reset() {\r\n $this->state = BaseConverter::ConvertFromBinary($this->initv, '0123456789');\r\n $this->state = ltrim($this->state, '0');\r\n }", "protected function reset(): void\n {\n }", "public function resetPeek()\n {\n $this->peek = 0;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_RSEED] = null;\n }", "abstract protected function reset_values();", "function _pre() {\n\n\t}", "public function reset_pos() {\n\t\tFile::save( $this->_resetfile, time() , true );\n\n\t\t$this->_summary[ 'is_running' ] = 0;\n\t\tself::save_summary();\n\t}", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public function reset();", "public static function reset()\n\t{\n\t\t// nothing by default\n\t}", "public function reset()\n {\n $this->values[self::_RET] = null;\n }", "public function reset()\n {\n $this->values[self::_RET] = null;\n }", "function reset() {\n\t\tparent::_resetSet();\n\t}", "public function Reset();", "public static function reset()\n\t{\n\t\tif(static::$use_cookies === true)\n\t\t{\n\t\t\t\\Cookie::delete('fuel_ts_sort_by');\n\t\t\t\\Cookie::delete('fuel_ts_direction');\n\t\t}\n\t\t\n\t\tstatic::$sort_by \t= static::$default_sort_by;\n\t\tstatic::$direction \t= static::$default_direction;\n\t}", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_EXCAVATE] = null;\n $this->values[self::_REWARD] = null;\n }", "public function reset(): void;", "public function testPreprocessingUnrotate()\n {\n }", "public function reset()\r\n\t{\r\n\t\t$this->first = null;\r\n\t\t$this->alreadyIncluded = array();\r\n\t\t$this->depths = array();\r\n\t}", "public function unRate()\n {\n\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_DRAW_VITALITY] = null;\n }", "public function reset()\n {\n $this->values[self::_OPEN_PANEL] = null;\n $this->values[self::_QUERY_OPPO] = null;\n $this->values[self::_START_BAT] = null;\n $this->values[self::_END_BAT] = null;\n $this->values[self::_RESET] = null;\n $this->values[self::_DRAW_REWARD] = null;\n }", "public static function reset(): void\n {\n self::$defined = null;\n self::$isChannel = false;\n }", "public function reset()\n {\n $this->values[self::INIT_BU] = null;\n $this->values[self::BU] = null;\n $this->values[self::GOLD] = null;\n $this->values[self::VIGOUR] = null;\n }", "public function reset()\r\n {\r\n }", "function OzState() {$this->reset();}", "public function reset()\n {\n $this->totalFitness = 0;\n $this->bestFitness = 0;\n $this->worstFitness = PHP_INT_MAX;\n $this->averageFitness = 0;\n }", "public function resetUC() {}", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_REWARDS] = array();\n }", "public function reset()\n {\n $this->values[self::_STAGE_ID] = null;\n $this->values[self::_DPS_RANK] = array();\n $this->values[self::_FIRST_PASS] = null;\n $this->values[self::_FAST_PASS] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_HERO_BASES] = array();\n $this->values[self::_HERO_DYNAS] = array();\n }", "public function reset()\n {\n $this->values[self::_HP_PERC] = null;\n $this->values[self::_MP_PERC] = null;\n $this->values[self::_CUSTOM_DATA] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_BEST_RANK_REWARD] = null;\n $this->values[self::_BEST_RANK] = null;\n $this->values[self::_CUR_RANK] = null;\n }", "public function reset()\n\t{\n\t\t$this->get(1);\n\t}", "public function resetState() {}", "function resetOlds(){\n// deal gracefully with discontinuity in logs by resetting \"old\" values\n\nglobal $firstRain,$firstSump, $firstWater;\n$firstRain=1;\n$firstSump=1;\n$firstWater=1;\n}", "public function reset() {\n $this->startTime = 0;\n $this->endTime = 0;\n $this->pauseTime = 0;\n $this->totalTime = 0;\n $this->laps = array();\n $this->isRunning = false;\n $this->isPaused = false;\n $this->lapCount = 0;\n }", "public function reset()\n {\n }", "public function reset()\n {\n $this->values[self::_ACQUIRE] = array();\n }", "public function reset()\n {\n $this->values[self::_LAST_RESET_TIME] = null;\n $this->values[self::_TODAY_FREE_SWEEP_TIMES] = null;\n }", "public function reset()\n {\n $this->values[self::_INSTANCE_INFO] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_LOOTS] = array();\n $this->values[self::_HP_DROP] = array();\n }", "private function reset()\n {\n $this->human->reset();\n $this->machine->reset();\n $this->memory->reset();\n }", "public function woocommerce_cart_reset() {\n\n\t\t\t$cart_reset_action_count = did_action( 'woocommerce_cart_reset' );\n\t\t\t$sc_after_calculate_action_count = did_action( 'smart_coupons_after_calculate_totals' );\n\n\t\t\t// This is to match counter for 'smart_coupons_after_calculate_totals' hook with 'woocommerce_cart_reset' counter since we are using these two counters to prevent store credit being appplied multiple times.\n\t\t\tif ( $sc_after_calculate_action_count < $cart_reset_action_count ) {\n\t\t\t\tdo_action( 'smart_coupons_after_calculate_totals' );\n\t\t\t}\n\n\t\t}", "public function reset()\n {\n $this->values[self::RES] = array();\n }", "public function reset($ensure = false);", "private function reset(): void\n {\n $this->values = [];\n $this->bg_colors = [];\n $this->striped = false;\n $this->animate = false;\n $this->height = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_REWARD] = null;\n }", "public static function resetAccelerator()\r\n\t{\r\n\t\t$fl = \\Bitrix\\Main\\Config\\Configuration::getValue(\"NoAcceleratorReset\");\r\n\t\tif ($fl)\r\n\t\t\treturn;\r\n\r\n\t\tif (function_exists(\"accelerator_reset\"))\r\n\t\t\taccelerator_reset();\r\n\t\telseif (function_exists(\"wincache_refresh_if_changed\"))\r\n\t\t\twincache_refresh_if_changed();\r\n\t}", "function clear_divide_flag($acc_number)\n\t{\n\t$data['divide'] = 0;\n return $this->db->where('number',$acc_number)\n\t\t ->order_by('id','DESC')\n\t\t ->limit(1)\n \t ->update('pamm_tp', $data);\n\n }", "public function reinit()\n {\n }", "public function reset(): int\n {\n return $this->set_meter(0);\n }" ]
[ "0.6025113", "0.5865192", "0.5804599", "0.5803992", "0.5780852", "0.57665", "0.57564956", "0.5733615", "0.57332987", "0.5732088", "0.5681655", "0.5670642", "0.5670642", "0.5670642", "0.5660234", "0.5653874", "0.5598495", "0.5576203", "0.55364466", "0.55133706", "0.54906946", "0.54906946", "0.54906946", "0.54906946", "0.54898494", "0.5475183", "0.5463598", "0.54327756", "0.5421788", "0.5421788", "0.5421788", "0.5421788", "0.5421788", "0.5421788", "0.5421788", "0.5420377", "0.5420377", "0.5420377", "0.5408892", "0.5400077", "0.53644323", "0.53524876", "0.5346626", "0.53450847", "0.5342406", "0.53391105", "0.533703", "0.5331774", "0.5331774", "0.5331774", "0.5331774", "0.5331774", "0.5331774", "0.5331774", "0.5331774", "0.5331774", "0.5331774", "0.5331774", "0.5331774", "0.5327484", "0.5325725", "0.5325725", "0.53196466", "0.5309987", "0.5304873", "0.52988225", "0.5296695", "0.52956104", "0.52909184", "0.52904594", "0.52881145", "0.5286769", "0.5285318", "0.5252357", "0.52514243", "0.52491826", "0.52463806", "0.52450943", "0.52391136", "0.52390295", "0.52357805", "0.5230626", "0.5227796", "0.52151996", "0.52116233", "0.5210131", "0.51975465", "0.519617", "0.5192928", "0.51912516", "0.5185287", "0.5183151", "0.51763725", "0.5167195", "0.5162511", "0.515444", "0.5152468", "0.5151362", "0.5146998", "0.5146967", "0.51468605" ]
0.0
-1
/ Inserting the word starting from root
function InsertIntoTrie($vertexPointer,$wordString){ $edgeLocation = 0; //counter to find edge position /* Check if the character is within the alphabet range, 0 - 25, if it is a character that is not an alphabet, it will be a bigger or smaller value; */ if(($wordString[0] - 97) < 0 || ($wordString[0] - 97 > 25) ) $edgeLocation = 26; else $edgeLocation = ($wordString[0]-97); //return if the word if it has a character not in the alphabet. if($edgeLocation == 26) return; /* If the edge doesnt exist for that pointer, make it, assign it, and point to it */ if($vertexPointer->edges[$edgeLocation] == NULL){ $vertexPointer->edges[$edgeLocation] = new Edge($wordString[0]); $vertexPointer->edgeP[] = $edgeLocation; $vertexPointer->edges[$edgeLocation]->child = new Vertex($vertexPointer . $wordString[0]); } /* If it is the last character in the word then this is the end of the word, so set the flag as true and find the neighbors as well as put this vertex back into the vertexList for lter use with breadthFirstSearch */ $nextVertex = $vertexPointer->edges[$edgeLocation]->child; if(strlen($wordString) == 1){ findNeighbor($nextVertex,$root,$nextVertex->word,0); $vertexList[] = $nextVertex; $nextVertex->end = true; }//otherwise keep inserting into the trie else InsertIntoTrie($vertexPointer->edges[$edgeLocation]->child,substr($wordString,1,strlen($wordString))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insert($word){\n\t\tinsert($root,$word);\n\t}", "function insert($word) {\n $p = $this->root;\n for ($i=0; $i < strlen($word); $i++) { \n $index = (int)(ord($word[$i]) - ord('a'));\n if ($p->children[$index] == null) {\n $p->children[$index] = new TrieNode();\n }\n $p = $p->children[$index]; // 移动到子节点\n }\n $p->is_word = true; // 当前单词走完一遍,标记is_word为真\n }", "function insert($word)\n {\n $node = $this->root;\n for ($i = 0; $i < strlen($word); $i++) {\n $index = ord($word[$i]) - ord('a');\n if (!isset($node->children[$index])) {\n $node->children[$index] = new TrieNode();\n }\n //每个节点都是必须要有的\n $node = $node->children[$index];\n }\n $node->isEnd = true;\n }", "function insert($word) {\n if (strlen($word) == 0) return;\n\n $cur = $this->root;\n for ($i = 0; $i < strlen($word); $i++) {\n $c = substr($word, $i, 1);\n if (!isset($cur->next[$c])) {\n $cur->next[$c] = new TrieNode();\n }\n $cur = $cur->next[$c];\n }\n\n if (!$cur->$isWord) {\n $cur->$isWord = true;\n $this->size++;\n }\n }", "function insert($word)\n {\n $node = $this;\n for ($i = 0; $i < strlen($word); $i++) {\n $index = ord($word[$i]) - ord('a');\n if (!isset($node->children[$index])) {\n $node->children[$index] = new Trie();\n }\n //每个节点都是必须要有的\n $node = $node->children[$index];\n }\n $node->isEnd = true;\n }", "function insert($word)\n {\n if (empty($word)) {\n return false;\n }\n $length = mb_strlen($word);\n $node = &$this->root;\n for ($i = 0; $i < $length; $i++) {\n $letter = mb_substr($word, $i, 1);\n if (!isset($node[$letter])) {\n $node[$letter] = [\n 'is_end' => false,\n ];\n }\n $node = &$node[$letter];\n }\n $node['is_end'] = true;\n return true;\n }", "public function test_insertPrefix()\n\t{\n\t}", "public function insertString($string, $index) {\n if ($string != null && strlen($string)) {\n $value = $string{0};\n $child = null;\n if (isset($this->children[$value])) {\n $child = $this->children[$value];\n }\n else {\n $child = new PrefixTreeNode();\n $this->children[$value] = $child;\n }\n\n $remainder = substr($string, 1);\n $child->indexes[] = $index;\n $child->insertString($remainder, $index);\n }\n }", "public function insertBaseTokens($content);", "function insertSub ( &$_n, $_payload, $_pos )\n\t{\n\t\t\t//empty pointer from an internal node\n\t\tif ( ! is_object ( $_n ) )\n\t\t{\n\t\t\t//auto leaf\n\t\t\t$_n = new Node ( $_payload->payload [ $_pos ] );\n\t\t} \n\t\t\n\t\t\t//we placed the leaf in an appropriate position and will\n\t\t\t//now continue with our new internal node.\n\t\tif ( ord ( $_payload->payload [ $_pos ] ) < ord ( $_n->char ) )\n\t\t{\n\t\t\t$this->insertSub ( &$_n->left, $_payload, $_pos );\t\n\t\t\n\t\t} else if ( ord ( $_payload->payload [ $_pos ] ) > ord ( $_n->char ) )\n\t\t{\n\t\t\t$this->insertSub ( &$_n->right, $_payload, $_pos );\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\tif ( $_pos+1 == strlen ( $_payload->payload ) )\n\t\t\t{\n\t\t\t\t$_n->word = $_payload; \n\t\t\t\t$this->is_leaf = false;\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$this->insertSub ( &$_n->mid, $_payload, $_pos+1 );\n\t\t\n\t\t\t}\n\t\t}\t\t\n\t}", "abstract public function insert ( \\Hoa\\Tree\\Generic $child );", "public function putWordInTheMiddle(array $array, string $word);", "function mINSERT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$INSERT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:19:3: ( 'insert' ) \n // Tokenizer11.g:20:3: 'insert' \n {\n $this->matchString(\"insert\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function expand($root);", "public function build($word, $content);", "public function insertKeyword($page_id, $word) {\n $page_id = $this->connection->escape_string($page_id);\n $word = $this->connection->escape_string($word);\n \n $this->query(\"INSERT INTO Keywords (page_id, word)\"\n . \" VALUES ('$page_id', '$word')\");\n }", "public function insert($item)\n {\n $this->insertItem($item, $this->root);\n }", "function insert_root($data)\n\t{\n\t\t$table = $this->tree_table;\n\n\t\t$this->_lock_tree_table();\n\n\t\tif($this->get_root() != false) \n\t\t{\n\t\t\t$this->_unlock_tree_table();\n\t\t\treturn false;\n\t\t}\n\t\t$data = $this->_sanitize_data( $data );\n\t\t$data['depth'] = 0;\n\t\t$data = array_merge( $data, array('lft' => 1, 'rgt' => 2) );\n\t\tunset($data['node_id']);\n\n\t\tif(!isset($data['moved']))\n\t\t{\n\t\t\t$data['moved'] = 0;\n\t\t}\n\t\t\n\t\tee()->db->insert( $this->tree_table, $data );\n\t\t$this->_unlock_tree_table();\n\t\treturn true;\n\t}", "public function addTagToPostInTheMiddle() {}", "function bl_InsertWords($page_id,$words)\n {\n\n \tforeach ($words as $word => $infos) \n \t{\n\t\t\t// On test si l'URL existe deja\n\t\t\t$worditem = db_getWordByWord($word);\n\t\t\tif (!$worditem) {\n\t\t\t\t$id = db_addWord($word);\n\t\t\t} else {\n\t\t\t\t// l'URL existe deja\n\t\t\t\t$id = $worditem['word_id'];\n\t\t\t}\n\n\n \t\t//if (!db_isWordedExist($page_id,$id)) {\n \t\t\t//db_createFastWorded($page_id,$id,$infos['total']['avg_weight'],$infos['total']['avg_density']);\n \t\t//}\n \t\t//db_insertWordedData($page_id,$id,$tag,$infos['freq'],$infos['density'],$infos['weight']);\n \t}\n \tdb_createFastWorded($page_id,$words);\n }", "public function Insert($data) {\r\n if($this->root == null) {\r\n return ($this->root = new Node($data));\r\n }\r\n return $this->insertHelper($data, $this->root);\r\n }", "function rootsBySynonyms($concept, $mysql_conn) {\n\t// Get language meta information from DB\n\t$meta = getMetaInformation($mysql_conn);\n\t\n\t// Get word entry from database\n\t$sql = \"SELECT * FROM synie WHERE `concept`='\" . mysql_real_escape_string($concept) . \"'\";\n\t$results = mysql_query($sql, $mysql_conn);\n\tif(!$results) die(err(\"invalid query -- \".mysql_error()));\n\t$row = mysql_fetch_assoc($results);\n\t\n\t// Storage arrays\n\t$words = array();\n\t$used_roots = array();\n\t$root_clumps = array();\n\t$edges = array();\n\t$core_nodes = array();\n\t$extra_nodes = array();\n\t\n\tforeach($meta as $lang=>$arr) {\n\t\t// Iterate through languages and build up $core_nodes and $extra_nodes\n\t\t$rootcode = $arr['rootcode'];\n\t\t$node_data = $arr['nodedata'];\n\t\t$pieroots = clean_parts(explode(\";\", $row[$rootcode]));\n\t\t$signs = clean_parts(explode(\";\", $row[$lang]));\n\t\t$groups = array();\n\t\t$roots = array();\n\t\t\n\t\tif(count($pieroots)!=count($signs)) {\n\t\t\t// Verify that $pieroots and $signs are of same length\n\t\t\t// Append blank strings to the shorter array until they are parallel.\n\t\t\twhile(count($pieroots)<count($signs)) {\n\t\t\t\t$pieroots[] = \"\";\n\t\t\t}\n\t\t\twhile(count($signs)<count($pieroots)) {\n\t\t\t\t$signs[] = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach($pieroots as $index=>$pieroot) {\n\t\t\t// Determine cognate group for each pieroot\n\t\t\t$group = array_search($pieroot, $used_roots);\n\t\t\t$root_clump = array();\n\t\t\tif($group===false) {\n\t\t\t\t$used_roots[] = $pieroot;\n\t\t\t\t$group = count($used_roots)-1;\n\t\t\t\t$splitroot = clean_parts(explode(\",\", $pieroot));\n\t\t\t\tforeach($splitroot as $j=>$root) {\n\t\t\t\t\t$sql = \"SELECT `root`,`origin`,`meaning`,`attested` FROM synie_roots WHERE `root`='\". mysql_real_escape_string($root) .\"'\";\n\t\t\t\t\t$results = mysql_query($sql, $mysql_conn) or die(err(\"can't find root definition\"));\n\t\t\t\t\t$res = mysql_fetch_assoc($results);\n\t\t\t\t\t$root_clump[] = array('root' => $res['root'],\n\t\t\t\t\t\t\t\t\t\t 'origin' => $res['origin'],\n\t\t\t\t\t\t\t\t\t\t 'meaning' => $res['meaning'],\n\t\t\t\t\t\t\t\t\t\t 'attested'=> (!strcmp($res['attested'], \"1\")));\n\t\t\t\t}\n\t\t\t\t$root_clumps[] = $root_clump;\n\t\t\t}\n\t\t\t$roots[] = $root_clumps[$group];\n\t\t\t$groups[] = $group;\n\t\t}\n\t\t\n\t\t// Create new core word\n\t\t$new_core_word = array('concept' => $concept,\n\t\t\t\t\t\t\t 'sign' => $signs[0],\n\t\t\t\t\t\t\t 'PIEroot' => $roots[0],\n\t\t\t\t\t\t\t 'group' => $groups[0]);\n\t\t$new_core_node = $node_data;\n\t\t$new_core_node['data'] = $new_core_word;\n\t\t$core_nodes[] = $new_core_node;\n\t\t\n\t\t// Put the remainder of the words in extra_words array\n\t\t\n\t\tfor($i=1; $i<count($signs); $i++) {\n\t\t\t$new_extra_node = $node_data;\n\t\t\t$new_extra_word = array('concept' => $concept,\n\t\t\t\t\t\t\t\t\t'sign'\t => $signs[$i],\n\t\t\t\t\t\t\t\t\t'PIEroot' => $roots[$i],\n\t\t\t\t\t\t\t\t\t'group' => $groups[$i]);\n\t\t\t$new_extra_node['data'] = $new_extra_word;\n\t\t\t$extra_nodes[] = $new_extra_node;\n\t\t\t$core_index = count($core_nodes)-1;\n\t\t\t$extra_index = count($extra_nodes)-1;\n\t\t\t$extra_nodes[$extra_index]['data'] = $new_extra_word;\n\t\t\t$edges[] = array('source' => $core_index, 'to_delta' => $extra_index);\n\t\t}\n\t}\n\t\n\tfor($i=0; $i<count($edges); $i++) {\n\t\t// Calculate absolute position of target in edges\n\t\t$edges[$i]['target'] = count($core_nodes) + $edges[$i]['to_delta'];\n\t\tunset($edges[$i]['to_delta']);\n\t\t$edges[$i]['value'] = 1; # default value -- any semantic possibility for edge weights?\n\t}\n\t\n\t\n\t// Create final object\n\t$meta_data = array('groups' => count($used_roots));\n\t$json_data = array('nodes' => array_merge($core_nodes, $extra_nodes),\n\t\t\t\t\t 'edges' => $edges,\n\t\t\t\t\t 'meta' => $meta_data);\n\t\n\treturn $json_data;\t\n}", "public function compileInsertString( $data );", "private function normalize_root( string $root ): string {\n\t\t$root = $this->remove_leading_backslash( $root );\n\t\t$root = $this->ensure_trailing_backslash( $root );\n\n\t\treturn $root;\n\t}", "public function testNewNodePrependToRoot()\n {\n $model2 = Animal::findOne(2);\n $root = $model2->getRoot();\n $model4 = Animal::findOne(4);\n \n $model = new Animal();\n $model->name = 'new';\n \n $this->assertTrue($model->prependTo($root));\n $this->assertSame($root, $model->getRoot());\n $this->assertSame('', $model->path);\n $this->assertEquals(1, $model->level);\n $this->assertEquals(1, $model->weight);\n \n $model2->refresh();\n $this->assertEquals(3, $model2->weight);\n $model4->refresh();\n $this->assertEquals(5, $model4->weight);\n \n }", "function putInTree()\n\t{\n//echo \"st:putInTree\";\n\t\t// chapters should be behind pages in the tree\n\t\t// so if target is first node, the target is substituted with\n\t\t// the last child of type pg\n\t\tif ($_GET[\"target\"] == IL_FIRST_NODE)\n\t\t{\n\t\t\t$tree = new ilTree($this->content_object->getId());\n\t\t\t$tree->setTableNames('lm_tree','lm_data');\n\t\t\t$tree->setTreeTablePK(\"lm_id\");\n\n\t\t\t// determine parent node id\n\t\t\t$parent_id = (!empty($_GET[\"obj_id\"]))\n\t\t\t\t? $_GET[\"obj_id\"]\n\t\t\t\t: $tree->getRootId();\n\t\t\t// determine last child of type pg\n\t\t\t$childs =& $tree->getChildsByType($parent_id, \"pg\");\n\t\t\tif (count($childs) != 0)\n\t\t\t{\n\t\t\t\t$_GET[\"target\"] = $childs[count($childs) - 1][\"obj_id\"];\n\t\t\t}\n\t\t}\n\t\tif (empty($_GET[\"target\"]))\n\t\t{\n\t\t\t$_GET[\"target\"] = IL_LAST_NODE;\n\t\t}\n\n\t\tparent::putInTree();\n\t}", "private function installWords()\n {\n $data = file(__DIR__ . '/../bad_words_pl.txt');\n\n $bom = pack('H*', 'EFBBBF');\n\n $rows = [];\n foreach ($data as $row) {\n $rows[] = [trim(preg_replace(\"/^$bom/\", '', $row))];\n }\n\n Yii::$app\n ->db\n ->createCommand()\n ->batchInsert($this->table, ['word'], $rows)\n ->execute();\n }", "function insertSubchapter()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\t$this->insertChapter(true);\n\t}", "public function addDefinition()\r\n{\r\n $query_string = \"INSERT INTO glossary \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"word = :word, \";\r\n $query_string .= \"worddefinition = :worddefinition\";\r\n\r\n return $query_string;\r\n}", "function addText($text);", "function upm_replace_howdy( $wp_admin_bar ) {\r\n $my_account=$wp_admin_bar->get_node('my-account');\r\n $new_title = str_replace( 'Howdy,', 'Welcome,', $my_account->title );\r\n $wp_admin_bar->add_node( array(\r\n 'id' => 'my-account',\r\n 'title' => $new_title,\r\n ) );\r\n}", "function cognatesByPIERoot($root, $conn) {\n\t// Fetch meta information from DB\n\t$meta = getMetaInformation($conn);\n\t\n\t// Retrieve requested root from DB\n\t$sql = \"SELECT * FROM synie_roots WHERE `root`='\". mysql_real_escape_string($root) .\"'\";\n\t$results = mysql_query($sql, $conn) or die(err(\"invalid query\".mysql_error()));\n\t$row = mysql_fetch_assoc($results);\n\t\n\t$nodes = array();\n\t// Iterate through $meta and build nodes array\n\tforeach($meta as $lang=>$arr) {\n\t\t$start = intval($arr['begin']);\n\t\t$end = intval($arr['end']);\n\t\tif($end==0) $end = intval(date('Y'));\n\t\t$node_data = $arr['nodedata'];\n\t\t$raw_words = clean_parts(explode(\";\", $row[$lang]));\n\t\t$words = array();\n\t\tif(!strcmp($lang, \"ne\")) {\n\t\t\t// Modern english doens't have (or need) glosses\n\t\t\t$words = $raw_words;\n\t\t}else{\n\t\t\t// Interpret the signs and glosses from the database entries\n\t\t\tforeach($raw_words as $i=>$word) {\n\t\t\t\t$matches = NULL;\n\t\t\t\tif(preg_match(\"/(?P<sign>[^\\'\\[]+)\\s[\\'\\]](?P<gloss>[^\\'\\]]+)[\\]\\']/\", $word, $matches)!=1) {\n\t\t\t\t\t// Error reading database entry. It is not in the right format. For now\n\t\t\t\t\t// exit silently.\n\t\t\t\t\t$words[] = array('sign'=>'', 'gloss'=>'');\n\t\t\t\t}else{\n\t\t\t\t\t$aux = false;\n\t\t\t\t\tif(strpos($word, '[')!==false && strpos($word, ']')!==false) {\n\t\t\t\t\t\t$aux = true;\n\t\t\t\t\t}\n\t\t\t\t\t$words[] = array('sign'=>$matches['sign'], 'gloss'=>$matches['gloss'], 'auxType'=>$aux);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t\t$data = array('words' => $words, // words is a list of objects [{'sign': $sign, 'gloss': $gloss} ... ]\n\t\t\t\t\t 'start' => $start,\n\t\t\t\t\t 'end' => $end);\n\t\t$node_data['data'] = $data;\n\t\t$nodes[] = $node_data;\n\t}\n\t\n\treturn $nodes;\t\n}", "public function moveTagFromEndToTheMiddle() {}", "public function insertFirst($data){\r\n $link = new Note($data);\r\n $link->next = $this->firstNode;\r\n $this->firstNode = $link;\r\n if($this->lastNode == null){\r\n $this->lastNode = $link;\r\n $this->count ++;\r\n }\r\n }", "public function replaceBaseTokens(&$content);", "function str_insert($keyValue, $string)\n {\n return str::insert($keyValue, $string);\n }", "protected function manageWord($word, $index) {\n // normalize\n $word = mb_strtolower($word, $this->encoding);\n \n $termObj = new Term($word);\n\n // save the term\n if(!$this->uniqueMatchesStatus[$word]) {\n $termObj->save();\n $this->uniqueMatchesStatus[$word] = TRUE;\n }\n \n // add to term list\n if ($this->termsList->contains($termObj)) {\n // just add new occurrence\n $this->invertedIndex->addOccurrence($this->invertedIndex->getInvertedIndex($termObj, $this), $index);\n } else {\n $this->termsList->push($termObj);\n\n // save term-doc relation (inverted index) and position of occurrance\n $this->invertedIndex->addRelation($termObj, $this, $index);\n }\n }", "public function snake($word);", "public function updateRootline() {}", "function apachesolr_add_tags_to_document(&$document, $text) {\r\n $tags_to_index = variable_get('apachesolr_tags_to_index', array(\r\n 'h1' => 'tags_h1',\r\n 'h2' => 'tags_h2_h3',\r\n 'h3' => 'tags_h2_h3',\r\n 'h4' => 'tags_h4_h5_h6',\r\n 'h5' => 'tags_h4_h5_h6',\r\n 'h6' => 'tags_h4_h5_h6',\r\n 'u' => 'tags_inline',\r\n 'b' => 'tags_inline',\r\n 'i' => 'tags_inline',\r\n 'strong' => 'tags_inline',\r\n 'em' => 'tags_inline',\r\n 'a' => 'tags_a'\r\n ));\r\n\r\n // Strip off all ignored tags.\r\n $text = strip_tags($text, '<'. implode('><', array_keys($tags_to_index)) .'>');\r\n\r\n preg_match_all('@<('. implode('|', array_keys($tags_to_index)) .')[^>]*>(.*)</\\1>@Ui', $text, $matches);\r\n foreach ($matches[1] as $key => $tag) {\r\n $tag = strtolower($tag);\r\n // We don't want to index links auto-generated by the url filter.\r\n if ($tag != 'a' || !preg_match('@(?:http://|https://|ftp://|mailto:|smb://|afp://|file://|gopher://|news://|ssl://|sslv2://|sslv3://|tls://|tcp://|udp://|www\\.)[a-zA-Z0-9]+@', $matches[2][$key])) {\r\n $document->{$tags_to_index[$tag]} .= ' '. $matches[2][$key];\r\n }\r\n }\r\n}", "public function addWord($word)\n {\n $this->_model->addWord($word);\n }", "abstract public function insert();", "public function makeRoot($position);", "function cheffism_admin_bar_replace_howdy($wp_admin_bar) {\n $account = $wp_admin_bar->get_node('my-account');\n $replace = str_replace('Howdy,', 'Welcome,', $account->title); \n $wp_admin_bar->add_node(array('id' => 'my-account', 'title' => $replace));\n}", "function searchesAddSearch($text){\n array_push($text, array('key' => 'PARENT_SEARCHES_ADD_SEARCH',\n 'parent' => '',\n 'text' => 'Search - Add search'));\n \n array_push($text, array('key' => 'SEARCHES_ADD_SEARCH_NAME',\n 'parent' => 'PARENT_SEARCHES_ADD_SEARCH',\n 'text' => 'New search'));\n \n array_push($text, array('key' => 'SEARCHES_ADD_SEARCH_SUBMIT',\n 'parent' => 'PARENT_SEARCHES_ADD_SEARCH',\n 'text' => 'Add search'));\n array_push($text, array('key' => 'SEARCHES_ADD_SEARCH_ADDING',\n 'parent' => 'PARENT_SEARCHES_ADD_SEARCH',\n 'text' => 'Adding a new search ...'));\n array_push($text, array('key' => 'SEARCHES_ADD_SEARCH_SUCCESS',\n 'parent' => 'PARENT_SEARCHES_ADD_SEARCH',\n 'text' => 'You have succesfully added a new search.'));\n \n return $text;\n }", "public function insert($i) {\n $this->_nodes[$this->_count] = new Node($i, $this->_pointer, $this->node()->right());\n $this->right()->setLeft($this->_count);\n $this->node()->setRight($this->_count);\n $this->_pointer = $this->_count;\n $this->_count++;\n }", "function replace_hi_greeting( $wp_admin_bar ) {\n\t$my_account = $wp_admin_bar->get_node( 'my-account' );\n\t$newtitle = str_replace( 'Hi,', 'Welcome', $my_account->title );\n\t$wp_admin_bar->add_node( array(\n\t\t'id' => 'my-account',\n\t\t'title' => $newtitle\n\t) );\n}", "function apostrophe() {\n global $lang;\n $this->doc .= $lang['apostrophe'];\n }", "private function insertCloneFolder()\n {\n global $boot;\n $coreIP = $boot->env('coreIP');\n\n if (file_exists($this->rootDir . \"/inserts/$this->oldName\")) ZFileHelper::copyDirectory($this->rootDir . \"/inserts/$this->oldName\", $this->rootDir . \"/inserts/$this->newName\");\n\n $sub_dirs = glob($this->rootDir . \"/inserts/$this->newName/*\");\n\n foreach ($sub_dirs as $dir) {\n if ($dir !== null && is_file($dir)) {\n $content = file_get_contents($dir);\n $replace = [\n $this->oldName => $this->newName\n ];\n $content = strtr($content, $replace);\n file_put_contents($dir, $content);\n }\n }\n\n $newdb = $this->dbname;\n $data = require $this->rootDir . '/configs/data/' . $this->oldName . '.php';\n $source = $data['components']['db']['dbName'];\n\n $file = $this->rootDir . '/configs/data/' . $this->newName . '.php';\n $file_content = file_get_contents($file);\n $replace = [\n $source => $newdb\n ];\n\n $content = strtr($file_content, $replace);\n file_put_contents($file, $content);\n\n }", "public function insert($uavmDocument);", "static function add_word($user_id, $word_list_id, $lang1, $lang2, $comment) {\n global $con;\n // TODO check owner\n $sql = \"INSERT INTO `word` (`list`, `language1`, `language2`, `comment`, `time`, `user`)\n\t\tVALUES (\".$word_list_id.\", '\".$lang1.\"', '\".$lang2.\"', '\".$comment.\"', \".time().\", \".$user_id.\");\";\n $query = mysqli_query($con, $sql);\n return mysqli_insert_id($con);\n }", "public function addRawContent($words);", "protected function updateRootLinesWithTranslations() {}", "function apachesolr_add_taxonomy_to_document(&$document, $node) {\r\n if (isset($node->taxonomy) && is_array($node->taxonomy)) {\r\n foreach ($node->taxonomy as $term) {\r\n // Double indexing of tids lets us do effecient searches (on tid)\r\n // and do accurate per-vocabulary faceting.\r\n\r\n // By including the ancestors to a term in the index we make\r\n // sure that searches for general categories match specific\r\n // categories, e.g. Fruit -> apple, a search for fruit will find\r\n // content categorized with apple.\r\n $ancestors = taxonomy_get_parents_all($term->tid);\r\n foreach ($ancestors as $ancestor) {\r\n $document->setMultiValue('tid', $ancestor->tid);\r\n $document->setMultiValue('im_vid_'. $ancestor->vid, $ancestor->tid);\r\n $name = apachesolr_clean_text($ancestor->name);\r\n $document->setMultiValue('vid', $ancestor->vid);\r\n $document->{'ts_vid_'. $ancestor->vid .'_names'} .= ' '. $name;\r\n // We index each name as a string for cross-site faceting\r\n // using the vocab name rather than vid in field construction .\r\n $document->setMultiValue('sm_vid_'. apachesolr_vocab_name($ancestor->vid), $name);\r\n }\r\n }\r\n }\r\n}", "function insert_string_in_file($file,$insert_point,$string,$return=FALSE,$position='')\n{\n\t// check if file exists\n\tif(!file_exists($file))\n\t{\n\t\treturn($return === TRUE ? 'ERROR - file ('.$file.') does not exist' : FALSE);\n\t}\n\t// check if file is writeable\n\tif(!is_writeable($file))\n\t{\n\t\treturn($return === TRUE ? 'ERROR - file ('.$file.') is not writeable' : FALSE);\n\t}\n\t// contruct insertion scheme\n\tif(empty($position))\n\t{\n\t\t// if nothing specified, replace the insertion point with string\n\t\t$replacement[$insert_point] = $string;\n\t}else{\n\t\tif($position == 'before')\n\t\t{\n\t\t\t// insert the string before the insertion point\n\t\t\t$replacement[$insert_point] = $string.$insert_point;\n\t\t}elseif($position == 'after')\n\t\t{\n\t\t\t// insert the string after the insertion point\n\t\t\t$replacement[$insert_point] = $insert_point.$string;\n\t\t}else{\n\t\t\treturn($return === TRUE ? 'ERROR - position ('.$position.') is invalid - \n\t\t\t\t\tuse &quot;before&quot; or &quot;after&quot;' : FALSE);\n\t\t}\n\t}\n\t// check filelenght\n\t$filesize = filesize($file);\n\tclearstatcache();\n\tif($filesize == 0)\n\t{\n\t\treturn ($return === TRUE ? 'ERROR - file ('.$file.') is empty' : FALSE);\t\n\t}\n\t// open file for read and write access\n\tif(!$handle = fopen($file, 'r+'))\n\t{\n\t\treturn($return === TRUE ? 'ERROR - cannot open file ('.$file.')' : FALSE);\n\t}else{\n\t\t$old_contents = fread($handle, $filesize);\n\t}\n\t// insert string at the insertion point\n\tif(!strpos($old_contents,$insert_point))\n\t{\n\t\tfclose($handle);\n\t\treturn($return === TRUE ? 'ERROR - insertion point ('.$insert_point.') not found' : FALSE);\n\t}else{\n\t\t//ftruncate($handle,0);\n\t\t$new_contents = strtr($old_contents,$replacement);\n\t}\n\t// write new content to file\n//\tif(fwrite($handle, $new_contents) === FALSE)\n//\t{\n//\t\tfclose($handle);\n//\t\treturn ($return === TRUE ? 'ERROR - cannot write to file ('.$file.')' : FALSE);\n//\t}\n echo \"CONTENTS:\\n$new_contents\\n\";\n\tfclose($handle);\n\treturn($return === TRUE ? 'SUCCESS - your string was inserted' : TRUE);\n}", "public abstract function insert();", "function createVector(&$docVector, &$word){\r\n if(isset($docVector[$word]) == false){\r\n $docVector[$word] = 1;\r\n }\r\n $docVector[$word] = $docVector[$word]+1;\r\n}", "public function insertBefore (DOMNode $newnode , $refnode = null) {}", "function associateWordWithWord($wordID, $seeAlsoID, $message=\"\"){\r\n\tinsertIntoTable(\"seealso\", array(\"wordID\" => $wordID, \"seeAlsoID\" => $seeAlsoID));\r\n\tprint $message;\r\n}", "function replace_howdy($wp_admin_bar) {\n $my_account=$wp_admin_bar->get_node('my-account');\n $newtitle = str_replace('Howdy,', '', $my_account->title );\n $wp_admin_bar->add_node(array(\n 'id' => 'my-account',\n 'title' => $newtitle,\n )\n );\n}", "private function addWord($word) {\n // - En las cajas de cuadrícula\n // - A la lista de palabras que se encuentran\n\n if($word->getLabel()=='') {return;}\n\n // Agregar a cuadros de cuadrícula\n $j=0;\n switch($word->getOrientation()) {\n\n case Word::HORIZONTAL:\n for ($i=$word->getStart(); $j<strlen($word->getLabel()); $i++) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n case Word::VERTICAL:\n for($i=$word->getStart(); $j<strlen($word->getLabel()); $i+=$this->_size) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n case Word::DIAGONAL_LEFT_TO_RIGHT:\n for($i=$word->getStart(); $j<strlen($word->getLabel()); $i+=$this->_size+1) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n case Word::DIAGONAL_RIGHT_TO_LEFT:\n for($i=$word->getStart(); $j<strlen($word->getLabel()); $i+=$this->_size-1) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n } // switch\n\n // Agregar la palabra a la lista\n $this->_wordsList[]=$word;\n\n }", "function mapWord(&$word_map, $word, $offset, $f)\r\n{\r\n if (isset($word_map[$word])) {\r\n if (isset($word_map[$word][$f])){\r\n $term_count = $word_map[$word]['term_count']+1;\r\n $word_map[$word]['term_count'] = $term_count;\r\n array_push($word_map[$word][$f], $offset);\r\n } else {\r\n $doc_count = $word_map[$word]['doc_count']+1;\r\n $word_map[$word]['doc_count'] = $doc_count;\r\n $word_map[$word][$f] = array();\r\n $term_count = $word_map[$word]['term_count']+1;\r\n $word_map[$word]['term_count'] = $term_count;\r\n array_push($word_map[$word][$f],$offset);\r\n }\r\n }\r\n else {\r\n $word_map[$word] = array();\r\n $word_map[$word]['doc_count'] = 1;\r\n $word_map[$word]['term_count'] = 1;\r\n $word_map[$word][$f] = array();\r\n array_push($word_map[$word][$f], $offset);\r\n }\r\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 testNewNodeInsertBeforeFirstChild()\n {\n $model1 = Animal::findOne(1);\n $model4 = Animal::findOne(4);\n \n $model = new Animal();\n $model->name = 'new'; \n \n $this->assertTrue($model->insertBefore($model1));\n $model1->refresh();\n $model4->refresh();\n \n $this->assertSame('', $model->path);\n $this->assertEquals(1, $model->level);\n $this->assertEquals(1, $model->weight); \n \n $this->assertEquals(2, $model1->weight); \n $this->assertEquals(5, $model4->weight); \n }", "public function insert(Node $node)\n {\n $this->root->insert($node);\n }", "public function insertByPath(&$curr_node, $path='', $array=null)\n {\n if (is_string($path)) {\n $p = explode('/', $path);\n $n = array_shift($p);\n if ($curr_node instanceof Node) {\n $curr_name = $curr_node->getName();\n }\n if ($curr_name === $n) {\n if (isset($p[0])) {\n $n = $p[0];\n }\n if ($next_node = $curr_node->getNode($n)) {\n $next_node = $next_node;\n } else {\n $next_node = $curr_node;\n }\n \n } else {\n $new_node = self::build($n);\n $new_node->setData($array);\n $curr_node->insert($new_node);\n $next_node = $new_node;\n }\n if ($n !== '') {\n $remaining_path = implode('/', $p);\n while (count($p) > 0) {\n return $this->insertByPath($next_node, $remaining_path, $array);\n }\n }\n }\n }", "function locationsAddLocation($text){\n array_push($text, array('key' => 'PARENT_LOCATIONS_ADD_LOCATION',\n 'parent' => '',\n 'text' => 'Locations - Add location'));\n \n array_push($text, array('key' => 'LOCATIONS_ADD_LOCATION_NAME',\n 'parent' => 'PARENT_LOCATIONS_ADD_LOCATION',\n 'text' => 'New location'));\n array_push($text, array('key' => 'LOCATIONS_ADD_LOCATION_SUBMIT',\n 'parent' => 'PARENT_LOCATIONS_ADD_LOCATION',\n 'text' => 'Add location'));\n array_push($text, array('key' => 'LOCATIONS_ADD_LOCATION_ADDING',\n 'parent' => 'PARENT_LOCATIONS_ADD_LOCATION',\n 'text' => 'Adding a new location ...'));\n array_push($text, array('key' => 'LOCATIONS_ADD_LOCATION_SUCCESS',\n 'parent' => 'PARENT_LOCATIONS_ADD_LOCATION',\n 'text' => 'You have succesfully added a new location.'));\n \n return $text;\n }", "public function insertAfterWordCount($wordCount, $insertString) {\n $totalWordCount = 0;\n $inserted = FALSE;\n\n foreach($this->_explodedBody as $key => $exploded) {\n $totalWordCount = $totalWordCount + $this->_paragraphCounts[$key];\n\n if($totalWordCount >= $wordCount && !$inserted && !isset($this->_inserts[$key])) {\n $this->_inserts[$key] = $insertString;\n $inserted = TRUE;\n }\n }\n }", "private function adjust_wordfencewaf_root_path() {\n\t\tglobal $wp_filesystem, $updraftplus;\n\t\tif (file_exists($this->abspath.'wordfence-waf.php')) {\n\t\t\t$updraftplus->log(\"Wordfence auto-prepended file has been detected during the restoration. Trying to open the file now for various-fixing tasks\");\n\t\t\t$wordfence_waf = file_get_contents($this->abspath.'wordfence-waf.php');\n\t\t\tif (false !== $wordfence_waf) {\n\t\t\t\t// https://regex101.com/r/VeCwzH/1/\n\t\t\t\tif (preg_match_all('/(?:wp-content[\\/\\\\\\]+plugins[\\/\\\\\\]+wordfence[\\/\\\\\\]+waf[\\/\\\\\\]+bootstrap\\.php|wp-content[\\/\\\\\\]+wflogs[\\/\\\\\\]*)((?:\\'|\"))/is', $wordfence_waf, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n\t\t\t\t\t$matches = array_reverse($matches);\n\t\t\t\t\tforeach ($matches as $match) {\n\t\t\t\t\t\t$enclosure_cnt = 0;\n\t\t\t\t\t\t$start = (int) $match[0][1];\n\t\t\t\t\t\t$enclosure = $match[1][0];\n\t\t\t\t\t\t$offset = -1;\n\t\t\t\t\t\tfor ($i=$start; $i>=0; $i--) {\n\t\t\t\t\t\t\tif ($enclosure_cnt > 0) {\n\t\t\t\t\t\t\t\tif ('\\\\' === $wordfence_waf[$i]) {\n\t\t\t\t\t\t\t\t\t$enclosure_cnt--;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$offset = $i+2;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ($enclosure === $wordfence_waf[$i]) {\n\t\t\t\t\t\t\t\t\t$enclosure_cnt++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($offset >= 0) {\n\t\t\t\t\t\t\tif (false !== stripos($match[0][0], 'wflogs')) {\n\t\t\t\t\t\t\t\t$wordfence_waf = substr_replace($wordfence_waf, WP_CONTENT_DIR.'/wflogs/', $offset, ((int) $match[1][1]) - $offset);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$wordfence_waf = substr_replace($wordfence_waf, WP_PLUGIN_DIR.'/wordfence/waf/bootstrap.php', $offset, ((int) $match[1][1]) - $offset);\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 (!$wp_filesystem->put_contents($this->abspath.'wordfence-waf.php', $wordfence_waf)) {\n\t\t\t\t\t\t$updraftplus->log(\"Couldn't write fixes into the wordfence-waf.php file\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$updraftplus->log(\"Failed to read the wordfence-waf.php file\");\n\t\t\t}\n\t\t}\n\t}", "function insertPage()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php\");\n\t\t\n\t\t$num = ilChapterHierarchyFormGUI::getPostMulti();\n\t\t$node_id = ilChapterHierarchyFormGUI::getPostNodeId();\n\t\t\n\t\tif (!ilChapterHierarchyFormGUI::getPostFirstChild())\t// insert after node id\n\t\t{\n\t\t\t$parent_id = $this->tree->getParentId($node_id);\n\t\t\t$target = $node_id;\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t// insert as first child\n\t\t{\n\t\t\t$parent_id = $node_id;\n\t\t\t$target = IL_FIRST_NODE;\n\t\t}\n\n\t\tfor ($i = 1; $i <= $num; $i++)\n\t\t{\n\t\t\t$page = new ilLMPageObject($this->content_object);\n\t\t\t$page->setType(\"pg\");\n\t\t\t$page->setTitle($lng->txt(\"cont_new_page\"));\n\t\t\t$page->setLMId($this->content_object->getId());\n\t\t\t$page->create();\n\t\t\tilLMObject::putInTree($page, $parent_id, $target);\n\t\t}\n\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}", "public function insert($gunBbl);", "function parse_content($words, $dom) //n words //m 4 letter words\n {\n $fourLetterArray = preg_grep(\"/\\b\\w{4}\\b/\", $words);\n \n foreach($words as $word)\n {\n if (array_search($word, $fourLetterArray))\n {\n $node = $dom->createElement(\"example\", \"**** \");\n }\n else \n {\n $node = $dom->createElement(\"example\", $word . ' ');\n }\n\n $sentence[] = $node;\n }\n return $sentence;\n }", "protected abstract function append($token);", "public function nodeMid();", "public function appendToCurrent(string $name): void\n {\n if ($this->current !== '') {\n $this->current .= '\\\\';\n }\n $this->current .= $this->lastPart = $name;\n }", "protected function _insertElt($elt)\n {\n if (!$elt || isset($this->_tree[$elt['v']])) {\n return;\n }\n\n // UW fix - it may return both 'foo' and 'foo/' as mailbox names.\n // Only add one of these (without the namespace character) to\n // the tree. See Ticket #5764.\n $ns_info = $this->_getNamespace($elt['v']);\n if (isset($this->_tree[rtrim($elt['v'], is_null($ns_info) ? $this->_delimiter : $ns_info['delimiter'])])) {\n return;\n }\n\n $this->_changed = true;\n\n $prev = $this->track\n ? $this->hasChildren($this->_tree[$elt['p']])\n : null;\n\n /* Set the parent array to the value in $elt['p']. */\n if (empty($this->_parent[$elt['p']])) {\n $this->_parent[$elt['p']] = array();\n }\n\n $this->_parent[$elt['p']][] = $elt['v'];\n $this->_tree[$elt['v']] = $elt;\n\n $this->_addEltDiff($elt, 'a');\n if (!is_null($prev) &&\n ($this->hasChildren($this->_tree[$elt['p']]) != $prev)) {\n $this->_addEltDiff($this->_tree[$elt['p']], 'c');\n }\n\n /* Make sure we are sorted correctly. */\n if (count($this->_parent[$elt['p']]) > 1) {\n $this->_setNeedSort($this->_tree[$elt['p']], true);\n }\n }", "private function step1()\n {\n // erte ert\n // replace with er\n if ( ($position = $this->searchIfInR1(array('erte', 'ert'))) !== false) {\n $this->word = preg_replace('#(erte|ert)$#u', 'er', $this->word);\n return true;\n }\n\n // a e ede ande ende ane ene hetene en heten ar er heter as es edes endes enes hetenes ens hetens ers ets et het ast\n // delete\n if ( ($position = $this->searchIfInR1(array(\n 'hetenes', 'hetene', 'hetens', 'heten', 'endes', 'heter', 'ande', 'ende', 'enes', 'edes', 'ede', 'ane',\n 'ene', 'het', 'ers', 'ets', 'ast', 'ens', 'en', 'ar', 'er', 'as', 'es', 'et', 'a', 'e'\n ))) !== false) {\n $this->word = UTF8::substr($this->word, 0, $position);\n return true;\n }\n\n // s\n // delete if preceded by a valid s-ending\n if ( ($position = $this->searchIfInR1(array('s'))) !== false) {\n $word = UTF8::substr($this->word, 0, $position);\n if ($this->hasValidSEnding($word)) {\n $this->word = $word;\n }\n return true;\n }\n }", "function apachesolr_index_add_tags_to_document(ApacheSolrDocument $document, $text) {\n $tags_to_index = _apachesolr_tags_to_index();\n\n // Strip off all ignored tags.\n $allowed_tags = '<' . implode('><', array_keys($tags_to_index)) . '>';\n $text = strip_tags($text, $allowed_tags);\n\n preg_match_all('@<(' . implode('|', array_keys($tags_to_index)) . ')[^>]*>(.*)</\\1>@Ui', $text, $matches);\n foreach ($matches[1] as $key => $tag) {\n $tag = drupal_strtolower($tag);\n // We don't want to index links auto-generated by the url filter.\n if ($tag != 'a' || !preg_match('@(?:http://|https://|ftp://|mailto:|smb://|afp://|file://|gopher://|news://|ssl://|sslv2://|sslv3://|tls://|tcp://|udp://|www\\.)[a-zA-Z0-9]+@', $matches[2][$key])) {\n if (!isset($document->{$tags_to_index[$tag]})) {\n $document->{$tags_to_index[$tag]} = '';\n }\n $document->{$tags_to_index[$tag]} .= ' ' . apachesolr_clean_text($matches[2][$key]);\n }\n }\n}", "public static function insert()\n {\n }", "function addObject( $contentObject, $uri )\n {\n $contentObjectID = $contentObject->attribute( 'id' );\n $currentVersion = $contentObject->currentVersion();\n\n if ( !$currentVersion )\n {\n $errCurrentVersion = $contentObject->attribute( 'current_version');\n require_once( \"lib/ezutils/classes/ezdebug.php\" );\n eZDebug::writeError( \"Failed to fetch \\\"current version\\\" ({$errCurrentVersion})\" .\n \" of content object (ID: {$contentObjectID})\", 'eZSphinx' );\n return;\n }\n\n $indexArray = array();\n $indexArrayOnlyWords = array();\n\n $wordCount = 0;\n $placement = 0;\n $previousWord = '';\n\t\t$textIndex = array();\n\t\t$ObjectLanguagesIndex = array();\n\t\t\n\t\t// Get global object values\n $mainNode = $contentObject->attribute( 'main_node' );\n if ( !$mainNode )\n {\n eZDebug::writeError( 'Unable to fetch main node for object: ' . $contentObject->attribute( 'id' ), 'eZSolr::addObject()' );\n return;\n }\n $pathArray = $mainNode->attribute( 'path_array' ); \n $mainNodeID = $mainNode->attribute( 'node_id' );\n \t\t\n eZContentObject::recursionProtectionStart();\n \n foreach( $currentVersion->translationList( false, false ) as $languageCode )\n {\n \n $textIndex = array();\n\t foreach ( $currentVersion->contentObjectAttributes($languageCode) as $attribute )\n\t {\n $metaData = array();\n\t $textParts = array();\n\t $MetaDataParts = array();\n\t $classAttribute = $attribute->contentClassAttribute();\n\t $text = '';\n\t $integerValue = 0;\n\t \n\t \n\t $contentClassAttribute = $attribute->attribute( 'contentclass_attribute' );\n\t \n\t // Indexing for custom types, in the future i will add more custom attributes :)\n\t switch ( $contentClassAttribute->attribute( 'data_type_string' ) )\n {\n // Usefull then searching related objects\n case 'ezobjectrelation' : \n { \n if ( $classAttribute->attribute( \"is_searchable\" ) == 1 ) { \n //Store related object ID in integer column \n $MetaDataParts[]=$attribute->attribute('data_int');\n\t }\n } break;\n \n //Always index price, it's wrong because of discounts. But where is no discounts perhaps it will be usefull :)\n case 'ezprice' : \n { \n $MetaDataParts[] = (int)($attribute->attribute('data_float')*100);\n } break;\n \n default:\n {\n if ( $classAttribute->attribute( \"is_searchable\" ) == 1 ) { \n $metaData = $attribute->metaData();\n \t if ( is_array( $metaData ) )\n { \n foreach ($metaData as $value)\n {\n $MetaDataParts[] = implode(' ',$value); \n } \n }\n else\n {\n $MetaDataParts[] = $metaData; \n }\n }\n } break;\n }\n\t \n \n $text = eZSearchEngine::normalizeText( strip_tags( implode(' ',$MetaDataParts )), true );\n \n if ( is_numeric( trim( $text ) ) )\n {\n $integerValue = (int) $text;\n $text = ''; // Avoid inserting integer to search column\n }\n else\n {\n $integerValue = 0;\n } \n\t \n\t \n\t //Each indexed attribute get's it's position. \n\t $textIndex[] = array('text' => trim($text), 'integer' => $integerValue );\n\t }\n\t \n $ObjectLanguagesIndex[] = array('attributes' => $textIndex,'language_code' => abs(crc32($languageCode)));\n }\n \n eZContentObject::recursionProtectionEnd();\n\n $db = eZDB::instance();\n $db->begin(); \n $this->indexWords($contentObject, $ObjectLanguagesIndex, $pathArray, $mainNodeID); \n $db->commit(); \n }", "protected function _insert($key, $data=null, $root=null) {\n\n\t\tif ($this->_root === null) {\n\t\t\t// tree is empty, just create a node and point _root there.\n\t\t\t$this->_root = new BSTNode($key, $data);\n\t\t\t$this->_count ++;\n\t\t} else {\n\t\t\t// iterate through and figure out where to put this item\n\t\t\t$current = $this->_root;\n\t\t\twhile ($key !== $current->key) {\n\t\t\t\tif ($key > $current->key) {\n\t\t\t\t\t// if key is greater, look right\n\t\t\t\t\tif ($current->right) {\n\t\t\t\t\t\t$current = $current->right;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$current->right = new BSTNode($key, $data);\n\t\t\t\t\t\t$this->_count ++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} elseif ($key < $current->key) {\n\t\t\t\t\t// key is lesser, look left\n\t\t\t\t\tif ($current->left) {\n\t\t\t\t\t\t$current = $current->left;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$current->left = new BSTNode($key, $data);\n\t\t\t\t\t\t$this->_count ++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function addRoot($root)\n {\n $this->roots[] = $root;\n }", "function _step_3( $word )\n {\n switch ( substr($word, -1) ) {\n case 'e':\n if ( $this->_replace($word, 'icate', 'ic', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ative', '', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'alize', 'al', 0) ) {\n return $word;\n }\n break;\n case 'i':\n if ( $this->_replace($word, 'iciti', 'ic', 0) ) {\n return $word;\n }\n break;\n case 'l':\n if ( $this->_replace($word, 'ical', 'ic', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ful', '', 0) ) {\n return $word;\n }\n break;\n case 's':\n if ( $this->_replace($word, 'ness', '', 0) ) {\n return $word;\n }\n break;\n }\n return $word;\n }", "public function lead_begin($text) {\n $pattern = \"/\\\\\\\\begin\\{lead\\}\n /xu\";\n return preg_replace($pattern, '<div class=\"lead\">', $text);\n }", "public function executeNewWord(sfWebRequest $request) {\n \t$word = new sfWordnikWord();\n \t// NOTE -- changed this from `getGetParameter` to `getParameter.` (andyinabox - 2010-05-20)\n \t$word->populate(Wordnik::getWordObject($request->getParameter(\"word\")));\n// \t$word->name = $request->getGetParameter(\"word\");\n// \t$word->Definitions[]->text = \"To see if something works.\";\n// \t$word->Examples[]->text = \"Let's test this motor, see if it works.'\";\n// \t$word->RelatedWords[]->text = \"try\";\n\t$word->save();\n $this->success = \"Awesome.\";\n }", "protected function nextWord() {\n\t\t$this->word = strtolower($this->puzzleList[array_rand($this->puzzleList)]);\n\t\t$this->guesses = [];\n\t\t$this->roundNum ++;\n\n\t\techo(\"New word: {$this->word}\\n\");\n\t\t$this->sendResults();\n\t}", "private function step3()\n {\n // leg eleg ig eig lig elig els lov elov slov hetslov\n if ( ($position = $this->searchIfInR1(array(\n 'hetslov', 'eleg', 'elov', 'slov', 'elig', 'eig', 'lig', 'els', 'lov', 'leg', 'ig'\n ))) !== false) {\n $this->word = UTF8::substr($this->word, 0, $position);\n }\n }", "public function run()\n {\n StopWord::insert([\n [\n 'ugc' => '{MOD}',\n 'find' => '测试'\n ],\n [\n 'ugc' => '{BANNED}',\n 'find' => '代孕'\n ],\n ]);\n }", "private function register_root_namespace()\n\t{\n\t\t$this->register_namespace_dir('', $this->get_modules_dir());\n\t}", "function addText($key, $text);", "public function singularize($word);", "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 }", "public function prependTitle(string $text);", "function tInserting($table,$field,$parentTable){\r\n $Xs = superGet('*',$table,\"Lang_ID = 1\");\r\n foreach ($Xs as $x) {\r\n echo '<li><a href=\"'.$_SERVER['PHP_SELF'].'?sRid='.$x['ID'].'&sTable='.$table.'&sField='.$field.'&sText='.$x[$field].'&sParentTable='.$parentTable.'&sParentID='.$x[$parentTable].'\">'.$x[$field].'</a></li>';\r\n } \r\n }", "public function insertBefore($key, $data){\n $input = new Node($data);\n $temp = $this->head;\n while($temp != NULL){\n if(($temp->data == $key) && ($temp == $this->head)){\n $this->addFirst($input);\n break;\n }elseif($temp->next->data == $key){\n $input->next = $temp->next;\n $temp->next = &$input;\n break;\n }\n $temp = $temp->next;\n }\n }", "public function generate_tree($string)\r\n\t{\r\n\t\tunset($this->current);\r\n\t\tunset($this->stack);\r\n\t\t\r\n\t\t$this->current = array();\r\n\t\t$this->stack = array(array('content' => &$this->current));\r\n\t\t\r\n\t\t$this->pre_parse($string);\r\n\t\t\r\n\t\treturn $this->current;\r\n\t}", "function doublequoteopening() {\n global $lang;\n $this->doc .= $lang['doublequoteopening'];\n }", "function pre_word() {\r\n\t\t//$this->code = preg_replace('/<ins\\s/is', '<ins stripme=\"y\" ', $this->code);\r\n\t\t//$this->code = str_replace('<span class=msoIns>', '<span stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_deleteme('<style[^>]*? id=\"dynCom\"[^>]*?>');\r\n\t\tReTidy::non_DOM_deleteme('<script language=\"JavaScript\">');\r\n\t\tReTidy::non_DOM_stripme('<ins\\s[^>]*?>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoIns>');\r\n\t\tReTidy::non_DOM_stripme('<span\\s+class=msoDel>');\r\n\t\t$this->code = preg_replace('/<del\\s/is', '<del deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) class=msocomtxt/is', '<div$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)class=MsoCommentReference>/is', '<span$1 deleteme=\"y\">', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\\'[^\\']*?display\\s*:\\s*none[^\\']*?\\'/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^<>]*?)style=\"[^\"]*?display\\s*:\\s*none[^\"]*?\\\"/is', '<span$1 deleteme=\"y\" ', $this->code);\r\n\t\t\r\n\t\t$this->code = preg_replace('/<(w:\\w+)[^<>]*?>(.*?)<\\/\\1>/is', '$2', $this->code); // will cause problems if there are nested tags with w: namespace\r\n\t\t\r\n\t//\t// microsoft classes to delete\r\n\t//\t$arrayMicrosoftClassesToDelete = array(\r\n\t//\t'msoIns',\r\n\t//\t'msoDel',\r\n\t//\t);\r\n\t//\tforeach($arrayMicrosoftClassesToDelete as $microsoftClass) {\r\n\t//\t\twhile(true) {\r\n\t//\t\t\t$this->code = preg_replace('/class=\"([^\"]*)' . ReTidy::preg_escape($microsoftClass) . '([^\"]*)\"/is', 'class=\"$1$2\"', $this->code, -1, $countA);\r\n\t//\t\t\t$this->code = str_replace(' class=' . ReTidy::preg_escape($microsoftClass), '', $this->code, $countB);\r\n\t//\t\t\tif($countA === 0 && $countB === 0) {\r\n\t//\t\t\t\tbreak;\r\n\t//\t\t\t}\t\t\t\t\r\n\t//\t\t}\r\n\t//\t}\r\n\t\t\r\n\t\t//$this->code = preg_replace('/\\n/', 'XXX\\n', $this->code);\r\n\t\t\r\n\t\t//<tr style='page-break-inside:avoid;height:11.25pt'> \r\n\t\t// <span lang=FR-CA style='font-size:9.0pt;font-family:\"Times New Roman\"; \r\n\t\t// color:black;layout-grid-mode:line'> \r\n\t\t// <td style='height:11.25pt;border:none' width=0 height=15></td> \r\n\t\t// </span> \r\n\t\t// </tr> \r\n\r\n\t\t// does this do anything?!?\r\n\t\t\r\n\t\t$this->code = str_replace('\r\n', ' \r\n', $this->code);\t\t\r\n\t}", "function search($word)\n {\n $node = $this->root;\n for ($i = 0; $i < strlen($word); $i++) {\n $index = ord($word[$i]) - ord('a');\n if (isset($node->children[$index])) {\n $node = $node->children[$index];\n } else {\n return false;\n }\n }\n return $node->isEnd;\n }", "public function testInsertFieldWithoutNodePath()\n {\n $remoteDataFolder = self::$baseRemoteFolderPath . \"/DocumentElements/Fields\";\n $textFolder = \"DocumentElements/Text\";\n $localFileName = \"SampleWordDocument.docx\";\n $remoteFileName = \"TestInsertFieldWithoutNodePath.docx\";\n\n $this->uploadFile(\n realpath(__DIR__ . '/../../..') . \"/TestData/\" . $textFolder . \"/\" . $localFileName,\n $remoteDataFolder . \"/\" . $remoteFileName\n );\n\n $requestField = new FieldInsert(array(\n \"field_code\" => \"{ NUMPAGES }\",\n ));\n $request = new InsertFieldRequest(\n $remoteFileName,\n $requestField,\n NULL,\n $remoteDataFolder,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL\n );\n\n $result = $this->words->insertField($request);\n Assert::assertTrue(json_decode($result, true) !== NULL);\n Assert::assertNotNull($result->getField());\n Assert::assertEquals(\"{ NUMPAGES }\", $result->getField()->getFieldCode());\n Assert::assertEquals(\"5.0.22.0\", $result->getField()->getNodeId());\n }" ]
[ "0.7908051", "0.7319656", "0.7248367", "0.7167526", "0.6901766", "0.68191594", "0.554695", "0.55450606", "0.5484725", "0.54331255", "0.5185261", "0.51284754", "0.51109594", "0.50691754", "0.5054363", "0.50267404", "0.49429068", "0.49318078", "0.490142", "0.48656765", "0.48490697", "0.4831175", "0.4784185", "0.47734892", "0.47486523", "0.4748231", "0.47213274", "0.47169164", "0.4713999", "0.47119388", "0.4710147", "0.46729866", "0.4669903", "0.46653172", "0.46619505", "0.46539423", "0.46531576", "0.4651675", "0.46412998", "0.46389222", "0.4634328", "0.46250466", "0.46200934", "0.46156153", "0.4606168", "0.460588", "0.45735273", "0.45683265", "0.45534095", "0.45435283", "0.45390147", "0.45343453", "0.45324284", "0.45283368", "0.45200303", "0.4517342", "0.45162055", "0.44956857", "0.44826895", "0.4479437", "0.44784096", "0.44752404", "0.44696426", "0.44614238", "0.44551808", "0.44463938", "0.44281235", "0.44208923", "0.4412963", "0.44104984", "0.4407971", "0.4400819", "0.44004288", "0.43984345", "0.4393219", "0.43910274", "0.4386724", "0.43816355", "0.43810242", "0.43775335", "0.4372695", "0.43658337", "0.43641737", "0.43624973", "0.43591914", "0.43554187", "0.43510222", "0.4343819", "0.4329167", "0.4327201", "0.43246746", "0.43211105", "0.43204957", "0.43142474", "0.43030813", "0.43021724", "0.43013877", "0.43011045", "0.43006143", "0.43000212" ]
0.5442936
9
helper function for insert
function insert($word){ insert($root,$word); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function insert();", "public abstract function insert();", "protected function _insert()\n\t{\n\t}", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "public static function insert()\n {\n }", "public abstract function Insert();", "public function insert() {\n \n }", "public static function Insert(){\r\n }", "public function insert()\n {\n \n }", "public function insert()\n {\n }", "public function insert()\n {\n }", "public function insert(...$field_values);", "function insertar($bd);", "protected function saveInsert()\n {\n }", "public function insert($data);", "public function insert()\n {\n # code...\n }", "public function Do_insert_Example1(){\n\n\t}", "function insertId();", "public function insert() : bool;", "public function inserir()\n {\n }", "private function _insert($data){\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }", "public abstract function getInsert(Table $table, $item = array());", "abstract public function insert_id();", "public function insert($gunBbl);", "public function insert($loyPrg);", "function insert($conn,$table,$data)\n {\n }", "abstract public function insertId();", "abstract public function insertId();", "abstract public function insertId();", "abstract public function insertID();", "public function insert(array $data);", "public function insert(array $data);", "function insert($table, $columns);", "protected function _postInsert()\n\t{\n\t}", "public function insert(){\n\n }", "function Insert($array){\n\n }", "public function insert(array $params);", "function dbInsert($edit)\r\n\t{\r\n\r\n\t}", "function yy_r102(){ \n $this->_retvalue = new SQL\\Insert(@$this->yystack[$this->yyidx + -2]->minor);\n $this->_retvalue->into($this->yystack[$this->yyidx + 0]->minor[0])->fields($this->yystack[$this->yyidx + 0]->minor[1]);\n }", "public function insert($data)\r\n {\r\n \r\n }", "function insert($table,$data){\n\t\t$j=0;\n\t\t$c=count($data);\n\t\tforeach($data as $key=>$value){\n\t\t\t$j++;\n\t\t\tif($c==$j){\n\t\t\t\t$line_1.='`'.$key.'`';\n\t\t\t\t$line_2.=\"'\".rce_remove_quotes(mysql_real_escape_string($value)).\"'\";\n\t\t\t} else {\n\t\t\t\t$line_1.='`'.$key.'`, ';\n\t\t\t\t$line_2.=\"'\".rce_remove_quotes(mysql_real_escape_string($value)).\"', \";\n\t\t\t}\n\t\t}\n\t\t$r=mysql_query(\"\n\t\t\tINSERT INTO `$table`\n\t\t\t(\".$line_1.\") VALUES\n\t\t\t(\".$line_2.\")\n\t\t\");\n\t\treturn $r;\n\t}", "public function insert($listOfValue);", "public function insert($table);", "function insert($table, $data, $format = null){\n\t\treturn $this->_insert_replace_helper($table, $data, $format, 'INSERT');\n\t}", "function insert($table='', $keyandvalue) {\n return $this->_query_insert_replace($table, $keyandvalue, 'INSERT');\n }", "abstract protected function _getInsertId();", "abstract public function insert(string $table, array $row, array $options = []);", "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(){\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 function insertRow($row);", "protected function _insert()\n\t{\n\t\t// INSERT INTO 'table'\n\t\t$this->_query = 'INSERT INTO '.$this->_table.' (';\n\n\t\t// * / row1, row2\n\t\t$first = true;\n\t\t$vals = '';\n\t\tforeach($this->_set as $key => $value) {\n\t\t\t$this->_query .= ($first) ? ('') : (', '); \n\t\t\t$vals .= ($first) ? ('') : (', '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $key;\n\t\t\t$vals .= \"'$value'\";\n\t\t} // foreach\n\n\t\t$this->_query .= \") VALUES ($vals);\";\n\n\t\treturn $this->_query;\n\t}", "public function insert($perifericos);", "function insert_stmt(){\n\t\tglobal $in;\n\t\tif ($this->attributes['BYTB']!='' )$this->fields_value_bytb($this->attributes['BYTB']);\n\t\t\n\t\t\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\t\t\t\t\n\t\t\t\t$this->field_stmt[$i]=\"{$key}\";\n\t\t\t\t$this->value_stmt[$i]=\"{$in[$key]}\";\n\t\t\t\t\n\t\t\t\tif($in[$key]==1){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t#GC 20/04/2015 gestione popolamento decode\n\t\t\t\t\tif (isset($this->attributes['DECODE'][$key])) $this->value_stmt[$i]=\"{$this->attributes['DECODE'][$key]}\";\n\t\t\t\t\telse $this->value_stmt[$i]=$val;\n\t\t\t\t}\n\t\t\t\t#GC 20/04/2015 gestione sbiancamento decode\n\t\t\t\tif($in[$key]==0){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t$this->value_stmt[$i]=\"\";\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn;\n\t}", "abstract public function InsertId();", "function insert_id();", "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 }", "function insert($table, $object) {\r\n\t\t//$object['id'] = $this->get_max($table, 'id') + 1;\r\n\t\t$query = \"insert into $table set \";\r\n\t\tforeach ($object as $name => $value) {\r\n\t\t\t$value = mysql_escape_string($value);\r\n\t\t\t$query .= \"$name = '$value',\";\r\n\t\t}\r\n\t\t$query[strlen($query) - 1] = \" \";\r\n\t\treturn $this->query($query);\t\r\n\t}", "function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}", "public function insert($table, array $data);", "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 Insert ($vars, $table, $identifier, $special_case)\r{\r\tif ($GLOBALS['feedback']) echo \"Insert($vars,$table,$identifier)\\n\";\r\r\tif (sizeof ($vars) > 0)\r\t{\r\t\t$fields = '';\r\t\t$values = '';\r\t\t$select = '';\r\t\twhile (list ($key, $value) = each ($vars))\r\t\t{\r\t\t\tswitch ($key)\r\t\t\t{\r\t\t\t\tcase 'button': break;\r\t\t\t\tdefault:\r\t\t\t\t\tif (strlen($value))\r\t\t\t\t\t{\r\t\t\t\t\t\tif ($special_case && isset($special_case[$key]))\r\t\t\t\t\t\t\t$value = $special_case[$key]['function'] ($value);\r\r\t\t\t\t\t\tif (strlen ($fields)) $fields .= ', ';\r\t\t\t\t\t\t$fields .= \"`$key`\";\r\t\t\t\t\t\tif (strlen ($values)) $values .= ', ';\r\t\t\t\t\t\t$values .= \"'$value'\";\r\t\t\t\t\t\tif (strlen ($select)) $select .= ' AND ';\r\t\t\t\t\t\t$select .= \"`$key` = '$value'\";\r\t\t\t\t\t}\r\t\t\t\t\tbreak;\r\t\t\t}\r\t\t}\r\r\t\t// this is lame, but it allows us to select the inserted record with significant confidence (how many duplicates can there be with the same timestamp?)\r\t\t$now = DEPCRECATED_Now();\r\r\t\t$fields .= ', `modified`';\r\t\t$values .= \", '$now'\";\r\t\t$select .= \" AND `modified` = '$now'\";\r\r\t\tmysql_select_db ($GLOBALS['db']['db'], $GLOBALS['db']['link']);\r\t\t$query_insert = \"INSERT INTO `$table` ($fields) VALUES ($values)\";\r\t\tmysql_query ($query_insert, $GLOBALS['db']['link']) or exit (mysql_error());\r\r\t\t$query_select = \"SELECT * FROM `$table` WHERE $select\";\r\t\t$new_record = mysql_query ($query_select, $GLOBALS['db']['link']) or exit (mysql_error());\r\t\t$record = mysql_fetch_assoc ($new_record);\r\t\treturn $record[$identifier];\r\t}\r\telse return NULL;\r}", "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 }", "public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}", "abstract protected function doInsert($subject, Statement $insertStatement);", "public function insert()\n {\n $this->id = insert($this);\n }", "public function addToInsertSQLArray();", "public function insert($mambot);", "function insert ($conn , $table , $fields , $values) {\n\n\t\t$fields = implode(\",\", $fields) ;\n\t\t$values = implode(\"','\", $values) ;\n\n\t\t// insert querry\n\t\t$sql=\"INSERT INTO $table (id, $fields) VALUES ('', '$values')\" ;\n\t\t$result =mysql_query($sql ,$conn ) ;\n\n\n\t\tif (mysql_affected_rows()>0) {\n\t\t\treturn TRUE ;\n\n\t\t}\n\n\t\telse {\n\t\t\tdie(\"Error : \".mysql_error()) ;\n\t\t}\n\t}", "function insert($values){\n $query = \"insert into \" . $this->tableName . \" (\";\n $separator = \"\";\n \n foreach ($values as $key => $value){\n $query .= $separator . \"`\" . $key . \"`\";\n $separator = \", \";\n \n }\n $query .= \") values (\";\n $separator = \"\";\n \n foreach ($values as $key => $value){\n $query .= $separator . \"'\" . $value . \"'\";\n $separator = \", \";\n \n }\n $query .= \");\";\n\n $this->dbh->query($query); \n return $this->dbh->insert_id;\n \n }", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public function insert($index, $value);", "protected function afterInserting()\n {\n }", "function insert($tbl, $dataArray)\n\t{\n\t\tforeach($dataArray as $k=>$v){\n\t\t\t$keys .= \"$k, \";\n\t\t\t$values .= \"'\".$this->real_escape_string($v).\"', \";\n\t\t}\n\t\t$keys = substr ($keys, 0, strlen($keys) - 2);\n\t\t$values = substr ($values, 0, strlen($values) - 2);\n\t\t$sql = \"INSERT INTO {$tbl}($keys) VALUES({$values})\";\n\t\t$exeq = $this->query($sql);\n\t\treturn $exeq;\n\t}", "public function insert_id();", "private function _insert($data){\n \t\n \tif(isset($data['date_established'] )){\n \t\t$data['date_established'] = Application_Core_Utilities::ukDateToMysql($data['date_established']);\n \t}\n \t\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\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 insertTest()\n {\n $this->cD->insertElement(new Product(1, \"Trang\"));\n $this->cD->insertElement(new Product(1, \"Trang\"));\n $this->cD->insertElement(new Product(1, \"Trang\"));\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}", "function insert($bd,$data){\n$data_one = \"\";\n$data_two = \"\";\n$contador = count($data);\n$i = 1;\nforeach ($data as $key => $value) {\n\t\tif($i < $contador){\n\t\t\t$data_one .= $key.\",\";\n\t\t\t$data_two .= \":\".$key.\",\";\n\t\t}else{\n\t\t\t$data_one .= $key;\n\t\t\t$data_two .= \":\".$key;\n\t\t}\n\t\t$i++;\n}\n $sql = \"INSERT INTO \".$bd.\" (\".$data_one.\") VALUES (\".$data_two.\")\";\n$conexion = new ConexionOther();\n$stmt= $conexion->prepare($sql);\n$dato = $stmt->execute($data);\n//$stmt = null;\nreturn $dato;\n}", "public function _insert()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function insert($tableName, $data);", "function getInsert($table,$data)\n\t{\n\n\t\t$fields\t\t\t= array();\n\t\t$values\t\t\t= array();\n\n\t\tforeach ($data as $curdata)\n\t\t{\n\n\t\t\t$fields[]\t= $curdata['field'];\n\n\t\t\tswitch (strtolower($curdata['type']))\n\t\t\t{\n\t\t\t\tcase 'i'\t:\n\t\t\t\t\t$values[]\t= (int)$curdata['value'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 's'\t:\n\t\t\t\t\t$values[]\t= '\\''.addslashes_mssql($curdata['value']).'\\'';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'd'\t:\n\t\t\t\t\t$values[]\t= 'CONVERT(datetime, \\''.date('Y-m-d H:i:s',(int)$curdata['value']).'\\', 120)';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t\treturn 'INSERT INTO '.$table.' ('.implode(', ',$fields).') VALUES ('.implode(', ',$values).')';\n\n\t}", "function insert($table_name,$data){\r\n$keys='';\r\n$values='';\r\nforeach($data as $k=>$v){\r\n\t$keys.='`'.$k.'`,';\r\n\t$values.=\"'\".$v.\"',\";\r\n}\r\n$keys=rtrim($keys,',');\r\n$values=rtrim($values,',');\r\n\r\n\t$query= \"INSERT INTO `{$table_name}` ({$keys}) VALUES ({$values})\";\r\n\t//echo $query;\r\n\t$this->query($query);\r\n}", "protected function beforeInserting()\n {\n }", "function yy_r103(){ \n $this->_retvalue = new SQL\\Insert(@$this->yystack[$this->yyidx + -1]->minor);\n $this->_retvalue->into($this->yystack[$this->yyidx + 0]->minor[0]); \n }", "function insert($data){\n\t if($data and (is_array($data) or is_object($data))){\n\t $data = (object) $data;\n\t }else return false; \n\t $data->id = uniqid('');\n\t return parent::insert($data);\t \n\t}", "public function insert($article);", "public function insert(Tag $tag);", "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 }", "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 }", "function insert($user)\n{ \n $cmd = 'INSERT INTO ' . TABLE . ' (name, price) ' .\n 'VALUES (:name, :price)';\n $sql = $GLOBALS['db']->prepare($cmd);\n $sql->bindValue(':name', $user['name']);\n $sql->bindValue(':price', $user['price']);\n $sql->execute();\n}", "protected function afterInsertAccepting()\n {\n }", "function insertRow($insertObject){\n $dbh = dbConnect();\n if(!$dbh){\n return false;\n }\n $keystring = $insertObject->colString();\n $valuesString = \"\";\n for ($i=0; $i < $insertObject->getTableSize(); $i++)\n {\n $valuesString .= \"?\";\n if($i < $insertObject->getTableSize() - 1){\n $valuesString .= \",\";\n }\n }\n $sql = \"INSERT INTO \".$insertObject::TABLENAME.\"($keystring)\".\" VALUES ($valuesString)\";\n $stmt = mysqli_prepare($dbh, $sql); //creates a statement, a container we can pass back and forth from database\n //$args = array(buildtypestring($dbh, $insertObject::TABLENAME));\n $values = $insertObject->getArray();\n array_unshift($values, buildtypestring($dbh, $insertObject::TABLENAME));\n call_user_func_array(array($stmt,\"bind_param\"), $values); //call bind param on stmt with args\n $result = $stmt->execute();\n if(!$result){\n logSQLError($stmt);\n mysqli_close($dbh);\n return false;\n }\n mysqli_close($dbh);\n return true;\n }", "function insertItem( $data = NULL ){\n if( $data == NULL ) return ; \n return $this->db->insert($this->table, $data); \n }", "function db_insert($tbl, $h){\n\tglobal $db;\n\t\n\tif($tbl && count($h)){\n\t\t$dbInsVar = array();\n\t\t$dbInsVal = array();\n\t\tforeach ($h as $dbVar=>$dbVal) {\n\t\t\tarray_push($dbInsVar,$dbVar);\n\t\t\tif (strtolower($dbVal) == 'null') {\n\t\t\t\tarray_push($dbInsVal,'null');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tarray_push($dbInsVal,$dbVal);\n\t\t\t}\n\t\t}\n\t\t$q = \"INSERT INTO \".$tbl.\" (\".implode(\", \",$dbInsVar).\") VALUES (:\".implode(\", :\",$dbInsVar).\")\";\n\t\n\t\ttry { \n\t\t\t$stmt = $db->prepare($q); \n\t\t\t$stmt->execute($h); \n\t\t}catch(PDOException $ex){ \n\t\t\treturn false; \n\t\t}\n\t\n\t\treturn $db->lastInsertId();\n\t}else\n\t\treturn false;\n}", "function insert($sql) {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\t$statement = $this->execute($sql, $args);\n\t\treturn $this->pdo->lastInsertId();\n\t}", "public function insert($permiso);", "public function insertTest()\n {\n $this->assertEquals(true, $this->object->insert('Ali','Khan',22,'A'));\n }", "function insert($tbl,$cols) {\n $sql = $this->build_sql_insert($tbl, $cols);\n try{\n $this->execute($sql);\n }catch(Exception $e){\n if($this->errno==1062){ // Duplicate Record\n return false;\n }\n throw $e;\n }\n return $this->last_id();\n }", "function insert_news( $title, $detail ) {\n // news create date\n $current_date = date('Y-m-d H:i:s');\n\n // connection object\n $conn = connectionObject();\n\n // insert\n $query = $conn->prepare( 'INSERT INTO news (englishtitle,arabictitle,frenchtitle,englishdetails,arabicdetails,frenchdetails,creationdate,updatedate) VALUES(?,?,?,?,?,?,?)' );\n $query->execute( array( $title['en'], $title['ar'], $title['fr'], $detail['en'], $detail['ar'], $detail['fr'], $current_date,$current_date ) );\n return $conn->lastInsertId();\n}" ]
[ "0.8577455", "0.84221953", "0.80702496", "0.79355687", "0.79355687", "0.79342705", "0.79178727", "0.7541268", "0.7431655", "0.7348551", "0.73209095", "0.73209095", "0.726244", "0.7217678", "0.71790373", "0.7147847", "0.7142705", "0.71154416", "0.71044105", "0.7096001", "0.7060432", "0.7009489", "0.7000963", "0.69984955", "0.69812536", "0.6960671", "0.69485027", "0.69392604", "0.69392604", "0.69392604", "0.69313455", "0.69192564", "0.69192564", "0.69034505", "0.6894572", "0.68884665", "0.68797827", "0.68637145", "0.68544686", "0.68318295", "0.68297327", "0.6804443", "0.6802666", "0.6802567", "0.67902", "0.6787292", "0.67868245", "0.6759424", "0.6728201", "0.67259127", "0.67219573", "0.67103755", "0.67034733", "0.6700519", "0.66932887", "0.6678759", "0.6665266", "0.6654805", "0.6633692", "0.66262335", "0.6614885", "0.6608804", "0.6591438", "0.6585094", "0.65723175", "0.65722376", "0.6572148", "0.65553707", "0.6551504", "0.65476227", "0.65462625", "0.6533173", "0.65286326", "0.65129006", "0.6512179", "0.6507033", "0.6506014", "0.65025884", "0.6499561", "0.64851946", "0.64848727", "0.6479366", "0.6474477", "0.6450835", "0.6450168", "0.64457", "0.64453954", "0.64339936", "0.64334106", "0.6433153", "0.64280856", "0.64145374", "0.64144087", "0.641412", "0.6413367", "0.6409384", "0.6406909", "0.6391346", "0.63854843", "0.6379236", "0.63784" ]
0.0
-1
/Find neighbor of each word, specific to it's size to avoid checks about size
function findNeighbor($Vertex_forWho,$Vertex_finder,$word,$differenceCount){ //since some words like car had r as the end but cars had the r and s as end //this function kept breaking, because this was my base case, but to save myself // a headache i split them up into word sized tries //if the end of the word is met, then if the difference is only 1 push it back //as an edge to both finder and for who. if($Vertexfind->end == true){ if($differenceCount == 1){ $Vertex_forWho->neighbors[] = $Vertex_finder; $Vertex_finder->neighbors[] = $Vertex_forWho; } }//if the word is still 1 character long, check its edges and find the neighbors for it else if(strlen($word) == 1){ foreach($Vertex_finder->edgeP as $e){ if($e->letter == $word[0]) findNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount); else findNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1); } }//for any wordzie bigger than 1, add all the neighbors else if(strlen($word) > 1){ if($differenceCount > 1) return; else if($differenceCount == 0){ foreach($Vertex_finder->edgeP as $e){ if($e->letter == $word[0]) findNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 0); else findNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 1); } } else if($differenceCount == 1){ foreach($Vertex_finder->edgeP as $e){ if($e->letter == $word[0]) findNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount); else findNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findNeighboorKeys($size, $y, $x)\n {\n $result = [];\n if ($y - 1 >= 0) {\n array_push($result, [$y - 1, $x]);\n if ($x == $y) array_push($result, [$y - 1, $x - 1]);\n }\n\n if ($y + 1 < $size) {\n array_push($result, [$y + 1, $x]);\n if ($x == $y) array_push($result, [$y + 1, $x + 1]);\n }\n if ($x - 1 >= 0) array_push($result, [$y, $x - 1]);\n if ($x + 1 < $size) array_push($result, [$y, $x + 1]);\n return $result;\n }", "function words_list($sequence, $word_size) {\n $word_list = array();\n $sequence_size = strlen($sequence);\n $index = 0;\n\n //go through the sequence to get each word\n while ($index < $sequence_size) {\n $flag = FALSE;\n $current_word = $index + $word_size - 1;\n $word_list_count = count($word_list);\n //substr ( string $string , int $start [, int $length ] ) : string\n //Returns the portion of string specified by the start and length parameters.\n $new_word = substr($sequence, $index, $word_size);\n\n // base case\n if ($current_word >= $sequence_size) {\n break;\n }\n\n $list_index = 0;\n while ($list_index < $word_list_count) {\n // check if word_list_index isset then push it into the array\n // already seen word\n if (isset($word_list[$list_index][$new_word])) {\n array_push($word_list[$list_index][$new_word], $index);\n $flag = TRUE;\n break;\n }\n $list_index++;\n }\n\n // not seen word in word list, add word\n if (!$flag) {\n $never_seen = array($new_word => array($index));\n array_push($word_list, $never_seen);\n $flag = FALSE;\n }\n $index++;\n }\n\n return $word_list;\n}", "function printNeighbors(){\n\t\tforeach($vertexList as $v){\n\t\t\tif(count($v->neighbors) > 0){\n\t\t\t\tprint($word . \": \");\n\t\t\t\tforeach($v->neighbors as $vertex){\n\t\t\t\t\tprint($vertex->word.\", \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function boxIDDistance(): string\n {\n\n $j = 0;\n $sizeOfArray = count($this->inputArray);\n $firstSimilarWord = '';\n $secondSimilarWord = '';\n\n foreach ($this->inputArray as $inputValue) {\n for ($i = $j; $i < $sizeOfArray - 1; $i++) {\n $wordCompare = $this->inputArray[$i + 1];\n if (levenshtein($inputValue, $wordCompare, 2, 1, 2) < 2) {\n $firstSimilarWord = $inputValue;\n $secondSimilarWord = $wordCompare;\n break 2;\n }\n }\n $j++;\n }\n\n $letterAppearsOnce = array_search(1, array_count_values(str_split($firstSimilarWord . $secondSimilarWord)), true);\n return str_replace($letterAppearsOnce,'',$firstSimilarWord);\n }", "function getSimilarWords($content) {\n $words = processContent($content);\n $suggestions = array();\n foreach ($words as $word) {\n $result = sql_query(\"SELECT * FROM `words`\");\n $shortest = -1;\n while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {\n // could use similar_text, but doing so is less efficient\n $lev = levenshtein($word, $row[\"word\"]);\n // check for an exact match\n \n if ($lev == 0) {\n $closest = $word;\n $shortest = 0;\n // break out of the loop; we've found an exact match\n break;\n }\n \n // if this distance is less than the next found shortest\n // distance, OR if a next shortest word has not yet been found\n if ($lev <= $shortest || $shortest < 0) {\n // set the closest match, and shortest distance\n $closest = $row[\"word\"];\n $shortest = $lev;\n }\n }\n if ($closest != $word) {\n $suggestions[$word] = $closest;\n }\n }\n return $suggestions;\n }", "function find_similar_words($word, $threshold)\n {\n $similar = array();\n $tbl = 'babl_words_' . $this->lan;\n $word = addslashes( ( trim( $word ) ) );\n $sndx = substr($word, 0, 2);\n $query = \"select `word` AS word from `$tbl` where `di`=?\";\n @$result = $this->mDb->query($query, array($sndx));\n while ($res = $result->fetchRow() )\n {\n $tword = $res[\"word\"];\n $lev = levenshtein($tword, $word);\n if (count($similar) < $threshold)\n {\n $similar[$tword] = $lev;\n asort ($similar);\n }\n else\n {\n // If the array is full then if the lev is better than the worst lev\n // then update $keys = array_keys($similar);\n $last_key = $keys[count($keys) - 1];\n if ($lev < $similar[$last_key])\n {\n unset ($similar[$last_key]);\n $similar[$tword] = $lev;\n asort ($similar);\n }\n }\n }\n return $similar;\n }", "function strposa($string, $words=array(), $offset=0) {\n $chr = array();\n //check by simlarity\n foreach($words as $word) {\n $res = checkExistanceBySimilarity($string,$word);\n if ($res !== false) $chr[$word] = $res;\n }\n // check exist\n /*foreach($words as $word) {\n $res = strpos($string, $word, $offset);\n if ($res !== false) $chr[$word] = $res;\n }*/\n if(empty($chr)) return false;\n return min($chr);\n}", "function live_neighbors($key, $type, $cells, $cols)\r\n\t{\r\n\t\t$live_neighbors = 0;\r\n\t\tif ($type !== 'ur' && $type !== 'rs' && $type !== 'br' && $cells[$key+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'bl' && $cells[$key-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'bl' && $type !== 'bs' && $type !== 'br' && $cells[$key+$cols] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ur' && $type !== 'rs' && $type !== 'br' && $type !== 'bl' && $type !== 'bs' && $cells[$key+$cols+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'br' && $type !== 'bl' && $type !== 'bs' && $cells[$key+$cols-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\r\n\t\tif ($type !== 'ul' && $type !== 'us' && $type !== 'ur' && $cells[$key-$cols] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\t\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'us' && $type !== 'bl' && $type !== 'ur' && $cells[$key-$cols-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\r\n\t\tif ($type !== 'ul' && $type !== 'us' && $type !== 'br' && $type !== 'ur' && $type !== 'rs' && $cells[$key-$cols+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\treturn $live_neighbors;\r\n\t}", "function getNeighbours($arr, $x, $y){\n\t$c = getColumn($arr, $x);\n\t$r = getRow($arr, $y);\n\t[$bnum, $bpos] = locateBlock($x, $y);\n\t$b = getBlock($arr, $bnum);\n\t$ret = array_merge(remove($b, $bpos), remove($c, $y), remove($r, $x));\n\treturn $ret;\n}", "function FrequentWordsMismatches($genome, $k, $d)\n{\n\t$solution = array();\n\t$_max = -1;\n\tfor ($i = 0; $i <= strlen($genome) - $k; $i++)\n\t{\n\t\t$_text = substr($genome, $i, $k);\n\t\t$_indexes = ApproximatePatternMatching($_text, $genome, $d);\n\t\tif ($_indexes)\n\t\t{\n\t\t\t$_cnt = count($_indexes);\n\t\t\tif ($_cnt > $_max)\n\t\t\t{\n\t\t\t\t$solution = array();\n\t\t\t\t$solution[$_text] = $_text;\n\t\t\t\t$_max = $_cnt;\n\t\t\t}\n\t\t\telseif ($_cnt == $_max)\n\t\t\t{\n\t\t\t\t$solution[$_text] = $_text;\n\t\t\t}\n\t\t\t// echo $_max.'<hr>';\n\t\t}\n\t}\n\treturn $solution;\n}", "public function neighbors($v);", "function check_for_word($letters_hashmap,$word){\n /// found letters\n $found_letters=0;\n ///visited cordinates\n $visited=[];\n //iterate in the word letters searching for them on the hash table\n $words_count=strlen($word);\n ///\n $stop=false;\n ///start from first letter \n $the_temp_letter=$word[0];\n \n while($found_letters<$words_count && !$stop){\n//serch for the letter on the hash table\n $the_letter=$the_temp_letter;\n \n \n\n if(array_key_exists($the_letter,$letters_hashmap)\n && count(array_diff(str_split($letters_hashmap[$the_letter],2),$visited))>=1\n ){\n \n //the letter is found on the hsah table\n //let us get how many times\n ///the last number was making error in the last letter to add to hash table\n $cordenates=$letters_hashmap[$the_letter];\n $cordenates = str_replace(' ', '', $cordenates);\n \n \n \n \n\n \n ///lets iterate throw the cordenates and check if it's available\n\n \n for($j=0;$j<strlen($cordenates);$j+=2){\n ///assign the first cordinates to start the search\n \n \n \n \n if($found_letters==0 && !in_array($cordenates[$j].$cordenates[$j+1],$visited)){\n $x_cord=$cordenates[$j];\n $y_cord=$cordenates[$j+1];\n array_push($visited,$x_cord.$y_cord);\n $found_letters++;\n $the_temp_letter=$word[$found_letters];\n break;\n \n\n }\n\n\n \n ///we are not on the first letter so we need compare the second letter cord with our cords\n else{\n \n $nexX=$cordenates[$j];\n $newY=$cordenates[$j+1];\n\n\n \n \n\n\n if(($x_cord-$newY+$y_cord-$nexX)<=1 && !in_array($j.$j+1,$visited)){\n \n\n ///the new position\n $x_cord=$cordenates[$j];\n $y_cord=$cordenates[$j+1];\n array_push($visited,$x_cord.$y_cord);\n\n \n \n $found_letters++;\n ///if we reached the last letter and found it then we should stop the loop\n if($found_letters==$words_count){\n \n $stop= true;\n \n break;\n \n }\n \n \n $the_temp_letter=$word[$found_letters];\n \n break;\n \n \n \n\n\n }else{\n\n if($j==strlen($cordenates)-1){\n $found_letters--;\n\n $the_temp_letter=$word[$found_letters];\n //\n \n array_push($visited,$cordenates[$j].$cordenates[$j+1]);\n $stop=true;\n break;\n }\n \n \n $the_temp_letter=$word[$found_letters];\n //array_push($visited,$cordenates[$j].$cordenates[$j+1]);\n \n // break;\n\n \n\n \n \n\n }\n }\n\n\n }\n \n \n }\n //so the letter is not found on the matrix so the word cant be formated\n else{\n $stop= true;\n \n \n }\n \n\n }\n \n //return $found_letters;\n if($found_letters==$words_count){\n return $found_letters;\n }else{\n return false;\n }\n\n}", "function getLabel($data, $neighbors)\n{\n $results = array();\n $neighbors = array_keys($neighbors);\n print_r($neighbors);\n foreach ($neighbors as $neighbor) {\n $results[] = $data[$neighbor][2];\n }\n $values = array_count_values($results);\n $values = array_flip($values);\n ksort($values);\n return array_pop($values);\n}", "function distance($a, $b)\n{\n if (strlen($a) !== strlen($b)) {\n throw new \\InvalidArgumentException(\"DNA strands must be of equal length.\", 1);\n }\n //\n // YOUR CODE GOES HERE\n //\n if ($a === $b)\n return 0;\n\n $charArrayA = str_split($a);\n $charArrayB = str_split($b);\n $hammingDistance = 0;\n foreach ($charArrayA as $idx => $value) {\n if( $charArrayA[$idx] !== $charArrayB[$idx]) {\n $hammingDistance++;\n }\n }\n\n return $hammingDistance;\n}", "abstract protected function getTextBoundings( $size, ezcGraphFontOptions $font, $text );", "function solve_two(string $input) : string\n{\n\n $seats = array_map('str_split', xplode_input($input));\n $limit = 5;\n while(true) {\n [$seats, $hasChanged, $occupied] = walk_matrix($seats, $limit, 'visible_neighbors');\n if (!$hasChanged) {\n return sprintf(\"Occupied seats: %d\\n\", $occupied);\n }\n }\n}", "function search_short($patt, $k, $text, $start_index = 0, $max_len = -1, $text_strlen = -1)\n {\n if ($text_strlen < 0) {\n $text_strlen = strlen($text);\n }\n\n if ($max_len < 0) {\n $max_len = $text_strlen;\n }\n\n $start_index = (int)max(0, $start_index);\n $n = min($max_len, $text_strlen - $start_index);\n $m = strlen($patt);\n $end_index = $start_index + $n;\n\n // If $text is shorter than $patt, use the built-in\n // levenshtein() instead:\n if ($n < $m) {\n $lev = levenshtein(substr($text, $start_index, $n), $patt);\n\n if ($lev <= $k) {\n return Array($start_index + $n - 1 => $lev);\n } else {\n return Array();\n }\n }\n\n $s = Array();\n\n for ($i = 0; $i < $m; $i++) {\n $c = $patt[$i];\n\n if (isset($s[$c])) {\n $s[$c] = min($i, $s[$c]);\n } else {\n $s[$c] = $i;\n }\n }\n\n if ($end_index < $start_index) {\n return Array();\n }\n\n $matches = Array();\n $da = $db = range(0, $m - $k + 1);\n\n $mk = $m - $k;\n\n for ($t = $start_index; $t < $end_index; $t++) {\n $c = $text[$t];\n $in_patt = isset($s[$c]);\n\n if ($t & 1) {\n $d = &$da;\n $e = &$db;\n } else {\n $d = &$db;\n $e = &$da;\n }\n\n for ($i = 1; $i <= $mk; $i++) {\n $g = min($k + 1, $e[$i] + 1, $e[$i + 1] + 1);\n\n // TODO: optimize this with a look-up-table?\n if ($in_patt)\n for ($j = $e[$i - 1]; ($j < $g && $j <= $mk); $j++) {\n if ($patt[$i + $j - 1] == $c) {\n $g = $j;\n }\n }\n\n $d[$i] = $g;\n }\n\n if ($d[$mk] <= $k) {\n $err = $d[$mk];\n $i = min($t-$err + $k + 1, $start_index + $n - 1);\n\n if (!isset($matches[$i]) || $err < $matches[$i]) {\n $matches[$i] = $err;\n }\n }\n }\n\n unset($da, $db);\n\n return $matches;\n }", "function string_compare_DP($str1, $str2) {\n $MATCH = 0;\n $INSERT = 1;\n $DELETE = 2;\n\n // init DP table, with Cell object inserted into each cell\n $temp = array_fill(0, strlen($str2)+1, 0);\n $compareTable = array_fill(0, strlen($str1)+1, $temp);\n \n for ($i=0; $i < strlen($str1)+1; $i++) { \n for ($j=0; $j < strlen($str2)+1; $j++) { \n // if 1st string is empty, the only option is to insert all char\n // of 2nd string\n if ($i == 0) {\n $compareTable[$i][$j] = $j;\n } elseif ($j == 0) { // if 2nd string is empty, the only option is to remove all char from 1st string\n $compareTable[$i][$j] = $i;\n } elseif ($str1[$i-1] == $str2[$j-1]) {\n $compareTable[$i][$j] = $compareTable[$i-1][$j-1];\n } else {\n $compareTable[$i][$j] = 1 + min($compareTable[$i-1][$j-1], $compareTable[$i-1][$j], $compareTable[$i][$j-1]);\n }\n }\n }\n print2DArray($compareTable);\n // return cost\n return $compareTable[strlen($str1)][strlen($str2)];\n}", "static function segword($str) {\n\t\t$segObj = new Segmentation();\n\t\t$sc = $segObj->_getSegClient();\n $sc->SetLimits(0, 1, 1);\n\t\t$searchRes = $segObj->queryViaValidConnection($str, 'goods_id_dist');\n\t\tif( $searchRes == false ) {\n\t\t\treturn false;\n\t\t}\n\t\t//var_dump($searchRes['words']);\n\t\t//return array_keys( $searchRes['words'] );\n\t\tif (!empty($searchRes['words'])) {\n\t\t\treturn array_keys($searchRes['words']);\n\t\t}\n\t\telse {\n\t\t\treturn array();\n\t\t} \n\t}", "function findWordArray2(string $word, array $array)\n{\n $word_array = [];\n $word = trim($word);\n if (!empty($word) && !empty($array)) {\n\n foreach ($array as $key => $value) {\n if ($value === $word) {\n $word_array[$key] = strlen($value);\n }\n }\n return !empty($word_array) ? $word_array : false;\n }\n}", "function parseList(){\r\n //gets word list, creates array of words from it\r\n //or return false if impossible\r\n\r\n global $currentWord, $boardData;\r\n\r\n $itWorked = TRUE;\r\n\r\n //convert word list entirely to upper case\r\n //$wordList = strtoupper($wordList);\r\n\r\n //split word list into array\r\n //$word = explode(\"\\n\", $wordList);\r\n\r\n //foreach ($word as $currentWord){\r\n //take out trailing newline characters\r\n //$currentWord = rtrim($currentWord);\r\n foreach($currentWord as $wordIndex) {\r\n var_dump($wordIndex);\r\n echo \"\\n\";\r\n //stop if any words are too long to fit in puzzle\r\n if ((strLen($wordIndex) > $boardData['width']) &&\r\n (strLen($wordIndex) > $boardData['height'])\r\n ) {\r\n print \"$wordIndex is too long for puzzle\";\r\n print \"Please increase the grid size in previous page and try again\";\r\n $itWorked = FALSE;\r\n } // end if\r\n }\r\n\r\n //} // end foreach\r\n return $itWorked;\r\n}", "public function findAdjacentOf(Cell $cell);", "public function getNeighbors(array $columns = ['*']);", "function toys($w){\n \n //we need to sort arra first\n \n sort($w);\n $start_e = $w[0]; \n $end_e = $start_e+4;\n $counter = 1; // at anycase there's a one container\n \n for($i = 1; $i < count($w); $i++){\n // so if an element $w[$i] is greater than a start_point+4 so he should be inside a new container\n if($w[$i] > $end_e){\n $start_e = $w[$i];\n $end_e = $start_e+4;\n $counter++;\n }\n }\n \n \n return $counter;\n \n}", "public function findLongestWord() {\n\n }", "function matching_words($query_words_list, $protein_subject_words_list) {\n $index = 0;\n $query_size = count($query_words_list);\n $matching_words_indices = array();\n\n // go through the whole query words list\n while ($index < $query_size) {\n // key — Fetch a key from an array\n $query_word_key = key($query_words_list[$index]);\n $db_index = 0;\n $db_size = count($protein_subject_words_list);\n\n // go through each database word list\n while ($db_index < $db_size) {\n $word_index_match = array();\n $db_word_key = key($protein_subject_words_list[$db_index]);\n // Returns < 0 if str1 is less than str2; > 0 if str1 is greater \n // than str2, and 0 if they are equal.\n $word_match = strcmp($query_word_key, $db_word_key);\n // if query word match with database then push it to array\n if ($word_match == 0) {\n $query_word_index = $query_words_list[$index][$query_word_key];\n $db_word_index = $protein_subject_words_list[$db_index][$db_word_key];\n $word_index_match = array($query_word_index, $db_word_index);\n array_push($matching_words_indices, $word_index_match);\n }\n $db_index++;\n } // end db\n $index++;\n }\n\n return $matching_words_indices;\n}", "public function neighbors()\n {\n $parent = $this->parent;\n $exclude = $this->term_id;\n\n $query = static::where('term_id', '!=', $exclude);\n\n return $parent ? $query->where('parent', $parent) : $query->whereNull('parent');\n }", "function findEditDistanceMatrix($initial, $final)\n{\t\n\t$m = sizeof($initial);\n\t$n = sizeof($final);\n\t\n\t$matrix = array();\n\tfor ($i = 0; $i <= $m; $i++)\n\t\t$matrix[$i] = array($i);\n\tfor ($j = 0; $j <= $n; $j++)\n\t\t$matrix[0][$j] = $j;\n\t\n\tfor ($j = 1; $j <= $n; $j++)\n\t{\n\t\tfor ($i = 1; $i <= $m; $i++)\n\t\t{\n\t\t\tif ($initial[$i - 1] === $final[$j - 1])\n\t\t\t\t$matrix[$i][$j] = $matrix[$i - 1][$j - 1];\n\t\t\telse\n\t\t\t\t$matrix[$i][$j] = min(\t$matrix[$i - 1][ $j ] + 1,\n\t\t\t\t\t\t\t\t\t\t$matrix[ $i ][$j - 1] + 1,\n\t\t\t\t\t\t\t\t\t\t$matrix[$i - 1][$j - 1] + 1);\n\t\t}\n\t}\n\n\treturn $matrix;\n}", "function ClumpFinding($genome, $kmer, $Length, $times)\n{\n\t$kmers = explode(' ', FrequentWords($genome, $kmer));\n\tif ($kmers)\n\t{\n\t\t$solution = array();\n\t\t// Check each one of them\n\t\t$_strlen = strlen($genome);\n\t\t//ddd($kmers);\n\t\tforeach ($kmers as $_item)\n\t\t{\n\t\t\t//echo strpos($genome, $_item).'<br>';\n\t\t\t//echo $_strlen.'<br>';\n\t\t\t//die();\n\t\t\t// Is it a solution?\n\t\t\tfor ($i = strpos($genome, $_item); $i <= $_strlen; $i++)\n\t\t\t{\n\t\t\t\t// echo $i.'<br>';\n\t\t\t\t//die('ffg');\n\t\t\t\t$_text = substr($genome, $i, $Length);\n\t\t\t\t//echo $_text.'<br>';\n\t\t\t\tif (PatternCount($_text, $_item) >= $times)\n\t\t\t\t{\n\t\t\t\t\t$solution[] = $_item;\n\t\t\t\t\t//ddd($solution);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn implode(' ', $solution);\n\t}\n\treturn '';\n}", "public function wordLength(){\n\n\t\t\t\t\n\t\t\t\t$array = explode(' ',$this->sentence);\n\t\t\t\t$Length = strlen($array[0]);\n\t\t\t\t$shortestWord=NULL;\n\n\t\t\t\tforeach ($array as $word) {\n \t\t\t\t\tif (strlen($word) < $Length) {\n \t\t\t\t\t $Length = strlen($word);\n \t\t\t \t\t $shortestWord = $word;\n \t\t\t\t }\n\t\t\t\t}\n\t\t\t\techo $shortestWord;\n\n\t\t\t}", "function numJewelsInStones($J,$S){\n $jArr = str_split($J,1);\n $jArr = array_flip($jArr);\n $len = strlen($S);\n $r = 0;\n for($i=0;$i<$len;$i++){\n $key = $S[$i];\n if(isset($jArr[$key])){\n $r++;\n }\n }\n return $r;\n}", "public function __construct($size=self::DEFAULT_GRID_SIZE) {\n $this->_errorMsg='';\n if($size<self::MIN_LEN_WORD || $size<self::MAX_LEN_WORD) {\n $this->_errorMsg='size must be between '.self::MIN_LEN_WORD.' and '.self::MAX_LEN_WORD;\n echo $this->_errorMsg;\n return;\n }\n $this->_size=$size;\n $this->_wordsList=array();\n $this->_cells=array_fill(0,$this->_size*$this->_size,'');\n $this->_db = new SQLite3('words.db',SQLITE3_OPEN_READONLY);\n // Índice de columnas en 2 cuadrículas de fijación vertical\n // Para gestionar el desbordamiento en la parte inferior\n $this->_arrayCOL = array();\n for($i=0;$i<(2*$this->_size*$this->_size);$i++) {\n $this->_arrayCOL[$i]=self::COL($i);\n }\n\t\t}", "function wordbreak($text, $wordsize) \n{\n\nif (strlen($text) <= $wordsize) { return $text; } # No breaking necessary, return original text.\n\n$text = str_replace(\"\\n\", \"\", $text); # Strip linefeeds\n$done = \"false\";\n$newtext = \"\";\n$start = 0; # Initialize starting position\n$segment = substr($text, $start, $wordsize + 1); # Initialize first segment\n\nwhile ($done == \"false\") { # Parse text\n\n\t$lastspace = strrpos($segment, \" \");\n\t$lastbreak = strrpos($segment, \"\\r\");\n\n\tif ( $lastspace == \"\" AND $lastbreak == \"\" ) { # Break segment\n\t\t$newtext .= substr($text, $start, $wordsize) . \" \";\n\t\t$start = $start + $wordsize; }\n\telse { # Move start to last space or break\n\t\t$last = max($lastspace, $lastbreak);\n\t\t$newtext .= substr($segment, 0, $last + 1);\n\t\t$start = $start + $last + 1;\n\t} # End If - Break segment\n\n\t$segment = substr($text, $start, $wordsize + 1);\n\n\tif ( strlen($segment) <= $wordsize ) { # Final segment is smaller than word size.\n\t\t$newtext .= $segment;\n\t\t$done = \"true\";\n\t} # End If - Final segment is smaller than word size.\n\n} # End While - Parse text\n\n$newtext = str_replace(\"\\r\", \"\\r\\n\", $newtext); # Replace linefeeds\n\nreturn $newtext;\n\n}", "function wordbreak($text, $wordsize)\n{\n\nif (strlen($text) <= $wordsize) { return $text; } # No breaking necessary, return original text.\n\n$text = str_replace(\"\\n\", \"\", $text); # Strip linefeeds\n$done = \"false\";\n$newtext = \"\";\n$start = 0; # Initialize starting position\n$segment = substr($text, $start, $wordsize + 1); # Initialize first segment\n\nwhile ($done == \"false\") { # Parse text\n\n\t$lastspace = strrpos($segment, \" \");\n\t$lastbreak = strrpos($segment, \"\\r\");\n\n\tif ( $lastspace == \"\" AND $lastbreak == \"\" ) { # Break segment\n\t\t$newtext .= substr($text, $start, $wordsize) . \" \";\n\t\t$start = $start + $wordsize; }\n\telse { # Move start to last space or break\n\t\t$last = max($lastspace, $lastbreak);\n\t\t$newtext .= substr($segment, 0, $last + 1);\n\t\t$start = $start + $last + 1;\n\t} # End If - Break segment\n\n\t$segment = substr($text, $start, $wordsize + 1);\n\n\tif ( strlen($segment) <= $wordsize ) { # Final segment is smaller than word size.\n\t\t$newtext .= $segment;\n\t\t$done = \"true\";\n\t} # End If - Final segment is smaller than word size.\n\n} # End While - Parse text\n\n$newtext = str_replace(\"\\r\", \"\\r\\n\", $newtext); # Replace linefeeds\n\nreturn $newtext;\n\n}", "function w_build_relations($text, $coherence) {\n $text = explode(' ', $text);\n $relations = array();\n\n for ($i = 0; $i < count($text) - $coherence; $i++) {\n $here = implode(' ', array_slice($text, $i, $coherence));\n $next = $text[$i + $coherence];\n if (!isset($relations[$here])) $relations[$here] = array();\n if (!isset($relations[$here][$next])) $relations[$here][$next] = 0;\n $relations[$here][$next]++;\n }\n return $relations;\n}", "function prims_mst($distance_table){\n //TODO use sets or something similar to sets for this\n $u = array();\n $v = array_keys($distance_table);\n\n $new_edges = array();\n $all_vertexes = array_keys($distance_table);\n\n $a = array_pop($v);\n array_push($u,$a);\n\n //Keep looping until we've got all the edges\n $i = 0; //Loop protector to prevent infinite loops\n $max_ittr = count($all_vertexes)+4;\n while(!contains_all_verticies($u,$all_vertexes) && $i < $max_ittr){\n\n //Now go through all the edges in $v find it's closest neighbour in $u\n //Find the miinmum of those and put that vertex in $v\n $min_v = INF;\n $min_i = 0;\n $min_j = 0;\n foreach($v as $v1){\n $mins = find_min_vertex($v1,$u,$distance_table);\n if($mins[1] < $min_v){\n $min_v = $mins[1];\n $min_i = $mins[0];\n $min_j = $v1;\n }\n }\n //add the edge to the edges and the vertex to $u\n array_push($u,$min_j);\n array_push($new_edges,array($min_j,$min_i));\n\n $v = array_delete($v,$min_j);\n\n\n\n $i++;\n }\n\n return $new_edges;\n}", "function parse_content($words, $dom) //n words //m 4 letter words\n {\n $fourLetterArray = preg_grep(\"/\\b\\w{4}\\b/\", $words);\n \n foreach($words as $word)\n {\n if (array_search($word, $fourLetterArray))\n {\n $node = $dom->createElement(\"example\", \"**** \");\n }\n else \n {\n $node = $dom->createElement(\"example\", $word . ' ');\n }\n\n $sentence[] = $node;\n }\n return $sentence;\n }", "function parse_2words()\n\t{\n\t\t$x = split(\" \", $this->contents);\n\t\t//initilize array\n\n\t\t//$y = array();\n\t\tfor ($i=0; $i < count($x)-1; $i++) {\n\t\t\t//delete phrases lesser than 5 characters\n\t\t\tif( (mb_strlen(trim($x[$i])) >= $this->word2WordPhraseLengthMin ) && (mb_strlen(trim($x[$i+1])) >= $this->word2WordPhraseLengthMin) )\n\t\t\t{\n\t\t\t\t$y[] = trim($x[$i]).\" \".trim($x[$i+1]);\n\t\t\t}\n\t\t}\n\n\t\t//count the 2 word phrases\n\t\t$y = array_count_values($y);\n\n\t\t$occur_filtered = $this->occure_filter($y, $this->phrase2WordLengthMinOccur);\n\t\t//sort the words from highest count to the lowest.\n\t\tarsort($occur_filtered);\n\n\t\t$imploded = $this->implode(\", \", $occur_filtered);\n\t\t//release unused variables\n\t\tunset($y);\n\t\tunset($x);\n\n\t\treturn $imploded;\n\t}", "function findWordArray(string $word, array $array)\n{\n $word_array = [];\n $word = trim($word);\n if (!empty($word) && !empty($array)) {\n for ($i = 0, $ii = count($array); $i < $ii; $i++) {\n if ($array[$i] === $word) {\n $word_array[$i] = strlen($array[$i]);\n }\n }\n return !empty($word_array) ? $word_array : false;\n }\n}", "protected function searchForWords()\n {\n $result = [];\n foreach ($this->words as $tokenizedWord) {\n $tokenizedWordAsObject = (object)$tokenizedWord;\n $tokenizedWord = $tokenizedWordAsObject->t;\n\n if (array_key_exists($tokenizedWord, $this->index)) {\n foreach ($this->index[$tokenizedWord] as $file) {\n\n $key = strval($file->f);\n if (array_key_exists($key, $result)) {\n $result[$key]['weight'] *= $file->w * $tokenizedWordAsObject->w;\n } else {\n $result[$key] = [\n 'file' => $this->files->{$key},\n 'weight' => $file->w * $tokenizedWordAsObject->w\n ];\n }\n }\n }\n }\n return $result;\n }", "function fiftyone_degrees_get_node_index_in_string($node, $useragent_bytes, $headers)\n{\n $characters = fiftyone_degrees_get_node_characters($node, $headers);\n $char_count = count($characters);\n $final_index = $char_count - 1;\n $ua_count = count($useragent_bytes);\n for ($index = 0; $index < $ua_count - $char_count; $index++) {\n for ($node_index = 0, $target_index = $index; \n $node_index < $char_count && $target_index < $ua_count; \n $node_index++, $target_index++) {\n\n if ($characters[$node_index] != $useragent_bytes[$target_index])\n break;\n else if ($node_index == $final_index)\n return $index;\n }\n }\n return -1;\n}", "function find_closest($arr, $l, $h, $x, $k){\n $mid = find_loc($arr, $l, $h, $x);\n echo $arr[$mid] . ' ';\n $l = $mid - 1;\n $h = $mid + 1;\n $total = 1;\n while($total < $k && $l >= 0 && $h < count($arr)){\n if($x - $arr[$l] < $arr[$h] - $x){\n echo $arr[$l] . ' ';\n $l--;\n }else{\n echo $arr[$h] . ' ';\n $h++;\n }\n $total++;\n }\n while($total < $k && $l >= 0){\n echo $arr[$l] . ' ';\n $l--;\n $total++;\n }\n while($total < $k && $h < count($arr)){\n echo $arr[$h] . ' ';\n $h++;\n $total++;\n }\n}", "public static function diff_match($a, $b, $level=\"line\")\n {\n // set_time_limit(0);\n $answer = \"\";\n if($level == \"line\" || $level == \"word\")\n {\n if($level == \"line\")\n {\n $as = explode(\"\\n\", $a);\n $bs = explode(\"\\n\", $b);\n }\n else\n {\n $as = explode(\" \", $a);\n $bs = explode(\" \", $b);\n }\n \n $last = array();\n $next = array();\n $start = -1;\n $len = 0;\n $answer = \"\";\n for($i = 0; $i < sizeof($as); $i++)\n {\n $start+= strlen($as[$i])+1;\n for($j = 0; $j < sizeof($bs); $j++)\n {\n if($as[$i] != $bs[$j])\n {\n if(isset($next[$j])) unset($next[$j]);\n }\n else\n {\n if(!isset($last[$j-1]))\n $next[$j] = strlen($bs[$j]) + 1;\n else\n $next[$j] = strlen($bs[$j]) + $last[$j-1] + 1;\n if($next[$j] > $len)\n {\n $len = $next[$j];\n $answer = substr($a, $start-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n else\n {\n $m = strlen($a);\n $n = strlen($b);\n $last = array();\n $next = array();\n $len = 0;\n $answer = \"\";\n for($i = 0; $i < $m; $i++)\n {\n for($j = 0; $j < $n; $j++)\n {\n if($a[$i] != $b[$j])\n {\n if(isset($next[$j])) unset($next[$j]);\n }\n else\n {\n if(!isset($last[$j-1]))\n $next[$j] = 1;\n else\n $next[$j] = 1 + $last[$j-1];\n if($next[$j] > $len)\n {\n $len = $next[$j];\n $answer = substr($a, $i-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n if($level == \"line\" && $answer == \"\") return self::diff_match($a, $b, \"word\");\n elseif($level == \"word\" && $answer == \"\") return self::diff_match($a, $b, \"letter\");\n else return $answer;\n }", "public function getNeighborhood()\n {\n return $this->neighborhood;\n }", "function phorum_api_diff_match($a, $b, $level=\"line\")\n{\n // set_time_limit(0); No, we don't like it.\n $answer = \"\";\n if ($level == \"line\" || $level == \"word\")\n {\n if ($level == \"line\") {\n $as = explode(\"\\n\", $a);\n $bs = explode(\"\\n\", $b);\n } else {\n $as = explode(\" \", $a);\n $bs = explode(\" \", $b);\n }\n\n $last = array();\n $next = array();\n $start = -1;\n $len = 0;\n $answer = \"\";\n for ($i = 0; $i < sizeof($as); $i++) {\n $start+= strlen($as[$i])+1;\n for ($j = 0; $j < sizeof($bs); $j++) {\n if ($as[$i] != $bs[$j]) {\n if (isset($next[$j])) unset($next[$j]);\n } else {\n if (!isset($last[$j-1]))\n $next[$j] = strlen($bs[$j]) + 1;\n else\n $next[$j] = strlen($bs[$j]) + $last[$j-1] + 1;\n if ($next[$j] > $len) {\n $len = $next[$j];\n $answer = substr($a, $start-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n else\n {\n $m = strlen($a);\n $n = strlen($b);\n $last = array();\n $next = array();\n $len = 0;\n $answer = \"\";\n for ($i = 0; $i < $m; $i++) {\n for ($j = 0; $j < $n; $j++) {\n if ($a[$i] != $b[$j]) {\n if (isset($next[$j])) unset($next[$j]);\n } else {\n if (!isset($last[$j-1]))\n $next[$j] = 1;\n else\n $next[$j] = 1 + $last[$j-1];\n if ($next[$j] > $len) {\n $len = $next[$j];\n $answer = substr($a, $i-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n\n if ($level == \"line\" && $answer == \"\") {\n return phorum_api_diff_match($a, $b, \"word\");\n } elseif ($level == \"word\" && $answer == \"\") {\n return phorum_api_diff_match($a, $b, \"letter\");\n } else {\n return $answer;\n }\n}", "protected function completeWords()\n {\n $result = [];\n\n foreach ($this->words as $tokenizedWord) {\n $tokenizedWordAsObject = (object)$tokenizedWord;\n\n $word = $tokenizedWordAsObject->t;\n $wordLength = mb_strlen($word);\n\n if (!array_key_exists($word, $this->index) && $wordLength > 2) {\n\n // complete this word adding all words available in the index with same start letters\n foreach ($this->index as $wordIndex => $wordIndexTokenized) {\n $indexWordSubstring = substr($wordIndex, 0, $wordLength);\n if ($indexWordSubstring === $word) {\n $result[] = ['t' => $wordIndex, 'w' => 1];\n }\n }\n } else {\n // keep existing word\n $result[] = $tokenizedWord;\n }\n }\n\n return $result;\n }", "function Similarity ($str, $a_link) \r\n{\t\r\n\t$str1=getDNSName($str);\r\n\t$adns1=getDNSName($a_link);\r\n $thresh=0.8;\r\n $pos=((strstr($adns1,$str1)) || (strstr($str1,$adns1)));\r\n if($pos===true)\r\n {\r\n\t\tglobal $v;\r\n\t\t$v=$str;\r\n\t\treturn true;\r\n\t}\r\n\t$maxlen=strlen($adns1);\r\n\t$minchanges = levenshtein($str1, $adns1);\r\n\t$temp=($maxlen-$minchanges)/$maxlen;\r\n\tif (($thresh<$temp) && ($temp<1))\r\n\t{ \t\r\n\t\tglobal $v;\r\n\t\t$v=$str;\r\n\t\treturn true; \r\n\t}\r\n\treturn false;\r\n}", "function fake_levenshtein($a,$b)\n{\n\t// Some stripping, for performance, and because white space doesn't matter so much in HTML anyway\n\t$a=preg_replace('#\\s#','',$a);\n\t$b=preg_replace('#\\s#','',$b);\n\n\t$a_len=strlen($a);\n\t$b_len=strlen($b);\n\tif (($a_len<255) && ($b_len<255))\n\t{\n\t\treturn levenshtein($a,$b);\n\t}\n\t$percent=0.0;\n\treturn max($a_len,$b_len)-similar_text($a,$b,$percent);\n}", "function findWord($String){\n\t\tforeach($vertexList as $v){\n\t\t\tif($v->word === $String)\n\t\t\t\treturn $v;\n\t\t}\n\t\treturn NULL;\n\t}", "function idx_getPageWords($page){\n global $conf;\n $word_idx = file($conf['cachedir'].'/word.idx');\n $swfile = DOKU_INC.'inc/lang/'.$conf['lang'].'/stopwords.txt';\n if(@file_exists($swfile)){\n $stopwords = file($swfile);\n }else{\n $stopwords = array();\n }\n\n $body = rawWiki($page);\n $body = strtr($body, \"\\r\\n\\t\", ' ');\n $tokens = explode(' ', $body);\n $tokens = array_count_values($tokens); // count the frequency of each token\n\n $words = array();\n foreach ($tokens as $word => $count) {\n $word = utf8_strtolower($word);\n\n // simple filter to restrict use of utf8_stripspecials\n if (preg_match('/\\W/', $word)) {\n $arr = explode(' ', utf8_stripspecials($word,' ','._\\-:'));\n $arr = array_count_values($arr);\n\n foreach ($arr as $w => $c) {\n if (!is_numeric($w) && strlen($w) < 3) continue;\n $words[$w] = $c + (isset($words[$w]) ? $words[$w] : 0);\n }\n } else {\n if (!is_numeric($w) && strlen($w) < 3) continue;\n $words[$word] = $count + (isset($words[$word]) ? $words[$word] : 0);\n }\n }\n\n // arrive here with $words = array(word => frequency)\n\n $index = array(); //resulting index\n foreach ($words as $word => $freq) {\n\tif (is_int(array_search(\"$word\\n\",$stopwords))) continue;\n $wid = array_search(\"$word\\n\",$word_idx);\n if(!is_int($wid)){\n $word_idx[] = \"$word\\n\";\n $wid = count($word_idx)-1;\n }\n $index[$wid] = $freq;\n }\n\n // save back word index\n $fh = fopen($conf['cachedir'].'/word.idx','w');\n if(!$fh){\n trigger_error(\"Failed to write word.idx\", E_USER_ERROR);\n return false;\n }\n fwrite($fh,join('',$word_idx));\n fclose($fh);\n\n return $index;\n}", "function levenshtein_strip_search($to_strip,$subject,$backwards,$i)\n\t{\n\t\t$best=mixed();\n\t\t$best_at=$i;\n\n\t\t// Find all tag start/end positions (comparison reference points), loading them into the search list, ordered by position\n\t\t$up_to=min(strlen($subject),intval(floatval(strlen($to_strip))*1.5));\n\t\t$positions=array();\n\t\tfor (;$i<$up_to;$i++)\n\t\t{\n\t\t\tif ($i!=0)\n\t\t\t{\n\t\t\t\tif ($backwards)\n\t\t\t\t{\n\t\t\t\t\t$next_tag_a=strrpos(substr($subject,0,strlen($subject)-$i),'<'); // Makes performance reasonable, by only checking at tag points\n\t\t\t\t\t$next_tag_b=strrpos(substr($subject,0,strlen($subject)-$i),'>');\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$next_tag_a=strpos($subject,'<',$i); // Makes performance reasonable, by only checking at tag points\n\t\t\t\t\t$next_tag_b=strpos($subject,'>',$i);\n\t\t\t\t}\n\t\t\t\t$next_tag=(($next_tag_b!==false) && (($next_tag_a===false) || ((!$backwards) && ($next_tag_b<$next_tag_a)) || (($backwards) && ($next_tag_b>$next_tag_a))))?($next_tag_b+1):$next_tag_a;\n\t\t\t\tif ($next_tag===false)\n\t\t\t\t{\n\t\t\t\t\t$i=(strlen($subject)-1);\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$possible_i=$backwards?(strlen($subject)-$next_tag):$next_tag;\n\t\t\t\t\tif ($possible_i!=$i) $i=$possible_i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$lev=NULL;\n\t\t\t//$lev=fake_levenshtein($backwards?substr($subject,-$i):substr($subject,0,$i),$to_strip);\t\tFor efficiency the next loop has a more intelligent searching algorithm, to narrow down on the peak\n\t\t\t$positions[]=array($i,$lev);\n\t\t}\n\n\t\tdo\n\t\t{\n\t\t\t$cnt=count($positions);\n\t\t\t$point_a=intval(3.0*floatval($cnt)/8.0);\n\t\t\t$point_b=intval(5.0*floatval($cnt)/8.0);\n\t\t\tif (($cnt<24)/*The peak algorithm breaks down on small data sets due to integer rounding problems and local maxima*/ || ($point_a==$point_b)) break; // Okay now we need to scan manually over the few that are left\n\n\t\t\t// Take the 3/8 point of the search list, and find it's levenshtein distance\n\t\t\tif (is_null($positions[$point_a][1]))\n\t\t\t\t$positions[$point_a][1]=fake_levenshtein($backwards?substr($subject,-$positions[$point_a][0]):substr($subject,0,$positions[$point_a][0]),$to_strip);\n\n\t\t\t// Take the 5/8 point of the search list, and find it's levenshtein distance\n\t\t\tif (is_null($positions[$point_b][1]))\n\t\t\t\t$positions[$point_b][1]=fake_levenshtein($backwards?substr($subject,-$positions[$point_b][0]):substr($subject,0,$positions[$point_b][0]),$to_strip);\n\t\t\t// If the 3/8 point has a higher or equal levenshtein distance, throw away everything to the left of the 3/8 point\n\t\t\tif ($positions[$point_a][1]>=$positions[$point_b][1])\n\t\t\t{\n\t\t\t\tarray_splice($positions,0,$point_a);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t// Therefore the 5/8 point has a higher levenshtein distance: throw away everything to the right of the 5/8 point\n\t\t\t\tarray_splice($positions,$point_b);\n\t\t\t}\n\t\t}\n\t\twhile (true);\t// Repeats until the 3/8 or 5/8 points are the same, due to indivisibility ('break' line does this)\n\n\t\t// Loop over the remaining results, finding the smallest levenshtein distance remaining- this is our result\n\t\tforeach ($positions as $p)\n\t\t{\n\t\t\tlist($i,$lev)=$p;\n\t\t\tif (is_null($lev)) $lev=fake_levenshtein(substr($subject,0,$i),$to_strip);\n\n\t\t\tif ((is_null($best)) || ($lev<$best))\n\t\t\t{\n\t\t\t\t$best=$lev;\n\t\t\t\t$best_at=$i;\n\t\t\t}\n\t\t}\n\t\t$ret=$backwards?substr($subject,0,(strlen($subject)-$best_at)):substr($subject,$best_at);\n\n\t\treturn $ret;\n\t}", "function edDisRecursive($str1, $str2){\n $distanceMatrix=[[0]];\n // Filling the first row of the matrix.\n // If this is the first row then we're transforming empty string to str1.\n // In this case the number of transformations equals to size of str1 substring.\n for ($i = 1; $i <= strlen($str1); $i++){\n $distanceMatrix[0][$i]=$i; \n if($i<= strlen($str2)){\n array_push($distanceMatrix,[]);\n $distanceMatrix[$i][0]=$i; \n }\n }\n // Filling the first column of the matrix.\n // If this is the first column then we're transforming empty string to str2.\n // In this case the number of transformations equals to size of str2 substring.\n for ($i = strlen($str1); $i <= strlen($str2); $i++){\n array_push($distanceMatrix,[]);\n $distanceMatrix[$i][0]=$i; \n }\n for ($j = 1; $j <= strlen($str1); $j++){\n for ($i = 1; $i <= strlen($str2); $i++){\n if($str1[$j-1] == $str2[$i-1]) $distanceMatrix[$i][$j] = $distanceMatrix[$i-1][$j-1];\n else $distanceMatrix[$i][$j]= $this->min($distanceMatrix[$i-1][$j-1],$distanceMatrix[$i][$j-1],$distanceMatrix[$i-1][$j])+1;\n }\n }\n return $distanceMatrix[strlen($str2)][strlen($str1)];\n }", "public function getCategoryNeighbors()\n {\n return $this->categoryNeighbors;\n }", "function tep_word_count($string, $needle) {\n\t$temp_array = split($needle, $string);\n\treturn sizeof($temp_array);\n}", "function rootsBySynonyms($concept, $mysql_conn) {\n\t// Get language meta information from DB\n\t$meta = getMetaInformation($mysql_conn);\n\t\n\t// Get word entry from database\n\t$sql = \"SELECT * FROM synie WHERE `concept`='\" . mysql_real_escape_string($concept) . \"'\";\n\t$results = mysql_query($sql, $mysql_conn);\n\tif(!$results) die(err(\"invalid query -- \".mysql_error()));\n\t$row = mysql_fetch_assoc($results);\n\t\n\t// Storage arrays\n\t$words = array();\n\t$used_roots = array();\n\t$root_clumps = array();\n\t$edges = array();\n\t$core_nodes = array();\n\t$extra_nodes = array();\n\t\n\tforeach($meta as $lang=>$arr) {\n\t\t// Iterate through languages and build up $core_nodes and $extra_nodes\n\t\t$rootcode = $arr['rootcode'];\n\t\t$node_data = $arr['nodedata'];\n\t\t$pieroots = clean_parts(explode(\";\", $row[$rootcode]));\n\t\t$signs = clean_parts(explode(\";\", $row[$lang]));\n\t\t$groups = array();\n\t\t$roots = array();\n\t\t\n\t\tif(count($pieroots)!=count($signs)) {\n\t\t\t// Verify that $pieroots and $signs are of same length\n\t\t\t// Append blank strings to the shorter array until they are parallel.\n\t\t\twhile(count($pieroots)<count($signs)) {\n\t\t\t\t$pieroots[] = \"\";\n\t\t\t}\n\t\t\twhile(count($signs)<count($pieroots)) {\n\t\t\t\t$signs[] = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach($pieroots as $index=>$pieroot) {\n\t\t\t// Determine cognate group for each pieroot\n\t\t\t$group = array_search($pieroot, $used_roots);\n\t\t\t$root_clump = array();\n\t\t\tif($group===false) {\n\t\t\t\t$used_roots[] = $pieroot;\n\t\t\t\t$group = count($used_roots)-1;\n\t\t\t\t$splitroot = clean_parts(explode(\",\", $pieroot));\n\t\t\t\tforeach($splitroot as $j=>$root) {\n\t\t\t\t\t$sql = \"SELECT `root`,`origin`,`meaning`,`attested` FROM synie_roots WHERE `root`='\". mysql_real_escape_string($root) .\"'\";\n\t\t\t\t\t$results = mysql_query($sql, $mysql_conn) or die(err(\"can't find root definition\"));\n\t\t\t\t\t$res = mysql_fetch_assoc($results);\n\t\t\t\t\t$root_clump[] = array('root' => $res['root'],\n\t\t\t\t\t\t\t\t\t\t 'origin' => $res['origin'],\n\t\t\t\t\t\t\t\t\t\t 'meaning' => $res['meaning'],\n\t\t\t\t\t\t\t\t\t\t 'attested'=> (!strcmp($res['attested'], \"1\")));\n\t\t\t\t}\n\t\t\t\t$root_clumps[] = $root_clump;\n\t\t\t}\n\t\t\t$roots[] = $root_clumps[$group];\n\t\t\t$groups[] = $group;\n\t\t}\n\t\t\n\t\t// Create new core word\n\t\t$new_core_word = array('concept' => $concept,\n\t\t\t\t\t\t\t 'sign' => $signs[0],\n\t\t\t\t\t\t\t 'PIEroot' => $roots[0],\n\t\t\t\t\t\t\t 'group' => $groups[0]);\n\t\t$new_core_node = $node_data;\n\t\t$new_core_node['data'] = $new_core_word;\n\t\t$core_nodes[] = $new_core_node;\n\t\t\n\t\t// Put the remainder of the words in extra_words array\n\t\t\n\t\tfor($i=1; $i<count($signs); $i++) {\n\t\t\t$new_extra_node = $node_data;\n\t\t\t$new_extra_word = array('concept' => $concept,\n\t\t\t\t\t\t\t\t\t'sign'\t => $signs[$i],\n\t\t\t\t\t\t\t\t\t'PIEroot' => $roots[$i],\n\t\t\t\t\t\t\t\t\t'group' => $groups[$i]);\n\t\t\t$new_extra_node['data'] = $new_extra_word;\n\t\t\t$extra_nodes[] = $new_extra_node;\n\t\t\t$core_index = count($core_nodes)-1;\n\t\t\t$extra_index = count($extra_nodes)-1;\n\t\t\t$extra_nodes[$extra_index]['data'] = $new_extra_word;\n\t\t\t$edges[] = array('source' => $core_index, 'to_delta' => $extra_index);\n\t\t}\n\t}\n\t\n\tfor($i=0; $i<count($edges); $i++) {\n\t\t// Calculate absolute position of target in edges\n\t\t$edges[$i]['target'] = count($core_nodes) + $edges[$i]['to_delta'];\n\t\tunset($edges[$i]['to_delta']);\n\t\t$edges[$i]['value'] = 1; # default value -- any semantic possibility for edge weights?\n\t}\n\t\n\t\n\t// Create final object\n\t$meta_data = array('groups' => count($used_roots));\n\t$json_data = array('nodes' => array_merge($core_nodes, $extra_nodes),\n\t\t\t\t\t 'edges' => $edges,\n\t\t\t\t\t 'meta' => $meta_data);\n\t\n\treturn $json_data;\t\n}", "function DoSwap($word,$num,&$blocks,&$wordlocs)\n{\n\t// Generate a list of the location keys (eg 0,1,2,3,4)\n\t$loclist=array_keys($wordlocs[$word]);\n\t\n\t// Randomise the order (eg 3,1,0,4,2)\n\tshuffle($loclist);\n\t\n\t$swapped=array();\n\tfor ($locidx=0; $locidx<$num; $locidx++)\n\t{\n\t\t$li1=$locidx;\n\t\t$li2=$loclist[$locidx];\n\t\t\n\t\tif ($li1==$li2) continue; // nothing being swapped\n\t\n\t\t// First part of sentence comes from $li1, second from $li2\n\t\t$loc1=$wordlocs[$word][$li1];\n\t\t$loc2=$wordlocs[$word][$li2];\n\n\t\tif (isset($swapped[$li2]) && $swapped[$li2]==$li1) continue; // already swapped these two\n\t\t$swapped[$li1]=$li2;\n\t\t\n\t\t$block_num1=$loc1[0];\n\t\t$snum1=$loc1[1];\n\t\t$wordnum1=$loc1[2];\n\t\t\n\t\t$block_num2=$loc2[0];\n\t\t$snum2=$loc2[1];\n\t\t$wordnum2=$loc2[2];\n\t\t\n\t\tif ($block_num1==$block_num2 && $snum1==$snum2) continue; // no swapping within same sentence\n\t\t\n\t\t$s1=$blocks[$block_num1][$snum1];\n\t\t$s2=$blocks[$block_num2][$snum2];\n\t\t\n\t\t// New s1 is everything up to, but not including wordnum1 from s1 + everything from wordnum2 from s2\n\t\t$ns1=array_merge(array_slice($s1,0,$wordnum1),array_slice($s2,$wordnum2));\n\t\t// Opposite for s2\n\t\t$ns2=array_merge(array_slice($s2,0,$wordnum2),array_slice($s1,$wordnum1));\n\t\t\n\t\t// If there are any indexed words in the second half of each sentence,\n\t\t// they need re-indexing\n\t\t\n\t\t// Second half of s2, which is going to s1\n\t\tfor ($wnum2=$wordnum2; $wnum2<count($s2); $wnum2++)\n\t\t{\n\t\t\t$wordw=$s2[$wnum2];\n\t\t\t$new_wordnum=$wnum2-$wordnum2+$wordnum1;\n\t\t\t// Move to a negative block, to avoid the situation where a word is moved\n\t\t\t// to a sentence which already has the same word in the same location\n\t\t\t// (which always happens for the word being handled, but may happen to others)\n\t\t\tMoveWord($wordw,$wordlocs,$block_num2,$snum2,$wnum2,-$block_num1,$snum1,$new_wordnum);\n\t\t}\n\t\t// Second half of s1, which is going to s2\n\t\tfor ($wnum1=$wordnum1; $wnum1<count($s1); $wnum1++)\n\t\t{\n\t\t\t$wordw=$s1[$wnum1];\n\t\t\t$new_wordnum=$wnum1-$wordnum1+$wordnum2;\n\t\t\tMoveWord($wordw,$wordlocs,$block_num1,$snum1,$wnum1,$block_num2,$snum2,$new_wordnum);\n\t\t}\n\t\t// Fix up words from second half of s2 with negative block numbers\n\t\tfor ($wnum2=$wordnum2; $wnum2<count($s2); $wnum2++)\n\t\t{\n\t\t\t$wordw=$s2[$wnum2];\n\t\t\tFixNegBlock($wordw,$wordlocs);\n\t\t}\n\t\t\n\t\t// Store the updates back\n\t\t$blocks[$block_num1][$snum1]=$ns1;\n\t\t$blocks[$block_num2][$snum2]=$ns2;\n\t}\n}", "public function getNeighbor($m, $n) {\n $ret = array();\n for ($j = -1; $j <= 1; $j++) {\n for ($i = -1; $i <= 1; $i++) {\n $x = $this->x + $i;\n $y = $this->y + $j;\n if ( !($x == $this->x && $y == $this->y) \n && ( $x >= 0 ) && ( $y >= 0 ) \n && ( $x < $m ) && ( $y < $n ) \n ) {\n $ret[] = array($x, $y);\n }\n }\n }\n return $ret;\n }", "static public function getConjugationsSearch($words)\n {\n\t\t$rc = null;\n\n\t\tif (!is_array($words))\n\t\t{\n\t\t\t// make the words array first\n\t\t\t// raw conjugation looks like: |;mato;mata;matas;|mate;mate;matamos;|\n\t\t\t$tenses = [];\n\t\t\t$lines = explode('|', $words);\n\t\t\tforeach($lines as $line)\n\t\t\t{\n\t\t\t\t$parts = explode(';', $line);\n\t\t\t\tif (count($parts) > 0)\n\t\t\t\t{\n\t\t\t\t\tforeach($parts as $part)\n\t\t\t\t\t{\n\t\t\t\t\t\t// fix the reflexives\n\t\t\t\t\t\tif (Tools::startsWithAny($part, ['me ', 'te ', 'se ', 'nos ', 'os ', 'no te ', 'no se ', 'no nos ', 'no os ', 'no se ']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// chop off the reflexive prefix words, like 'me acuerdo', 'no se acuerden'\n\t\t\t\t\t\t\t$pieces = explode(' ', $part);\n\t\t\t\t\t\t\tif (count($pieces) > 2)\n\t\t\t\t\t\t\t\t$part = $pieces[2];\n\t\t\t\t\t\t\telse if (count($pieces) > 1)\n\t\t\t\t\t\t\t\t$part = $pieces[1];\n\t\t\t\t\t\t\telse if (count($pieces) > 0)\n\t\t\t\t\t\t\t\t$part = $pieces[0];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$tenses[] = $part;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$words = $tenses;\n\t\t}\n\n\t\tif (isset($words) && is_array($words))\n\t\t{\n\t\t\t$unique = [];\n\t\t\tforeach($words as $word)\n\t\t\t{\n\t\t\t\tif (strlen($word) > 0)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($word, $unique))\n\t\t\t\t\t{\n\t\t\t\t\t\t$unique[] = $word;\n\t\t\t\t\t\t$rc .= $word . ';';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$rc = ';' . $rc; // make it mysql searchable for exact match, like: \";voy;vea;veamos;ven;vamos;\n\t\t}\n\n\t\treturn $rc;\n\t}", "abstract public function lookupWordRandomly();", "function AnalyseNode($n,$v,&$blocks,&$block_num,&$wordlocs)\n{\n\tif (trim($v)==\"\") return -1;\n\t\n\t// Attempt to split block into sentences\n\t$s=preg_split('/([.?!]\\s*|,?\\s*[\"()]\\s*)/',$v,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);\n\t\n\tfor ($snum=0; $snum<count($s); $snum++)\n\t{\n\t\t$sentence=$s[$snum];\n\t\t\n\t\t// Replace any occurrences of strings of dashes with the same but with spaces around\n\t\t$sentence=preg_replace(\"/(--+)/\",\" $1 \",$sentence);\n\n\t\t// If there are no actual words in the sentence, just put it as a single\n\t\t// entry in the sentence array\n\t\tif (!preg_match('/\\w/',$sentence))\n\t\t{\n\t\t\t$words=array($sentence);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Split the sentence into words around whitespace\n\t\t\tif ($n==\"pre\") $regexp='/(\\h+)/'; else $regexp='/(\\s+)/';\n\t\t\t$words=preg_split($regexp,$sentence,-1,PREG_SPLIT_NO_EMPTY);\n\t\t\t\n\t\t\tif (count($words)==0) $words=array($sentence);\n\t\t}\n\t\t\n\t\t// Only analyse sentences that are more than 2 words long\n\t\tif (count($words)>2)\n\t\t{\n\t\t\tfor ($wordnum=1; $wordnum<count($words)-1; $wordnum++)\n\t\t\t{\n\t\t\t\t$word=$words[$wordnum];\n\t\t\t\n\t\t\t\t// Remove any punctuation at the start or end of the word\n\t\t\t\t$word=TrimWord($word);\n\t\t\t\tif ($word==\"\") continue;\n\t\t\t\t\n\t\t\t\t// Record the location of this word within the document, the block, and the sentence\n\t\t\t\tif (!isset($wordlocs[$word])) $wordlocs[$word]=array();\n\t\t\t\t$wordlocs[$word][]=array($block_num,$snum,$wordnum);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Replace the sentence with an array of the words\n\t\t$s[$snum]=$words;\n\t}\n\n\t// Save this block of sentences\n\t$blocks[$block_num]=$s;\n\t$block_num++;\n\treturn $block_num-1;\n}", "private function calculateConnections() {\n $map = array();\n $whiteRecheck = array();\n for ($row=0; $row < $this->matrix->getSize(); $row++) {\n for ($col=0; $col < $this->matrix->getSize(); $col++) {\n $map[$row][$col][5] = $this->isDarkInt($row, $col);\n $map[$row][$col][0] = 0;\n $map[$row][$col][4] = $this->isDarkInt($row, $col - 1);\n $map[$row][$col][6] = $this->isDarkInt($row, $col + 1);\n $map[$row][$col][8] = $this->isDarkInt($row - 1, $col);\n $map[$row][$col][2] = $this->isDarkInt($row + 1, $col);\n $map[$row][$col][7] = $this->isDarkInt($row - 1, $col - 1);\n $map[$row][$col][9] = $this->isDarkInt($row - 1, $col + 1);\n $map[$row][$col][1] = $this->isDarkInt($row + 1, $col - 1);\n $map[$row][$col][3] = $this->isDarkInt($row + 1, $col + 1);\n if (!$map[$row][$col][5]) {\n $fullCount = $map[$row][$col][1] + $map[$row][$col][2] + $map[$row][$col][3] + $map[$row][$col][4]\n + $map[$row][$col][6] + $map[$row][$col][7] + $map[$row][$col][8] + $map[$row][$col][9];\n $soloCount = $map[$row][$col][2] + $map[$row][$col][4] + $map[$row][$col][6] + $map[$row][$col][8];\n $map[$row][$col][7] = 0;\n $map[$row][$col][9] = 0;\n $map[$row][$col][1] = 0;\n $map[$row][$col][3] = 0;\n if ($this->isDarkInt($row, $col - 1) && $this->isDarkInt($row - 1, $col)) {\n $map[$row][$col][7] = 1;\n }\n if ($this->isDarkInt($row, $col + 1) && $this->isDarkInt($row - 1, $col)) {\n $map[$row][$col][9] = 1;\n }\n if ($this->isDarkInt($row, $col - 1) && $this->isDarkInt($row + 1, $col)) {\n $map[$row][$col][1] = 1;\n }\n if ($this->isDarkInt($row, $col + 1) && $this->isDarkInt($row + 1, $col)) {\n $map[$row][$col][3] = 1;\n }\n if ($fullCount >= 5) {\n $whiteRecheck[]=array('row' => $row, 'col' => $col);\n }\n if ($soloCount >= 4) {\n $map[$row][$col][0] = 1;\n }\n }\n }\n }\n foreach ($whiteRecheck as $key => $cw) {\n $row = $cw['row'];\n $col = $cw['col'];\n if (isset($map[$row + 1][$col - 1]) && !$map[$row + 1][$col - 1][5] && isset($map[$row + 1][$col - 1]) && $map[$row + 1][$col - 1][0]) {\n $map[$row][$col][1] = 0;\n $map[$row][$col - 1][3] = 0;\n $map[$row + 1][$col][7] = 0;\n $map[$row + 1][$col - 1][9] = 0;\n }\n if (isset($map[$row + 1][$col + 1]) && !$map[$row + 1][$col + 1][5] && isset($map[$row + 1][$col + 1]) && $map[$row + 1][$col + 1][0]) {\n $map[$row][$col][3] = 0;\n $map[$row][$col + 1][1] = 0;\n $map[$row + 1][$col][9] = 0;\n $map[$row + 1][$col + 1][7] = 0;\n }\n }\n return $map;\n }", "public function getWordSpacing() {}", "public function getWordSpacing() {}", "function mx_add_search_words($mode, $post_id, $post_text, $post_title = '', $mx_mode = 'mx')\n\t{\n\t\tglobal $db, $config, $lang;\n\n\t\t// $search_match_table = SEARCH_MATCH_TABLE;\n\t\t// $search_word_table = SEARCH_WORD_TABLE;\n\n\t\tswitch ($mx_mode)\n\t\t{\n\t\t\tcase 'mx':\n\t\t\t\t$search_match_table = MX_MATCH_TABLE;\n\t\t\t\t$search_word_table = MX_WORD_TABLE;\n\t\t\t\t$db_key = 'block_id';\n\t\t\tbreak;\n\t\t\tcase 'kb':\n\t\t\t\t$search_match_table = KB_MATCH_TABLE;\n\t\t\t\t$search_word_table = KB_WORD_TABLE;\n\t\t\t\t$db_key = 'article_id';\n\t\t\tbreak;\n\t\t}\n\n\t\tstopwords_synonyms_init();\n\n\t\t$search_raw_words = array();\n\t\t$search_raw_words['text'] = split_words(clean_words('post', $post_text, $stopwords_array, $synonyms_array));\n\t\t$search_raw_words['title'] = split_words(clean_words('post', $post_title, $stopwords_array, $synonyms_array));\n\n\t\t@set_time_limit(0);\n\n\t\t$word = array();\n\t\t$word_insert_sql = array();\n\t\twhile (list($word_in, $search_matches) = @each($search_raw_words))\n\t\t{\n\t\t\t$word_insert_sql[$word_in] = '';\n\t\t\tif (!empty($search_matches))\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < sizeof($search_matches); $i++)\n\t\t\t\t{\n\t\t\t\t\t$search_matches[$i] = trim($search_matches[$i]);\n\n\t\t\t\t\tif($search_matches[$i] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$word[] = $search_matches[$i];\n\t\t\t\t\t\tif (!strstr($word_insert_sql[$word_in], \"'\" . $search_matches[$i] . \"'\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$word_insert_sql[$word_in] .= ($word_insert_sql[$word_in] != \"\") ? \", '\" . $search_matches[$i] . \"'\" : \"'\" . $search_matches[$i] . \"'\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (sizeof($word))\n\t\t{\n\t\t\tsort($word);\n\n\t\t\t$prev_word = '';\n\t\t\t$word_text_sql = '';\n\t\t\t$temp_word = array();\n\t\t\tfor($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\tif ($word[$i] != $prev_word)\n\t\t\t\t{\n\t\t\t\t\t$temp_word[] = $word[$i];\n\t\t\t\t\t$word_text_sql .= (($word_text_sql != '') ? ', ' : '') . \"'\" . $word[$i] . \"'\";\n\t\t\t\t}\n\t\t\t\t$prev_word = $word[$i];\n\t\t\t}\n\t\t\t$word = $temp_word;\n\n\t\t\t$check_words = array();\n\n\t\t\t$value_sql = '';\n\t\t\t$match_word = array();\n\t\t\tfor ($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\t$new_match = true;\n\t\t\t\tif (isset($check_words[$word[$i]]))\n\t\t\t\t{\n\t\t\t\t\t$new_match = false;\n\t\t\t\t}\n\n\t\t\t\tif ($new_match)\n\t\t\t\t{\n\t\t\t\t\t$value_sql .= (($value_sql != '') ? ', ' : '') . '(\\'' . $word[$i] . '\\', 0)';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($value_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT IGNORE INTO \" . $search_word_table . \" (word_text, word_common) VALUES $value_sql\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\twhile(list($word_in, $match_sql) = @each($word_insert_sql))\n\t\t{\n\t\t\t$title_match = ($word_in == 'title') ? 1 : 0;\n\n\t\t\tif ($match_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO \" . $search_match_table . \" ($db_key, word_id, title_match)\n\t\t\t\t\tSELECT $post_id, word_id, $title_match\n\t\t\t\t\t\tFROM \" . $search_word_table . \"\n\t\t\t\t\t\tWHERE word_text IN ($match_sql)\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\tif ($mode == 'single')\n\t\t{\n\t\t\t// remove_common('single', 4/10, $word);\n\t\t}\n\n\t\treturn;\n\t}", "function insert($word) {\n if (strlen($word) == 0) return;\n\n $cur = $this->root;\n for ($i = 0; $i < strlen($word); $i++) {\n $c = substr($word, $i, 1);\n if (!isset($cur->next[$c])) {\n $cur->next[$c] = new TrieNode();\n }\n $cur = $cur->next[$c];\n }\n\n if (!$cur->$isWord) {\n $cur->$isWord = true;\n $this->size++;\n }\n }", "function NbLines($w,$txt)\n{\n\t$cw=&$this->CurrentFont['cw'];\n\tif($w==0)\n\t\t$w=$this->w-$this->rMargin-$this->x;\n\t$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n\t$s=str_replace(\"\\r\",'',$txt);\n\t$nb=strlen($s);\n\tif($nb>0 and $s[$nb-1]==\"\\n\")\n\t\t$nb--;\n\t$sep=-1;\n\t$i=0;\n\t$j=0;\n\t$l=0;\n\t$nl=1;\n\twhile($i<$nb)\n\t{\n\t\t$c=$s[$i];\n\t\tif($c==\"\\n\")\n\t\t{\n\t\t\t$i++;\n\t\t\t$sep=-1;\n\t\t\t$j=$i;\n\t\t\t$l=0;\n\t\t\t$nl++;\n\t\t\tcontinue;\n\t\t}\n\t\tif($c==' ')\n\t\t\t$sep=$i;\n\t\t$l+=$cw[$c];\n\t\tif($l>$wmax)\n\t\t{\n\t\t\tif($sep==-1)\n\t\t\t{\n\t\t\t\tif($i==$j)\n\t\t\t\t\t$i++;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$i=$sep+1;\n\t\t\t$sep=-1;\n\t\t\t$j=$i;\n\t\t\t$l=0;\n\t\t\t$nl++;\n\t\t}\n\t\telse\n\t\t\t$i++;\n\t}\n\treturn $nl;\n}", "function NbLines($w,$txt)\n{\n\t$cw=&$this->CurrentFont['cw'];\n\tif($w==0)\n\t\t$w=$this->w-$this->rMargin-$this->x;\n\t$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n\t$s=str_replace(\"\\r\",'',$txt);\n\t$nb=strlen($s);\n\tif($nb>0 and $s[$nb-1]==\"\\n\")\n\t\t$nb--;\n\t$sep=-1;\n\t$i=0;\n\t$j=0;\n\t$l=0;\n\t$nl=1;\n\twhile($i<$nb)\n\t{\n\t\t$c=$s[$i];\n\t\tif($c==\"\\n\")\n\t\t{\n\t\t\t$i++;\n\t\t\t$sep=-1;\n\t\t\t$j=$i;\n\t\t\t$l=0;\n\t\t\t$nl++;\n\t\t\tcontinue;\n\t\t}\n\t\tif($c==' ')\n\t\t\t$sep=$i;\n\t\t$l+=$cw[$c];\n\t\tif($l>$wmax)\n\t\t{\n\t\t\tif($sep==-1)\n\t\t\t{\n\t\t\t\tif($i==$j)\n\t\t\t\t\t$i++;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$i=$sep+1;\n\t\t\t$sep=-1;\n\t\t\t$j=$i;\n\t\t\t$l=0;\n\t\t\t$nl++;\n\t\t}\n\t\telse\n\t\t\t$i++;\n\t}\n\treturn $nl;\n}", "function NbLines($w,$txt)\n{\n\t$cw=&$this->CurrentFont['cw'];\n\tif($w==0)\n\t\t$w=$this->w-$this->rMargin-$this->x;\n\t$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n\t$s=str_replace(\"\\r\",'',$txt);\n\t$nb=strlen($s);\n\tif($nb>0 and $s[$nb-1]==\"\\n\")\n\t\t$nb--;\n\t$sep=-1;\n\t$i=0;\n\t$j=0;\n\t$l=0;\n\t$nl=1;\n\twhile($i<$nb)\n\t{\n\t\t$c=$s[$i];\n\t\tif($c==\"\\n\")\n\t\t{\n\t\t\t$i++;\n\t\t\t$sep=-1;\n\t\t\t$j=$i;\n\t\t\t$l=0;\n\t\t\t$nl++;\n\t\t\tcontinue;\n\t\t}\n\t\tif($c==' ')\n\t\t\t$sep=$i;\n\t\t$l+=$cw[$c];\n\t\tif($l>$wmax)\n\t\t{\n\t\t\tif($sep==-1)\n\t\t\t{\n\t\t\t\tif($i==$j)\n\t\t\t\t\t$i++;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$i=$sep+1;\n\t\t\t$sep=-1;\n\t\t\t$j=$i;\n\t\t\t$l=0;\n\t\t\t$nl++;\n\t\t}\n\t\telse\n\t\t\t$i++;\n\t}\n\treturn $nl;\n}", "function cut_word(string $word)\n{\n// \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n $save_word = \"\";\n $answer_word = array();\n $count_array = 0;\n $word = strtolower($word) . \" \";\n for ($i = 0; $i < strlen($word); $i++) {\n if ($word[$i] != \" \") {\n $save_word = $save_word . $word[$i];\n } else {\n $answer_word[$count_array] = $save_word;\n $count_array++;\n $save_word = \"\";\n }\n }\n return $answer_word;\n}", "public function returnWords($input){\n\t\t//most common words from wikipedia\n\t\t$commonWords = array(\"the\",\"be\",\"to\",\"of\",\"and\",\"a\",\"in\",\"that\",\"have\",\"i\",\"it\",\n\t\t\"for\",\"not\",\"on\",\"with\",\"he\",\"as\",\"you\",\"do\",\"at\",\"this\",\"but\",\"his\",\"by\",\"from\",\n\t\t\"they\",\"we\",\"say\",\"her\",\"she\",\"or\",\"an\",\"will\",\"my\",\"one\",\"all\",\"would\",\"there\",\"their\",\n\t\t\"what\",\"so\",\"up\",\"out\",\"if\",\"about\",\"who\",\"get\",\"which\",\"go\",\"me\",\"when\",\"make\",\"can\",\n\t\t\"like\",\"time\",\"no\",\"just\",\"him\",\"know\",\"take\",\"people\",\"into\",\"year\",\"your\",\"good\",\"some\",\n\t\t\"could\",\"them\",\"see\",\"other\",\"than\",\"then\",\"now\",\"look\",\"only\",\"come\",\"its\",\"over\",\"think\",\n\t\t\"also\",\"back\",\"after\",\"use\",\"two\",\"how\",\"our\",\"work\",\"first\",\"well\",\"way\",\"even\",\"new\",\"want\",\n\t\t\"because\",\"any\",\"these\",\"give\",\"day\",\"most\",\"us\",\"s\",\"m\",\"ll\",\"ve\",\"is\",\"am\");\n\n\n\t\t//remove tags\n\t\t$input = preg_replace(\"/<[^>]*>/\", \" \", $input);\n\t\t$input = str_replace(\"<br />\", \" \", $input);\n\t\t$input = str_replace(\",\", \" \", $input);\n\t\t$input = str_replace(\".\", \" \", $input);\n\t\t$input = str_replace(\"?\", \" \", $input);\n\t\t$input = str_replace(\"!\", \" \", $input);\n\t\t$input = str_replace(\":\", \" \", $input);\n\t\t$input = str_replace(\";\", \" \", $input);\n\t\t$input = str_replace(\"\\\"\", \" \", $input);\n\t\t$input = str_replace(\"(\", \" \", $input);\n\t\t$input = str_replace(\")\", \" \", $input);\n\t\t$input = str_replace(\"\\n\", \" \", $input);\n\t\t$input = str_replace(\"'\", \" \", $input);\n\t\t$input = str_replace(\"-\", \" \", $input);\n\t\t$input = str_replace(\"*\", \" \", $input);\n\t\t$input = strtolower($input);\n\t\t//replace all multiple spaces into single space\n\t\t$output = preg_replace('!\\s+!', ' ', $input);\n\t\t//split into string\n\t\t$output = trim($output);\n\t\t$wordArray = explode(\" \",$output);\n\n\t\t//remove common words\n\n\t\tfor($i = count($wordArray) - 1 ; $i > -1; $i--){\n\t\t\tfor($j = 0; $j < count($commonWords); $j++){\n\t\t\t\tif($wordArray[$i] == $commonWords[$j]){\n\t\t\t\t\tunset($wordArray[$i]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$wordArray = array_count_values($wordArray);\n\t\tforeach($wordArray as $key => $value){\n\t\t\tif($key == \"\")\n\t\t\t\tunset($wordArray[$key]);\n\t\t}\n\t\treturn $wordArray;\n\n\t}", "function spellcheck_text($text, $threshold = 5)\n {\n $words = preg_split(\"/\\s/\", $text);\n $results = array();\n foreach ($words as $word)\n {\n if (!$this->word_exists($word))\n {\n $results[$word] = $this->find_similar_words($word, $threshold);\n }\n }\n return $results;\n }", "function NbLines($w,$txt)\n{\n $cw=&$this->CurrentFont['cw'];\n if($w==0)\n $w=$this->w-$this->rMargin-$this->x;\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n $s=str_replace(\"\\r\",'',$txt);\n $nb=strlen($s);\n if($nb>0 and $s[$nb-1]==\"\\n\")\n $nb--;\n $sep=-1;\n $i=0;\n $j=0;\n $l=0;\n $nl=1;\n while($i<$nb)\n {\n $c=$s[$i];\n if($c==\"\\n\")\n {\n $i++;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n continue;\n }\n if($c==' ')\n $sep=$i;\n $l+=$cw[$c];\n if($l>$wmax)\n {\n if($sep==-1)\n {\n if($i==$j)\n $i++;\n }\n else\n $i=$sep+1;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n }\n else\n $i++;\n }\n return $nl;\n}", "function NbLines($w,$txt)\n{\n $cw=&$this->CurrentFont['cw'];\n if($w==0)\n $w=$this->w-$this->rMargin-$this->x;\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n $s=str_replace(\"\\r\",'',$txt);\n $nb=strlen($s);\n if($nb>0 and $s[$nb-1]==\"\\n\")\n $nb--;\n $sep=-1;\n $i=0;\n $j=0;\n $l=0;\n $nl=1;\n while($i<$nb)\n {\n $c=$s[$i];\n if($c==\"\\n\")\n {\n $i++;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n continue;\n }\n if($c==' ')\n $sep=$i;\n $l+=$cw[$c];\n if($l>$wmax)\n {\n if($sep==-1)\n {\n if($i==$j)\n $i++;\n }\n else\n $i=$sep+1;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n }\n else\n $i++;\n }\n return $nl;\n}", "function NbLines($w,$txt)\n{\n $cw=&$this->CurrentFont['cw'];\n if($w==0)\n $w=$this->w-$this->rMargin-$this->x;\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n $s=str_replace(\"\\r\",'',$txt);\n $nb=strlen($s);\n if($nb>0 and $s[$nb-1]==\"\\n\")\n $nb--;\n $sep=-1;\n $i=0;\n $j=0;\n $l=0;\n $nl=1;\n while($i<$nb)\n {\n $c=$s[$i];\n if($c==\"\\n\")\n {\n $i++;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n continue;\n }\n if($c==' ')\n $sep=$i;\n $l+=$cw[$c];\n if($l>$wmax)\n {\n if($sep==-1)\n {\n if($i==$j)\n $i++;\n }\n else\n $i=$sep+1;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n }\n else\n $i++;\n }\n return $nl;\n}", "function NbLines($w,$txt)\n{\n $cw=&$this->CurrentFont['cw'];\n if($w==0)\n $w=$this->w-$this->rMargin-$this->x;\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n $s=str_replace(\"\\r\",'',$txt);\n $nb=strlen($s);\n if($nb>0 and $s[$nb-1]==\"\\n\")\n $nb--;\n $sep=-1;\n $i=0;\n $j=0;\n $l=0;\n $nl=1;\n while($i<$nb)\n {\n $c=$s[$i];\n if($c==\"\\n\")\n {\n $i++;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n continue;\n }\n if($c==' ')\n $sep=$i;\n $l+=$cw[$c];\n if($l>$wmax)\n {\n if($sep==-1)\n {\n if($i==$j)\n $i++;\n }\n else\n $i=$sep+1;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n }\n else\n $i++;\n }\n return $nl;\n}", "function NbLines($w,$txt)\r\n{\r\n\t$cw=&$this->CurrentFont['cw'];\r\n\tif($w==0)\r\n\t\t$w=$this->w-$this->rMargin-$this->x;\r\n\t$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\r\n\t$s=str_replace(\"\\r\",'',$txt);\r\n\t$nb=strlen($s);\r\n\tif($nb>0 and $s[$nb-1]==\"\\n\")\r\n\t\t$nb--;\r\n\t$sep=-1;\r\n\t$i=0;\r\n\t$j=0;\r\n\t$l=0;\r\n\t$nl=1;\r\n\twhile($i<$nb)\r\n\t{\r\n\t\t$c=$s[$i];\r\n\t\tif($c==\"\\n\")\r\n\t\t{\r\n\t\t\t$i++;\r\n\t\t\t$sep=-1;\r\n\t\t\t$j=$i;\r\n\t\t\t$l=0;\r\n\t\t\t$nl++;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif($c==' ')\r\n\t\t\t$sep=$i;\r\n\t\t$l+=$cw[$c];\r\n\t\tif($l>$wmax)\r\n\t\t{\r\n\t\t\tif($sep==-1)\r\n\t\t\t{\r\n\t\t\t\tif($i==$j)\r\n\t\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$i=$sep+1;\r\n\t\t\t$sep=-1;\r\n\t\t\t$j=$i;\r\n\t\t\t$l=0;\r\n\t\t\t$nl++;\r\n\t\t}\r\n\t\telse\r\n\t\t\t$i++;\r\n\t}\r\n\treturn $nl;\r\n}", "function NbLines($w,$txt)\r\n{\r\n\t$cw=&$this->CurrentFont['cw'];\r\n\tif($w==0)\r\n\t\t$w=$this->w-$this->rMargin-$this->x;\r\n\t$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\r\n\t$s=str_replace(\"\\r\",'',$txt);\r\n\t$nb=strlen($s);\r\n\tif($nb>0 and $s[$nb-1]==\"\\n\")\r\n\t\t$nb--;\r\n\t$sep=-1;\r\n\t$i=0;\r\n\t$j=0;\r\n\t$l=0;\r\n\t$nl=1;\r\n\twhile($i<$nb)\r\n\t{\r\n\t\t$c=$s[$i];\r\n\t\tif($c==\"\\n\")\r\n\t\t{\r\n\t\t\t$i++;\r\n\t\t\t$sep=-1;\r\n\t\t\t$j=$i;\r\n\t\t\t$l=0;\r\n\t\t\t$nl++;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif($c==' ')\r\n\t\t\t$sep=$i;\r\n\t\t$l+=$cw[$c];\r\n\t\tif($l>$wmax)\r\n\t\t{\r\n\t\t\tif($sep==-1)\r\n\t\t\t{\r\n\t\t\t\tif($i==$j)\r\n\t\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$i=$sep+1;\r\n\t\t\t$sep=-1;\r\n\t\t\t$j=$i;\r\n\t\t\t$l=0;\r\n\t\t\t$nl++;\r\n\t\t}\r\n\t\telse\r\n\t\t\t$i++;\r\n\t}\r\n\treturn $nl;\r\n}", "function parseToMatchSiteshTable($size)\n{\n\techo '</br></br>';\n\n\t$locationOfBottle = strpos($size, 'Bottle');\n\t$locationOfCan = strpos($size, 'Can');\n\n\tif($locationOfBottle > 1)\n\t{\n\t\t$packageType = 'Bottle'; //Returned In Array...\n\t\t$volumeWithUnits = substr($size, ($locationOfBottle + 6), strlen($size));\n\t\t$quantityInPackage = trim(substr($size, 0, ($locationOfBottle - 3))); //Returned In Array...\n\t}\n\telse\n\t{\n\t\t$packageType = 'Can'; //Returned In Array...\n\t\t$volumeWithUnits = substr($size, ($locationOfCan + 3), strlen($size));\n\t\t$quantityInPackage = trim(substr($size, 0, ($locationOfCan - 3))); //Returned In Array...\n\t}\n\n\t$locationOfMl = strpos($volumeWithUnits, 'ml');\n\t$volumeML = trim(substr($volumeWithUnits, 0, $locationOfMl)); //Returned In Array...\n\n\t$sizeFormattedArray = array($quantityInPackage, $packageType, $volumeML);\n\n\treturn $sizeFormattedArray;\n}", "function hamDist($a ,$b) {\n\n $dist = 0;\n\n $a = str_split($a);\n $b = str_split($b);\n\n for ($i = 0; $i < count($a); $i++) {\n\n if (isset($a[$i]) && isset($b[$i])) { # While this won't give errors if the inputs aren't of the same length this function doesn't work properly for such use cases.\n\n $diff = ord($a[$i]) ^ ord($b[$i]);\n \n foreach (str_split(decbin($diff)) as $bit) {\n \n if ($bit) {\n \n $dist++;\n \n }\n \n }\n\n }\n \n }\n\n return $dist;\n\n}", "function distance($v1, $v2)\r\n{\r\n return sqrt(pow(($v1[0]-$v2[0]),2)+pow(($v1[1]-$v2[1]),2));//計算座標2點的距離\r\n}", "function trimWordLen($str, $max) {\n $str = cleanSpaces($str);\n $lines = explode(\"\\n\", $str);\n $ss = \"\";\n foreach ($lines as $i => $line) {\n $words = explode(\" \", $line);\n foreach ($words as $j => $w)\n $ss.=trimWord($w, $max) . \" \";\n $ss.=\"\\n\";\n }\n return cleanSpaces($ss);\n}", "public function searchWord($dataset = array(), $datalatih = array()){\n\n\t$data = array();\n\t$term = array_unique($datalatih);// menghilangkan array yg duplikat\n\n\tfor($i=0; $i<count($dataset); $i++){\n\t\t$key[$i] = 0;\n\t\tforeach($dataset[$i]['stopword'] AS $keys => $value){\n\t\t\t$data[$i][$key[$i]] = array($key[$i] => $value);\n\t\t\t$key[$i] ++;\n\t\t}\n\t}\n\n\tforeach ($term as $keys => $val) {\n\t\tfor($x = 0; $x < count($data); $x++) {\n\t\t\t$sum[$x] = 0;\n\t\t\tfor($y = 0; $y < count($data[$x]); $y++) {\n\t\t\t\tforeach ($data[$x][$y] as $key => $value) {\n\t\t\t\t\tif($val == $value) {\n\t\t\t\t\t\t$nilai = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t \t$nilai = 0; \n\t\t\t\t\t}\n\t\t\t\t\t$sum[$x] += $nilai;\n\t\t\t\t} \n\t\t\t}\n\n\t\t\t$params[$x] = array($val, $sum[$x]);\n\t\t}\n\n\t\t$df[$keys] = $params;\n\n\t}\n\n\treturn $df;\n\n}", "public function get_neighbors()\n\t{\n\t\t// get parent Directory and its children\n\t\t$path = $this->dir->getPath();\n\t\t$parent = new self(dirname($path));\n\t\t$dirs = $parent->get_dirs();\n\n\t\t// find position of current dir\n\t\t$key = array_search(basename($path), $dirs);\n\n\t\t// check if previous/next directories exist\n\t\t$neighbors = array();\n\t\tif (array_key_exists($key - 1, $dirs))\n\t\t\t$neighbors['prev'] = $dirs[$key - 1];\n\t\tif (array_key_exists($key + 1, $dirs))\n\t\t\t$neighbors['next'] = $dirs[$key + 1];\n\n\t\treturn $neighbors;\n\t}", "private function addWord($word) {\n // - En las cajas de cuadrícula\n // - A la lista de palabras que se encuentran\n\n if($word->getLabel()=='') {return;}\n\n // Agregar a cuadros de cuadrícula\n $j=0;\n switch($word->getOrientation()) {\n\n case Word::HORIZONTAL:\n for ($i=$word->getStart(); $j<strlen($word->getLabel()); $i++) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n case Word::VERTICAL:\n for($i=$word->getStart(); $j<strlen($word->getLabel()); $i+=$this->_size) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n case Word::DIAGONAL_LEFT_TO_RIGHT:\n for($i=$word->getStart(); $j<strlen($word->getLabel()); $i+=$this->_size+1) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n case Word::DIAGONAL_RIGHT_TO_LEFT:\n for($i=$word->getStart(); $j<strlen($word->getLabel()); $i+=$this->_size-1) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n } // switch\n\n // Agregar la palabra a la lista\n $this->_wordsList[]=$word;\n\n }", "function seatsInTheater($nCols, $nRows, $col, $row) {\n $disturbed_cols = $nCols - $col + 1;\n $disturbed_rows = $nRows - $row + 1;\n \n $disturbed_people = $disturbed_cols * $disturbed_rows;\n \n return $disturbed_people;\n}", "function mapWord(&$word_map, $word, $offset, $f)\r\n{\r\n if (isset($word_map[$word])) {\r\n if (isset($word_map[$word][$f])){\r\n $term_count = $word_map[$word]['term_count']+1;\r\n $word_map[$word]['term_count'] = $term_count;\r\n array_push($word_map[$word][$f], $offset);\r\n } else {\r\n $doc_count = $word_map[$word]['doc_count']+1;\r\n $word_map[$word]['doc_count'] = $doc_count;\r\n $word_map[$word][$f] = array();\r\n $term_count = $word_map[$word]['term_count']+1;\r\n $word_map[$word]['term_count'] = $term_count;\r\n array_push($word_map[$word][$f],$offset);\r\n }\r\n }\r\n else {\r\n $word_map[$word] = array();\r\n $word_map[$word]['doc_count'] = 1;\r\n $word_map[$word]['term_count'] = 1;\r\n $word_map[$word][$f] = array();\r\n array_push($word_map[$word][$f], $offset);\r\n }\r\n}", "function findSubsquare($inputs) {\n for ($i = count($inputs); $i > 0; $i --) {\n $ans = findSubsquareOfSize($inputs, $i);\n if ($ans) return $ans;\n }\n}", "public function compute(array $lines) {\n list($k, $d) = array_map(function($val) {\n return (int) $val;\n }, explode(' ',$lines[0]));\n\n $strings = [];\n $l = count($lines);\n for ($i = 1; $i < $l; $i++) {\n if (!empty($lines[$i])) array_push($strings, $lines[$i]);\n }\n\n\n $motifs = [];\n for ($i = 0; $i < strlen($strings[0]) - $k + 1; $i++) {\n $patt = substr($strings[0], $i, $k);\n\n $neighbors = BioUtil::neighbors($patt, $d);\n\n foreach($neighbors as $nb) {\n\n if (Arrays::matches($strings, function($str) use ($nb,$d) {\n return BioUtil::approximate_frequency($str, $nb, $d, true) > 0;\n }) &&\n !Arrays::contains($motifs, $nb)) {\n array_push($motifs, $nb);\n }\n }\n }\n\n return $motifs;\n }", "function WordWrap(&$text, $maxwidth)\n\t\t{\n\t\t\t$biggestword=0;//EDITEI\n\t\t\t$toonarrow=false;//EDITEI\n\n\t\t\t$text = trim($text);\n\t\t\tif ($text==='') return 0;\n\t\t\t$space = $this->GetStringWidth(' ');\n\t\t\t$lines = explode(\"\\n\", $text);\n\t\t\t$text = '';\n\t\t\t$count = 0;\n\n\t\t\tforeach ($lines as $line)\n\t\t\t{\n\t\t\t\t$words = preg_split('/ +/', $line);\n\t\t\t\t$width = 0;\n\n\t\t\t\tforeach ($words as $word)\n\t\t\t\t{\n\t\t\t\t\t$wordwidth = $this->GetStringWidth($word);\n\n\t\t\t\t\t //EDITEI\n\t\t\t\t\t //Warn user that maxwidth is insufficient\n\t\t\t\t\t if ($wordwidth > $maxwidth)\n\t\t\t\t\t {\n\t\t\t\t\t\t if ($wordwidth > $biggestword) $biggestword = $wordwidth;\n\t\t\t\t\t\t $toonarrow=true;//EDITEI\n\t\t\t\t\t }\n\t\t\t\t\tif ($width + $wordwidth <= $maxwidth)\n\t\t\t\t\t{\n\t\t\t\t\t\t$width += $wordwidth + $space;\n\t\t\t\t\t\t$text .= $word.' ';\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$width = $wordwidth + $space;\n\t\t\t\t\t\t$text = rtrim($text).\"\\n\".$word.' ';\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$text = rtrim($text).\"\\n\";\n\t\t\t\t$count++;\n\t\t\t}\n\t\t\t$text = rtrim($text);\n\n\t\t\t//Return -(wordsize) if word is bigger than maxwidth \n\t\t\tif ($toonarrow) return -$biggestword;\n\t\t\telse return $count;\n\t\t}", "function NbLines($w,$txt)\r\n{\r\n $cw=&$this->CurrentFont['cw'];\r\n if($w==0)\r\n $w=$this->w-$this->rMargin-$this->x;\r\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\r\n $s=str_replace(\"\\r\",'',$txt);\r\n $nb=strlen($s);\r\n if($nb>0 and $s[$nb-1]==\"\\n\")\r\n $nb--;\r\n $sep=-1;\r\n $i=0;\r\n $j=0;\r\n $l=0;\r\n $nl=1;\r\n while($i<$nb)\r\n {\r\n $c=$s[$i];\r\n if($c==\"\\n\")\r\n {\r\n $i++;\r\n $sep=-1;\r\n $j=$i;\r\n $l=0;\r\n $nl++;\r\n continue;\r\n }\r\n if($c==' ')\r\n $sep=$i;\r\n $l+=$cw[$c];\r\n if($l>$wmax)\r\n {\r\n if($sep==-1)\r\n {\r\n if($i==$j)\r\n $i++;\r\n }\r\n else\r\n $i=$sep+1;\r\n $sep=-1;\r\n $j=$i;\r\n $l=0;\r\n $nl++;\r\n }\r\n else\r\n $i++;\r\n }\r\n return $nl;\r\n}", "public function get($size): array\r\n {\r\n $s = ShapeSettings::AVAILABLE_CHARACTERS['SPACE'];\r\n $f = ShapeSettings::AVAILABLE_CHARACTERS['FILL'];\r\n $e = ShapeSettings::AVAILABLE_CHARACTERS['EDGE'];\r\n \r\n switch ($size) {\r\n case 5:\r\n return [\r\n 1 => [[$s => 3], [$e => 1]],\r\n 2 => [[$s => 3], [$f => 1]],\r\n 3 => [[$s => 2], [$f => 3]],\r\n 4 => [[$s => 1], [$f => 5]],\r\n 5 => [[$f => 7]],\r\n ];\r\n case 7:\r\n return [\r\n 1 => [[$s => 5], [$e => 1]],\r\n 2 => [[$s => 5], [$f => 1]],\r\n 3 => [[$s => 4], [$f => 3]],\r\n 4 => [[$s => 3], [$f => 5]],\r\n 5 => [[$s => 2], [$f => 7]],\r\n 6 => [[$s => 1], [$f => 9]],\r\n 7 => [[$f => 11]],\r\n ];\r\n case 11:\r\n return [\r\n 1 => [[$s => 9], [$e => 1]],\r\n 2 => [[$s => 9], [$f => 1]],\r\n 3 => [[$s => 8], [$f => 3]],\r\n 4 => [[$s => 7], [$f => 5]],\r\n 5 => [[$s => 6], [$f => 7]],\r\n 6 => [[$s => 5], [$f => 9]],\r\n 7 => [[$s => 4], [$f => 11]],\r\n 8 => [[$s => 3], [$f => 13]],\r\n 9 => [[$s => 2], [$f => 15]],\r\n 10 => [[$s => 1], [$f => 17]],\r\n 11 => [[$f => 19]],\r\n ];\r\n default:\r\n return [];\r\n }\r\n }", "private function _highlightMatchingWord($datas)\n {\n $numResult = count($datas);\n for ($i = 0; $i < $numResult; $i++) {\n //store how much word matching\n $match = 0;\n //searching each word in title\n foreach ($this->sSearch as $word) {\n $pos = mb_stripos($datas[$i]->title, $word);\n if (is_numeric($pos) && (strlen($word) > 1)) {\n $word = mb_strtolower($word);\n $datas[$i]->title = mb_strtolower($datas[$i]->title);\n $datas[$i]->title = str_ireplace(\n $word,\n \"<b style='background-color:#ffc107;'>$word</b>\",\n $datas[$i]->title\n );\n $match++;\n }\n }\n //push to each array depend on how much word matching\n if ($match) {\n $part[$match][] = $datas[$i];\n }\n }\n //merge all document ordered by matching number form hight to low\n $wordNumb = count($this->sSearch);\n $partTmp = [];\n for ($j = $wordNumb; $j > 0; $j--) {\n if (isset($part[$j])) {\n foreach ($part[$j] as $value) {\n $partTmp[] = $value;\n }\n }\n }\n // store total of matching title\n $this->count_filtered = count($partTmp);\n // paging by cutting array\n $end = Input::get('start') + Input::get('length');\n $tmp = [];\n for ($i = Input::get('start'); $i < $end; $i++) {\n if (isset($partTmp[$i])) {\n $tmp[] = $partTmp[$i];\n }\n }\n return $tmp;\n }", "public function getProductNeighbors()\n {\n return $this->productNeighbors;\n }", "function hammingDistance($strainReference, $firstStrain, $secondStrain)\n{\n $dist = 0;\n foreach ($strainReference as $key => $value)\n {\n //If we should consider the current marker in the distance calculus\n if(!in_array($value, [\"\", -1]))\n {\n if(array_key_exists($key, $firstStrain) && array_key_exists($key, $secondStrain))\n {\n if ($firstStrain[$key] != $secondStrain[$key])\n {\n $dist += 1;\n }\n }\n }\n }\n return $dist;\n}", "function ST_indexR($ST_h, $ST_v, $ST_w) {\n\t$i = $ST_v[$ST_w];\n\t/* echo(\"<br> ST_indexR: i=$i\"); */\n\tif ($ST_h == 0) $ST_h = new ST_node($i);\n\t/* echo(\"<br> h->index: $ST_h->index, d: $ST_h->d, l: $ST_h->l, m: $ST_h->m, r: $ST_h->r \"); */\n\tif ($i == 0) {\n\t\tif ($ST_h->index == -1) $ST_h->index = $this->ST_N++;\n\t\t$this->ST_val = $ST_h->index;\n\t\treturn $ST_h;\n\t\t}\n\tif ($i < $ST_h->d) $ST_h->l = $this->ST_indexR($ST_h->l, $ST_v, $ST_w);\n\tif ($i == $ST_h->d) $ST_h->m = $this->ST_indexR($ST_h->m, $ST_v, $ST_w+1);\n\tif ($i > $ST_h->d) $ST_h->r = $this->ST_indexR($ST_h->r, $ST_v, $ST_w);\n\treturn $ST_h;\n\t}", "function MoveWord($word,&$wordlocs,$blockfrom,$sfrom,$wfrom,$blockto,$sto,$wto)\n{\n\t$word=TrimWord($word);\n\tif (!isset($wordlocs[$word])) return;\n\t\n\tfor ($loc=0; $loc<count($wordlocs[$word]); $loc++)\n\t{\n\t\t$loci=$wordlocs[$word][$loc];\n\t\tif ($loci[0]==$blockfrom // same block\n\t\t\t&& $loci[1]==$sfrom // same sentence\n\t\t\t&& $loci[2]==$wfrom) // same word\n\t\t{\n\t\t\t// Store new location\n\t\t\t$wordlocs[$word][$loc]=array($blockto,$sto,$wto);\n\t\t}\n\t}\n}", "function NbLines($w,$txt)\n\t{\n\t\t$cw=&$this->CurrentFont['cw'];\n\t\tif($w==0)\n\t\t\t$w=$this->w-$this->rMargin-$this->x;\n\t\t$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n\t\t$s=str_replace(\"\\r\",'',$txt);\n\t\t$nb=strlen($s);\n\t\tif($nb>0 and $s[$nb-1]==\"\\n\")\n\t\t\t$nb--;\n\t\t$sep=-1;\n\t\t$i=0;\n\t\t$j=0;\n\t\t$l=0;\n\t\t$nl=1;\n\t\twhile($i<$nb)\n\t\t{\n\t\t\t$c=$s[$i];\n\t\t\tif($c==\"\\n\")\n\t\t\t{\n\t\t\t\t$i++;\n\t\t\t\t$sep=-1;\n\t\t\t\t$j=$i;\n\t\t\t\t$l=0;\n\t\t\t\t$nl++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif($c==' ')\n\t\t\t\t$sep=$i;\n\t\t\t$l+=$cw[$c];\n\t\t\tif($l>$wmax)\n\t\t\t{\n\t\t\t\tif($sep==-1)\n\t\t\t\t{\n\t\t\t\t\tif($i==$j)\n\t\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$i=$sep+1;\n\t\t\t\t$sep=-1;\n\t\t\t\t$j=$i;\n\t\t\t\t$l=0;\n\t\t\t\t$nl++;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$i++;\n\t\t}\n\t\treturn $nl;\n\t}", "function NbLines($w,$txt)\n\t{\n\t\t$cw=&$this->CurrentFont['cw'];\n\t\tif($w==0)\n\t\t\t$w=$this->w-$this->rMargin-$this->x;\n\t\t$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n\t\t$s=str_replace(\"\\r\",'',$txt);\n\t\t$nb=strlen($s);\n\t\tif($nb>0 and $s[$nb-1]==\"\\n\")\n\t\t\t$nb--;\n\t\t$sep=-1;\n\t\t$i=0;\n\t\t$j=0;\n\t\t$l=0;\n\t\t$nl=1;\n\t\twhile($i<$nb)\n\t\t{\n\t\t\t$c=$s[$i];\n\t\t\tif($c==\"\\n\")\n\t\t\t{\n\t\t\t\t$i++;\n\t\t\t\t$sep=-1;\n\t\t\t\t$j=$i;\n\t\t\t\t$l=0;\n\t\t\t\t$nl++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif($c==' ')\n\t\t\t\t$sep=$i;\n\t\t\t$l+=$cw[$c];\n\t\t\tif($l>$wmax)\n\t\t\t{\n\t\t\t\tif($sep==-1)\n\t\t\t\t{\n\t\t\t\t\tif($i==$j)\n\t\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$i=$sep+1;\n\t\t\t\t$sep=-1;\n\t\t\t\t$j=$i;\n\t\t\t\t$l=0;\n\t\t\t\t$nl++;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$i++;\n\t\t}\n\t\treturn $nl;\n\t}", "function NbLines($w,$txt)\n\t{\n\t\t$cw=&$this->CurrentFont['cw'];\n\t\tif($w==0)\n\t\t\t$w=$this->w-$this->rMargin-$this->x;\n\t\t$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n\t\t$s=str_replace(\"\\r\",'',$txt);\n\t\t$nb=strlen($s);\n\t\tif($nb>0 and $s[$nb-1]==\"\\n\")\n\t\t\t$nb--;\n\t\t$sep=-1;\n\t\t$i=0;\n\t\t$j=0;\n\t\t$l=0;\n\t\t$nl=1;\n\t\twhile($i<$nb)\n\t\t{\n\t\t\t$c=$s[$i];\n\t\t\tif($c==\"\\n\")\n\t\t\t{\n\t\t\t\t$i++;\n\t\t\t\t$sep=-1;\n\t\t\t\t$j=$i;\n\t\t\t\t$l=0;\n\t\t\t\t$nl++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif($c==' ')\n\t\t\t\t$sep=$i;\n\t\t\t$l+=$cw[$c];\n\t\t\tif($l>$wmax)\n\t\t\t{\n\t\t\t\tif($sep==-1)\n\t\t\t\t{\n\t\t\t\t\tif($i==$j)\n\t\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$i=$sep+1;\n\t\t\t\t$sep=-1;\n\t\t\t\t$j=$i;\n\t\t\t\t$l=0;\n\t\t\t\t$nl++;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$i++;\n\t\t}\n\t\treturn $nl;\n\t}", "function linify($string, $fitwidth, $font, $size){\n\t\t$words = explode(' ', $string);\n\t\t$lines = array($words[0]);\n\t\t$currentLine = 0; \n\t for($i = 1; $i < count($words); $i++) { \n\t\t\t// see if next word fits\n\t $lineSize = imagettfbbox($size, 0, $font, $lines[$currentLine] . ' ' . $words[$i]);\n\t\t\t$linewidth = $lineSize[2] - $lineSize[0];\n\t if($linewidth < $fitwidth) { \n\t $lines[$currentLine] .= ' ' . $words[$i]; \n\t }else { \n\t $currentLine += 1;\n\t $lines[$currentLine] = $words[$i]; \n\t } \n\t }\n\t\treturn $lines;\n\t}" ]
[ "0.55393374", "0.5393672", "0.5344756", "0.5256735", "0.5157782", "0.5143379", "0.5100168", "0.50893384", "0.5087017", "0.5025564", "0.4932043", "0.48924276", "0.4760784", "0.47087795", "0.46929485", "0.4657881", "0.46575263", "0.46490246", "0.4636563", "0.46287817", "0.46173584", "0.45898056", "0.45721936", "0.45658275", "0.45615816", "0.45142877", "0.4511122", "0.44931686", "0.44710648", "0.44314384", "0.44288155", "0.44215477", "0.44006777", "0.43967342", "0.43962014", "0.4394533", "0.43926847", "0.43723", "0.43680447", "0.43643013", "0.436176", "0.43505865", "0.4347098", "0.43344477", "0.4315241", "0.4314207", "0.42991257", "0.42959908", "0.42730764", "0.4268435", "0.4265789", "0.42562446", "0.4238567", "0.42362764", "0.4229282", "0.4213565", "0.42000735", "0.41985896", "0.41983828", "0.4197755", "0.41951275", "0.41858125", "0.41858125", "0.4170738", "0.41704506", "0.41695288", "0.41695288", "0.41695288", "0.41672403", "0.41452923", "0.4143177", "0.41292888", "0.41292888", "0.41292888", "0.41292888", "0.41275474", "0.41275474", "0.41240075", "0.41234517", "0.4122404", "0.4117906", "0.4116554", "0.41147304", "0.41132945", "0.41105366", "0.41073698", "0.4094165", "0.4092606", "0.4092019", "0.40876922", "0.40799555", "0.40795493", "0.4070744", "0.40683472", "0.4062263", "0.40620387", "0.40619147", "0.40619147", "0.40619147", "0.40610623" ]
0.69498
0
/end of find neighbor function /print function for vertex neighbors
function printNeighbors(){ foreach($vertexList as $v){ if(count($v->neighbors) > 0){ print($word . ": "); foreach($v->neighbors as $vertex){ print($vertex->word.", "); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function neighbors($v);", "function findNeighbor($Vertex_forWho,$Vertex_finder,$word,$differenceCount){\n\t\t//since some words like car had r as the end but cars had the r and s as end\n\t\t//this function kept breaking, because this was my base case, but to save myself\n\t\t// a headache i split them up into word sized tries\n\n\t\t//if the end of the word is met, then if the difference is only 1 push it back\n\t\t//as an edge to both finder and for who.\n\n\t\tif($Vertexfind->end == true){\n\t\t\tif($differenceCount == 1){\n\t\t\t\t$Vertex_forWho->neighbors[] = $Vertex_finder;\n\t\t\t\t$Vertex_finder->neighbors[] = $Vertex_forWho;\n\t\t\t}\n\t\t}//if the word is still 1 character long, check its edges and find the neighbors for it\n\t\telse if(strlen($word) == 1){\n\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\telse\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t}\n\t\t}//for any wordzie bigger than 1, add all the neighbors\n\t\telse if(strlen($word) > 1){\n\t\t\tif($differenceCount > 1)\n\t\t\t\treturn;\n\t\t\telse if($differenceCount == 0){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 0);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($differenceCount == 1){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getNeighbours($arr, $x, $y){\n\t$c = getColumn($arr, $x);\n\t$r = getRow($arr, $y);\n\t[$bnum, $bpos] = locateBlock($x, $y);\n\t$b = getBlock($arr, $bnum);\n\t$ret = array_merge(remove($b, $bpos), remove($c, $y), remove($r, $x));\n\treturn $ret;\n}", "public function getNeighbor($m, $n) {\n $ret = array();\n for ($j = -1; $j <= 1; $j++) {\n for ($i = -1; $i <= 1; $i++) {\n $x = $this->x + $i;\n $y = $this->y + $j;\n if ( !($x == $this->x && $y == $this->y) \n && ( $x >= 0 ) && ( $y >= 0 ) \n && ( $x < $m ) && ( $y < $n ) \n ) {\n $ret[] = array($x, $y);\n }\n }\n }\n return $ret;\n }", "public function edges();", "function live_neighbors($key, $type, $cells, $cols)\r\n\t{\r\n\t\t$live_neighbors = 0;\r\n\t\tif ($type !== 'ur' && $type !== 'rs' && $type !== 'br' && $cells[$key+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'bl' && $cells[$key-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'bl' && $type !== 'bs' && $type !== 'br' && $cells[$key+$cols] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ur' && $type !== 'rs' && $type !== 'br' && $type !== 'bl' && $type !== 'bs' && $cells[$key+$cols+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'br' && $type !== 'bl' && $type !== 'bs' && $cells[$key+$cols-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\r\n\t\tif ($type !== 'ul' && $type !== 'us' && $type !== 'ur' && $cells[$key-$cols] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\t\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'us' && $type !== 'bl' && $type !== 'ur' && $cells[$key-$cols-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\r\n\t\tif ($type !== 'ul' && $type !== 'us' && $type !== 'br' && $type !== 'ur' && $type !== 'rs' && $cells[$key-$cols+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\treturn $live_neighbors;\r\n\t}", "abstract public function getEdges();", "public function getNeighborhood()\n {\n return $this->neighborhood;\n }", "public function getNeighbors(array $columns = ['*']);", "public function get_neighbors()\n\t{\n\t\t// get parent Directory and its children\n\t\t$path = $this->dir->getPath();\n\t\t$parent = new self(dirname($path));\n\t\t$dirs = $parent->get_dirs();\n\n\t\t// find position of current dir\n\t\t$key = array_search(basename($path), $dirs);\n\n\t\t// check if previous/next directories exist\n\t\t$neighbors = array();\n\t\tif (array_key_exists($key - 1, $dirs))\n\t\t\t$neighbors['prev'] = $dirs[$key - 1];\n\t\tif (array_key_exists($key + 1, $dirs))\n\t\t\t$neighbors['next'] = $dirs[$key + 1];\n\n\t\treturn $neighbors;\n\t}", "public function getNeighborCount()\n {\n return $this->neighbor_count;\n }", "public function neighbors()\n {\n $parent = $this->parent;\n $exclude = $this->term_id;\n\n $query = static::where('term_id', '!=', $exclude);\n\n return $parent ? $query->where('parent', $parent) : $query->whereNull('parent');\n }", "public function printRoute()\r\n {\r\n foreach (end($this->visited) as $visit) {\r\n echo $this->locations[$visit]['name'] . \"\\n\";\r\n }\r\n }", "function getLabel($data, $neighbors)\n{\n $results = array();\n $neighbors = array_keys($neighbors);\n print_r($neighbors);\n foreach ($neighbors as $neighbor) {\n $results[] = $data[$neighbor][2];\n }\n $values = array_count_values($results);\n $values = array_flip($values);\n ksort($values);\n return array_pop($values);\n}", "public function outAdjacentVertices($id) {\n\t\treturn $this->outAdjacents[$id];\n\t}", "public function get_edges()\n {\n }", "public function countVertices() {\n\t\treturn count($this->inAdjacents);\n\t}", "public function inAdjacentVertices($id) {\n\t\treturn $this->inAdjacents[$id];\n\t}", "public function findAdjacentOf(Cell $cell);", "public function edgeCount();", "public function add_neighbor($uid, $neighbor_ip){\n $ngh_id = $this->get_uid($neighbor_ip);\n if(!$ngh_id)\n $ngh_id = $this->add_user($neighbor_ip);\n \n if(!$ngh_id)\n return NULL;\n\n $edge_exists = $this->edge_exists($uid, $ngh_id);\n \n\t\t$query = \"INSERT INTO edges(\n src_id,\n\t\t\ttarget_id) \n\t\t\tVALUES(?, ?)\n ON DUPLICATE KEY UPDATE src_id = src_id;\n\t\t\";\n\t\t\t\n\t\t$stmt = $this->prepare_statement($query);\n if(!$stmt)\n return NULL;\n\t\t$bind = $stmt->bind_param(\"ii\", $uid, $ngh_id);\n\t\tif(!$bind)\n\t\t\treturn NULL;\n\t\t\n\t\t$exec = $stmt->execute();\n\t\tif(!$exec)\n\t\t\treturn NULL;\n\n /* duplicate edges */\n\t\t$bind = $stmt->bind_param(\"ii\", $ngh_id, $uid);\n\t\tif(!$bind)\n\t\t\treturn NULL;\n\t\t\n\t\t$exec = $stmt->execute();\n\t\tif(!$exec)\n\t\t\treturn NULL;\n\t\t\t\n\t\treturn array(\n \"neighbor_id\" => $ngh_id,\n \"edge_exists\" => $edge_exists\n );\n }", "public function __toString()\n {\n $vertices = $this->getVertices();\n // init\n $buffer = [];\n // add\n $buffer[] = sprintf(\n '%d vertices, %d edges',\n $vertices,\n $this->getEdges()\n );\n // iterate over the vertices\n for ($vertex = 0; $vertex < $vertices; $vertex++) {\n // get the adjacent vertices\n $adjacentVertices = $this->adjacent($vertex);\n // add\n $buffer[] = sprintf(\n '%d : %s',\n $vertex,\n implode(' ', $adjacentVertices)\n );\n }\n // convert to string\n return implode(PHP_EOL, $buffer);\n }", "public function getProductNeighbors()\n {\n return $this->productNeighbors;\n }", "public function index()\n {\n $a = new Node(1,'A',12,34,[]);\n $b = new Node(2,'B',12,34,[]);\n $c = new Node(3,'C',12,34,[]);\n $d = new Node(4,'D',12,34,[]);\n $e = new Node(5,'E',13,45,[]); \n $f = new Node(7,'F',13,45,[]); \n $g = new Node(8,'G',13,45,[]); \n $h = new Node(9,'H',13,45,[]); \n $i = new Node(12,'I',13,45,[]); \n $j = new Node(10,'J',13,45,[]); \n $k = new Node(11,'K',13,45,[]); \n $l = new Node(13,'L',13,45,[]); \n $m = new Node(14,'M',13,45,[]); \n $n = new Node(16,'N',13,45,[]); \n $p = new Node(17,'P',13,45,[]);\n\n\n $gr = new Grafo();\n $gr->Add($a);\n $gr->Add($b);\n $gr->Add($c);\n $gr->Add($d);\n $gr->Add($e);\n $gr->Add($f);\n $gr->Add($g);\n $gr->Add($h);\n $gr->Add($i);\n $gr->Add($j);\n $gr->Add($k);\n $gr->Add($l);\n $gr->Add($m);\n $gr->Add($n);\n $gr->Add($p);\n\n // A\n $gr->AddEdge($a,8,$b);\n $gr->AddEdge($b,8,$a);\n $gr->AddEdge($a,4,$e);\n $gr->AddEdge($e,4,$a);\n $gr->AddEdge($a,5,$d);\n $gr->AddEdge($d,5,$a);\n // B\n $gr->AddEdge($b,12,$e);\n $gr->AddEdge($e,12,$b);\n $gr->AddEdge($b,4,$f);\n $gr->AddEdge($f,4,$b);\n $gr->AddEdge($b,3,$c);\n $gr->AddEdge($c,3,$b);\n // C\n $gr->AddEdge($c,9,$f);\n $gr->AddEdge($f,9,$c);\n $gr->AddEdge($c,11,$g);\n $gr->AddEdge($g,11,$c);\n // F\n $gr->AddEdge($f,1,$g);\n $gr->AddEdge($g,1,$f);\n $gr->AddEdge($f,3,$e);\n $gr->AddEdge($e,3,$f);\n $gr->AddEdge($f,8,$k);\n $gr->AddEdge($k,8,$f);\n // G\n $gr->AddEdge($g,7,$l);\n $gr->AddEdge($l,7,$g);\n $gr->AddEdge($g,8,$k);\n $gr->AddEdge($k,8,$g);\n // E\n $gr->AddEdge($e,9,$d);\n $gr->AddEdge($d,9,$e);\n $gr->AddEdge($e,5,$j);\n $gr->AddEdge($j,5,$e);\n $gr->AddEdge($e,8,$i);\n $gr->AddEdge($i,8,$e);\n // D\n $gr->AddEdge($d,6,$h);\n $gr->AddEdge($h,6,$d);\n // H\n $gr->AddEdge($h,2,$i);\n $gr->AddEdge($i,2,$h);\n $gr->AddEdge($h,7,$m);\n $gr->AddEdge($m,7,$h);\n // I\n $gr->AddEdge($i,10,$j);\n $gr->AddEdge($j,10,$i);\n $gr->AddEdge($i,6,$m);\n $gr->AddEdge($m,6,$i);\n // M\n $gr->AddEdge($m,2,$n);\n $gr->AddEdge($n,2,$m);\n // J\n $gr->AddEdge($j,6,$k);\n $gr->AddEdge($k,6,$j);\n $gr->AddEdge($j,9,$n);\n $gr->AddEdge($n,9,$j);\n // K\n $gr->AddEdge($k,5,$l);\n $gr->AddEdge($l,5,$k);\n $gr->AddEdge($k,7,$p);\n $gr->AddEdge($p,7,$k);\n // L\n $gr->AddEdge($l,6,$p);\n $gr->AddEdge($p,6,$l);\n // N\n $gr->AddEdge($n,12,$p);\n $gr->AddEdge($p,12,$n);\n // P\n\n // dd($gr);\n // return $gr->MenorDistancia([INF,INF,0,INF]);\n // return $gr->Show();\n return $gr->Disjtra($a,$p);\n }", "public function isVisitedEdge($edge);", "function prims_mst($distance_table){\n //TODO use sets or something similar to sets for this\n $u = array();\n $v = array_keys($distance_table);\n\n $new_edges = array();\n $all_vertexes = array_keys($distance_table);\n\n $a = array_pop($v);\n array_push($u,$a);\n\n //Keep looping until we've got all the edges\n $i = 0; //Loop protector to prevent infinite loops\n $max_ittr = count($all_vertexes)+4;\n while(!contains_all_verticies($u,$all_vertexes) && $i < $max_ittr){\n\n //Now go through all the edges in $v find it's closest neighbour in $u\n //Find the miinmum of those and put that vertex in $v\n $min_v = INF;\n $min_i = 0;\n $min_j = 0;\n foreach($v as $v1){\n $mins = find_min_vertex($v1,$u,$distance_table);\n if($mins[1] < $min_v){\n $min_v = $mins[1];\n $min_i = $mins[0];\n $min_j = $v1;\n }\n }\n //add the edge to the edges and the vertex to $u\n array_push($u,$min_j);\n array_push($new_edges,array($min_j,$min_i));\n\n $v = array_delete($v,$min_j);\n\n\n\n $i++;\n }\n\n return $new_edges;\n}", "abstract public function getVerticesTarget();", "public function getUserNeighbours ( $user, $limit = 50 ) {\n\t\tif ( $this->api_key ) {\t\n\t\t\t$url = \n\t\t\t\tself::API_ROOT . $this->urls['UserNeighbours'] . \n\t\t\t\t\"&api_key=\" . $this->api_key . \n\t\t\t\t\"&user=\" . $user .\n\t\t\t\t\"&limit=\" . $limit;\n\t\t\t\t\n\t\t\treturn $this->getResults( $url );\n\t\t}\n\t}", "public function index()\n {\n $neighbors = Neighbor::all();\n return view('neighbor.index')->with('neighbors', $neighbors);\n }", "private function calculateConnections() {\n $map = array();\n $whiteRecheck = array();\n for ($row=0; $row < $this->matrix->getSize(); $row++) {\n for ($col=0; $col < $this->matrix->getSize(); $col++) {\n $map[$row][$col][5] = $this->isDarkInt($row, $col);\n $map[$row][$col][0] = 0;\n $map[$row][$col][4] = $this->isDarkInt($row, $col - 1);\n $map[$row][$col][6] = $this->isDarkInt($row, $col + 1);\n $map[$row][$col][8] = $this->isDarkInt($row - 1, $col);\n $map[$row][$col][2] = $this->isDarkInt($row + 1, $col);\n $map[$row][$col][7] = $this->isDarkInt($row - 1, $col - 1);\n $map[$row][$col][9] = $this->isDarkInt($row - 1, $col + 1);\n $map[$row][$col][1] = $this->isDarkInt($row + 1, $col - 1);\n $map[$row][$col][3] = $this->isDarkInt($row + 1, $col + 1);\n if (!$map[$row][$col][5]) {\n $fullCount = $map[$row][$col][1] + $map[$row][$col][2] + $map[$row][$col][3] + $map[$row][$col][4]\n + $map[$row][$col][6] + $map[$row][$col][7] + $map[$row][$col][8] + $map[$row][$col][9];\n $soloCount = $map[$row][$col][2] + $map[$row][$col][4] + $map[$row][$col][6] + $map[$row][$col][8];\n $map[$row][$col][7] = 0;\n $map[$row][$col][9] = 0;\n $map[$row][$col][1] = 0;\n $map[$row][$col][3] = 0;\n if ($this->isDarkInt($row, $col - 1) && $this->isDarkInt($row - 1, $col)) {\n $map[$row][$col][7] = 1;\n }\n if ($this->isDarkInt($row, $col + 1) && $this->isDarkInt($row - 1, $col)) {\n $map[$row][$col][9] = 1;\n }\n if ($this->isDarkInt($row, $col - 1) && $this->isDarkInt($row + 1, $col)) {\n $map[$row][$col][1] = 1;\n }\n if ($this->isDarkInt($row, $col + 1) && $this->isDarkInt($row + 1, $col)) {\n $map[$row][$col][3] = 1;\n }\n if ($fullCount >= 5) {\n $whiteRecheck[]=array('row' => $row, 'col' => $col);\n }\n if ($soloCount >= 4) {\n $map[$row][$col][0] = 1;\n }\n }\n }\n }\n foreach ($whiteRecheck as $key => $cw) {\n $row = $cw['row'];\n $col = $cw['col'];\n if (isset($map[$row + 1][$col - 1]) && !$map[$row + 1][$col - 1][5] && isset($map[$row + 1][$col - 1]) && $map[$row + 1][$col - 1][0]) {\n $map[$row][$col][1] = 0;\n $map[$row][$col - 1][3] = 0;\n $map[$row + 1][$col][7] = 0;\n $map[$row + 1][$col - 1][9] = 0;\n }\n if (isset($map[$row + 1][$col + 1]) && !$map[$row + 1][$col + 1][5] && isset($map[$row + 1][$col + 1]) && $map[$row + 1][$col + 1][0]) {\n $map[$row][$col][3] = 0;\n $map[$row][$col + 1][1] = 0;\n $map[$row + 1][$col][9] = 0;\n $map[$row + 1][$col + 1][7] = 0;\n }\n }\n return $map;\n }", "function XXXneighbors($id, $ccid) {\n\t\t/*\n\t\t * neighborhood filmstrip, \n\t\t * - allow JSON request only, for rendering in JS\n\t\t */\n\t\t$result = $this->__getFilmstripInit($id, $ccid);\n//\t\t$this->set('jsonData',array('init'=>$result['init'], 'CastingCall'=>$result['castingCall']));\n\t\t$this->viewVars['jsonData']['filmstrip']['init'] = $result['init'];\n\t\t$this->viewVars['jsonData']['castingCall'] = $result['castingCall'];\n\t\t$this->viewVars['jsonData']['ccid'] = $ccid;\t\t\n\t\t\n\t\t\n\t\t$done = $this->renderXHRByRequest('json', '/elements/photo/filmstrip');\n\t\tif ($done) return; // stop for JSON/XHR requests, $this->autoRender==false\n\t\t\n\t\t// or autoRender\n//\t\tdebug($result);\n\t\t$this->set($result);\n\t\t$options = array('conditions'=>array('Asset.id'=>$id)\t\t);\n\t\t$this->Asset->contain(null);\t\t\n\t\t$data = @$this->Asset->find('first', $options);\n\t\t$this->set('data', $data);\t\n\t}", "function point_is_on_vertex($point)\n{\n $vertices = $this->vertices;\n\n foreach ($vertices as $vertex)\n {\n if ($point === $vertex)\n {\n return true;\n }\n }\n\n return false;\n}", "function generar_DFS($indice,$mat,$numero){\r\n $padre[$indice] = 1;\r\n vardump($numero);\r\n for($i = 0; $i<$numero; $i++){\r\n if($i == $indice){\r\n for($j = 0; $j<$numero; $j++){\r\n if($mat[$i][$j]==1 && $padre[$j]==0){ #si el vertice inicial esta conectado al vertice final y este no fue visitado\r\n $matrizDFS[$i][$j] = 1;\r\n generar_DFS($j,$mat,$numero);\r\n } #se registra la conexion en la matriz dfs global\r\n }\r\n }\r\n }\r\n #los datos de la matriz global pasan a una matriz local\r\n return $matrizDFS; #se regresa la matriz DFS\r\n}", "function getNeighbour($direction){\n\t\t\t\tif(isset($this->neighbours[$direction])){\n\t\t\t\t\treturn $this->neighbours[$direction];\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}", "public function getCategoryNeighbors()\n {\n return $this->categoryNeighbors;\n }", "public static function neighborsOf(GraphInterface $graph, VertexInterface $vertex): array\n {\n $neighbors = [];\n $edges = $graph->edgesOf($vertex);\n foreach ($edges as $edge) {\n $neighbors[] = self::getOppositeVertex($graph, $edge, $vertex);\n }\n return $neighbors;\n }", "function search_own_router($all_nodes, $own_nodes)\n{\n # Deklariere Array\n $own_router_index = array();\n $i = 0;\n foreach ($all_nodes as $node) {\n $node_id = $node['node_id'];\n foreach ($own_nodes as $own_id) {\n if ($own_id == $node_id) {\n array_push($own_router_index, $i);\n }\n }\n $i = $i + 1;\n }\n return $own_router_index;\n}", "public function visitEdge($edge);", "public function byNeighborhoodId($n_id) {\n $points = array();\n foreach($this->_points as $p) {\n if (!$p->isTie())\n if($p->isWinner($n_id))\n array_push($points,$p);\n }\n return $points;\n }", "function neighbors($ccid=null) {\n\t\t// force JSON request\n\t\tif ($this->RequestHandler->ext !== 'json') $this->redirectSafe();\n\t\t\n\t\t$FILMSTRIP_LIMIT = 999;\n\t\t$options = $this->params['named'];\n\t\tif (empty($options['perpage'])) $options['perpage'] = $FILMSTRIP_LIMIT;\n\t\t/*\n\t\t * navFilmstrip processing\n\t\t */\n\t\tif (!isset($this->CastingCall)) $this->CastingCall = loadComponent('CastingCall', $this);\n\t\tif (empty($ccid) && isset($this->params['url']['ccid'])) $ccid = $this->params['url']['ccid'];\n\t\t$castingCall = $this->CastingCall->cache_Refresh($ccid, $options);\t\t\n\t\t$this->viewVars['jsonData']['castingCall'] = $castingCall;\n\t\t$done = $this->renderXHRByRequest('json', null, null , 0);\n\t\treturn;\n\t}", "private function getVerticesNeighbor(Vertex $vertex)\n {\n $vertices = array();\n foreach ($vertex->getEdges() as $edge) {\n if (!$edge instanceof EdgeUndirected) {\n throw new UnexpectedValueException('Directed edge encountered');\n }\n $vertices[] = $edge->getVertexToFrom($vertex);\n }\n return new Vertices($vertices);\n }", "function floydWarshall($graph, $V, $INF)\n{\n $dist = [];\n foreach ($graph as $ind => $g) {\n foreach ($g as $key) {\n $dist[$ind][] = 0;\n }\n }\n $path = $dist;\n\n /* initial values for based on shortest paths considering no intermediate vertex. */\n for ($i = 0; $i < $V; $i++) {\n for ($j = 0; $j < $V; $j++) {\n $dist[$i][$j] = $graph[$i][$j];\n $path[$i][$j] = ($graph[$i][$j] > 0 && $graph[$i][$j] < $INF) ? 1 : 0;\n }\n }\n\n /* Add all vertices */\n for ($k = 0; $k < $V; $k++) {\n // Pick all vertices as source one by one\n for ($i = 0; $i < $V; $i++) {\n // Pick all vertices as destination\n // for the above picked source\n for ($j = 0; $j < $V; $j++) {\n // If vertex k is on the shortest path from\n // i to j, then update the value of dist[i][j]\n if (\n $dist[$i][$k] + $dist[$k][$j] <\n $dist[$i][$j]\n ) {\n $dist[$i][$j] = $dist[$i][$k] +\n $dist[$k][$j];\n $path[$i][$j] = $path[$i][$k] +\n $path[$k][$j];\n }\n }\n }\n }\n\n return [$dist, $path];\n}", "public static function successorsOf(GraphInterface $graph, VertexInterface $vertex): array\n {\n $neighbors = [];\n $edges = $graph->outgoingEdgesOf($vertex);\n foreach ($edges as $edge) {\n $neighbors[] = self::getOppositeVertex($graph, $edge, $vertex);\n }\n return $neighbors;\n }", "abstract public function _get_connected();", "public function adjacent(int $vertex)\n {\n // validate the vertex\n Digraph::validateVertex($vertex, $this->getVertices());\n // return the adjacent vertices to it\n return $this->adjacencyList[$vertex];\n }", "public function executeGabow($graph, $root){\n\n //input string that will be converted to the input file for wmatch\n $input = \"\";\n //initialize total number of edges. Will be used in line 1 of the input file\n $totaledges = 0;\n\n //initialize total number of vertices. Will be used in line 1 of the input file\n $vertices = count($graph);\n\n //create some complementary arrays to convert the position of the cysteines\n //(label) to an index that will be used in the input file for wmatch\n $keys = array_keys($graph);\n sort($keys,SORT_NUMERIC);\n for($i=0;$i<$vertices;$i++){\n $index[$keys[$i]] = $i+1;\n }\n\n //for each vertex, add its edges with respective weightes to the input file\n for($i=0;$i<$vertices;$i++){\n \n //unset variables to avoid it from carrying garbage\n if(isset($matches))unset($matches);\n if(isset($edges))unset($edges);\n if(isset($edgeskeys))unset($edgeskeys);\n\n //given one vertex, find all the possible edges\n $matches = $graph[$keys[$i]];\n for($j=0;$j<count($matches);$j++){\n //indexes are the cysteine positions converted into an integer that\n //will be interpreted by the wmatch executable and values are the\n //edge weights\n $edges[$index[$matches[$j]]] += 1;\n }\n\n //add to total edges\n $totaledges += count($edges);\n\n //mount vertex info to populate the vertex line in the input file\n $vertex = $index[$keys[$i]];\n $label = $keys[$i];\n $edgeskeys = array_keys($edges);\n //#edges label 0 0 \\n\\n\n $input .= count($edgeskeys).\" \".$label.\" 0 0 \\n\\n\";\n\n //for each vertex, calculate the possible edges with its respective weight\n //hold edge weights on array values\n ksort($edges,SORT_NUMERIC);\n //hold edge indexes on array values\n sort($edgeskeys,SORT_NUMERIC);\n for($k=0;$k<count($edges);$k++){\n //#index #weight \\n\\n\n $input .= $edgeskeys[$k].\" \".$edges[$edgeskeys[$k]].\" \\n\\n\";\n }\n }\n\n //calculate final number of edges. divide by 2 because are edges are duplicated\n //i.e. 142-292 and 292-142 are the same S-S bond\n //totaledges needs to be a natural number\n if($totaledges%2 > 0){\n $totaledges--;\n }\n $totaledges = $totaledges/2;\n //first line of input file: carries total number of vertices and edges\n //#vertices #edges U \\n\\n\n $input = $vertices.\" \".$totaledges.\" U \\n\\n\".$input.\"\\n\";\n\n //prepare file paths\n $path = $root.\"/gabow/\".$vertices.$totaledges.\"U\";\n\n if($_ENV['OS'] == \"Windows_NT\"){\n $path = str_replace(\"/\", \"\\\\\", $path);\n }\n\n $extensionIN = \".in\";\n $extensionOUT = \".out\";\n\n //delete old files if they exist\n if(file_exists($path.$extensionIN)){\n unlink($path.$extensionIN);\n }\n\n //save input string to input file\n file_put_contents($path.$extensionIN, $input);\n\n //write command to be executed to run wmatch executable\n $command = \"\";\n if($_ENV['OS'] == \"Windows_NT\"){\n $command = $root.\"/gabow/wmatch.exe \".\n $path.$extensionIN.\" > \".$path.$extensionOUT;\n $command = str_replace(\"/\", \"\\\\\", $command);\n }\n else{\n $command = $root.\"/gabow/./wmatch \".\n $path.$extensionIN.\" > \".$path.$extensionOUT;\n }\n \n //execute command\n exec($command);\n\n //delete files created\n if(file_exists($path.$extensionIN)){\n unlink($path.$extensionIN);\n }\n if(file_exists($path.$extensionOUT)){\n //read output file to output string\n $output = file_get_contents($path.$extensionOUT);\n unlink($path.$extensionOUT);\n }\n\n /*OLD CODE\n //extract maximum weighted match results\n $results = array();\n if($_ENV['OS'] == \"Windows_NT\"){\n $output = str_replace(\"\\r\\n\", \" \", $output);\n $results = explode(\" \", trim($output));\n }\n else{\n for($l=0;$l<strlen($output);$l++){\n $value = substr($output, $l, 1);\n if(strlen(trim($value)) > 0){\n $results[] = $value;\n }\n }\n }\n */\n \n //extract results\n $output = trim($output);\n $output = str_replace(\"\\r\\n\", \" \", $output);\n $output = str_replace(\"\\t\", \" \", $output);\n $output = str_replace(\"\\n\", \" \", $output);\n $output = str_replace(\"\\r\", \" \", $output);\n $results = explode(\" \", $output);\n\n //create an array with all chosen V-E-V (vertex-edge-vertex) combinations\n for($i=0;$i<count($results);$i+=2){\n //dilsufide bond: i.e. 142-292\n $bond = $keys[$results[$i]-1].\"-\".$keys[$results[$i+1]-1];\n //reverse disulfide bond to avoid creating duplicated disulfide bonds\n $reversebond = $keys[$results[$i+1]-1].\"-\".$keys[$results[$i]-1];\n $exist = false;\n //if disulfide bond already exists, skip without creating a duplicate\n if(count($bonds) > 0){\n $exist = array_search($reversebond, $bonds);\n }\n //if disulfide bond is new, add to S-S bonds array\n if($exist === false && $results[$i] != \"0\" && $results[$i+1] != \"0\"){\n $bonds[] = $keys[$results[$i]-1].\"-\".$keys[$results[$i+1]-1];\n }\n }\n\n //return final array with selected disulfide bonds according to Gabow's\n //algorithm to solve maximum weighted matching problems\n return $bonds;\n }", "public function edge() {\r\n\t\t$matrix = array(\r\n\t\t\tarray(1, 1, 1),\r\n\t\t\tarray(1, -2, 1),\r\n\t\t\tarray(1, 1, 1)\r\n\t\t);\r\n\t\t$this->convolution($matrix, array_sum(array_map('array_sum', $matrix)));\r\n\t}", "public function show(Neighbor $neighbor)\n {\n\n return view('neighbor.show')->with('neighbor', $neighbor);\n //\n }", "private function isReachable(array $from, array $to): bool\n {\n $cells = [];\n if ($from[0] === $to[0]) {\n for ($i = min($from[1], $to[1]); $i <= max($from[1], $to[1]); ++$i) {\n $cells[] = $this->getCell($from[0], $i);\n }\n } else if ($from[1] === $to[1]) {\n for ($i = min($from[0], $to[0]); $i <= max($from[0], $to[0]); ++$i) {\n $cells[] = $this->getCell($i, $from[1]);\n }\n } else {\n $x1 = min($from[0], $to[0]);\n $y1 = $x1 === $from[0] ? $from[1] : $to[1];\n $x2 = max($from[0], $to[0]);\n $y2 = $x2 === $from[0] ? $from[1] : $to[1];\n while (abs($x1 - $x2) >= 0 && abs($y1 - $y2) >= 0) {\n $cells[] = $this->getCell($x1, $y1);\n if ($x1 > $x2) {\n --$x1;\n } else if ($x1 < $x2) {\n ++$x1;\n } else if ($x1 === $x2) {\n break;\n }\n if ($y1 > $y2) {\n --$y1;\n } else if ($y1 < $y2) {\n ++$y1;\n } else if ($y1 === $y2) {\n break;\n }\n }\n }\n\n $pieces = count(array_filter($cells, function ($i) {\n return !is_null($i);\n }));\n\n if ($pieces === 1) {\n return true;\n }\n if ($pieces === 2) {\n $result = 0;\n if ($cells[0] instanceof Piece) {\n $result += $cells[0]->getColor() !== $this->getCell($from[0], $from[1])->getColor() ? 1 : 0;\n }\n if ($cells[count($cells) - 1] instanceof Piece) {\n $result +=\n $cells[count($cells) - 1]->getColor() !== $this->getCell($from[0], $from[1])->getColor() ? 1 : 0;\n }\n if (\n $this->getCell($from[0], $from[1]) instanceof Pawn &&\n $from[0] === $to[0]\n ) {\n $result += 1;\n }\n return $result === 1;\n }\n return false;\n }", "public function containsEdge($v1, $v2);", "public function getNodeRoute();", "public function setNeighborCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->neighbor_count = $var;\n\n return $this;\n }", "function findNeighboorKeys($size, $y, $x)\n {\n $result = [];\n if ($y - 1 >= 0) {\n array_push($result, [$y - 1, $x]);\n if ($x == $y) array_push($result, [$y - 1, $x - 1]);\n }\n\n if ($y + 1 < $size) {\n array_push($result, [$y + 1, $x]);\n if ($x == $y) array_push($result, [$y + 1, $x + 1]);\n }\n if ($x - 1 >= 0) array_push($result, [$y, $x - 1]);\n if ($x + 1 < $size) array_push($result, [$y, $x + 1]);\n return $result;\n }", "abstract public function getVertexFromTo(Vertex $endVertex);", "public function getNodes();", "function catch_information($nodes, $index_own_nodes, $status)\n{\n $own_nodes_list = array();\n foreach ($index_own_nodes as $index) {\n $push = false;\n $node = $nodes[$index];\n $lastseen = format_date($node['lastseen']); # WICHTIG\n\n $hostname = $node['hostname']; # WICHTIG\n $node_id = $node['node_id']; # WICHTIG\n $addresses = $node['addresses'];\n\n $base = $node['firmware']['base'];\n # lösche folgende substrings in base\n $hw = array(\"gluon-\",);\n $base = str_replace($hw, '', $base);\n $release = $node['firmware']['release'];\n\n $model = $node['model'];\n # lösche folgende substrings in model\n $hw = array(\"TP-Link\", \"TP-LINK\", \"ALFA NETWORK\", \"N/ND\");\n $model = str_replace($hw, '', $model);\n\n $gateway = $node['gateway'];\n $gateway_nexthop = $node['gateway_nexthop'];\n # Uplink (Workaround, da Uplink direkt nicht mehr in der JSON steht)\n $uplink = ($gateway == $gateway_nexthop); # WICHTIG\n\n # Richtige IP wählen\n if (startsWith($addresses['0'], \"fe80:\")) {\n $ipv6 = $addresses['1']; # WICHTIG\n } else {\n $ipv6 = $addresses['0']; # WICHTIG\n }\n # Flags\n $online = $node['is_online']; # WICHTIG\n # $uplink = $flags['uplink']; # WICHTIG (kaputt)\n\n # Speichere Werter zur Übergabe\n $inf_node = array(\n \"lastseen\" => $lastseen,\n \"hostname\" => $hostname,\n \"node_id\" => $node_id,\n \"ipv6\" => $ipv6,\n \"online\" => $online,\n \"uplink\" => $uplink,\n \"release\" => $release,\n \"base\" => $base,\n \"model\" => $model,);\n\n # Hier Entscheide, ob offline, uplink oder online\n if ($status == \"offline\") {\n if (!$online) {\n $push = true;\n }\n } else {\n if ($status == \"uplink\") {\n if ($uplink and $online) {\n $push = true;\n }\n } else {\n if ($status == \"online\") {\n if ($online and !$uplink) {\n $push = true;\n }\n }\n }\n }\n if ($push) {\n array_push($own_nodes_list, $inf_node);\n }\n }\n return $own_nodes_list;\n}", "public function index()\n {\n $sql = \"SELECT NEIGHBOR_ID, NEIGHBOR_NAME, INCOME, SCHOOL_DISTRICT, POPULATION_SIZE FROM `NEIGHBORHOOD`;\";\n $Neighbor_query = $this->db->query($sql);\n $data['NeighborList'] = $Neighbor_query->getResult();\n return view('show_all_neighbor', $data);\n }", "function solve_two(string $input) : string\n{\n\n $seats = array_map('str_split', xplode_input($input));\n $limit = 5;\n while(true) {\n [$seats, $hasChanged, $occupied] = walk_matrix($seats, $limit, 'visible_neighbors');\n if (!$hasChanged) {\n return sprintf(\"Occupied seats: %d\\n\", $occupied);\n }\n }\n}", "function Draw($im, &$map)\n\t{\n\t\t$x1=$map->nodes[$this->a->name]->x;\n\t\t$y1=$map->nodes[$this->a->name]->y;\n\n\t\t$x2=$map->nodes[$this->b->name]->x;\n\t\t$y2=$map->nodes[$this->b->name]->y;\n\t\t\n\t\tif(is_null($x1)) { wm_warn(\"LINK \".$this->name.\" uses a NODE with no POSITION! [WMWARN35]\\n\"); return; }\n\t\tif(is_null($y1)) { wm_warn(\"LINK \".$this->name.\" uses a NODE with no POSITION! [WMWARN35]\\n\"); return; }\n\t\tif(is_null($x2)) { wm_warn(\"LINK \".$this->name.\" uses a NODE with no POSITION! [WMWARN35]\\n\"); return; }\n\t\tif(is_null($y2)) { wm_warn(\"LINK \".$this->name.\" uses a NODE with no POSITION! [WMWARN35]\\n\"); return; }\n\t\t\n\t\t\n\t\tif( ($this->linkstyle=='twoway') && ($this->labeloffset_in < $this->labeloffset_out) && (intval($map->get_hint(\"nowarn_bwlabelpos\"))==0) )\n\t\t{\n\t\t\twm_warn(\"LINK \".$this->name.\" probably has it's BWLABELPOSs the wrong way around [WMWARN50]\\n\");\n\t\t}\n\t\t\n\t\tlist($dx, $dy)=calc_offset($this->a_offset, $map->nodes[$this->a->name]->width, $map->nodes[$this->a->name]->height);\n\t\t$x1+=$dx;\n\t\t$y1+=$dy;\n\n\t\tlist($dx, $dy)=calc_offset($this->b_offset, $map->nodes[$this->b->name]->width, $map->nodes[$this->b->name]->height);\n\t\t$x2+=$dx;\n\t\t$y2+=$dy;\n\n\t\tif( ($x1==$x2) && ($y1==$y2) && sizeof($this->vialist)==0)\n\t\t{\n\t\t\twm_warn(\"Zero-length link \".$this->name.\" skipped. [WMWARN45]\");\n\t\t\treturn;\n\t\t}\n\n\t\t\n\t\t$outlinecol = new Colour($this->outlinecolour);\n\t\t$commentcol = new Colour($this->commentfontcolour);\n\t\t\n\t\t$outline_colour = $outlinecol->gdallocate($im);\n\t\t\t\t\n\t\t$xpoints = array ( );\n\t\t$ypoints = array ( );\n\n\t\t$xpoints[]=$x1;\n\t\t$ypoints[]=$y1;\n\n\t\t# warn(\"There are VIAs.\\n\");\n\t\tforeach ($this->vialist as $via)\n\t\t{\n\t\t\t# imagearc($im, $via[0],$via[1],20,20,0,360,$map->selected);\n\t\t\tif(isset($via[2]))\n\t\t\t{\n\t\t\t\t$xpoints[]=$map->nodes[$via[2]]->x + $via[0];\n\t\t\t\t$ypoints[]=$map->nodes[$via[2]]->y + $via[1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$xpoints[]=$via[0];\n\t\t\t\t$ypoints[]=$via[1];\n\t\t\t}\n\t\t}\n\n\t\t$xpoints[]=$x2;\n\t\t$ypoints[]=$y2;\n\n\t\t# list($link_in_colour,$link_in_scalekey, $link_in_scaletag) = $map->NewColourFromPercent($this->inpercent,$this->usescale,$this->name);\n\t\t# list($link_out_colour,$link_out_scalekey, $link_out_scaletag) = $map->NewColourFromPercent($this->outpercent,$this->usescale,$this->name);\n\t\t\n\t\t$link_in_colour = $this->colours[IN];\n\t\t$link_out_colour = $this->colours[OUT];\n\t\t\n\t\t$gd_in_colour = $link_in_colour->gdallocate($im);\n\t\t$gd_out_colour = $link_out_colour->gdallocate($im);\n\t\t\n\t//\t$map->links[$this->name]->inscalekey = $link_in_scalekey;\n\t//\t$map->links[$this->name]->outscalekey = $link_out_scalekey;\n\t\t\n\t\t$link_width=$this->width;\n\t\t// these will replace the one above, ultimately.\n\t\t$link_in_width=$this->width;\n\t\t$link_out_width=$this->width;\n\t\t\t\n\t\t// for bulging animations\n\t\tif ( ($map->widthmod) || ($map->get_hint('link_bulge') == 1))\n\t\t{\n\t\t\t// a few 0.1s and +1s to fix div-by-zero, and invisible links\n\t\t\t$link_width = (($link_width * $this->inpercent * 1.5 + 0.1) / 100) + 1;\n\t\t\t// these too\n\t\t\t$link_in_width = (($link_in_width * $this->inpercent * 1.5 + 0.1) / 100) + 1;\n\t\t\t$link_out_width = (($link_out_width * $this->outpercent * 1.5 + 0.1) / 100) + 1;\n\t\t}\n\n\t\t// If there are no vias, treat this as a 2-point angled link, not curved\n\t\tif( sizeof($this->vialist)==0 || $this->viastyle=='angled') {\n\t\t\t// Calculate the spine points - the actual not a curve really, but we\n\t\t\t// need to create the array, and calculate the distance bits, otherwise\n\t\t\t// things like bwlabels won't know where to go.\n\t\t\t\n\t\t\t$this->curvepoints = calc_straight($xpoints, $ypoints);\n\t\t\t\t\t\t\t\n\t\t\t// then draw the \"curve\" itself\n\t\t\tdraw_straight($im, $this->curvepoints,\n\t\t\t\tarray($link_in_width,$link_out_width), $outline_colour, array($gd_in_colour, $gd_out_colour),\n\t\t\t\t$this->name, $map, $this->splitpos, ($this->linkstyle=='oneway'?TRUE:FALSE) );\n\t\t}\n\t\telseif($this->viastyle=='curved')\n\t\t{\n\t\t\t// Calculate the spine points - the actual curve\t\n\t\t\t$this->curvepoints = calc_curve($xpoints, $ypoints);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t// then draw the curve itself\n\t\t\tdraw_curve($im, $this->curvepoints,\n\t\t\t\tarray($link_in_width,$link_out_width), $outline_colour, array($gd_in_colour, $gd_out_colour),\n\t\t\t\t$this->name, $map, $this->splitpos, ($this->linkstyle=='oneway'?TRUE:FALSE) );\n\t\t}\n\n\t\t\n\t\tif ( !$commentcol->is_none() )\n\t\t{\t\t\t\n\t\t\tif($commentcol->is_contrast())\n\t\t\t{\n\t\t\t\t$commentcol_in = $link_in_colour->contrast();\n\t\t\t\t$commentcol_out = $link_out_colour->contrast();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$commentcol_in = $commentcol;\n\t\t\t\t$commentcol_out = $commentcol;\n\t\t\t}\n\t\t\n\t\t\t$comment_colour_in = $commentcol_in->gdallocate($im);\n\t\t\t$comment_colour_out = $commentcol_out->gdallocate($im);\n\t\t\t\n\t\t\t$this->DrawComments($im,array($comment_colour_in, $comment_colour_out),array($link_in_width*1.1,$link_out_width*1.1));\n\t\t}\n\n\t\t$curvelength = $this->curvepoints[count($this->curvepoints)-1][2];\n\t\t// figure out where the labels should be, and what the angle of the curve is at that point\n\t\tlist($q1_x,$q1_y,$junk,$q1_angle) = find_distance_coords_angle($this->curvepoints,($this->labeloffset_out/100)*$curvelength);\n\t\tlist($q3_x,$q3_y,$junk,$q3_angle) = find_distance_coords_angle($this->curvepoints,($this->labeloffset_in/100)*$curvelength);\n\n\t\t# imageline($im, $q1_x+20*cos(deg2rad($q1_angle)),$q1_y-20*sin(deg2rad($q1_angle)), $q1_x-20*cos(deg2rad($q1_angle)), $q1_y+20*sin(deg2rad($q1_angle)), $this->owner->selected );\n\t\t# imageline($im, $q3_x+20*cos(deg2rad($q3_angle)),$q3_y-20*sin(deg2rad($q3_angle)), $q3_x-20*cos(deg2rad($q3_angle)), $q3_y+20*sin(deg2rad($q3_angle)), $this->owner->selected );\n\n\t\t# warn(\"$q1_angle $q3_angle\\n\");\n\n\t\tif (!is_null($q1_x))\n\t\t{\n\t\t\t$outbound=array\n\t\t\t\t(\n\t\t\t\t\t$q1_x,\n\t\t\t\t\t$q1_y,\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\t$this->outpercent,\n\t\t\t\t\t$this->bandwidth_out,\n\t\t\t\t\t$q1_angle,\n\t\t\t\t\tOUT\n\t\t\t\t);\n\n\t\t\t$inbound=array\n\t\t\t\t(\n\t\t\t\t\t$q3_x,\n\t\t\t\t\t$q3_y,\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\t$this->inpercent,\n\t\t\t\t\t$this->bandwidth_in,\n\t\t\t\t\t$q3_angle,\n\t\t\t\t\tIN\n\t\t\t\t);\n\n\t\t\tif ($map->sizedebug)\n\t\t\t{\n\t\t\t\t$outbound[5]=$this->max_bandwidth_out;\n\t\t\t\t$inbound[5]=$this->max_bandwidth_in;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($this->linkstyle=='oneway')\n\t\t\t{\n\t\t\t\t$tasks = array($outbound);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tasks = array($inbound,$outbound);\n\t\t\t}\n\n\t\t\tforeach ($tasks as $task)\n\t\t\t{\n\t\t\t\t$thelabel=\"\";\n\t\t\t\t\n\t\t\t\t$thelabel = $map->ProcessString($this->bwlabelformats[$task[7]],$this);\n\t\n\t\t\t\tif ($thelabel != '')\n\t\t\t\t{\n\t\t\t\t\twm_debug(\"Bandwidth for label is \".$task[5].\"\\n\");\n\t\t\t\t\t\n\t\t\t\t\t$padding = intval($this->get_hint('bwlabel_padding'));\t\t\n\t\t\t\t\t\n\t\t\t\t\t// if screenshot_mode is enabled, wipe any letters to X and wipe any IP address to 127.0.0.1\n\t\t\t\t\t// hopefully that will preserve enough information to show cool stuff without leaking info\n\t\t\t\t\tif($map->get_hint('screenshot_mode')==1) $thelabel = screenshotify($thelabel);\n\n\t\t\t\t\tif($this->labelboxstyle == 'angled')\n\t\t\t\t\t{\n\t\t\t\t\t\t$angle = $task[6];\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$angle = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$map->DrawLabelRotated($im, $task[0], $task[1],$angle, $thelabel, $this->bwfont, $padding,\n\t\t\t\t\t\t\t$this->name, $this->bwfontcolour, $this->bwboxcolour, $this->bwoutlinecolour,$map, $task[7]);\n\t\t\t\t\t\n\t\t\t\t\t// imagearc($im, $task[0], $task[1], 10,10,0,360,$map->selected);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "abstract public function containsEdge( $edge );", "function inregion($grid, $x, $y){\n\n for($i = $x-1; $i < $x+1; $i++){\n for($j = $y-1; $j < $y+1; $j++){ \n if($grid[$i][$j] == \"#\"){\n return True;\n }\n } \n }\n return False;\n}", "public function isVisited($v);", "public function solve()\n {\n\n // initiate cache with the target node as distance = 0\n $cache[0] = [0];\n\n $result = $this->pascalTriangle(self::$NUMBER_OF_SQUARES, self::$NUMBER_OF_SQUARES);\n\n return 'Number of ways in a grid: ' . $result;\n }", "public function getConnections()\n {\n return $this->edges;\n }", "public function getPeerInfo();", "public function breadFirstSearch($origin, $desitnation)\n {\n //mark all nodes as unvisited\n foreach($this->graph as $vetex => $adj)\n {\n $this->visited[$vertec] = false;\n }\n\n //create an empty queue\n $q = new SplQueue();\n\n //enqueue the origin vertex and mark as visted\n $q->enqueue($origin);\n $this->visited[$origin] = true;\n\n //this is used to track the path back from each node\n $path = array();\n $path[$origin] = new SplDoubleLinkedList();\n $path[$origin]->setIteratorMode(\n SpleDoubleLinkedLit::IT_MODE_FIFO|SpleDoublyLinkedList::IT_MODE_KEEP\n );\n\n $path[$origin]->push($origin);\n\n $found = false;\n //while queue is not empty and destination not found\n while(!$q->isEmpty() && $q->bottom != $destination)\n {\n $t = $q->dequeue();\n\n if(!empty($this->graph[$t]))\n {\n //for each adjacent neighbor\n foreach($this->graph[$t] as $vertex)\n {\n if(!$this->visited[$vertex])\n {\n //if not yet visited, enqueue vertex and mark\n //as visited\n $q->enqueue($vertex);\n $this->visited[$vertex] = true;\n //add vertex to current path\n $path[$vertex] = clone$path[$t];\n $path[$vertex]->push($vertex);\n }\n }\n }\n }\n\n if(isset($path[$destination]))\n {\n echo \"$origin to $desitnation in \",\n count($path[$destination]) - 1,\n \"hopsn\";\n $sep = '';\n foreach($path[$destination] as $vertex)\n {\n echo $sep, $vertex;\n $sep = '->';\n }\n echo \"n\";\n }\n else\n {\n echo \"No route from the $origin to $destination\";\n }\n }", "function breadthFirstSearch($startVertex){\n\t\t$startVertex->visited = true;\n\t\t$Q = new SplQueue();\n\t\t$Q->push($startVertex);\n\t\twhile(!$Q->empty()){\n\t\t\t$x = new Vertex();\n\t\t\t$x = $Q->front(); $Q->pop();\n\t\t\tforeach($x->neighbors as $VertexPtr){\n\t\t\t\tif($VertexPtr->visited == false){\n\t\t\t\t\t$VertexPtr->visited = trie;\n\t\t\t\t\t$VertexPtr->pred = $x;\n\t\t\t\t\t$Q->push($VertexPtr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getNodeVisitors();", "public function addVertex($id) {\n\t\tif(!isset($this->inAdjacents[$id])) {\n\t\t\t$this->inAdjacents[$id] = array();\n\t\t}\n\t\t\n\t\tif(!isset($this->outAdjacents[$id])) {\n\t\t\t$this->outAdjacents[$id] = array();\n\t\t}\n\t}", "function find_min_vertex($v1,$vertices,$distance_table){\n $min = INF;\n $min_i = 0;\n\n foreach($vertices as $v2){\n $d = distance_lookup($v1,$v2,$distance_table);\n if($d < $min){\n $min = $d;\n $min_i = $v2;\n }\n }\n return array($min_i,$min);\n\n}", "public function adjacents(\n ): array\n {\n $result = [];\n foreach (self::CHANGE_VECTORS as $change_vector) {\n $result[] = new self(\n $this->x + $change_vector[0],\n $this->y + $change_vector[1],\n $this->z + $change_vector[2],\n );\n }\n\n return $result;\n }", "function resetPred(){\n\t\tforeach($vertexList as $v){\n\t\t\t$v->visited = false;\n\t\t\t$v->pret = NULL;\n\t\t}\n\t}", "public function getEdge($v1, $v2);", "function kneser( $graph, $n, $k )\n{\n\tif( $n <= 0 ) die( \"n must be positive\" );\n\tif( ! ($k > 0 && $k <= $n ) ) die( \"k must be positive and less than n\" );\n\t\n\t$s = subsets( $n, $k );\n\t\n\tfor( $i = 0; $i < count($s); $i++ )\n\t{\t\n\t\t$set = $s[$i];\n\t\tfor( $j = $i + 1; $j < count($s); $j++ )\n\t\t{\n\t\t\t$can = $s[$j];\n\t\t\tif( disjoint( $set, $can ) )\n\t\t\t\t$graph->connect( implode(\"\",$set), implode(\"\",$can) );\n\t\t}\n\t}\n}", "public function getAliveNeighbour(int $x, int $y): int\n {\n $n1 = $this->ifCellAliveAt($x-1, $y-1);\n $n2 = $this->ifCellAliveAt($x-1, $y);\n $n3 = $this->ifCellAliveAt($x-1, $y+1);\n $n4 = $this->ifCellAliveAt($x, $y-1);\n $n5 = $this->ifCellAliveAt($x, $y+1);\n $n6 = $this->ifCellAliveAt($x+1, $y-1);\n $n7 = $this->ifCellAliveAt($x+1, $y);\n $n8 = $this->ifCellAliveAt($x+1, $y+1);\n\n return $n1+$n2+$n3+$n4+$n5+$n6+$n7+$n8;\n }", "public function get_directions();", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }", "public function directions(): array;", "public function get_locations($nodes);", "protected function getActiveNeighbours(Board $board, $x, $y)\n {\n $total = 0;\n $total += (int) $this->isCellLive($board, $x - 1, $y - 1); // top left \n $total += (int) $this->isCellLive($board, $x, $y - 1); // top center \n $total += (int) $this->isCellLive($board, $x + 1, $y - 1); // top right \n $total += (int) $this->isCellLive($board, $x - 1, $y); // middle left \n $total += (int) $this->isCellLive($board, $x + 1, $y); // middle right \n $total += (int) $this->isCellLive($board, $x - 1, $y + 1); // bottom left \n $total += (int) $this->isCellLive($board, $x, $y + 1); // bottom center \n $total += (int) $this->isCellLive($board, $x + 1, $y + 1); // bottom right \n return $total;\n }", "public function getVerticesEdgeTo()\n {\n $ret = array();\n foreach ($this->getEdgesOut() as $edge) {\n $ret []= $edge->getVertexToFrom($this);\n }\n\n return new Vertices($ret);\n }", "public static function checkNeighborNode($id , $node) {\n $category=self::model()->findByPk($id);\n switch ($node) {\n case 'prev':\n $model = $category->prev()->find();\n break;\n case 'next':\n $model = $category->next()->find();\n break;\n }\n\n if($model === null) { return false;} else {return true;}\n }", "public function neighborhood() {\n # Define an inverse one-to-many relationship.\n return $this->belongsTo('\\dsa\\Neighborhood');\n }", "public function getEdges ()\n\t{\n\t\treturn $this->edges;\n\t}", "function isecrects($r1, $r2) {\n\n \n $pn; $px;\n for ($pi = 0, $pl = count($r1); $pi < $pl; $pi += 2) {\n $pn = ($pi === ($pl - 2)) ? 0 : $pi + 2; // next $po$int\n $px = ($pn === ($pl - 2)) ? 0 : $pn + 2;\n if (edgeTest([$r1[$pi], $r1[$pi+1]],\n [$r1[$pn], $r1[$pn+1]],\n [$r1[$px], $r1[$px+1]], $r2)){ return false;}\n }\n for ($pi = 0, $pl = count($r2); $pi < $pl; $pi += 2) {\n $pn = ($pi === ($pl - 2)) ? 0 : $pi + 2; // next $point\n $px = ($pn === ($pl - 2)) ? 0 : $pn + 2;\n if (edgeTest([$r2[$pi], $r2[$pi+1]],\n [$r2[$pn], $r2[$pn+1]],\n [$r2[$px], $r2[$px+1]], $r1)){return false;}\n }\n return true;\n}", "public function createResult()\n {\n $totalCostCheapestPathFromTo = array();\n $cheapestPathFromTo = array();\n $vertexSet = array_values($this->graph->getVertices());\n\n $nVertices = count($vertexSet);\n\n //Total cost from i to i is 0\n for ($i = 0; $i < $nVertices; ++$i) {\n\n $totalCostCheapestPathFromTo[$i][$i] = 0;\n }\n\n // Calculating shortestPath(i,j,k+1) = min(shortestPath(i,j,k),shortestPath(i,k+1,k) + shortestPath(k+1,j,k))\n for ($k = 0; $k < $nVertices; ++$k) {\n\n for ($i = 0; $i < $nVertices; ++$i) {\n\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $k);\n\n for ($j = 0; $j < $nVertices; ++$j) {\n\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $k);\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $j);\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $k, $j);\n\n // If we find that the path from (i, k) + (k, j) is shorter than the path (i, j), the new path is\n // calculated.\n if ($totalCostCheapestPathFromTo[$i][$k] + $totalCostCheapestPathFromTo[$k][$j] < $totalCostCheapestPathFromTo[$i][$j]) {\n\n $totalCostCheapestPathFromTo[$i][$j] = $totalCostCheapestPathFromTo[$i][$k] + $totalCostCheapestPathFromTo[$k][$j];\n\n // Testing if we are not repeating a vertex' path over itself before merging the paths\n if ($vertexSet[$i]->getId() != $vertexSet[$k]->getId() || $vertexSet[$k]->getId() != $vertexSet[$j]->getId()) {\n\n $cheapestPathFromTo[$vertexSet[$i]->getId()][$vertexSet[$j]->getId()] = array_merge($cheapestPathFromTo[$vertexSet[$i]->getId()][$vertexSet[$k]->getId()],\n $cheapestPathFromTo[$vertexSet[$k]->getId()][$vertexSet[$j]->getId()]);\n }\n\n }\n\n }\n\n }\n\n if($totalCostCheapestPathFromTo[$k][$k] < 0) {\n\n throw new UnexpectedValueException('Floyd-Warshall not supported for negative cycles');\n }\n }\n\n return new FloydWarshallResult($cheapestPathFromTo, $this->graph);\n }", "public function get_all_edges(){ \n $removed = $this->remove_inactive_users();\n\n $query = \"SELECT * FROM edges\";\n\n\t\t$stmt = $this->prepare_statement($query);\n if(!$stmt)\n return NULL;\t\n\t\tif(!$stmt->execute())\n\t\t\treturn NULL;\n \n $stmt->store_result();\n\t\tif($stmt->num_rows == 0)\n\t\t\treturn NULL;\n\t\t\t\n $ret = array();\n\t\t$stmt->bind_result($src_id, $target_id);\t\t\n while($stmt->fetch()){\n if(array_key_exists($src_id, $ret)){\n $ret[$src_id][] = $target_id;\n }\n else{\n $ret[$src_id] = array($target_id);\n }\n } \n\n return $ret;\n }", "public function addCellToVisited()\n {\n if (!$this->isCellVisited($this->currentXPosition, $this->currentYPosition)) {\n $this->executionResult['visited'][] = ['X' => $this->currentXPosition, 'Y' => $this->currentYPosition];\n return true;\n }\n else return false;\n }", "function getNodes()\n {\n }", "public function getCells();", "function removeConnectedRecursive($remaining, $current)\n{\n unset($remaining[$current]);\n $coord = getCoords($current);\n $row = $coord['row'];\n $col = $coord['col'];\n\n // go round the houses\n // N = $row-1 : $col\n // E = $row : $col+1\n // S = $row+1 : $col\n // W = $row : $col-1\n if (isset($remaining[($row-1).\":$col\"])) {\n $remaining = removeConnectedRecursive($remaining, ($row-1).\":$col\");\n }\n if (isset($remaining[\"$row:\".($col+1)])) {\n $remaining = removeConnectedRecursive($remaining, \"$row:\".($col+1));\n }\n if (isset($remaining[($row+1).\":$col\"])) {\n $remaining = removeConnectedRecursive($remaining, ($row+1).\":$col\");\n }\n if (isset($remaining[\"$row:\".($col-1)])) {\n $remaining = removeConnectedRecursive($remaining, \"$row:\".($col-1));\n }\n return $remaining;\n}", "function triangle($side)\r\n {\r\n for ($i = 1; $i <= $side; $i++) {\r\n for ($j = $i; $j < $side; $j++)\r\n echo \" \";\r\n\r\n for (\r\n $j = 1;\r\n $j <= (2 * $i - 1);\r\n $j++\r\n ) {\r\n if (\r\n $i == $side || $j == 1 ||\r\n $j == (2 * $i - 1)\r\n )\r\n echo \"*\";\r\n\r\n else\r\n echo \"*\";\r\n }\r\n echo \"<br>\";\r\n }\r\n }", "function printN()\r\n{\r\n for($i=0;$i<8;$i++){\r\n for($j=0;$j<6;$j++){\r\n if($j==0 || $j==5||$i==$j+1){\r\n echo \"*\";\r\n } else {\r\n echo \" \";\r\n }\r\n }\r\n echo \"\\n\";\r\n }\r\n echo \"\\n\";\r\n}", "public function dump()\n {\n foreach ($this->sudoku as $y => $row) {\n foreach ($row as $x => $value) {\n echo \"{$value} \";\n }\n\n echo \"\\n\";\n }\n\n echo \"\\n\";\n }", "public function getEdgesOut()\n {\n $that = $this;\n $prev = null;\n\n return $this->getEdges()->getEdgesMatch(function (Edge $edge) use ($that, &$prev) {\n $ret = $edge->hasVertexStart($that);\n\n // skip duplicate directed loop edges\n if ($edge === $prev && $edge instanceof EdgeDirected) {\n $ret = false;\n }\n $prev = $edge;\n\n return $ret;\n });\n }" ]
[ "0.7257222", "0.60856897", "0.6082075", "0.5742842", "0.5733574", "0.56998277", "0.5598441", "0.55713034", "0.54402417", "0.5418688", "0.5408478", "0.538175", "0.5363773", "0.5344014", "0.52620125", "0.5234594", "0.51420575", "0.5111883", "0.5072339", "0.5070315", "0.50499874", "0.50017756", "0.4996916", "0.4927528", "0.4922623", "0.48878744", "0.48832217", "0.4882706", "0.48611593", "0.48288667", "0.48192927", "0.48114213", "0.47973487", "0.47633398", "0.47520956", "0.47511452", "0.47475442", "0.47179115", "0.46872193", "0.46401012", "0.46333647", "0.45663968", "0.4563474", "0.4563354", "0.45376098", "0.45273408", "0.45170906", "0.45051914", "0.45014", "0.44984412", "0.44945946", "0.44824496", "0.44773936", "0.44754115", "0.44575956", "0.4454394", "0.44445023", "0.44296286", "0.4411808", "0.43995747", "0.43980446", "0.43978336", "0.43867886", "0.43845415", "0.43806174", "0.43697414", "0.43605846", "0.4357935", "0.43533733", "0.4338352", "0.43372217", "0.43293938", "0.432354", "0.43152994", "0.43145892", "0.43129492", "0.43082288", "0.43082288", "0.43082288", "0.43082288", "0.43082288", "0.43082288", "0.43034536", "0.42988306", "0.42940056", "0.4291798", "0.42723584", "0.42713067", "0.42704973", "0.42680678", "0.42645845", "0.4262805", "0.426098", "0.42543748", "0.4254047", "0.4247569", "0.42388958", "0.42305812", "0.42186236", "0.42129797" ]
0.78646415
0
/Run breadfirst sesarch on neighbors to find the shortest path
function breadthFirstSearch($startVertex){ $startVertex->visited = true; $Q = new SplQueue(); $Q->push($startVertex); while(!$Q->empty()){ $x = new Vertex(); $x = $Q->front(); $Q->pop(); foreach($x->neighbors as $VertexPtr){ if($VertexPtr->visited == false){ $VertexPtr->visited = trie; $VertexPtr->pred = $x; $Q->push($VertexPtr); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function breadFirstSearch($origin, $desitnation)\n {\n //mark all nodes as unvisited\n foreach($this->graph as $vetex => $adj)\n {\n $this->visited[$vertec] = false;\n }\n\n //create an empty queue\n $q = new SplQueue();\n\n //enqueue the origin vertex and mark as visted\n $q->enqueue($origin);\n $this->visited[$origin] = true;\n\n //this is used to track the path back from each node\n $path = array();\n $path[$origin] = new SplDoubleLinkedList();\n $path[$origin]->setIteratorMode(\n SpleDoubleLinkedLit::IT_MODE_FIFO|SpleDoublyLinkedList::IT_MODE_KEEP\n );\n\n $path[$origin]->push($origin);\n\n $found = false;\n //while queue is not empty and destination not found\n while(!$q->isEmpty() && $q->bottom != $destination)\n {\n $t = $q->dequeue();\n\n if(!empty($this->graph[$t]))\n {\n //for each adjacent neighbor\n foreach($this->graph[$t] as $vertex)\n {\n if(!$this->visited[$vertex])\n {\n //if not yet visited, enqueue vertex and mark\n //as visited\n $q->enqueue($vertex);\n $this->visited[$vertex] = true;\n //add vertex to current path\n $path[$vertex] = clone$path[$t];\n $path[$vertex]->push($vertex);\n }\n }\n }\n }\n\n if(isset($path[$destination]))\n {\n echo \"$origin to $desitnation in \",\n count($path[$destination]) - 1,\n \"hopsn\";\n $sep = '';\n foreach($path[$destination] as $vertex)\n {\n echo $sep, $vertex;\n $sep = '->';\n }\n echo \"n\";\n }\n else\n {\n echo \"No route from the $origin to $destination\";\n }\n }", "public function shortestPath($source, $target)\n {\n //vertex\n $d = array();\n //array of predecessors for each vertex\n $pi = array();\n //queue of all unoptimized vertives\n $Q = new SplPriorityQueue();\n\n foreach($this->graph as $v => $adj)\n {\n $d[$v] = INF; //set intitial distance to \"infinity\"\n $pi[$v] = null; // no known predecessors yet\n foreach($adj as $w => $cost)\n {\n //use the edge cost as the priority\n $Q->insert($w, $cost);\n }\n }\n\n //initial distance at source is 0\n $d[$source] = 0;\n\n while(!$Q->isEmpty())\n {\n //extract min cost\n $u = $Q->extract();\n if(!empty($this->graph[$u]))\n {\n //alternate route length to adjacent neightbor\n $alt = $d[$u] + $cost;\n //if alternate route is shorter\n if($alt < $d[$v])\n {\n $d[$v] = $alt;//update minimun length to vertex\n $pi[$v] = $u;//add neighbor to predecessors for vertex\n }\n }\n }\n }", "public function breadthFirstSearch($origin, $destination, $maxTime) {\n // mark all nodes as unvisited\n foreach ($this->graph as $vertex => $adj) {\n $this->visited[$vertex] = false;\n }\n\n // create an empty queue\n $q = new SplQueue();\n\n // enqueue the origin vertex and mark as visited\n $q->enqueue($origin);\n $this->visited[$origin] = true;\n\n // this is used to track the path back from each node\n $path = array();\n $path[$origin] = new SplDoublyLinkedList();\n $path[$origin]->setIteratorMode(\n SplDoublyLinkedList::IT_MODE_FIFO|SplDoublyLinkedList::IT_MODE_KEEP\n );\n\n $path[$origin]->push($origin);\n\n $found = false;\n // while queue is not empty and destination not found\n while (!$q->isEmpty() && $q->bottom() != $destination) {\n $t = $q->dequeue();\n\n if (!empty($this->graph[$t])) {\n // for each adjacent neighbor\n foreach ($this->graph[$t] as $vertex) {\n $totalTime = 0;\n foreach($vertex as $v=>$time){\n if (!$this->visited[$v]) {\n // if not yet visited, enqueue vertex and mark\n // as visited\n $q->enqueue($v);\n $this->visited[$v] = true;\n // add vertex to current path\n $path[$v] = clone $path[$t];\n $path[$v]->push([$v => $time]);\n $totalTime += $time;\n if($v == $destination){\n $sep = '';\n $output = '';\n $totalTime = 0;\n foreach ($path[$destination] as $key => $value) {\n if($key == 0) {\n $output .= $sep. $value;\n $sep = '=>';\n continue;\n }\n foreach($value as $vertex => $time){\n $output .= $sep. $vertex;\n $totalTime += $time;\n }\n\n }\n $output .= $sep.$totalTime.PHP_EOL;\n if($totalTime < $maxTime) {\n echo $output;\n break;\n }else {\n $this->visited[$v] = false;\n unset($path[$v]);\n }\n }\n }\n }\n\n }\n }\n }\n //print_r($path);\n if (!isset($path[$destination])) {\n echo \"Path not found between $origin to $destination\".PHP_EOL;\n }\n }", "function dijkstra(Graph $graph, $startIndex) {\n // init spt bool array to mark visited vertices\n // init dist array to mark distance between vertices from start\n // init parent array to all -1\n // set start dist to 0\n // set traverse ptr to start index\n // while not all vertices are visited\n // put index into spt\n // get edges of index\n // loop through all edges of this index\n // if distance to reach this vertex is bigger than this index dist + current weight\n // set this vertex dist to this index dist + current weight\n // set parent of this vertex to index\n // advance to next edge\n // loop through all vertices\n // if stored dist is bigger than current vertex dist\n // set dist to new smaller dist\n // set index to the smaller dist\n $spt = array_fill(0, $graph->getVerticeCount(), False);\n $dist = array_fill(0, $graph->getVerticeCount(), PHP_INT_MAX);\n $parent = array_fill(0, $graph->getVerticeCount(), -1);\n\n $dist[$startIndex] = 0;\n $index = $startIndex;\n\n while (in_array(False, $spt)) {\n $spt[$index] = True;\n $curr = $graph->getEdges()[$index];\n while (!empty($curr)) {\n if ($dist[$curr->data] > $dist[$index] + $curr->weight) {\n $dist[$curr->data] = $dist[$index] + $curr->weight;\n $parent[$curr->data] = $index;\n }\n $curr = $curr->next;\n }\n $minDist = PHP_INT_MAX;\n for ($i=0; $i < $graph->getVerticeCount(); $i++) { \n if (!$spt[$i] && $minDist > $dist[$i]) {\n $minDist = $dist[$i];\n $index = $i;\n }\n }\n }\n return $parent;\n}", "function prims_mst($distance_table){\n //TODO use sets or something similar to sets for this\n $u = array();\n $v = array_keys($distance_table);\n\n $new_edges = array();\n $all_vertexes = array_keys($distance_table);\n\n $a = array_pop($v);\n array_push($u,$a);\n\n //Keep looping until we've got all the edges\n $i = 0; //Loop protector to prevent infinite loops\n $max_ittr = count($all_vertexes)+4;\n while(!contains_all_verticies($u,$all_vertexes) && $i < $max_ittr){\n\n //Now go through all the edges in $v find it's closest neighbour in $u\n //Find the miinmum of those and put that vertex in $v\n $min_v = INF;\n $min_i = 0;\n $min_j = 0;\n foreach($v as $v1){\n $mins = find_min_vertex($v1,$u,$distance_table);\n if($mins[1] < $min_v){\n $min_v = $mins[1];\n $min_i = $mins[0];\n $min_j = $v1;\n }\n }\n //add the edge to the edges and the vertex to $u\n array_push($u,$min_j);\n array_push($new_edges,array($min_j,$min_i));\n\n $v = array_delete($v,$min_j);\n\n\n\n $i++;\n }\n\n return $new_edges;\n}", "public function createResult()\n {\n $totalCostCheapestPathFromTo = array();\n $cheapestPathFromTo = array();\n $vertexSet = array_values($this->graph->getVertices());\n\n $nVertices = count($vertexSet);\n\n //Total cost from i to i is 0\n for ($i = 0; $i < $nVertices; ++$i) {\n\n $totalCostCheapestPathFromTo[$i][$i] = 0;\n }\n\n // Calculating shortestPath(i,j,k+1) = min(shortestPath(i,j,k),shortestPath(i,k+1,k) + shortestPath(k+1,j,k))\n for ($k = 0; $k < $nVertices; ++$k) {\n\n for ($i = 0; $i < $nVertices; ++$i) {\n\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $k);\n\n for ($j = 0; $j < $nVertices; ++$j) {\n\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $k);\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $j);\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $k, $j);\n\n // If we find that the path from (i, k) + (k, j) is shorter than the path (i, j), the new path is\n // calculated.\n if ($totalCostCheapestPathFromTo[$i][$k] + $totalCostCheapestPathFromTo[$k][$j] < $totalCostCheapestPathFromTo[$i][$j]) {\n\n $totalCostCheapestPathFromTo[$i][$j] = $totalCostCheapestPathFromTo[$i][$k] + $totalCostCheapestPathFromTo[$k][$j];\n\n // Testing if we are not repeating a vertex' path over itself before merging the paths\n if ($vertexSet[$i]->getId() != $vertexSet[$k]->getId() || $vertexSet[$k]->getId() != $vertexSet[$j]->getId()) {\n\n $cheapestPathFromTo[$vertexSet[$i]->getId()][$vertexSet[$j]->getId()] = array_merge($cheapestPathFromTo[$vertexSet[$i]->getId()][$vertexSet[$k]->getId()],\n $cheapestPathFromTo[$vertexSet[$k]->getId()][$vertexSet[$j]->getId()]);\n }\n\n }\n\n }\n\n }\n\n if($totalCostCheapestPathFromTo[$k][$k] < 0) {\n\n throw new UnexpectedValueException('Floyd-Warshall not supported for negative cycles');\n }\n }\n\n return new FloydWarshallResult($cheapestPathFromTo, $this->graph);\n }", "static public function DijkstraAlgorithmByArray($first, $finish) {\n $link_db = Piwidict::getDatabaseConnection();\n\n if ($first == $finish) return array(0,array($first));\n\n $vertex_arr = PWRelatedWords::getAllRelatedWords(); // list of unvisited vertexes generated from list of vertexes having an edge\n if (!in_array($first, $vertex_arr))\n return array(0,NULL); // search vertexes is not connected with any edge\n\n $infinity = 1000000;\n foreach ($vertex_arr as $v)\n $unvisited[$v] = $infinity;\n $unvisited[$first] = 0;\n\n $edge_table = PWRelatedWords::getTableName(); // table of related words (words and distance between them)\n\n $prev_arr = array(); // list of next-to-last for path from first to last vertexes\n $prev_arr[$first] = NULL;\n\n $prev=$first;\n $path_len = 0;\n// $dist_arr = array(); // <key>,<value>: list of distances <value> from $first to <key>\n// $dist_arr[$first] =0;\n\n $success = 0; // the condition of finding the shortest path in the given vertex ($finish)\n\n//print \"<PRE>\";\n$count=0;\n//print $first;\n//return;\n while (!$success && sizeof($unvisited) && $path_len<$infinity) { // until all vertixes will not be visited\n// && $count<10\nprint \"<p>\".$count.\": \".sizeof($unvisited);\n//.\".-----------------------------</p>\";\n//print_r($finish_arr);\n//print_r($len_arr);\n $query = \"SELECT * FROM $edge_table WHERE lemma_id1='$prev' or lemma_id2='$prev'\"; // search nearest vertexes to $prev (НЕТ необходимости сортировать, так как неважно в какой последовательности ставятся метки)\n $res_neib = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n while ($row_neib = $res_neib->fetch_object()) {\n if ($row_neib->lemma_id1 == $prev)\n $last = $row_neib->lemma_id2; // $last - nearest vertexes to $prev and last vertex for next paths\n else \n $last = $row_neib->lemma_id1;\n $new_path_len = $path_len + $row_neib->weight; // path length from $prev to $last (neighbour of $prev via semantic relations)\n\n// if (!isset($dist_arr[$last]) || $dist_arr[$last]>$new_path_len) { // this is new path from $first to $last OR \n if (isset($unvisited[$last]) && $unvisited[$last]>$new_path_len) { // this is new path from $first to $last OR \n // already (one) path from $first to $last does exist, but the new path is shorter\n// $dist_arr[$last] =\n $unvisited[$last] = $new_path_len;\n $prev_arr[$last] = $prev;\n }\n }\n $count++;\n\n $path_len = min(array_values($unvisited)); // choose minimal distance of path from first to any unvisited vertex \n $prev = array_search($path_len, $unvisited); // choose unvisited vertex with minimal distance\n\nprint \" = \".$path_len;\n\n unset($unvisited[$prev]); // mark this vertes as visited, delete it from unvisited list\n\n if ($prev == $finish) { // the shortest path in $finish are found!!\n $success=1; \n continue; \n }\n\n }\nprint \"<p>$count iterations\";\n\n if ($success) { // \n $path = array($finish);\n $prev = $prev_arr[$finish];\n\n while ($prev != NULL) {\n array_unshift($path,$prev);\n $prev = $prev_arr[$prev];\n }\n\n return array($path_len, $path); \n } else return array(NULL,NULL); // any path from $first to $finish are not found\n }", "public function shortestPaths($source, $target, array $exclude = array()) {\n\n $this->distance = array_fill_keys(array_keys($this->graph), INF);\n $this->distance[$source] = 0;\n $this->previous = array_fill_keys(array_keys($this->graph), array());\n $this->queue = array($source => 0);\n\n while (!empty($this->queue))\n $this->processNextNodeInQueue($exclude);\n\n if ($source === $target)\n return array(array($source));\n\n elseif (empty($this->previous[$target]))\n return array();\n\n else\n return $this->extractPaths($target);\n }", "function jeanisRoute($citys, $roads) {\n // 需要投递的城市\n $deliverMap = [];\n $k = count($citys);\n foreach ($citys as $city) {\n $deliverMap[$city] = true;\n }\n \n // road转成connectMap\n $connectMap = [];\n foreach ($roads as $item) {\n $connectMap[$item[0]][$item[1]] = $connectMap[$item[1]][$item[0]] = $item[2];\n }\n \n // 以第一个节点作为根\n $root = 1;\n \n // 其所有子节点中待投递城市的数量\n $subDeliveryCountArr = [];\n \n // 所有走过的边的距离之和\n $result = 0;\n \n // 最长距离\n $globalMaxDis = 0;\n \n processDis($subDeliveryCountArr, $connectMap, $deliverMap, $result, $globalMaxDis, $root, 0, $k);\n\n \n return 2 * $result - $globalMaxDis;\n}", "protected function dijkstraEdges ($from)\n\t{\n\t\t//init\n\t\t$lengths = array(); // vertexId => length\n\t\t$prevVertices = array(); // i => vertexId\n\t\t$vertices = $this->getVerticesIds(); // i => vertexId\n\n\t\t$prevVertices[$from] = null;\n\t\t$lengths[$from] = 0;\n\n\t\t// alg\n\t\twhile(count($vertices) > 0){ // while some vertices remain\n\t\t\t$minValue = null;\n\t\t\t$minKey = null;\n\t\t\tforeach($vertices as $i => $vertexKey){ //pop the one with shortest path\n\t\t\t\tif (isset($lengths[$vertexKey])){\n\t\t\t\t\tif($minValue === null || $lengths[$vertexKey] < $minValue){\n\t\t\t\t\t\t$minValue = $lengths[$vertexKey];\n\t\t\t\t\t\t$minKey = $i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($minValue === null || $minKey === null){ //or pop random\n\t\t\t\treset($vertices);\n\t\t\t\tlist($minKey, $minValue) = each($vertices);\n\t\t\t}\n\t\t\t$u = $vertices[$minKey];\n\t\t\tunset($vertices[$minKey]);\n\n\t\t\tif (isset($lengths[$u])){\n\t\t\t\t$neighbours = array();\n\t\t\t\tforeach($this->edges[$u] as $key => $distance){ // get distances of neighbours\n\t\t\t\t\t$neighbours[$key] = $distance;\n\t\t\t\t}\n\t\t\t\tforeach($neighbours as $neighbourId => $neighbourDistance){\n\t\t\t\t\t$potentialLength = $lengths[$u] + $neighbourDistance;\n\t\t\t\t\tif(!isset($lengths[$neighbourId]) || $potentialLength < $lengths[$neighbourId]){ // check better route\n\t\t\t\t\t\t$lengths[$neighbourId] = $potentialLength;\n\t\t\t\t\t\t$prevVertices[$neighbourId] = $u;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $prevVertices;\n\t}", "static public function DijkstraAlgorithmByDB($first, $finish) {\n $link_db = Piwidict::getDatabaseConnection();\n\n if ($first == $finish) return array(0,array($first));\n\n $edge_table = PWRelatedWords::getTableName(); // table of related words (words and distance between them)\n $path_table = PWShortPath::getTableName(); // table of shortest paths (first, last, next-to-last vertexes, length of path)\n//print \"$first, $finish\";\n $query = \"SELECT lemma_id1 FROM $edge_table WHERE lemma_id1='$first' or lemma_id2='$first' LIMIT 1\"; // check if any edge with $first exists\n $res_exist = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n if ($link_db -> query_count($res_exist) == 0) \n return array(0,NULL);\n\n $query = \"SELECT lemma_id1 FROM $edge_table WHERE lemma_id1='$finish' or lemma_id2='$finish' LIMIT 1\"; // check if any edge with $finish exists\n $res_exist = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n if ($link_db -> query_count($res_exist) == 0) \n return array(0,NULL);\n\n $success = 0; // the condition of finding the shortest path in the given vertex ($finish)\n $count_row = 1;\n\n $query = \"UPDATE $path_table SET mark=0 where lemma_id_1=\".$first; // mark all vertexes as unvisited (if already any paths in DB exists)\n// $query = \"DELETE FROM $path_table where lemma_id_1=\".$first; // mark all vertexes as unvisited (if already any paths in DB exists)\n $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n $prev = $first;\n $path_len = 0;\n//print \"<PRE>\";\n$count=0;\n//print $first;\n//return;\n while (!$success && $count_row) { // until all vertixes will not be visited\n $count++;\n// && $count<3\nprint \"<p>\".$count.\": \".$count_row.\".-----------------------------</p>\";\n//print_r($finish_arr);\n//print_r($len_arr);\n $query = \"SELECT * FROM $edge_table WHERE lemma_id1='$prev' or lemma_id2='$prev'\"; // search nearest vertexes to $prev (НЕТ необходимости сортировать, так как неважно в какой последовательности ставятся метки)\n $res_neib = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n while ($row_neib = $res_neib->fetch_object()) {\n if ($row_neib->lemma_id1 == $prev)\n $last = $row_neib->lemma_id2; // $last - nearest vertexes to $prev and last vertex for next paths\n else \n $last = $row_neib->lemma_id1;\n $new_path_len = $path_len + $row_neib->weight; // path length from $prev to $last (neighbour of $prev via semantic relations)\n\n $query = \"SELECT path_len,mark FROM $path_table WHERE lemma_id_1='$first' and lemma_id_n='$last'\"; // recounted only unvisited vertexes\n//print \"<P>$query\";\n $res_path = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n if ($link_db -> query_count($res_path) == 0) {\n // 1. this is new path from $start to $finish which is absent in table pw_short_path_LANG_CODE\n $query = \"INSERT INTO $path_table (`lemma_id_1`, `lemma_id_n`, `path_len`, `lemma_id_prev_n`, mark) VALUES ($first, $last, $new_path_len, $prev, 0)\";\n//print \"<P>$query\";\n $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n } else {\n // 2. already (one) path from $start to $finish does exist, then update (length and previous word) only if length of new path is shorter\n $row_path = $res_path->fetch_object();\n if ($row_path->mark==0 && $new_path_len < $row_path->path_len) {\n $query = \"UPDATE $path_table SET path_len=$new_path_len, lemma_id_prev_n=$prev WHERE lemma_id_1=$first and lemma_id_n=$last\";\n//print \"<P>$query\";\n $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n }\n }\n }\n\n $query = \"SELECT path_len, lemma_id_n FROM $path_table WHERE lemma_id_1='$first' and mark=0 order by path_len\"; // choose minimal distance of path from first to any unvisited vertex \n $res_min = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n $count_row = $link_db -> query_count($res_min);\n if (!$count_row) // all paths from start are marked as visited\n $path_len = 0;\n\n else { // choose vertex with minimal distance\n $row_min = $res_min->fetch_object(); // get only one row - minimal path length\n $path_len = $row_min->path_len; // choose minimal distance of path from first to any unvisited vertex \n $prev = $row_min->lemma_id_n; // choose unvisited vertex with minimal distance\n }\n//print \"<p>prev:$prev, path_len:\".$path_len;\n \n $query = \"UPDATE $path_table SET mark=1 where lemma_id_1=$first and lemma_id_n=$prev\"; // mark vertex $prev as unvisited\n//print \"<P>$query\";\n $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n if ($prev == $finish) // the shortest path in $finish are found!!\n $success=1; \n }\nprint \"<p>$count iterations\";\n\n if ($success) { // \n $path = array($finish);\n $prev = $finish;\n\n while ($prev != start) {\n $query = \"SELECT lemma_id_prev_n FROM $path_table WHERE lemma_id_1='$first' and lemma_id_n='$prev' order by path_len LIMIT 1\"; // choose minimal distance of path from first to any unvisited vertex \n $res = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n $row = $res->fetch_object();\n $prev = $row -> lemma_id_prev_n;\n\n array_unshift($path,$prev);\n }\n\n return array($path_len, $path); \n } else return array(NULL,NULL); // any path from $first to $finish are not found\n }", "function floydWarshall(array $graph): array\n{\n $dist = $graph;\n\n $size = count($dist);\n\n for ($k = 0; $k < $size; $k++) {\n for ($i = 0; $i < $size; $i++) {\n for ($j = 0; $j < $size; $j++) {\n $dist[$i][$j] = min($dist[$i][$j], $dist[$i][$k] + $dist[$k][$j]);\n }\n }\n }\n return $dist;\n}", "public function BreadthFirstSearch($node){\r\n if($node == null)\r\n return;\r\n\r\n $queue = [];\r\n array_push($queue,$node);\r\n\r\n while (count($queue) > 0) {\r\n $node = array_shift($queue);\r\n echo $node.\" \";\r\n\r\n if($node->left != null)\r\n array_push($queue,$node->left);\r\n\r\n if($node->right != null)\r\n array_push($queue,$node->right);\r\n }\r\n }", "public function get_neighbors()\n\t{\n\t\t// get parent Directory and its children\n\t\t$path = $this->dir->getPath();\n\t\t$parent = new self(dirname($path));\n\t\t$dirs = $parent->get_dirs();\n\n\t\t// find position of current dir\n\t\t$key = array_search(basename($path), $dirs);\n\n\t\t// check if previous/next directories exist\n\t\t$neighbors = array();\n\t\tif (array_key_exists($key - 1, $dirs))\n\t\t\t$neighbors['prev'] = $dirs[$key - 1];\n\t\tif (array_key_exists($key + 1, $dirs))\n\t\t\t$neighbors['next'] = $dirs[$key + 1];\n\n\t\treturn $neighbors;\n\t}", "protected function dijkstraVertices ($from)\n\t{\n\t\t//init\n\t\t$profitSum = array(); // vertexId => length\n\t\t$prevVertices = array(); // i => vertexId\n\t\t$vertices = $this->getVerticesIds(); // i => vertexId\n\t\t$verticesProfitTmp = $this->vertices->toArray(); // vertexId => profit\n\t\t$verticesProfit = array();\n\t\tforeach ($verticesProfitTmp as $key => $item){\n\t\t\t$verticesProfit[$key] = $item;\n\t\t}\n\t\t$prevVertices[$from] = null;\n\t\t$profitSum[$from] = 0;\n\n\t\t// alg\n\t\twhile(count($vertices) > 0){ // while some vertices remain\n\t\t\t$minValue = null;\n\t\t\t$minKey = null;\n\t\t\tforeach($vertices as $i => $vertexKey){ // pop the one with lowest profit\n\t\t\t\tif (isset($profitSum[$vertexKey])){\n\t\t\t\t\tif($minValue === null || $profitSum[$vertexKey] < $minValue){\n\t\t\t\t\t\t$minValue = $profitSum[$vertexKey];\n\t\t\t\t\t\t$minKey = $i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($minValue === null || $minKey === null){ //or pop random\n\t\t\t\treset($vertices);\n\t\t\t\tlist($minKey, $minValue) = each($vertices);\n\t\t\t}\n\t\t\t$u = $vertices[$minKey];\n\t\t\tunset($vertices[$minKey]);\n\n\t\t\tif (isset($profitSum[$u])){\n\t\t\t\t$neighbours = array();\n\t\t\t\tforeach($this->edges[$u] as $key => $distance){ // get profits of neighbours\n\t\t\t\t\t$profit = $verticesProfit[$key];\n\t\t\t\t\t$neighbours[$key] = $profit == 0 ? 0.01 : 1000-log($profit);\n\t\t\t\t}\n\t\t\t\tforeach($neighbours as $neighbourId => $neighbourDistance){\n\t\t\t\t\t$potentialLength = $profitSum[$u] + $neighbourDistance;\n\t\t\t\t\tif(!isset($profitSum[$neighbourId]) || $potentialLength < $profitSum[$neighbourId]){ // check better route\n\t\t\t\t\t\t$profitSum[$neighbourId] = $potentialLength;\n\t\t\t\t\t\t$prevVertices[$neighbourId] = $u;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $prevVertices;\n\t}", "function getNeighbours($arr, $x, $y){\n\t$c = getColumn($arr, $x);\n\t$r = getRow($arr, $y);\n\t[$bnum, $bpos] = locateBlock($x, $y);\n\t$b = getBlock($arr, $bnum);\n\t$ret = array_merge(remove($b, $bpos), remove($c, $y), remove($r, $x));\n\treturn $ret;\n}", "function findNeighbor($Vertex_forWho,$Vertex_finder,$word,$differenceCount){\n\t\t//since some words like car had r as the end but cars had the r and s as end\n\t\t//this function kept breaking, because this was my base case, but to save myself\n\t\t// a headache i split them up into word sized tries\n\n\t\t//if the end of the word is met, then if the difference is only 1 push it back\n\t\t//as an edge to both finder and for who.\n\n\t\tif($Vertexfind->end == true){\n\t\t\tif($differenceCount == 1){\n\t\t\t\t$Vertex_forWho->neighbors[] = $Vertex_finder;\n\t\t\t\t$Vertex_finder->neighbors[] = $Vertex_forWho;\n\t\t\t}\n\t\t}//if the word is still 1 character long, check its edges and find the neighbors for it\n\t\telse if(strlen($word) == 1){\n\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\telse\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t}\n\t\t}//for any wordzie bigger than 1, add all the neighbors\n\t\telse if(strlen($word) > 1){\n\t\t\tif($differenceCount > 1)\n\t\t\t\treturn;\n\t\t\telse if($differenceCount == 0){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 0);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($differenceCount == 1){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function floydWarshall($graph, $V, $INF)\n{\n $dist = [];\n foreach ($graph as $ind => $g) {\n foreach ($g as $key) {\n $dist[$ind][] = 0;\n }\n }\n $path = $dist;\n\n /* initial values for based on shortest paths considering no intermediate vertex. */\n for ($i = 0; $i < $V; $i++) {\n for ($j = 0; $j < $V; $j++) {\n $dist[$i][$j] = $graph[$i][$j];\n $path[$i][$j] = ($graph[$i][$j] > 0 && $graph[$i][$j] < $INF) ? 1 : 0;\n }\n }\n\n /* Add all vertices */\n for ($k = 0; $k < $V; $k++) {\n // Pick all vertices as source one by one\n for ($i = 0; $i < $V; $i++) {\n // Pick all vertices as destination\n // for the above picked source\n for ($j = 0; $j < $V; $j++) {\n // If vertex k is on the shortest path from\n // i to j, then update the value of dist[i][j]\n if (\n $dist[$i][$k] + $dist[$k][$j] <\n $dist[$i][$j]\n ) {\n $dist[$i][$j] = $dist[$i][$k] +\n $dist[$k][$j];\n $path[$i][$j] = $path[$i][$k] +\n $path[$k][$j];\n }\n }\n }\n }\n\n return [$dist, $path];\n}", "public function findCheapest(string $city1, string $city2): array\n {\n $airport1 = $this->airportRepository->findByCity($city1);\n \n abort_if(is_null($airport1), 404, 'Airport in the city ' . $city1 . ' does not exist.');\n \n $airport2 = $this->airportRepository->findByCity($city2);\n \n abort_if(is_null($airport2), 404, 'Airport in the city ' . $city2 . ' does not exist.');\n \n if (Cache::has('routes')) {\n $routes = Cache::get('routes');\n } else {\n $routes = $this->routeRepository->findAll();\n }\n \n $graph = $this->dijkstraGraph->createGraph($routes, 'source_id', 'destination_id', 'price');\n \n $cheapestPath = $this->dijkstraGraph->shortestPath($airport1['id'], $airport2['id']);\n \n $airports = $this->airportRepository->findByIds($cheapestPath);\n \n $cheapestRoute = [];\n $price = 0;\n foreach ($cheapestPath as $key => $element) {\n $airport = $airports[$element];\n if ($key === array_key_first($cheapestPath)) {\n $cheapestRoute['start'] = $this->getRouteInformation($airport);\n $price += $graph[$cheapestPath[$key]][$cheapestPath[$key + 1]];\n } elseif ($key === array_key_last($cheapestPath)) {\n $cheapestRoute['end'] = $this->getRouteInformation($airport);\n } else {\n $cheapestRoute['through'][] = $this->getRouteInformation($airport);\n $price += $graph[$cheapestPath[$key]][$cheapestPath[$key + 1]];\n }\n }\n \n $cheapestRoute['price'] = $price;\n \n return $cheapestRoute;\n }", "public function getShortestPath($origin, $destination);", "public function findPath(){\r\n\r\n $position = $this->_startPoint;\r\n $tile = $this->_getTile($position);\r\n\r\n while(!$this->_checkEnd($position)){\r\n $direction = $tile->move();\r\n $position = $this->_getNewPosition($position,$direction);\r\n $newTile = $this->_getTile($position);\r\n $newTile->enter($direction);\r\n $tile = $newTile;\r\n }\r\n\r\n return $this->_getResult();\r\n }", "public function step(array $matrix, array &$visitedPoints, $point_y, $point_x): void\n {\n if (isset($visitedPoints[$point_y][$point_x])) {\n return;\n }\n\n /**\n * We have 4 directions with offsets (y,x);\n * - up (-1,0)\n * - left (0,-1)\n * - right (0,1)\n * - down (1,0)\n */\n\n // First check next neighbors for the cheapest and then add you own risk to their risk\n // The previous neighbors we always see as up or left\n $neighbors = [];\n foreach ([[-1,0], [0,-1], [0,1], [1,0]] as [$offset_y, $offset_x]) {\n // Don't bother with non-existing points\n if (!isset($matrix[$point_y+$offset_y][$point_x+$offset_x])) {\n continue;\n }\n $neighbors[$matrix[$point_y+$offset_y][$point_x+$offset_x]] = [\n \"y\" => $point_y+$offset_y,\n \"x\" => $point_x+$offset_x,\n \"risk_val\" => $matrix[$point_y+$offset_y][$point_x+$offset_x],\n \"total_risk_val\" => $visitedPoints[$point_y+$offset_y][$point_x+$offset_x][\"total_risk\"]];\n }\n if (empty($neighbors)) {\n // start\n $visitedPoints[$point_y][$point_x] = [\n \"total_risk_val\" => 0,\n \"risk_val\" => $matrix[$point_y+$offset_y][$point_x+$offset_x],\n \"cheapest_neighbor_x\" => null,\n \"cheapest_neighbor_y\" => null\n ];\n } else {\n sort($neighbors);\n $cheapest_neighbor = reset($neighbors);\n $visitedPoints[$point_y][$point_x] = [\n \"total_risk_val\" => $cheapest_neighbor[2] + $matrix[$point_y][$point_x],\n \"risk_val\" => $matrix[$point_y+$offset_y][$point_x+$offset_x],\n \"cheapest_neighbor_x\" => $cheapest_neighbor[1],\n \"cheapest_neighbor_y\" => $cheapest_neighbor[0]\n ];\n }\n foreach ([[-1,0], [0,-1], [0,1], [1,0]] as [$offset_y, $offset_x]) {\n // Don't bother with non-existing points\n if (!isset($matrix[$point_y+$offset_y][$point_x+$offset_x])) {\n continue;\n }\n $this->step($matrix, $visitedPoints, $point_y+$offset_y, $point_x+$offset_x);\n }\n return;\n }", "function find_min_vertex($v1,$vertices,$distance_table){\n $min = INF;\n $min_i = 0;\n\n foreach($vertices as $v2){\n $d = distance_lookup($v1,$v2,$distance_table);\n if($d < $min){\n $min = $d;\n $min_i = $v2;\n }\n }\n return array($min_i,$min);\n\n}", "function generar_DFS($indice,$mat,$numero){\r\n $padre[$indice] = 1;\r\n vardump($numero);\r\n for($i = 0; $i<$numero; $i++){\r\n if($i == $indice){\r\n for($j = 0; $j<$numero; $j++){\r\n if($mat[$i][$j]==1 && $padre[$j]==0){ #si el vertice inicial esta conectado al vertice final y este no fue visitado\r\n $matrizDFS[$i][$j] = 1;\r\n generar_DFS($j,$mat,$numero);\r\n } #se registra la conexion en la matriz dfs global\r\n }\r\n }\r\n }\r\n #los datos de la matriz global pasan a una matriz local\r\n return $matrizDFS; #se regresa la matriz DFS\r\n}", "function getBikeParkLoc($from_lat, $from_lon){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.1;\n $sql = \"SELECT node_id, lat, lon, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_bike_parkings\n ORDER BY x ASC LIMIT 1\";\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = array($row['lat'],$row['lon']);\n }\n return $arr[0];\n}", "public function neighbors()\n {\n $parent = $this->parent;\n $exclude = $this->term_id;\n\n $query = static::where('term_id', '!=', $exclude);\n\n return $parent ? $query->where('parent', $parent) : $query->whereNull('parent');\n }", "private function isReachable(array $from, array $to): bool\n {\n $cells = [];\n if ($from[0] === $to[0]) {\n for ($i = min($from[1], $to[1]); $i <= max($from[1], $to[1]); ++$i) {\n $cells[] = $this->getCell($from[0], $i);\n }\n } else if ($from[1] === $to[1]) {\n for ($i = min($from[0], $to[0]); $i <= max($from[0], $to[0]); ++$i) {\n $cells[] = $this->getCell($i, $from[1]);\n }\n } else {\n $x1 = min($from[0], $to[0]);\n $y1 = $x1 === $from[0] ? $from[1] : $to[1];\n $x2 = max($from[0], $to[0]);\n $y2 = $x2 === $from[0] ? $from[1] : $to[1];\n while (abs($x1 - $x2) >= 0 && abs($y1 - $y2) >= 0) {\n $cells[] = $this->getCell($x1, $y1);\n if ($x1 > $x2) {\n --$x1;\n } else if ($x1 < $x2) {\n ++$x1;\n } else if ($x1 === $x2) {\n break;\n }\n if ($y1 > $y2) {\n --$y1;\n } else if ($y1 < $y2) {\n ++$y1;\n } else if ($y1 === $y2) {\n break;\n }\n }\n }\n\n $pieces = count(array_filter($cells, function ($i) {\n return !is_null($i);\n }));\n\n if ($pieces === 1) {\n return true;\n }\n if ($pieces === 2) {\n $result = 0;\n if ($cells[0] instanceof Piece) {\n $result += $cells[0]->getColor() !== $this->getCell($from[0], $from[1])->getColor() ? 1 : 0;\n }\n if ($cells[count($cells) - 1] instanceof Piece) {\n $result +=\n $cells[count($cells) - 1]->getColor() !== $this->getCell($from[0], $from[1])->getColor() ? 1 : 0;\n }\n if (\n $this->getCell($from[0], $from[1]) instanceof Pawn &&\n $from[0] === $to[0]\n ) {\n $result += 1;\n }\n return $result === 1;\n }\n return false;\n }", "public function neighbors($v);", "public function getNeighbors(array $columns = ['*']);", "function MinimumDistance($distance, $shortestPathTreeSet, $verticesCount)\r\n\t{\r\n\t\tglobal $INT_MAX;\r\n\t\t$min = $INT_MAX;\r\n\t\t$minIndex = 0;\r\n\r\n\t\tfor ($v = 0; $v < $verticesCount; ++$v)\r\n\t\t{\r\n\t\t\tif ($shortestPathTreeSet[$v] == false && $distance[$v] <= $min)\r\n\t\t\t{\r\n\t\t\t\t$min = $distance[$v];\r\n\t\t\t\t$minIndex = $v;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $minIndex;\r\n\t}", "private function buildFirstLastBoarding()\n {\n $hasPreviousBoarding = false;\n $isLastBoarding = true;\n\n for ($i = 0, $size = count($this->boardings); $i < $size ; $i++) {\n // Lookup for the arrival city and the departure city\n foreach ($this->boardings as $trip) {\n // If current trip departure is another's trip arrival, so we have a previous trip\n if (strcasecmp($this->boardings[$i]['Departure'], $trip['Arrival']) == 0) {\n $hasPreviousBoarding = true;\n } elseif (strcasecmp($this->boardings[$i]['Arrival'], $trip['Departure']) == 0) {\n // If current trip's arrival is another trip departure, then it is not the last trip\n $isLastBoarding = false;\n }\n }\n\n if (!$hasPreviousBoarding) {\n // Its first trip, so should be a first element\n array_unshift($this->boardings, $this->boardings[$i]);\n unset($this->boardings[$i]);\n } elseif ($isLastBoarding) {\n // Lat element pushed to the end\n array_push($this->boardings, $this->boardings[$i]);\n unset($this->boardings[$i]);\n }\n }\n\n // We regenerate indexes\n $this->boardings = array_merge($this->boardings);\n }", "function search_own_router($all_nodes, $own_nodes)\n{\n # Deklariere Array\n $own_router_index = array();\n $i = 0;\n foreach ($all_nodes as $node) {\n $node_id = $node['node_id'];\n foreach ($own_nodes as $own_id) {\n if ($own_id == $node_id) {\n array_push($own_router_index, $i);\n }\n }\n $i = $i + 1;\n }\n return $own_router_index;\n}", "private function findSimpleMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($this->moveDestinations as $direction)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->canMoveTo($direction, $i, $j))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$moves[] = array(array($direction, $i, $j));\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\t\n\t\treturn $moves;\n\t}", "public function buildPaths($state)\n {\n $this->path_history[] = $state;\n \n if (count($this->path_history) == $this->total_states) {\n $this->paths[] = $this->path_history;\n array_pop($this->path_history);\n return;\n }\n\n foreach ($this->bounded_state_borders[$state] as $next) {\n if (!in_array($next, $this->path_history)) {\n $this->buildPaths($next);\n }\n }\n\n array_pop($this->path_history);\n }", "public function visitNode($xCoordinate, $yCoordinate, $bestSolutionSoFar = [])\n {\n if ($this->nodeIsOutOfBounds($xCoordinate, $yCoordinate)\n || $this->nodeIsObstacle($xCoordinate, $yCoordinate)\n || $this->nodeHasBeenPreviouslyVisited($xCoordinate, $yCoordinate)\n ) {\n return;\n }\n\n /* Mark that the node has been visited. */\n $this->obstacleMap[$xCoordinate][$yCoordinate] = self::NODE_VISITED_MARK;\n\n /* Get the best path that has been accessed so far. */\n $currentValue = $this->solvedMap[$xCoordinate][$yCoordinate];\n\n /* If we already have a better solution, don't bother going further. */\n if ($currentValue >= $this->bestSolutionLength) {\n return;\n }\n\n $newValue = $currentValue + 1;\n $bestSolutionSoFar[] = new Point($xCoordinate, $yCoordinate);\n\n /* Get the optimal path to all the neighbours. */\n $this->visitNeighbour($xCoordinate + 1, $yCoordinate, $newValue, $bestSolutionSoFar);\n $this->visitNeighbour($xCoordinate - 1, $yCoordinate, $newValue, $bestSolutionSoFar);\n $this->visitNeighbour($xCoordinate, $yCoordinate + 1, $newValue, $bestSolutionSoFar);\n $this->visitNeighbour($xCoordinate, $yCoordinate - 1, $newValue, $bestSolutionSoFar);\n\n /* Visit the neighbours and carry on generating best path. */\n $this->visitNode($xCoordinate + 1, $yCoordinate, $bestSolutionSoFar);\n $this->visitNode($xCoordinate - 1, $yCoordinate, $bestSolutionSoFar);\n $this->visitNode($xCoordinate, $yCoordinate + 1, $bestSolutionSoFar);\n $this->visitNode($xCoordinate, $yCoordinate - 1, $bestSolutionSoFar);\n }", "public function getMinBeds();", "public function getMinBaths();", "function removeConnectedStack($remaining, $current)\n{\n $stack = array();\n array_push($stack, $current);\n \n while (!empty($stack)) {\n $current = array_pop($stack);\n unset($remaining[$current]);\n \n $coord = getCoords($current);\n $row = $coord['row'];\n $col = $coord['col'];\n\n // go round the houses\n // N = $row-1 : $col\n // E = $row : $col+1\n // S = $row+1 : $col\n // W = $row : $col-1\n if (isset($remaining[($row-1).\":$col\"])) {\n array_push($stack, ($row-1).\":$col\");\n }\n if (isset($remaining[\"$row:\".($col+1)])) {\n array_push($stack, \"$row:\".($col+1));\n }\n if (isset($remaining[($row+1).\":$col\"])) {\n array_push($stack, ($row+1).\":$col\");\n }\n if (isset($remaining[\"$row:\".($col-1)])) {\n array_push($stack, \"$row:\".($col-1));\n }\n }\n\n return $remaining;\n}", "protected function processNextNodeInQueue(array $exclude) {\n\n $closest = array_search(min($this->queue), $this->queue);\n\n if (!empty($this->graph[$closest]) && !in_array($closest, $exclude)) {\n\n foreach ($this->graph[$closest] as $neighbor => $cost) {\n\n if (isset($this->distance[$neighbor])) {\n\n if ($this->distance[$closest] + $cost < $this->distance[$neighbor]) {\n\n $this->distance[$neighbor] = $this->distance[$closest] + $cost;\n $this->previous[$neighbor] = array($closest);\n $this->queue[$neighbor] = $this->distance[$neighbor];\n }\n\n elseif ($this->distance[$closest] + $cost === $this->distance[$neighbor]) {\n\n $this->previous[$neighbor][] = $closest;\n $this->queue[$neighbor] = $this->distance[$neighbor];\n }\n }\n }\n }\n\n unset($this->queue[$closest]);\n }", "public function initMatrix()\r\n {\r\n $num_locations = count($this->locations);\r\n for ($i = 1; $i <= $num_locations; $i++) {\r\n for ($j = 1; $j <= $num_locations; $j++) {\r\n if ($i == $j) {\r\n $this->cost_matrix[$i][$j] = $this->infinity;\r\n } else {\r\n $this->cost_matrix[$i][$j] = $this->distance($this->locations[$i]['latitude'], $this->locations[$i]['longitude'], $this->locations[$j]['latitude'], $this->locations[$j]['longitude']);\r\n }\r\n }\r\n }\r\n }", "function find_closest_stations ($lat, $lng, $stations, $num, $recalc = FALSE) {\r\n\tstatic $R = 6371;\r\n\tstatic $distances = array();\r\n\t$closest = -1;\r\n\treset($distances);\r\n\t//if (count(array_diff($stations_cache,$stations)) > 0) {\r\n\t//\t$stations_cache = $stations;\r\n\t// \t$recalc = TRUE;\r\n\t//}\r\n\tif (count($distances) == 0 || $recalc) {\r\n\t\t$station_ids = array_keys( $stations );\r\n\t\tfor ( $i = 0 ; $i < count( $station_ids ) ; $i++ ) {\r\n\t\t\tif ( !isset( $stations[$station_ids[$i]] ) ) { continue; }\r\n\t\t\t// check for a duplicate station using an alternate ID, e.g. 999999XXXXX or XXXXXX99999\r\n\t\t\tif ( isset( $stations[$station_ids[$i]] ) && $stations[$station_ids[$i]]['usafid'] != '999999' && $stations[$station_ids[$i]]['wban'] != '99999' ) {\r\n\t\t\t\t$i_usafid_only = $stations[$station_ids[$i]]['usafid'] . '99999';\r\n\t\t\t\tif ( isset( $stations[$i_usafid_only] ) ) {\r\n\t\t\t\t\tunset( $stations[$i_usafid_only] );\r\n\t\t\t\t\tif ( isset( $distances[$i_usafid_only] ) ) {\r\n\t\t\t\t\t\tunset( $distances[$i_usafid_only] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$i_wban_only = '999999' . $stations[$station_ids[$i]]['wban'];\r\n\t\t\t\tif ( isset( $stations[$i_wban_only] ) ) {\r\n\t\t\t\t\tunset( $stations[$i_wban_only] );\r\n\t\t\t\t\tif ( isset( $distances[$i_wban_only] ) ) {\r\n\t\t\t\t\t\tunset( $distances[$i_wban_only] );\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$mlat = $stations[$station_ids[$i]]['lat'];\r\n\t\t\t$mlng = $stations[$station_ids[$i]]['lng'];\r\n\t\t\t$dLat = rad($mlat - $lat);\r\n\t\t\t$dLng = rad($mlng - $lng);\r\n\t\t\t$a = sin($dLat/2) * sin($dLat/2) +\r\n\t\t\t\tcos(rad($lat)) * cos(rad($lat)) * sin($dLng/2) * sin($dLng/2);\r\n\t\t\t$c = 2 * atan2(sqrt($a), sqrt(1-$a));\r\n\t\t\t$d = $R * $c;\r\n\t\t\t/* If the distance calculation results in is_nan($d), do not add it to the distances array. \r\n\t\t\tThese values will always be pushed to the top of the array, resulting in a poor \r\n\t\t\t\"closest station\" calculation. */\r\n\t\t\tif (!is_nan($d)) {\r\n\t\t\t\t$distances[$station_ids[$i]] = $d;\r\n\t\t\t}\r\n\t\t}\r\n\t\tasort($distances);\r\n\t} else {\r\n\t\tunset($distances[key($distances)]);\r\n\t}\r\n\treturn array_slice($distances,0,$num,TRUE);\r\n}", "public function index()\n {\n $a = new Node(1,'A',12,34,[]);\n $b = new Node(2,'B',12,34,[]);\n $c = new Node(3,'C',12,34,[]);\n $d = new Node(4,'D',12,34,[]);\n $e = new Node(5,'E',13,45,[]); \n $f = new Node(7,'F',13,45,[]); \n $g = new Node(8,'G',13,45,[]); \n $h = new Node(9,'H',13,45,[]); \n $i = new Node(12,'I',13,45,[]); \n $j = new Node(10,'J',13,45,[]); \n $k = new Node(11,'K',13,45,[]); \n $l = new Node(13,'L',13,45,[]); \n $m = new Node(14,'M',13,45,[]); \n $n = new Node(16,'N',13,45,[]); \n $p = new Node(17,'P',13,45,[]);\n\n\n $gr = new Grafo();\n $gr->Add($a);\n $gr->Add($b);\n $gr->Add($c);\n $gr->Add($d);\n $gr->Add($e);\n $gr->Add($f);\n $gr->Add($g);\n $gr->Add($h);\n $gr->Add($i);\n $gr->Add($j);\n $gr->Add($k);\n $gr->Add($l);\n $gr->Add($m);\n $gr->Add($n);\n $gr->Add($p);\n\n // A\n $gr->AddEdge($a,8,$b);\n $gr->AddEdge($b,8,$a);\n $gr->AddEdge($a,4,$e);\n $gr->AddEdge($e,4,$a);\n $gr->AddEdge($a,5,$d);\n $gr->AddEdge($d,5,$a);\n // B\n $gr->AddEdge($b,12,$e);\n $gr->AddEdge($e,12,$b);\n $gr->AddEdge($b,4,$f);\n $gr->AddEdge($f,4,$b);\n $gr->AddEdge($b,3,$c);\n $gr->AddEdge($c,3,$b);\n // C\n $gr->AddEdge($c,9,$f);\n $gr->AddEdge($f,9,$c);\n $gr->AddEdge($c,11,$g);\n $gr->AddEdge($g,11,$c);\n // F\n $gr->AddEdge($f,1,$g);\n $gr->AddEdge($g,1,$f);\n $gr->AddEdge($f,3,$e);\n $gr->AddEdge($e,3,$f);\n $gr->AddEdge($f,8,$k);\n $gr->AddEdge($k,8,$f);\n // G\n $gr->AddEdge($g,7,$l);\n $gr->AddEdge($l,7,$g);\n $gr->AddEdge($g,8,$k);\n $gr->AddEdge($k,8,$g);\n // E\n $gr->AddEdge($e,9,$d);\n $gr->AddEdge($d,9,$e);\n $gr->AddEdge($e,5,$j);\n $gr->AddEdge($j,5,$e);\n $gr->AddEdge($e,8,$i);\n $gr->AddEdge($i,8,$e);\n // D\n $gr->AddEdge($d,6,$h);\n $gr->AddEdge($h,6,$d);\n // H\n $gr->AddEdge($h,2,$i);\n $gr->AddEdge($i,2,$h);\n $gr->AddEdge($h,7,$m);\n $gr->AddEdge($m,7,$h);\n // I\n $gr->AddEdge($i,10,$j);\n $gr->AddEdge($j,10,$i);\n $gr->AddEdge($i,6,$m);\n $gr->AddEdge($m,6,$i);\n // M\n $gr->AddEdge($m,2,$n);\n $gr->AddEdge($n,2,$m);\n // J\n $gr->AddEdge($j,6,$k);\n $gr->AddEdge($k,6,$j);\n $gr->AddEdge($j,9,$n);\n $gr->AddEdge($n,9,$j);\n // K\n $gr->AddEdge($k,5,$l);\n $gr->AddEdge($l,5,$k);\n $gr->AddEdge($k,7,$p);\n $gr->AddEdge($p,7,$k);\n // L\n $gr->AddEdge($l,6,$p);\n $gr->AddEdge($p,6,$l);\n // N\n $gr->AddEdge($n,12,$p);\n $gr->AddEdge($p,12,$n);\n // P\n\n // dd($gr);\n // return $gr->MenorDistancia([INF,INF,0,INF]);\n // return $gr->Show();\n return $gr->Disjtra($a,$p);\n }", "public function paths_to($node_dsts, $tonode) {\r\n\r\n\t\t$current = $tonode;\r\n\t\t$path = array();\r\n\r\n\t\tif (isset($node_dsts[$current])) { // only add if there is a path to node\r\n\t\t\tarray_push($path, $tonode);\r\n\t\t}\r\n\t\twhile(isset($node_dsts[$current])) {\r\n\t\t\t$nextnode = $node_dsts[$current];\r\n\r\n\t\t\tarray_push($path, $nextnode);\r\n\r\n\t\t\t$current = $nextnode;\r\n\t\t}\r\n\r\n\t\treturn array_reverse($path);\r\n\r\n\t}", "function removeConnectedRecursive($remaining, $current)\n{\n unset($remaining[$current]);\n $coord = getCoords($current);\n $row = $coord['row'];\n $col = $coord['col'];\n\n // go round the houses\n // N = $row-1 : $col\n // E = $row : $col+1\n // S = $row+1 : $col\n // W = $row : $col-1\n if (isset($remaining[($row-1).\":$col\"])) {\n $remaining = removeConnectedRecursive($remaining, ($row-1).\":$col\");\n }\n if (isset($remaining[\"$row:\".($col+1)])) {\n $remaining = removeConnectedRecursive($remaining, \"$row:\".($col+1));\n }\n if (isset($remaining[($row+1).\":$col\"])) {\n $remaining = removeConnectedRecursive($remaining, ($row+1).\":$col\");\n }\n if (isset($remaining[\"$row:\".($col-1)])) {\n $remaining = removeConnectedRecursive($remaining, \"$row:\".($col-1));\n }\n return $remaining;\n}", "public function scan()\r\n {\r\n $result = array(\"wormholes\" => array(), \"asteroids\" => array());\r\n // asteroids first.\r\n foreach ($this->asteroids as $asteroid) {\r\n // if the asteroid is within scanning range of the ship....\r\n if (abs($asteroid->getX() - $this->spaceShip->getX()) < $this->asteroidScanningRange &&\r\n abs($asteroid->getY() - $this->spaceShip->getY()) < $this->asteroidScanningRange &&\r\n abs($asteroid->getZ() - $this->spaceShip->getZ()) < $this->asteroidScanningRange) {\r\n // then add it's details to the result\r\n $result['asteroids'][] = array(\r\n // we don't give absolute positions of asteroids, only their location relative to the ship\r\n 'x' => $asteroid->getX() - $this->spaceShip->getX(),\r\n 'y' => $asteroid->getY() - $this->spaceShip->getY(),\r\n 'z' => $asteroid->getZ() - $this->spaceShip->getZ(),\r\n 'dx' => $asteroid->getDx(),\r\n 'dy' => $asteroid->getDY(),\r\n 'dz' => $asteroid->getDz()\r\n );\r\n }\r\n }\r\n // now do the same for the wormholes...\r\n // for wormholes we only return the nearest end, and then the SHA1 of the furthest end\r\n // the navigator will have to figure out what the input of the SHA1 was. If you've actually\r\n // bothered to read these comments, please be assured that there is a better way to do it\r\n // then to brute force them.\r\n foreach ($this->wormholes as $wormhole) {\r\n // we'll do pythagorean distance\r\n // first for end1\r\n $diffX = abs($wormhole->getX1() - $this->spaceShip->getX());\r\n $diffY = abs($wormhole->getY1() - $this->spaceShip->getY());\r\n $diffZ = abs($wormhole->getZ1() - $this->spaceShip->getZ());\r\n $diffXY = sqrt(($diffX * $diffX) + ($diffY * $diffY));\r\n $diffXYZ1 = sqrt(($diffZ * $diffZ) + ($diffXY * $diffXY));\r\n // then for end2\r\n $diffX = abs($wormhole->getX2() - $this->spaceShip->getX());\r\n $diffY = abs($wormhole->getY2() - $this->spaceShip->getY());\r\n $diffZ = abs($wormhole->getZ2() - $this->spaceShip->getZ());\r\n $diffXY = sqrt(($diffX * $diffX) + ($diffY * $diffY));\r\n $diffXYZ2 = sqrt(($diffZ * $diffZ) + ($diffXY * $diffXY));\r\n // now show them the details for the nearest end, and let them figure out the further one...\r\n if ($diffXYZ1 < $diffXYZ2) {\r\n $result['wormholes'][] = array(\r\n 'x' => $wormhole->getX1(),\r\n 'y' => $wormhole->getY1(),\r\n 'z' => $wormhole->getZ1(),\r\n 'destination' => sha1($wormhole->getX2() . ',' . $wormhole->getY2() . ',' . $wormhole->getZ2())\r\n );\r\n } else {\r\n $result['wormholes'][] = array(\r\n 'x' => $wormhole->getX2(),\r\n 'y' => $wormhole->getY2(),\r\n 'z' => $wormhole->getZ2(),\r\n 'destination' => sha1($wormhole->getX1() . ',' . $wormhole->getY1() . ',' . $wormhole->getZ1())\r\n );\r\n }\r\n }\r\n return $result;\r\n }", "public static function nearest_exit ()\n {\n $current_x = Map::current('x');\n $current_y = Map::current('y');\n $candidate_distance = array_product(Map::size());\n $candidate_xy = [];\n foreach (static::$_value_matrix as $y => $row) {\n foreach ($row as $x => $value) {\n if ( $value > 0 ) {\n $this_distance = Map::distance($current_x, $current_y, $x, $y);\n if ( $this_distance < $candidate_distance ) {\n $candidate_distance = $this_distance;\n $candidate_xy = ['x' => $x, 'y' => $y];\n }\n if ( $y == $current_y && $this_distance > $candidate_distance ) {\n // Because this is a row-based scan of the map, nothing\n // closer will be found from this point.\n break 2;\n }\n }\n }\n }\n echo \"nearest_exit():\\n\";\n var_dump($candidate_xy);\n return $candidate_xy;\n }", "protected function updateInfo(&$vertexSet, &$pathCosts, &$cheapestPaths, $i, $j)\n {\n\n // If the index pair exists, return\n if (array_key_exists($vertexSet[$i]->getId(), $cheapestPaths) && array_key_exists($vertexSet[$j]->getId(),\n $cheapestPaths[$vertexSet[$i]->getId()])\n ) {\n\n return;\n }\n\n // Creating new array indexes if necessary\n if (!array_key_exists($vertexSet[$i]->getId(), $cheapestPaths)) {\n\n $cheapestPaths[$vertexSet[$i]->getId()] = array();\n }\n\n if (!array_key_exists($vertexSet[$j]->getId(), $cheapestPaths[$vertexSet[$i]->getId()])) {\n\n $cheapestPaths[$vertexSet[$i]->getId()][$vertexSet[$j]->getId()] = array();\n }\n\n if (!array_key_exists($i, $pathCosts)) {\n\n $pathCosts[$i] = array();\n }\n\n // If we have an edge between Vertices in positions i, j, we update the cost and assign the edge to the\n // path between them, if not, the cost will be INF\n $edge = $this->getEdgeBetween($vertexSet[$i], $vertexSet[$j]);\n\n if ($edge) {\n\n $cheapestPaths[$vertexSet[$i]->getId()][$vertexSet[$j]->getId()] = array($edge);\n $pathCosts[$i][$j] = $edge->getWeight();\n\n } else {\n\n if ($i !== $j) {\n\n $pathCosts[$i][$j] = INF;\n }\n }\n\n }", "public function getNeighbor($m, $n) {\n $ret = array();\n for ($j = -1; $j <= 1; $j++) {\n for ($i = -1; $i <= 1; $i++) {\n $x = $this->x + $i;\n $y = $this->y + $j;\n if ( !($x == $this->x && $y == $this->y) \n && ( $x >= 0 ) && ( $y >= 0 ) \n && ( $x < $m ) && ( $y < $n ) \n ) {\n $ret[] = array($x, $y);\n }\n }\n }\n return $ret;\n }", "function fiftyone_degrees_get_closest_signature_indexs(\n $node_indexs,\n &$timings,\n &$debug_info,\n $headers) {\n\n \n $node_count = count($node_indexs);\n \n if ($node_count == 1) {\n // There is only 1 list so return that single list.\n $node = fiftyone_degrees_read_node($node_indexs[0], $headers);\n fiftyone_degrees_fill_node_ranked_signatures($node, $headers['info']['max_signatures']);\n $sig_offsets = array();\n foreach ($node['node_ranked_signatures'] as $offset) {\n $sig_offsets[] = $offset;\n }\n return $sig_offsets;\n }\n else {\n $timings['closest_match_node_sort_time'] = microtime(TRUE); \n $sorted_nodes = array();\n $nodes = array();\n\n $max_count = 1;\n $iteration = 2;\n for ($i = 0; $i < $node_count; $i++) {\n $node = fiftyone_degrees_read_node($node_indexs[$i], $headers);\n $sorted_nodes[$i] = $node['node_ranked_signature_count'];\n $nodes[] = $node;\n }\n // Sort nodes in ascending order by signature count.\n array_multisort($sorted_nodes, SORT_ASC, $nodes);\n\n $timings['closest_match_node_sort_time'] = microtime(TRUE) - $timings['closest_match_node_sort_time'];\n\n $timings['closest_match_node_fill_signatures_time'] = microtime(TRUE);\n for ($i = 0; $i < $node_count; $i++) {\n fiftyone_degrees_fill_node_ranked_signatures($nodes[$i]);\n }\n $timings['closest_match_node_fill_signatures_time'] = microtime(TRUE) - $timings['closest_match_node_fill_signatures_time'];\n\n $timings['closest_match_filling_linked_list_time'] = microtime(TRUE);\n\n // Building initial list.\n $linked_list = new LinkedList();\n if (count($nodes) > 0) {\n $node_0_signatures_count = count($nodes[0]['node_ranked_signatures']);\n if ($node_0_signatures_count > $headers['info']['max_signatures']) {\n // $node_0_signatures_count = $headers['info']['max_signatures'];\n }\n for ($i = 0; $i < $node_0_signatures_count; $i++) {\n $linked_list->addLast(array($nodes[0]['node_ranked_signatures'][$i], 1));\n }\n }\n\n // Count the number of times each signature index occurs.\n for ($i = 1; $i < $node_count; $i++) {\n $max_count = fiftyone_degrees_get_closest_signatures_for_node(\n $node_count,\n $nodes[$i]['node_ranked_signatures'],\n $linked_list,\n $max_count,\n $iteration,\n $headers);\n $iteration++;\n }\n $timings['closest_match_filling_linked_list_time'] = microtime(TRUE) - $timings['closest_match_filling_linked_list_time'];\n $timings['closest_match_sorting_signature_ranks'] = microtime(TRUE);\n\n $sig_offsets = array();\n $linked_list->current = $linked_list->first;\n \n while ($linked_list->current !== -1) {\n if ($linked_list->current->value[1] == $max_count) {\n $debug_info['signatures_read']++;\n $sig_offsets[] = $linked_list->current->value[0];\n }\n $linked_list->moveNext();\n }\n\n $timings['closest_match_sorting_signature_ranks'] = microtime(TRUE) - $timings['closest_match_sorting_signature_ranks'];\n return $sig_offsets;\n }\n}", "function findNeighboorKeys($size, $y, $x)\n {\n $result = [];\n if ($y - 1 >= 0) {\n array_push($result, [$y - 1, $x]);\n if ($x == $y) array_push($result, [$y - 1, $x - 1]);\n }\n\n if ($y + 1 < $size) {\n array_push($result, [$y + 1, $x]);\n if ($x == $y) array_push($result, [$y + 1, $x + 1]);\n }\n if ($x - 1 >= 0) array_push($result, [$y, $x - 1]);\n if ($x + 1 < $size) array_push($result, [$y, $x + 1]);\n return $result;\n }", "public function getNeighborhood()\n {\n return $this->neighborhood;\n }", "protected function shortestMiddleSnake(array $a, $lowerA, $upperA, array $b, $lowerB, $upperB)\n\t{\n\t\t$result = array();\n\n\t\t$downK = $lowerA - $lowerB; // the k-line to start the forward search\n\t\t$upK = $upperA - $upperB; // the k-line to start the reverse search\n\n\t\t$delta = ($upperA - $lowerA) - ($upperB - $lowerB);\n\t\t$oddDelta = ($delta & 1) != 0;\n\n\t\t$maxD = (($upperA - $lowerA + $upperB - $lowerB) / 2) + 1;\n\n\t\t// init vectors\n\t\t$this->downVector[$downK + 1] = $lowerA;\n\t\t$this->upVector[$upK - 1] = $upperA;\n\n\t\tfor ($d = 0; $d <= $maxD; $d++)\n\t\t{\n\n\t\t\t// Extend the forward path.\n\t\t\tfor ($k = $downK - $d; $k <= $downK + $d; $k += 2)\n\t\t\t{\n\t\t\t\t// find the only or better starting point\n\t\t\t\t$x = 0;\n\t\t\t\t$y = 0;\n\t\t\t\tif ($k == $downK - $d)\n\t\t\t\t{\n\t\t\t\t\t$x = $this->downVector[$k + 1]; // down\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$x = $this->downVector[$k - 1] + 1; // a step to the right\n\t\t\t\t\tif (($k < $downK + $d) && ($this->downVector[$k + 1] >= $x))\n\t\t\t\t\t{\n\t\t\t\t\t\t$x = $this->downVector[$k + 1];\n\t\t\t\t\t} // down\n\t\t\t\t}\n\t\t\t\t$y = $x - $k;\n\n\t\t\t\t// find the end of the furthest reaching forward D-path in diagonal k.\n\t\t\t\twhile (($x < $upperA) && ($y < $upperB) && ($a[$x] == $b[$y]))\n\t\t\t\t{\n\t\t\t\t\t$x++;\n\t\t\t\t\t$y++;\n\t\t\t\t}\n\t\t\t\t$this->downVector[$k] = $x;\n\n\t\t\t\t// overlap ?\n\t\t\t\tif ($oddDelta && ($upK - $d < $k) && ($k < $upK + $d))\n\t\t\t\t{\n\t\t\t\t\tif ($this->upVector[$k] <= $this->downVector[$k])\n\t\t\t\t\t{\n\t\t\t\t\t\t$result['x'] = $this->downVector[$k];\n\t\t\t\t\t\t$result['y'] = $this->downVector[$k] - $k;\n\t\t\t\t\t\treturn $result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Extend the reverse path.\n\t\t\tfor ($k = $upK - $d; $k <= $upK + $d; $k += 2)\n\t\t\t{\n\n\t\t\t\t// find the only or better starting point\n\t\t\t\t$x = 0;\n\t\t\t\t$y = 0;\n\t\t\t\tif ($k == $upK + $d)\n\t\t\t\t{\n\t\t\t\t\t$x = $this->upVector[$k - 1]; // up\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$x = $this->upVector[$k + 1] - 1; // left\n\t\t\t\t\tif (($k > $upK - $d) && ($this->upVector[$k - 1] < $x))\n\t\t\t\t\t{\n\t\t\t\t\t\t$x = $this->upVector[$k - 1];\n\t\t\t\t\t} // up\n\t\t\t\t}\n\t\t\t\t$y = $x - $k;\n\n\t\t\t\twhile (($x > $lowerA) && ($y > $lowerB) && ($a[$x - 1] == $b[$y - 1]))\n\t\t\t\t{\n\t\t\t\t\t// diagonal\n\t\t\t\t\t$x--;\n\t\t\t\t\t$y--;\n\t\t\t\t}\n\t\t\t\t$this->upVector[$k] = $x;\n\n\t\t\t\t// overlap ?\n\t\t\t\tif (!$oddDelta && ($downK - $d <= $k) && ($k <= $downK + $d))\n\t\t\t\t{\n\t\t\t\t\tif ($this->upVector[$k] <= $this->downVector[$k])\n\t\t\t\t\t{\n\t\t\t\t\t\t$result['x'] = $this->downVector[$k];\n\t\t\t\t\t\t$result['y'] = $this->downVector[$k] - $k;\n\t\t\t\t\t\treturn $result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getCarParkLoc($from_lat, $from_lon){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.1;\n $sql = \"SELECT node_id, lat, lon, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_car_parkings\n ORDER BY x ASC LIMIT 1\";\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = array($row['lat'],$row['lon']);\n }\n return $arr[0];\n}", "public function findPath()\n\t{\n\t\t$pegs = array();\n\t\t$moves = array();\n\t\t\n\t\t$aux = $this->findRectangleMove();\n\t\tforeach($aux as $move)\n\t\t{\n\t\t\t$moves[] = $move;\n\t\t}\n\t\t\n\t\t$aux = $this->findBigLMove();\n\t\tforeach($aux as $move)\n\t\t{\n\t\t\t$moves[] = $move;\n\t\t}\n\t\t\n\t\t$aux = $this->findLMove();\n\t\tforeach($aux as $move)\n\t\t{\n\t\t\t$moves[] = $move;\n\t\t}\n\t\t\n\t\tif(empty($moves))\n\t\t{\n\t\t\tif(count($this->moves) > 28)\n\t\t\t{\n\t\t\t\t$moves = $this->findSimpleMove();\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach($moves as $move)\n\t\t{\n\t\t\t$newPeg = clone $this;\n\t\t\t\n\t\t\tforeach($move as $m)\n\t\t\t{\n\t\t\t\t$newPeg->moveTo($m[0], $m[1], $m[2]);\n\t\t\t}\n\t\t\t\n\t\t\t$pegs[] = clone $newPeg;\n\t\t}\n\t\t\n\t\treturn $pegs;\n\t}", "public function get_directions();", "private function calculateConnections() {\n $map = array();\n $whiteRecheck = array();\n for ($row=0; $row < $this->matrix->getSize(); $row++) {\n for ($col=0; $col < $this->matrix->getSize(); $col++) {\n $map[$row][$col][5] = $this->isDarkInt($row, $col);\n $map[$row][$col][0] = 0;\n $map[$row][$col][4] = $this->isDarkInt($row, $col - 1);\n $map[$row][$col][6] = $this->isDarkInt($row, $col + 1);\n $map[$row][$col][8] = $this->isDarkInt($row - 1, $col);\n $map[$row][$col][2] = $this->isDarkInt($row + 1, $col);\n $map[$row][$col][7] = $this->isDarkInt($row - 1, $col - 1);\n $map[$row][$col][9] = $this->isDarkInt($row - 1, $col + 1);\n $map[$row][$col][1] = $this->isDarkInt($row + 1, $col - 1);\n $map[$row][$col][3] = $this->isDarkInt($row + 1, $col + 1);\n if (!$map[$row][$col][5]) {\n $fullCount = $map[$row][$col][1] + $map[$row][$col][2] + $map[$row][$col][3] + $map[$row][$col][4]\n + $map[$row][$col][6] + $map[$row][$col][7] + $map[$row][$col][8] + $map[$row][$col][9];\n $soloCount = $map[$row][$col][2] + $map[$row][$col][4] + $map[$row][$col][6] + $map[$row][$col][8];\n $map[$row][$col][7] = 0;\n $map[$row][$col][9] = 0;\n $map[$row][$col][1] = 0;\n $map[$row][$col][3] = 0;\n if ($this->isDarkInt($row, $col - 1) && $this->isDarkInt($row - 1, $col)) {\n $map[$row][$col][7] = 1;\n }\n if ($this->isDarkInt($row, $col + 1) && $this->isDarkInt($row - 1, $col)) {\n $map[$row][$col][9] = 1;\n }\n if ($this->isDarkInt($row, $col - 1) && $this->isDarkInt($row + 1, $col)) {\n $map[$row][$col][1] = 1;\n }\n if ($this->isDarkInt($row, $col + 1) && $this->isDarkInt($row + 1, $col)) {\n $map[$row][$col][3] = 1;\n }\n if ($fullCount >= 5) {\n $whiteRecheck[]=array('row' => $row, 'col' => $col);\n }\n if ($soloCount >= 4) {\n $map[$row][$col][0] = 1;\n }\n }\n }\n }\n foreach ($whiteRecheck as $key => $cw) {\n $row = $cw['row'];\n $col = $cw['col'];\n if (isset($map[$row + 1][$col - 1]) && !$map[$row + 1][$col - 1][5] && isset($map[$row + 1][$col - 1]) && $map[$row + 1][$col - 1][0]) {\n $map[$row][$col][1] = 0;\n $map[$row][$col - 1][3] = 0;\n $map[$row + 1][$col][7] = 0;\n $map[$row + 1][$col - 1][9] = 0;\n }\n if (isset($map[$row + 1][$col + 1]) && !$map[$row + 1][$col + 1][5] && isset($map[$row + 1][$col + 1]) && $map[$row + 1][$col + 1][0]) {\n $map[$row][$col][3] = 0;\n $map[$row][$col + 1][1] = 0;\n $map[$row + 1][$col][9] = 0;\n $map[$row + 1][$col + 1][7] = 0;\n }\n }\n return $map;\n }", "public function testfindCheapestRoute()\n {\n $travelRoute = new TravelRoute();\n\n $this->assertEquals([\n 'route' => 'GRU,BRC,SCL',\n 'price' => 15\n ], $travelRoute->findCheapestRoute('GRU', 'SCL'));\n }", "function consolidatePath2($path, $type) {\n $cpath = array();\n /*\n What are the conditions that determine a transfer?\n 1. If the connection type is different (express -> local)\n 2. If the train in the next segment is different and the original one is not available\n 3. if the connection type is transfer\n */\n // debugging\n $debug = true;\n $path_array = $path->path;\n $count = count($path_array);\n // this is a direction path and there is only one or two paths.\n // that means it either goes from loc->station->loc or just loc->loc\n if ($type == \"dir\" && $count <= 2) {\n return \"walk\";\n }\n //set up the first segment\n $segment = $path_array[0];\n if ($type == \"s2s\") {\n $i = 1; \n }\n else {\n $cpath[] = $segment;\n $segment = $path_array[1];\n $i = 2;\n }\n $marker1 = $segment->m1;\n $current_lines = $segment->m1->getOverlapLines($segment->m2);\n $connection = $segment->connection;\n $total_time = $segment->t;\n $segment2 = $path_array[$i+1];\n // loop through the path, starting at the next segment.\n for (; $i < $count; $i++) {\n // grab the segment\n $segment2 = $path_array[$i];\n \n if ($debug) {\n echo \"@\" . $segment2->m1->name . \"<br/>\";\n echo \"lines = \";\n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n \n if ($connection == \"transfer\") {\n // we know this segment is a transfer, so they will have to get off the train\n echo \"transfer<br/>\";\n \n // end the segment\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // add the transfer segment\n // we need to get the transfer lines\n $lines = $segment2->m1->getOverlapLines($segment2->m2);\n $lines = getCorrectLines($lines, $segment2->connection);\n // create new segment\n $new_segment = new Segment($segment2->m1, $segment2->m2, $lines, $segment2->t, $segment2->connection);\n $cpath[] = $new_segment;\n \n // increment if we need to\n if ($i < $count) {\n // increment\n $i++;\n $segment = $path_array[$i];\n $marker1 = $segment->m1;\n $current_lines = $segment->m1->getOverlapLines($segment->m2);\n $connection = $segment->connection;\n $total_time = $segment->t;\n if ($i < $count) {\n // more segments available\n continue;\n }\n // we end here with this segment\n $new_segment = new Segment($segment->m1, $segment->m2, $current_lines, $total_time, $connection);\n $cpath[] = $new_segment;\n return $cpath;\n }\n }\n else if ($connection != $segment2->connection) {\n // the connection types are different, but trains can shift from express to local and vice versa.\n if ($debug) {\n echo \"old conn: \" . $connection . \" | new conn: \" . $segment2->connection . \"<br/>\";\n }\n // do we have the same train available?\n if (sameTrain($current_lines, $segment2)) {\n // it's the same train, so we just update our lines and continue\n $current_lines = updateLines($segment, $current_lines);\n $total_time += $segment2->t;\n $connection = $segment2->connection;\n continue;\n }\n // different trains, so we need to transfer\n \n // end the old segment and add to the path\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"new_segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // reset our variables for the next segment\n $segment = $segment2;\n $marker1 = $segment2->m1;\n $current_lines = $segment2->m1->getOverlapLines($segment2->m2);\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n continue;\n }\n else if (!sameTrain($current_lines, $segment2)) {\n // different trains, so we need to transfer\n if ($debug) {\n echo \"old lines: \";\n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n echo \"new line: \" . $segment2->lines[0]->name . \"<br/>\";\n } \n // end the old segment and add to the path\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"new_segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // reset our variables for the next segment\n $segment = $segment2;\n $marker1 = $segment2->m1;\n $current_lines = $segment2->m1->getOverlapLines($segment2->m2);\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n continue;\n }\n // otherwise, we keep going and merge the segments\n $current_lines = linesIntersect($current_lines, $segment2->m1->getOverlapLines($segment2->m2));\n if ($debug) {\n echo \"# current_lines after intersect: \" . count($current_lines) . \"<br/>\"; \n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n $current_lines = getCorrectLines($current_lines, $connection);\n if ($debug) {\n echo \"# current_lines after correction: \" . count($current_lines) . \"<br/>\"; \n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n } // for\n // add the last segment\n $new_segment = new Segment($marker1, $segment2->m2, $current_lines, $total_time, $connection);\n $cpath[] = $new_segment; \n return $cpath;\n}", "private function findLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif($hole && !$hole->hasMarble)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[0][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i - 2, $j + 1);\n\t\t\t\t\t\t\t$moves[0][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[1][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i + 1, $j - 2);\n\t\t\t\t\t\t\t$moves[1][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[2][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('left', $i - 1, $j + 2);\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[3][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i - 1, $j - 2);\n\t\t\t\t\t\t\t$moves[3][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[4][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[4][] = array('left', $i + 1, $j + 2);\n\t\t\t\t\t\t\t$moves[4][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[5][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[5][] = array('down', $i + 2, $j + 1);\n\t\t\t\t\t\t\t$moves[5][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[6][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[6][] = array('down', $i + 2, $j - 1);\n\t\t\t\t\t\t\t$moves[6][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[7][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[7][] = array('up', $i - 2, $j - 1);\n\t\t\t\t\t\t\t$moves[7][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "public function short_route($routes){\r\n $min_route = NULL;\r\n $min_cost = NULL;\r\n\r\n foreach($routes as $route){\r\n $cost = $this->get_cost_route($route);\r\n if(!isset($min_cost) || $cost < $min_cost){\r\n $min_route = $route;\r\n $min_cost = $cost;\r\n }\r\n }\r\n\r\n return array('route' => $min_route, 'cost' => $min_cost);\r\n\r\n }", "abstract public function getVertexToFrom(Vertex $startVertex);", "private function find_paths_($u, $v, $conditions, $history)\n {\n if ($u == $v) {\n array_push($this->paths, $history);\n return;\n }\n\n // gete route history\n $airport_history = array();\n \n foreach ($history as $flight) {\n array_push($airport_history, $flight->departure_airport_id);\n array_push($airport_history, $flight->arrival_airport_id);\n }\n\n\n // if neighbour is not in the history, recursively call find_paths_ \n foreach($this->get_adjacent_($u) as $neighbour)\n {\n // skip the neighbour if already in history (visited)\n if (in_array($neighbour, $airport_history))\n continue;\n\n // send the request all the available neighbour \n foreach ($this->map[$u][$neighbour] as $id)\n {\n $flight = $this->CI->flights->get($id);\n\n // skip the flight if not meeting the requirement\n if (!$this->check_($id, $conditions))\n continue;\n\n // make a copy of current history\n $updated_history = $history;\n\n // put the flight into the updated_history\n array_push($updated_history, $flight);\n \n // update the requirement for next candidate\n $new_conditions = array(\n 'departure_time' => (Object) array(\n 'what' => 'departure_time',\n 'expr' => '<=',\n 'departure_date' => $conditions['departure_time']->departure_date,\n 'departure_time' => $flight->arrival_time, \n )\n );\n\n // send the message for next node \n $this->find_paths_($neighbour, $v, $new_conditions, $updated_history);\n }\n }\n }", "function GasStation($strArr) {\r\n $totalGasAtStation = 0;\r\n $totalGasToTravel = 0;\r\n $totalNumGasStation = array_shift($strArr);\r\n for ($i = 0; $i < $totalNumGasStation; $i++) {\r\n $gas = explode(':',$strArr[$i]);\r\n $totalGasAtStation = $totalGasAtStation + $gas[0];\r\n $totalGasToTravel = $totalGasToTravel + $gas[1];\r\n }\r\n if ($totalGasAtStation < $totalGasToTravel) {\r\n $strArr = \"impossible\";\r\n }\r\n // iterate through the routes \r\n else {\r\n \r\n $iteration = 0;\r\n $foundloop = false;\r\n while (($foundloop == false) && ($iteration <= $totalNumGasStation)) {\r\n $iteration++;\r\n $gasTank = 0;\r\n $isBrokeDown = false;\r\n $gasStationNum = 0;\r\n for ($gasStationNum; $gasStationNum < $totalNumGasStation; $gasStationNum++) {\r\n \r\n $gas = explode(':',$strArr[$gasStationNum]);\r\n $gasTank = $gasTank + $gas[0] - $gas[1];\r\n if ($gasTank < 0) {\r\n \r\n $isBrokeDown = true;\r\n break;\r\n }\r\n }\r\n \r\n if (($isBrokeDown == FALSE) && ($gasStationNum == 4)) {\r\n $strArr = $iteration;\r\n $foundloop = true;\r\n }\r\n else {\r\n $deltaGasStation = array_shift($strArr);\r\n $strArr[] = $deltaGasStation;\r\n\r\n }\r\n }\r\n }\r\n return $strArr; \r\n\r\n}", "function live_neighbors($key, $type, $cells, $cols)\r\n\t{\r\n\t\t$live_neighbors = 0;\r\n\t\tif ($type !== 'ur' && $type !== 'rs' && $type !== 'br' && $cells[$key+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'bl' && $cells[$key-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'bl' && $type !== 'bs' && $type !== 'br' && $cells[$key+$cols] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ur' && $type !== 'rs' && $type !== 'br' && $type !== 'bl' && $type !== 'bs' && $cells[$key+$cols+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'br' && $type !== 'bl' && $type !== 'bs' && $cells[$key+$cols-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\r\n\t\tif ($type !== 'ul' && $type !== 'us' && $type !== 'ur' && $cells[$key-$cols] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\t\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'us' && $type !== 'bl' && $type !== 'ur' && $cells[$key-$cols-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\r\n\t\tif ($type !== 'ul' && $type !== 'us' && $type !== 'br' && $type !== 'ur' && $type !== 'rs' && $cells[$key-$cols+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\treturn $live_neighbors;\r\n\t}", "private function findLineMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('up', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i + 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i + 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i, $j);\n\t\t\t\t\t\t\t$moves[0][] = array('down', $i + 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('right', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j + 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j + 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('left', $i, $j + 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('down', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i - 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i - 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('top', $i - 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('left', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j - 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j - 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t$moves[3][] = array('left', $i, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i, $j - 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}", "public function executeGabow($graph, $root){\n\n //input string that will be converted to the input file for wmatch\n $input = \"\";\n //initialize total number of edges. Will be used in line 1 of the input file\n $totaledges = 0;\n\n //initialize total number of vertices. Will be used in line 1 of the input file\n $vertices = count($graph);\n\n //create some complementary arrays to convert the position of the cysteines\n //(label) to an index that will be used in the input file for wmatch\n $keys = array_keys($graph);\n sort($keys,SORT_NUMERIC);\n for($i=0;$i<$vertices;$i++){\n $index[$keys[$i]] = $i+1;\n }\n\n //for each vertex, add its edges with respective weightes to the input file\n for($i=0;$i<$vertices;$i++){\n \n //unset variables to avoid it from carrying garbage\n if(isset($matches))unset($matches);\n if(isset($edges))unset($edges);\n if(isset($edgeskeys))unset($edgeskeys);\n\n //given one vertex, find all the possible edges\n $matches = $graph[$keys[$i]];\n for($j=0;$j<count($matches);$j++){\n //indexes are the cysteine positions converted into an integer that\n //will be interpreted by the wmatch executable and values are the\n //edge weights\n $edges[$index[$matches[$j]]] += 1;\n }\n\n //add to total edges\n $totaledges += count($edges);\n\n //mount vertex info to populate the vertex line in the input file\n $vertex = $index[$keys[$i]];\n $label = $keys[$i];\n $edgeskeys = array_keys($edges);\n //#edges label 0 0 \\n\\n\n $input .= count($edgeskeys).\" \".$label.\" 0 0 \\n\\n\";\n\n //for each vertex, calculate the possible edges with its respective weight\n //hold edge weights on array values\n ksort($edges,SORT_NUMERIC);\n //hold edge indexes on array values\n sort($edgeskeys,SORT_NUMERIC);\n for($k=0;$k<count($edges);$k++){\n //#index #weight \\n\\n\n $input .= $edgeskeys[$k].\" \".$edges[$edgeskeys[$k]].\" \\n\\n\";\n }\n }\n\n //calculate final number of edges. divide by 2 because are edges are duplicated\n //i.e. 142-292 and 292-142 are the same S-S bond\n //totaledges needs to be a natural number\n if($totaledges%2 > 0){\n $totaledges--;\n }\n $totaledges = $totaledges/2;\n //first line of input file: carries total number of vertices and edges\n //#vertices #edges U \\n\\n\n $input = $vertices.\" \".$totaledges.\" U \\n\\n\".$input.\"\\n\";\n\n //prepare file paths\n $path = $root.\"/gabow/\".$vertices.$totaledges.\"U\";\n\n if($_ENV['OS'] == \"Windows_NT\"){\n $path = str_replace(\"/\", \"\\\\\", $path);\n }\n\n $extensionIN = \".in\";\n $extensionOUT = \".out\";\n\n //delete old files if they exist\n if(file_exists($path.$extensionIN)){\n unlink($path.$extensionIN);\n }\n\n //save input string to input file\n file_put_contents($path.$extensionIN, $input);\n\n //write command to be executed to run wmatch executable\n $command = \"\";\n if($_ENV['OS'] == \"Windows_NT\"){\n $command = $root.\"/gabow/wmatch.exe \".\n $path.$extensionIN.\" > \".$path.$extensionOUT;\n $command = str_replace(\"/\", \"\\\\\", $command);\n }\n else{\n $command = $root.\"/gabow/./wmatch \".\n $path.$extensionIN.\" > \".$path.$extensionOUT;\n }\n \n //execute command\n exec($command);\n\n //delete files created\n if(file_exists($path.$extensionIN)){\n unlink($path.$extensionIN);\n }\n if(file_exists($path.$extensionOUT)){\n //read output file to output string\n $output = file_get_contents($path.$extensionOUT);\n unlink($path.$extensionOUT);\n }\n\n /*OLD CODE\n //extract maximum weighted match results\n $results = array();\n if($_ENV['OS'] == \"Windows_NT\"){\n $output = str_replace(\"\\r\\n\", \" \", $output);\n $results = explode(\" \", trim($output));\n }\n else{\n for($l=0;$l<strlen($output);$l++){\n $value = substr($output, $l, 1);\n if(strlen(trim($value)) > 0){\n $results[] = $value;\n }\n }\n }\n */\n \n //extract results\n $output = trim($output);\n $output = str_replace(\"\\r\\n\", \" \", $output);\n $output = str_replace(\"\\t\", \" \", $output);\n $output = str_replace(\"\\n\", \" \", $output);\n $output = str_replace(\"\\r\", \" \", $output);\n $results = explode(\" \", $output);\n\n //create an array with all chosen V-E-V (vertex-edge-vertex) combinations\n for($i=0;$i<count($results);$i+=2){\n //dilsufide bond: i.e. 142-292\n $bond = $keys[$results[$i]-1].\"-\".$keys[$results[$i+1]-1];\n //reverse disulfide bond to avoid creating duplicated disulfide bonds\n $reversebond = $keys[$results[$i+1]-1].\"-\".$keys[$results[$i]-1];\n $exist = false;\n //if disulfide bond already exists, skip without creating a duplicate\n if(count($bonds) > 0){\n $exist = array_search($reversebond, $bonds);\n }\n //if disulfide bond is new, add to S-S bonds array\n if($exist === false && $results[$i] != \"0\" && $results[$i+1] != \"0\"){\n $bonds[] = $keys[$results[$i]-1].\"-\".$keys[$results[$i+1]-1];\n }\n }\n\n //return final array with selected disulfide bonds according to Gabow's\n //algorithm to solve maximum weighted matching problems\n return $bonds;\n }", "function calculate_sighting_sref($bearing, $reticuleFrom, $reticules, $platformHeight, $distance, $enteredSref, $args) {\n //Convert the 50N 50E style latitude/longitude spatial reference format into pure numbers so we\n //can manipulate it mathematically.\n $convertedSref = lat_long_conversion_to_numbers($enteredSref);\n $radians = $bearing*pi()/180;\n if (empty($platformHeight) || empty($reticules) || $reticuleFrom === 'Land') {\n // use estimated distance if we don't have reticules, or reticules taken from land (currently don't have a distance to land)\n // we assume that if no reticulesFrom then from hoizon.\n $radialDistance = empty($distance) ? 0 : $distance; // assumed in metres\n } else {\n //Calculations done assuming Platform Height is in km, however Platform Height is stored in metres, so divide by 1000.\n $platformHeight=$platformHeight/1000;\n //Mathematical calculations provided by client, so this is merely a straight conversion into php\n $angleRetDeclination = 0.2865*6.28/360;\n $angleBetween2Radii = acos(6370/(6370+$platformHeight));\n $simplifiedAngle = $angleBetween2Radii+$reticules*$angleRetDeclination;\n $radialDistance = (cos($simplifiedAngle )*(6370*sin($simplifiedAngle)-sqrt(pow(6370,2)*(pow(sin($simplifiedAngle),2))-2*6370*$platformHeight*pow(cos($simplifiedAngle),2))))*1000;\n }\n $dLat = $radialDistance*(cos($radians));\n $angleLat = 2*((($dLat/1000)/(6370*2)));\n $dLong = $radialDistance*(sin($radians));\n $angleLong = 2*((($dLong/1000)/(6370*2)));\n $sightingSref['lat'] = $angleLat * (180/pi()) + $convertedSref['lat'];\n $sightingSref['long'] = $angleLong * (180/pi()) + $convertedSref['long'];\n //Convert back into 50N 50E style latitude/longitude spatial reference format\n return lat_long_conversion_to_NE($sightingSref);\n }", "function getLabel($data, $neighbors)\n{\n $results = array();\n $neighbors = array_keys($neighbors);\n print_r($neighbors);\n foreach ($neighbors as $neighbor) {\n $results[] = $data[$neighbor][2];\n }\n $values = array_count_values($results);\n $values = array_flip($values);\n ksort($values);\n return array_pop($values);\n}", "public function nextPossibleMove()\n {\n $x = $this->snake['pos']['x'];\n $y = $this->snake['pos']['y'];\n \n $moves = [\n 'up' => [$x, $y - 1],\n 'right' => [$x + 1, $y],\n 'down' => [$x, $y + 1],\n 'left' => [$x - 1, $y],\n ];\n\n $moves = $this->removeDeadMoves($moves);\n\n if (empty($moves)) {\n return $moves;\n }\n\n $moves = $this->calcThresholds($moves);\n\n if (!empty($safe = array_diff_key($moves, $this->getDangerMoves($moves)))) {\n $danger = array_intersect_key($moves, $this->getDangerMoves($moves));\n\n $threshold = array_first($safe)[2];\n\n if ($threshold > 7 && !empty($danger)) {\n return $danger;\n }\n\n if ($threshold > 5) {\n if (!empty($tail = $this->getTailMoves($safe))) {\n return $tail;\n }\n }\n\n if ($threshold > 5 && $this->snake['health'] < 95) {\n $result = $this->getFoodMoves($safe);\n\n if (!empty($result)) {\n return $result;\n }\n }\n\n return $safe;\n }\n\n if (!empty($head = $this->getHeadMoves($moves))) {\n return $head;\n }\n\n if (!empty($tail = $this->getTailMoves($moves))) {\n return $tail;\n }\n\n return $moves;\n }", "private function getValidRoutes($position, $visited = [], $path = []) {\n if ($position->value == 'X') {\n $this->routes[] = array_merge($path, [ $position ]);\n return;\n }\n\n $open = $this->findOpenSquares($position, $visited);\n foreach ($open as $key => $space) {\n $visited[] = $space;\n $this->getValidRoutes($space, $visited, array_merge($path, [ $position ]));\n }\n }", "private function findBigLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\t// Top\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[3][-1]->hasMarble &&\n\t\t\t\t$this->board[3][0]->hasMarble &&\n\t\t\t\t$this->board[3][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Left\n\t\t\t\tif(\t$this->board[2][-1]->hasMarble &&\n\t\t\t\t\t$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[0][-1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[1][-2]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -2);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('left', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t$moves[0][] = array('left', 3, 1);\n\t\t\t\t\t$moves[0][] = array('up', 0, -1);\n\t\t\t\t\t$moves[0][] = array('down', 3, -1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][-2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('right', 1, -2);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[0][] = array('left', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Right\n\t\t\t\tif(\t$this->board[2][1]->hasMarble &&\n\t\t\t\t\t$this->board[1][1]->hasMarble &&\n\t\t\t\t\t$this->board[0][1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[1][2]->hasMarble && $this->board[1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 2);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('right', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t$moves[1][] = array('right', 3, -1);\n\t\t\t\t\t$moves[1][] = array('up', 0, 1);\n\t\t\t\t\t$moves[1][] = array('down', 3, 1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[1][2]->hasMarble && !$this->board[1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('left', 1, 2);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[1][] = array('right', 1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Down\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[-3][-1]->hasMarble &&\n\t\t\t\t$this->board[-3][0]->hasMarble &&\n\t\t\t\t$this->board[-3][1]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Left\n\t\t\t\tif(\t$this->board[-2][-1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[0][-1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-1][-2]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[2][] = array('right', -1, -2);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[2][] = array('left', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[2][] = array('up', -3, -1);\n\t\t\t\t\t$moves[2][] = array('left', -3, 1);\n\t\t\t\t\t$moves[2][] = array('down', 0, -1);\n\t\t\t\t\t$moves[2][] = array('up', -3, -1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][-2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[2][] = array('right', -1, -2);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[2][] = array('left', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Right\n\t\t\t\tif(\t$this->board[-2][1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t$this->board[0][1]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-1][2]->hasMarble && $this->board[-1][0]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[3][] = array('left', -1, 2);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[3][] = array('right', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[3][] = array('up', -3, 1);\n\t\t\t\t\t$moves[3][] = array('right', -3, -1);\n\t\t\t\t\t$moves[3][] = array('down', 0, 1);\n\t\t\t\t\t$moves[3][] = array('up', -3, 1);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-1][2]->hasMarble && !$this->board[-1][0]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[3][] = array('left', -1, 2);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[3][] = array('right', -1, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Left\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][-3]->hasMarble &&\n\t\t\t\t$this->board[0][-3]->hasMarble &&\n\t\t\t\t$this->board[-1][-3]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Up\n\t\t\t\tif(\t$this->board[1][-2]->hasMarble &&\n\t\t\t\t\t$this->board[1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[2][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('down', 2, -1);\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$moves[4][] = array('up', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[4][] = array('right', 1, -3);\n\t\t\t\t\t$moves[4][] = array('up', -1, -3);\n\t\t\t\t\t$moves[4][] = array('left', 1, 0);\n\t\t\t\t\t$moves[4][] = array('right', 1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[4][] = array('down', 2, -1);\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$moves[4][] = array('up', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Down\n\t\t\t\tif(\t$this->board[-1][-2]->hasMarble &&\n\t\t\t\t\t$this->board[-1][-1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-2][-1]->hasMarble && $this->board[0][-1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('up', -2, -1);\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$moves[5][] = array('down', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[5][] = array('right', -1, -3);\n\t\t\t\t\t$moves[5][] = array('down', 1, -3);\n\t\t\t\t\t$moves[5][] = array('left', 1, 0);\n\t\t\t\t\t$moves[5][] = array('right', -1, -3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][-1]->hasMarble && !$this->board[0][-1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[5][] = array('up', 2, -1);\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$moves[5][] = array('down', 0, -1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\t// Right\n\t\ttry\n\t\t{\n\t\t\tif(\n\t\t\t\t$this->board[1][3]->hasMarble &&\n\t\t\t\t$this->board[0][3]->hasMarble &&\n\t\t\t\t$this->board[-1][3]->hasMarble\n\t\t\t)\n\t\t\t{\n\t\t\t\t// Up\n\t\t\t\tif(\t$this->board[1][2]->hasMarble &&\n\t\t\t\t\t$this->board[1][1]->hasMarble &&\n\t\t\t\t\t$this->board[1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[2][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('down', 2, 1);\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$moves[6][] = array('up', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[6][] = array('left', 1, 3);\n\t\t\t\t\t$moves[6][] = array('up', -1, 3);\n\t\t\t\t\t$moves[6][] = array('right', 1, 0);\n\t\t\t\t\t$moves[6][] = array('left', 1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[6][] = array('down', 2, 1);\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$moves[6][] = array('up', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Down\n\t\t\t\tif(\t$this->board[-1][2]->hasMarble &&\n\t\t\t\t\t$this->board[-1][1]->hasMarble &&\n\t\t\t\t\t$this->board[-1][0]->hasMarble &&\n\t\t\t\t\t(\n\t\t\t\t\t\t($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble) ||\n\t\t\t\t\t\t(!$this->board[-2][1]->hasMarble && $this->board[0][1]->hasMarble)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, 1);\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$moves[7][] = array('down', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$moves[7][] = array('left', -1, 3);\n\t\t\t\t\t$moves[7][] = array('down', 1, 3);\n\t\t\t\t\t$moves[7][] = array('right', -1, 0);\n\t\t\t\t\t$moves[7][] = array('left', -1, 3);\n\t\t\t\t\t\n\t\t\t\t\tif($this->board[-2][1]->hasMarble && !$this->board[0][1]->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t$moves[7][] = array('up', -2, 1);\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$moves[7][] = array('down', 0, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {};\n\t\t\n\t\t\n\t\treturn $moves;\n\t}", "function sortTruebonds($truebonds){\n /*\n unset($truebonds);\n $truebonds = array();\n $truebonds['99-339']['cys1'] = \"99\";\n $truebonds['99-339']['cys2'] = \"339\";\n $truebonds['99-339']['score'] = 232;\n $truebonds['200-392']['cys1'] = \"200\";\n $truebonds['200-392']['cys2'] = \"392\";\n $truebonds['200-392']['score'] = 184;\n $truebonds['392-537']['cys1'] = \"392\";\n $truebonds['392-537']['cys2'] = \"537\";\n $truebonds['392-537']['score'] = 237;\n $truebonds['223-537']['cys1'] = \"223\";\n $truebonds['223-537']['cys2'] = \"537\";\n $truebonds['223-537']['score'] = 167;\n $truebonds['339-383']['cys1'] = \"339\";\n $truebonds['339-383']['cys2'] = \"383\";\n $truebonds['339-383']['score'] = 215;\n $truebonds['312-510']['cys1'] = \"312\";\n $truebonds['312-510']['cys2'] = \"510\";\n $truebonds['312-510']['score'] = 238;\n $truebonds['471-590']['cys1'] = \"471\";\n $truebonds['471-590']['cys2'] = \"590\";\n $truebonds['471-590']['score'] = 218;\n */\n\n $results = array();\n $graphbonds = array();\n $readybonds = array();\n\n $keys = array_keys($truebonds);\n for($i=0;$i<count($keys);$i++){\n $ready = true;\n $bond = $keys[$i];\n $cys1 = $truebonds[$bond]['cys1'];\n $cys2 = $truebonds[$bond]['cys2'];\n for($j=0;$j<count($keys);$j++){\n if($i!=$j){\n $cys3 = $truebonds[$keys[$j]]['cys1'];\n $cys4 = $truebonds[$keys[$j]]['cys2'];\n if($cys1 == $cys3 || $cys1 == $cys4 || $cys2 == $cys3 || $cys2 == $cys4){\n $graphbonds[$keys[$i]] = $truebonds[$keys[$i]];\n $ready = false;\n break;\n }\n }\n }\n if($ready){\n $readybonds[] = $bond;\n }\n }\n\n $results['graphbonds'] = $graphbonds;\n $results['readybonds'] = $readybonds;\n\n return $results;\n }", "function printNeighbors(){\n\t\tforeach($vertexList as $v){\n\t\t\tif(count($v->neighbors) > 0){\n\t\t\t\tprint($word . \": \");\n\t\t\t\tforeach($v->neighbors as $vertex){\n\t\t\t\t\tprint($vertex->word.\", \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function outgoingPaths()\n {\n return $this->hasMany(Path::class,'first_node_id','id');\n }", "function find_gaps()\n\t{\n\t\t// Get all lfts and rgts and sort them in a list\n\t\tee()->db->select('lft, rgt');\n\t\tee()->db->order_by('lft','asc');\n\t\t$table = ee()->db->get( $this->tree_table );\n\n\t\t$nums = array();\n\n\t\tforeach($table->result() as $row)\n\t\t{\n\t\t\t$nums[] = $row->{'lft'};\n\t\t\t$nums[] = $row->{'rgt'};\n\t\t}\n\t\t\n\t\tsort($nums);\n\t\t\n\t\t// Init vars for looping\n\t\t$old = array();\n\t\t$current = 1;\n\t\t$foundgap = 0;\n\t\t$gaps = array();\n\t\t$current = 1;\n\t\t$i = 0;\n\t\t$max = max($nums);\n\t\twhile($max >= $current)\n\t\t{\n\t\t\t$val = $nums[$i];\n\t\t\tif($val == $current)\n\t\t\t{\n\t\t\t\t$old[] = $val;\n\t\t\t\t$foundgap = 0;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// have gap or duplicate\n\t\t\t\tif($val > $current)\n\t\t\t\t{\n\t\t\t\t\tif(!$foundgap)$gaps[] = array('start'=>$current,'size'=>1);\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$gaps[count($gaps) - 1]['size']++;\n\t\t\t\t\t}\n\t\t\t\t\t$foundgap = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$current++;\n\t\t}\n\t\treturn count($gaps) > 0 ? $gaps : false;\n\t}", "private function searchNearest(\n NodeInterface $node,\n int $dimension,\n array $upperBound,\n array $lowerBound,\n array $orthogonalDistances,\n float $possibleDistance\n ) {\n $item = $node->getItem();\n $distance = $this->calculateDistance($item, $this->point);\n $this->addToQueue($item, $distance);\n\n $rightLowerBound = $lowerBound;\n $leftUpperBound = $upperBound;\n $rightLowerBound[$dimension] = $item->getNthDimension($dimension);\n $leftUpperBound[$dimension] = $item->getNthDimension($dimension);\n\n $rightNode = $node->getRight();\n $leftNode = $node->getLeft();\n\n if ($rightNode && $leftNode) {\n $this->smartBranchesSearch(\n $rightNode,\n $leftNode,\n $dimension,\n $upperBound,\n $rightLowerBound,\n $leftUpperBound,\n $lowerBound,\n $orthogonalDistances,\n $possibleDistance\n );\n return;\n }\n\n if ($rightNode) {\n $this->branchSearch(\n $rightNode,\n $dimension,\n $upperBound,\n $rightLowerBound,\n $orthogonalDistances,\n $possibleDistance\n );\n }\n\n if ($leftNode) {\n $this->branchSearch(\n $leftNode,\n $dimension,\n $leftUpperBound,\n $lowerBound,\n $orthogonalDistances,\n $possibleDistance\n );\n }\n }", "function bfs(Node $origin, $max, $visitFlag) {\n \n $list = [];\n $origin->_visited = $visitFlag;\n $origin->_depth = 0;\n $list[] = $origin;\n $maxDepth = -1;\n \n while (!empty($list)) {\n $node = array_pop($list);\n $n = $node->_first;\n //error_log(\"key: \" . $visitFlag . \", node: \" . $node->_id . \", depth: \" . $node->_depth);\n while ($n) {\n if ($n->_visited != $visitFlag) {\n $n->_visited = $visitFlag;\n $n->_depth = $node->_depth + 1;\n if ($max != -1 && $n->_depth >= $max) {\n return $max;\n }\n $list[] = $n;\n if ($n->_depth > $maxDepth || $maxDepth == -1) {\n $maxDepth = $n->_depth;\n }\n }\n $n = $n->_next;\n }\n $n = $node->_parent;\n if ($n && $n->_visited != $visitFlag) {\n $n->_visited = $visitFlag;\n $n->_depth = $node->_depth + 1;\n $list[] = $n;\n if ($n->_depth > $maxDepth || $maxDepth == -1) {\n $maxDepth = $n->_depth;\n }\n }\n }\n \n return $maxDepth;\n}", "function topological_sort($nodeids, $edges) \n {\n\n // initialize variables\n $L = $S = $nodes = array(); \n\n // remove duplicate nodes\n $nodeids = array_unique($nodeids); \t\n\n // remove duplicate edges\n $hashes = array();\n foreach($edges as $k=>$e) {\n $hash = md5(serialize($e));\n if (in_array($hash, $hashes)) { unset($edges[$k]); }\n else { $hashes[] = $hash; }; \n }\n\n // Build a lookup table of each node's edges\n foreach($nodeids as $id) {\n $nodes[$id] = array('in'=>array(), 'out'=>array());\n foreach($edges as $e) {\n if ($id==$e[0]) { $nodes[$id]['out'][]=$e[1]; }\n if ($id==$e[1]) { $nodes[$id]['in'][]=$e[0]; }\n }\n }\n\n // While we have nodes left, we pick a node with no inbound edges, \n // remove it and its edges from the graph, and add it to the end \n // of the sorted list.\n foreach ($nodes as $id=>$n) { if (empty($n['in'])) $S[]=$id; }\n while (!empty($S)) {\n $L[] = $id = array_shift($S);\n foreach($nodes[$id]['out'] as $m) {\n $nodes[$m]['in'] = array_diff($nodes[$m]['in'], array($id));\n if (empty($nodes[$m]['in'])) { $S[] = $m; }\n }\n $nodes[$id]['out'] = array();\n }\n\n // Check if we have any edges left unprocessed\n foreach($nodes as $n) {\n if (!empty($n['in']) or !empty($n['out'])) {\n return null; // not sortable as graph is cyclic\n }\n }\n return $L;\n }", "public function findRoutes() {\n $positions = $this->starts();\n\n foreach ($positions as $index => $position) {\n $this->getValidRoutes($position);\n }\n\n return $this->routes;\n }", "function kneser( $graph, $n, $k )\n{\n\tif( $n <= 0 ) die( \"n must be positive\" );\n\tif( ! ($k > 0 && $k <= $n ) ) die( \"k must be positive and less than n\" );\n\t\n\t$s = subsets( $n, $k );\n\t\n\tfor( $i = 0; $i < count($s); $i++ )\n\t{\t\n\t\t$set = $s[$i];\n\t\tfor( $j = $i + 1; $j < count($s); $j++ )\n\t\t{\n\t\t\t$can = $s[$j];\n\t\t\tif( disjoint( $set, $can ) )\n\t\t\t\t$graph->connect( implode(\"\",$set), implode(\"\",$can) );\n\t\t}\n\t}\n}", "public function getNrJumps($startSystemID, $destinationSystemID, $minSecurity=null)\n {\n \\AppRoot::debug(\"getNrJumps(\".$startSystemID.\",\".$destinationSystemID.\")\");\n\n if ($startSystemID == $destinationSystemID)\n return 0;\n\n // Eerst cache bekijken\n $query = array();\n if ($minSecurity == null)\n $query[] = \" minsecurity is null\";\n else\n $query[] = \" minsecurity = \".round($minSecurity*100);\n\n if ($result = \\MySQL::getDB()->getRow(\"\tSELECT * FROM mapnrofjumps\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\t((startid = ? AND destid = ?)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tOR\t(destid = ? AND startid = ?))\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND \t\".implode(\" AND \",$query),\n array(\t$startSystemID, $destinationSystemID,\n $startSystemID, $destinationSystemID)))\n {\n // Ophalen uit database cache.\n return $result[\"nrjumps\"];\n }\n else\n {\n // Start rekenen!\n $open = array();\n $closed = array();\n\n $sid = $startSystemID;\n $did = $destinationSystemID;\n\n $open[$sid]['weight'] = 0;\n $open[$sid]['parent'] = NULL;\n $open[$sid]['sid'] = $sid;\n\n do\n {\n foreach ($open as $value)\n {\n $sid = $value['sid'];\n $weight = $value['weight'];\n $parent = $value['parent'];\n\n $closed[$sid]['weight'] = $weight;\n $closed[$sid]['parent'] = $parent;\n $closed[$sid]['sid'] = $sid;\n\n if ($sid == $did)\n {\n // We hebben em!!! Opslaan in cache\n \\MySQL::getDB()->updateinsert(\"mapnrofjumps\",\n [\"startid\" => $startSystemID,\n \"destid\" => $destinationSystemID,\n \"nrjumps\" => $weight,\n \"minsecurity\" => round($minSecurity*100)],\n [\"startid\" => $startSystemID,\n \"destid\" => $destinationSystemID]\n );\n return $weight;\n }\n else\n {\n if ($results = \\MySQL::getDB()->getRows(\"select tosolarsystemid\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom \".\\eve\\Module::eveDB().\".mapsolarsystemjumps\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere fromsolarsystemid = ?\"\n , array($sid)))\n {\n foreach ($results as $data)\n {\n if ($minSecurity != null) {\n $system = new \\eve\\model\\SolarSystem($data[\"tosolarsystemid\"]);\n if ($system->security < $minSecurity)\n continue;\n }\n\n $nsid = $data[\"tosolarsystemid\"];\n $nweight = $weight + 1;\n $nparent = $sid;\n\n if (!isset($closed[$nsid]['weight']) || ($closed[$nsid]['weight'] >= $nweight))\n {\n $open[$nsid]['weight'] = $nweight;\n $open[$nsid]['parent'] = $sid;\n $open[$nsid]['sid'] = $nsid;\n }\n }\n }\n unset($open[$sid]);\n }\n }\n }\n while (count($open) > 0);\n }\n\n return null;\n }", "function getRoute($con, $start_id, $end_id, $cost){\t\n\n\t\t$arrayData = array(); \t\t\t\t// Store geometric results from query in arrays\t\t\n\t\t$t1 = array();\n\t\t$t2 = array();\n\t\t$t3 = array();\n\t\t$t4 = array();\n\t\t$t5 = array();\n\t\t$t6 = array();\t\n\t\t\t\n\t\t$sql_routing = \"SELECT ST_AsGeoJSON(geom),\n\t\t\t\t\t\t\t\tt1, t2, t3, t4, t5, t6\n\t\t\t\t\t\t FROM dublin_traffic\n\t\t\t\t\t\t\t\tJOIN\n\t\t\t\t\t\t\t\t (SELECT * FROM shortest_path('\n\t\t\t\t\t\t\t\t\t SELECT id AS id, \n\t\t\t\t\t\t\t\t\t\t source::int4 AS source, \n\t\t\t\t\t\t\t\t\t\t target::int4 AS target, \n\t\t\t\t\t\t\t\t\t\t $cost::float8 AS cost\n\t\t\t\t\t\t\t\t\t FROM dublin_traffic',\n\t\t\t\t\t\t\t\t $start_id,\n\t\t\t\t\t\t\t\t $end_id,\n\t\t\t\t\t\t\t\t false,\n\t\t\t\t\t\t\t\t false)) AS route\n\t\t\t\t\t\t\tON\n\t\t\t\t\t\t dublin_traffic.id = route.edge_id;\";\n\n\t\t$query = pg_query($con, $sql_routing);\t\t// Run query\t\n\t\t$route = array(); \t\t\t\t\t\t\t// Store results in array\n\t\twhile($r = pg_fetch_row($query) ) {\t\t\t// Parse results\t\t\t\n\t\t\t\t$route[] = $r[0];\t\t\t\n\t\t\t\t$t1[] = $r[1];\t\t\t\n\t\t\t\t$t2[] = $r[2];\t\t\n\t\t\t\t$t3[] = $r[3];\t\t\n\t\t\t\t$t4[] = $r[4];\t\t\n\t\t\t\t$t5[] = $r[5];\t\t\n\t\t}\t\t\n\n\t\t/* function to calculate average */\n\t\tfunction avgT($a){\n\t\t\treturn array_sum($a) / count($a);\t\n\t\t}\n\n\t$avgTraffic = array(avgT($t1), avgT($t2), avgT($t3), avgT($t4), avgT($t5));\n\t\t \t\n\t\t\t\t\n\t\treturn \tarray(\t'start_id' => $start_id, \n\t\t\t\t\t\t'end_id' => $end_id,\n\t\t\t\t\t\t't1' => $t1,\n\t\t\t\t\t\t't2' => $t2,\n\t\t\t\t\t\t't3' => $t3,\n\t\t\t\t\t\t't4' => $t4,\n\t\t\t\t\t\t't5' => $t5,\t\n\t\t\t\t\t\t'avg' => $avgTraffic,\t\t\t\t\t\t\n\t\t\t\t\t\t'roads' => $route\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t \n\t}", "public function calculateRoute($startLongitude, $startLatitude, $tripDistance, $breweriesData)\n {\n if (!$this->validateInputFields($startLongitude, $startLatitude, $tripDistance, $breweriesData)) {\n return [];\n }\n $currentLong = $startLongitude;\n $currentLat = $startLatitude;\n $usedIndexes = [];//contains indexes of visited breweries\n $distanceLeft = $tripDistance;//setting up starting data\n $i = 0;//index for usedIndexes array\n while ($this->findClosestPointService->\n findClosestPoint($currentLong, $currentLat, $usedIndexes, $distanceLeft, $breweriesData) != null) {\n //while closest point exists and you can go back home after visiting it\n $closestData = $this->findClosestPointService->findClosestPoint(//finds closest point\n $currentLong,\n $currentLat,\n $usedIndexes,\n $distanceLeft,\n $breweriesData\n );\n\n if (in_array($closestData['closestBreweryIndex'], $usedIndexes)) {\n return [\n 'usedIndexes' => $usedIndexes,\n 'distanceLeft' => $distanceLeft,\n 'breweriesData' => $breweriesData\n ];\n }\n $usedIndexes[$i] = $closestData['closestBreweryIndex'];//inserts index of found point to visited indexes\n $distanceLeft = $distanceLeft - $closestData['closestDistance'];//subtracts trip distance\n //setting up values for next iteration\n\n $breweriesData[$closestData['closestBreweryIndex']]['distance'] = $closestData['closestDistance'];\n\n $currentLat = $breweriesData[$closestData['closestBreweryIndex']]['latitude'];\n $currentLong = $breweriesData[$closestData['closestBreweryIndex']]['longitude'];\n $i++;\n }\n return ['usedIndexes' => $usedIndexes, 'distanceLeft' => $distanceLeft, 'breweriesData' => $breweriesData];\n }", "public function findIndexNearDistance($targetDistance)\n {\n $left = 0;\n $right = count($this->elements) - 1;\n\n if ($left == $right) {\n return $left;\n }\n\n // if the distance is zero, there's no need to search (and it doesn't work anyway)\n // if it's a point before the start of the line, then just return the start of the line\n // Weathermap should *never* ask for this, anyway, either\n if ($targetDistance <= 0) {\n return $left;\n }\n\n // if it's a point past the end of the line, then just return the end of the line\n // Weathermap should *never* ask for this, anyway\n if ($this->elements[$right]->distance < $targetDistance) {\n return $right;\n }\n\n // if somehow we have a 0-length curve, then don't try and search, just give up\n // in a somewhat predictable manner\n if ($this->elements[$left]->distance === $this->elements[$right]->distance) {\n return $left;\n }\n\n while ($left <= $right) {\n $mid = (int) floor(($left + $right) / 2);\n\n if (($this->elements[$mid]->distance <= $targetDistance) && ($this->elements[$mid + 1]->distance > $targetDistance)) {\n return $mid;\n }\n\n if ($targetDistance <= $this->elements[$mid]->distance) {\n $right = $mid - 1;\n } else {\n $left = $mid + 1;\n }\n }\n\n throw new WeathermapInternalFail(\"Howie's crappy binary search is wrong after all.\\n\");\n }", "function setInfinity($start, $graph)\n{\n\t$nodesArray = [];\n\n\tfor ($i=0; $i < count($graph); $i++) { \n\t\t\n\t\tif ($i == $start) {\n\t\t\tcontinue;\n\t\t}\n\t\t$nodesArray[$i]['node'] = $i;\n\t\t$nodesArray[$i]['score'] = 100000;\n\t\t$nodesArray[$i]['route'] = '';\n\t\t\n\t}\n\n\treturn $nodesArray;\n}", "private function getStartLocation()\n {\n for ($counter = 0; $counter < count($this->boardingCards); $counter++) {\n\n $from = $this->boardingCards[$counter]->getFrom();\n /*\n * The start location is a place we depart from but never arrived\n */\n if (!array_key_exists($from, $this->toIndex)) {\n return $from;\n }\n }\n return null;\n }", "function get_first_gap()\n\t{\n\t\t$ret = $this->find_gaps();\n\t\treturn $ret === false ? false : $ret[0];\n\t}", "public function analyze(array $messages) {\n\t\t$starttime = $messages[0]->getTimestamp();\n\t\t$moteid2address = $this->_collectMoteAddresses($messages);\n\t\t$address2moteid = array_flip($moteid2address);\n\t\t$neighborhood = $this->_collectNeighborhood($messages, $address2moteid);\n\t\t$ignoredlinks = $this->_collectIgnoredLinks($messages, $address2moteid);\n\t\t\n\t\t// init graph with mote vertices\n\t\t$initgraph = new Graph();\n\t\tforeach($address2moteid as $moteid) {\n\t\t\t$initgraph->createVertex($moteid);\n\t\t}\n\t\t\n\t\t$graphAtMinute = [];\n\t\tforeach($neighborhood as $minute => $motes) {\n\t\t\t$graphAtMinute[$minute] = $nowgraph = $initgraph->createGraphClone();\n\t\t\t\n\t\t\tforeach($motes as $moteid => $moteNeighborhoods) {\n\t\t\t\tforeach($moteNeighborhoods as $moteNeighborhood) {\n\t\t\t\t\t//\n\t\t\t\t\t// edge from node2 to node1 (because 1 received from 2)\n\t\t\t\t\t//\n\t\t\t\t\t\n\t\t\t\t\tif($moteNeighborhood[\"node1\"] != $moteid)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif(in_array($moteNeighborhood[\"node2\"] , $ignoredlinks[$minute][$moteNeighborhood[\"node1\"]]))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\t$node1 = $nowgraph->getVertex($moteNeighborhood[\"node1\"]);\n\t\t\t\t\t$node2 = $nowgraph->getVertex($moteNeighborhood[\"node2\"]);\n\t\t\t\t\tif(!$node2->hasEdgeFrom($node1)) {\n\t\t\t\t\t\t$edge = $node2->createEdgeTo($node1);\n\t\t\t\t\t\t$edge->setAttribute(\"weight\", $moteNeighborhood[\"weight\"][\"node2_to_node1\"]);\n\t\t\t\t\t\t$weight=$moteNeighborhood[\"weight\"][\"node2_to_node1\"];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$oldEdge = $node2->getEdgesFrom($node1)->getEdgeFirst();\n\t\t\t\t\t\t$oldEdge->destroy();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$edge = $node1->createEdge($node2);\n\t\t\t\t\t\t$weight=array_sum($moteNeighborhood[\"weight\"]) / 2;\n\t\t\t\t\t\t$edge->setAttribute(\"weight\", array_sum($moteNeighborhood[\"weight\"]) / 2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $graphAtMinute;\n\t}", "public function toLinkedListBFS() {\n $prev = null;\n\n if ($this->root == null) return;\n\n $q = new SplQueue();\n $q->enqueue($this->root);\n\n while (!$q->isEmpty()) {\n $current = $q->dequeue();\n\n if ($current->left != null) $q->enqueue($current->left);\n if ($current->right != null) $q->enqueue($current->right);\n\n $current->left = $prev;\n if (!$q->isEmpty()) $current->right = $q->top();\n $prev = $current;\n $this->tail = $prev;\n }\n }", "function DepthLimitedSearch($node, $goal, $depth, $parent){\n if($depth==0){\n if($node==$goal){\n global $solution;\n $solution++;\n Path($goal);\n return;\n }\n else return;\n }\n else if($depth>0){\n global $graph;\n global $mool;\n global $parent_node;\n $g_length = count($graph[$node]);\n\n for($i=0; $i<$g_length; $i++){\n $val = $graph[$node][$i];\n\n if($val==$mool || $val==$parent)\n continue;\n $parent_node[$val] = $node;\n DepthLimitedSearch($val,$goal,$depth-1,$node);\n }\n } \n }", "function getNodeId($from_lat, $from_lon, $transport){\n // find the closest node_id to ($from_lat, $from_lon) on a way\n global $mysqli;\n $offset = 0.01;\n switch ($transport){\n case \"foot\":\n $sql = \"SELECT id, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_road_nodes\n WHERE lat < $from_lat+$offset AND lat > $from_lat-$offset\n AND lon < $from_lon+$offset AND lon > $from_lon-$offset\n ORDER BY x ASC LIMIT 1\";\n break;\n case \"bicycle\":\n $sql = \"SELECT id, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_road_nodes\n WHERE lat < $from_lat+$offset AND lat > $from_lat-$offset\n AND lon < $from_lon+$offset AND lon > $from_lon-$offset\n ORDER BY x ASC LIMIT 1\";\n break;\n case \"car\":\n $sql = \"SELECT id, (lat-{$from_lat})*(lat-{$from_lat}) + (lon - {$from_lon})*(lon - {$from_lon}) AS x FROM osm_road_nodes\n WHERE lat < $from_lat+$offset AND lat > $from_lat-$offset\n AND lon < $from_lon+$offset AND lon > $from_lon-$offset\n ORDER BY x ASC LIMIT 1\";\n break;\n }\n $arr = array();\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $arr[] = $row;\n }\n return (int) $arr[0]['id'];\n}", "public function getNodeRoutes() {\n \t$localizedModel = $this->meta->getLocalizedModel();\n\n $query = $localizedModel->createQuery(0);\n $query->setDistinct(true);\n $query->setFields('{route}');\n $query->addCondition('{route} IS NOT NULL AND {route} <> %1%', '');\n $nodes = $query->query();\n\n $routes = array();\n foreach ($nodes as $node) {\n $routes[$node->route] = $node->route;\n }\n\n return $routes;\n }", "function get_snapped_point ($lat, $lng)\n{\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/json\",\n 'method' => 'GET' \n )\n );\n \n //ATTENTION :Replace your own api_key\n $api_key=\"key\";\n $url_arr = array(\"https://roads.googleapis.com/v1/nearestRoads?points=$lat,$lng&key=\".$api_key,\n \"https://roads.googleapis.com/v1/snapToRoads?path=$lat,$lng&key=\".$api_key);\n\n $url= $url_arr[array_rand($url_arr)];\n $context = stream_context_create($options);\n\n $result = file_get_contents($url, false, $context);\n $result_arr=json_decode($result,true);\n\n \n return ($result_arr[\"snappedPoints\"][0][\"location\"]);\n}", "function getPathFull($a_endnode_id, $a_startnode_id = 0)\n\t{\n\t\t$pathIds =& $this->getPathId($a_endnode_id, $a_startnode_id);\n\n\t\t// We retrieve the full path in a single query to improve performance\n global $ilDB;\n\n\t\t// Abort if no path ids were found\n\t\tif (count($pathIds) == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t$inClause = 'child IN (';\n\t\tfor ($i=0; $i < count($pathIds); $i++)\n\t\t{\n\t\t\tif ($i > 0) $inClause .= ',';\n\t\t\t$inClause .= $ilDB->quote($pathIds[$i],'integer');\n\t\t}\n\t\t$inClause .= ')';\n\n\t\t$q = 'SELECT * '.\n\t\t\t'FROM '.$this->table_tree.' '.\n $this->buildJoin().' '.\n\t\t\t'WHERE '.$inClause.' '.\n 'AND '.$this->table_tree.'.'.$this->tree_pk.' = '.$this->ilDB->quote($this->tree_id,'integer').' '.\n\t\t\t'ORDER BY depth';\n\t\t$r = $ilDB->query($q);\n\n\t\t$pathFull = array();\n\t\twhile ($row = $r->fetchRow(DB_FETCHMODE_ASSOC))\n\t\t{\n\t\t\t$pathFull[] = $this->fetchNodeData($row);\n\n\t\t\t// Update cache\n\t\t\tif ($this->__isMainTree())\n\t\t\t{\n\t\t\t\t#$GLOBALS['ilLog']->write(__METHOD__.': Storing in tree cache '.$row['child']);\n\t\t\t\t$this->in_tree_cache[$row['child']] = $row['tree'] == 1;\n\t\t\t}\n\t\t}\n\t\treturn $pathFull;\n\t}", "protected function getJcDecauxNearestStation($latitude, $longitude, $city)\n {\n $nearestStation = new BikeStation($this->availableCities[$city[0]['contract_name']]['commercial_name']);\n $nearestDistance = -1;\n $nearestPos = [];\n $currentNearestStation = null;\n\n foreach ($city as $bikePlace) {\n if ($bikePlace['status'] !== 'OPEN' || !($bikePlace['available_bikes'] > 0)) {\n continue;\n }\n\n $currentDistance = $this\n ->distanceCalculator\n ->distance($latitude, $longitude, $bikePlace['position']['lat'], $bikePlace['position']['lng'], 'K')\n ;\n\n if ($currentDistance < $nearestDistance || $nearestDistance === -1) {\n $nearestDistance = $currentDistance;\n $nearestPos = $bikePlace['position'];\n $currentNearestStation = $bikePlace;\n }\n }\n\n $nearestStation->setName($currentNearestStation['name']);\n $nearestStation->setAvailableBikes(intval($currentNearestStation['available_bikes']));\n $nearestStation->setAvailableBikeStands(intval($currentNearestStation['available_bike_stands']));\n $nearestStation->setDistance($nearestDistance);\n $nearestStation->setPosition($nearestPos);\n $nearestStation->setNumber(intval($currentNearestStation['number']));\n $epoch = substr($currentNearestStation['last_update'], 0, -3);\n $nearestStation->setLastUpdate(new DateTime(\"@$epoch\"));\n\n return $nearestStation;\n }", "public function getNodeRoute();", "function getNeighbour($direction){\n\t\t\t\tif(isset($this->neighbours[$direction])){\n\t\t\t\t\treturn $this->neighbours[$direction];\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}", "public function get_up_path($params)\r\n {\r\n $this->_tree->FullBonesMas=array();\r\n\r\n $this->_tree->GetFullBonesUp($params[0], $params[1]);\r\n\r\n if ($this->_tree->FullBonesMas)\r\n {\r\n if (!$params[2])\r\n {\r\n return array_pop($this->_tree->FullBonesMas);\r\n }\r\n else\r\n {\r\n return $this->_tree->FullBonesMas;\r\n }\r\n }\r\n }", "function remove_first_gap()\n\t{\n\t\t$ret = $this->get_first_gap();\n\t\tif($ret !== false)\n\t\t{\n\t\t\tee()->db->query('UPDATE '.$this->tree_table.\n\t\t\t\t' SET lft = lft - '.$ret['size'].\n\t\t\t\t' WHERE lft > '. $ret['start']);\n\n\t\t\tee()->db->query('UPDATE '.$this->tree_table.\n\t\t\t\t' SET rgt = rgt - '.$ret['size'].\n\t\t\t\t' WHERE rgt > '. $ret['start']);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function get_routes($punto1, $punto2, &$routes, &$route = array()){\r\n \r\n $origin_connections = $this->connections[$punto1];\r\n \r\n foreach ($origin_connections as $city => $cost) {\r\n \r\n if(!in_array($city , $this->ruta) && $cost > 0){\r\n $this->ruta[] = $city;\r\n if($city == $punto2){\r\n $routes[] = $this->ruta;\r\n array_splice($this->ruta, array_search($city, $this->ruta ));\r\n }else{\r\n $this->get_routes($city, $punto2, $routes, $route);\r\n }\r\n }\r\n }\r\n array_splice($this->ruta, count($this->ruta)-1);\r\n\r\n }" ]
[ "0.6038467", "0.57633936", "0.57107615", "0.5567789", "0.5436847", "0.53547996", "0.5277927", "0.5260983", "0.519865", "0.5121522", "0.51197696", "0.5076012", "0.5063239", "0.5058841", "0.5001685", "0.49322623", "0.4921283", "0.4901554", "0.4843623", "0.47763368", "0.47162768", "0.47142154", "0.4713368", "0.47084874", "0.4701476", "0.46147534", "0.46079615", "0.4587651", "0.45606837", "0.4534258", "0.45250255", "0.4524644", "0.45117152", "0.45032895", "0.4495021", "0.44948375", "0.44862574", "0.44725692", "0.4467862", "0.44615608", "0.44453275", "0.44229168", "0.43874526", "0.43811503", "0.43651158", "0.43512228", "0.43423516", "0.4331761", "0.43294454", "0.4313377", "0.4312321", "0.4302665", "0.42981595", "0.42914742", "0.4284889", "0.4277912", "0.42754304", "0.42686677", "0.4247114", "0.42401087", "0.42340145", "0.42327982", "0.42241383", "0.42205727", "0.42152542", "0.4203182", "0.4200818", "0.41972226", "0.41916516", "0.41885307", "0.41836604", "0.4177987", "0.4177596", "0.41769278", "0.4171453", "0.41663936", "0.41591418", "0.4158451", "0.41412577", "0.4129672", "0.41180003", "0.41134042", "0.41070276", "0.4089301", "0.4080318", "0.40794384", "0.40735963", "0.40594256", "0.40439618", "0.40393084", "0.4039002", "0.402608", "0.40251797", "0.40237272", "0.4020159", "0.40195322", "0.4010037", "0.3999285", "0.3996544", "0.39949626" ]
0.5885793
1
/From breadthFirstSearch you call this to find the shortest path between two strings
function findPath($StringX, $StringY){ $Start = findWord($StringY); /*Check if the word given by the user even exist in the dictionary*/ if($Start == NULL){ print($Start);print(" does not exist in the dictionary!"); } $End = findWord($StringY); /*Check to see if second word given even exists in the dictionary*/ if($End == NULL){ Print($End);print(" does not exist in the dictionary!"); } /* Run breadth first search on the start vertex*/ breadthFirstSearch($Start); /*We will traverse backwards on the list from breadfirstSearch to find the path*/ while($End->pred != NULL){ /*If the predecessor for end is NULL means there is no neighbor for this word*/ if($End->pret == NULL){ print("No Path Found!"); } /*Otherwise print out as it traverses*/ print($end->word." -> ");$End = $End->pred; } print($End->word); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShortestPath($origin, $destination);", "function edDisRecursive($str1, $str2){\n $distanceMatrix=[[0]];\n // Filling the first row of the matrix.\n // If this is the first row then we're transforming empty string to str1.\n // In this case the number of transformations equals to size of str1 substring.\n for ($i = 1; $i <= strlen($str1); $i++){\n $distanceMatrix[0][$i]=$i; \n if($i<= strlen($str2)){\n array_push($distanceMatrix,[]);\n $distanceMatrix[$i][0]=$i; \n }\n }\n // Filling the first column of the matrix.\n // If this is the first column then we're transforming empty string to str2.\n // In this case the number of transformations equals to size of str2 substring.\n for ($i = strlen($str1); $i <= strlen($str2); $i++){\n array_push($distanceMatrix,[]);\n $distanceMatrix[$i][0]=$i; \n }\n for ($j = 1; $j <= strlen($str1); $j++){\n for ($i = 1; $i <= strlen($str2); $i++){\n if($str1[$j-1] == $str2[$i-1]) $distanceMatrix[$i][$j] = $distanceMatrix[$i-1][$j-1];\n else $distanceMatrix[$i][$j]= $this->min($distanceMatrix[$i-1][$j-1],$distanceMatrix[$i][$j-1],$distanceMatrix[$i-1][$j])+1;\n }\n }\n return $distanceMatrix[strlen($str2)][strlen($str1)];\n }", "public function shortestPath($source, $target)\n {\n //vertex\n $d = array();\n //array of predecessors for each vertex\n $pi = array();\n //queue of all unoptimized vertives\n $Q = new SplPriorityQueue();\n\n foreach($this->graph as $v => $adj)\n {\n $d[$v] = INF; //set intitial distance to \"infinity\"\n $pi[$v] = null; // no known predecessors yet\n foreach($adj as $w => $cost)\n {\n //use the edge cost as the priority\n $Q->insert($w, $cost);\n }\n }\n\n //initial distance at source is 0\n $d[$source] = 0;\n\n while(!$Q->isEmpty())\n {\n //extract min cost\n $u = $Q->extract();\n if(!empty($this->graph[$u]))\n {\n //alternate route length to adjacent neightbor\n $alt = $d[$u] + $cost;\n //if alternate route is shorter\n if($alt < $d[$v])\n {\n $d[$v] = $alt;//update minimun length to vertex\n $pi[$v] = $u;//add neighbor to predecessors for vertex\n }\n }\n }\n }", "function string_compare_DP($str1, $str2) {\n $MATCH = 0;\n $INSERT = 1;\n $DELETE = 2;\n\n // init DP table, with Cell object inserted into each cell\n $temp = array_fill(0, strlen($str2)+1, 0);\n $compareTable = array_fill(0, strlen($str1)+1, $temp);\n \n for ($i=0; $i < strlen($str1)+1; $i++) { \n for ($j=0; $j < strlen($str2)+1; $j++) { \n // if 1st string is empty, the only option is to insert all char\n // of 2nd string\n if ($i == 0) {\n $compareTable[$i][$j] = $j;\n } elseif ($j == 0) { // if 2nd string is empty, the only option is to remove all char from 1st string\n $compareTable[$i][$j] = $i;\n } elseif ($str1[$i-1] == $str2[$j-1]) {\n $compareTable[$i][$j] = $compareTable[$i-1][$j-1];\n } else {\n $compareTable[$i][$j] = 1 + min($compareTable[$i-1][$j-1], $compareTable[$i-1][$j], $compareTable[$i][$j-1]);\n }\n }\n }\n print2DArray($compareTable);\n // return cost\n return $compareTable[strlen($str1)][strlen($str2)];\n}", "protected function shortestMiddleSnake(array $a, $lowerA, $upperA, array $b, $lowerB, $upperB)\n\t{\n\t\t$result = array();\n\n\t\t$downK = $lowerA - $lowerB; // the k-line to start the forward search\n\t\t$upK = $upperA - $upperB; // the k-line to start the reverse search\n\n\t\t$delta = ($upperA - $lowerA) - ($upperB - $lowerB);\n\t\t$oddDelta = ($delta & 1) != 0;\n\n\t\t$maxD = (($upperA - $lowerA + $upperB - $lowerB) / 2) + 1;\n\n\t\t// init vectors\n\t\t$this->downVector[$downK + 1] = $lowerA;\n\t\t$this->upVector[$upK - 1] = $upperA;\n\n\t\tfor ($d = 0; $d <= $maxD; $d++)\n\t\t{\n\n\t\t\t// Extend the forward path.\n\t\t\tfor ($k = $downK - $d; $k <= $downK + $d; $k += 2)\n\t\t\t{\n\t\t\t\t// find the only or better starting point\n\t\t\t\t$x = 0;\n\t\t\t\t$y = 0;\n\t\t\t\tif ($k == $downK - $d)\n\t\t\t\t{\n\t\t\t\t\t$x = $this->downVector[$k + 1]; // down\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$x = $this->downVector[$k - 1] + 1; // a step to the right\n\t\t\t\t\tif (($k < $downK + $d) && ($this->downVector[$k + 1] >= $x))\n\t\t\t\t\t{\n\t\t\t\t\t\t$x = $this->downVector[$k + 1];\n\t\t\t\t\t} // down\n\t\t\t\t}\n\t\t\t\t$y = $x - $k;\n\n\t\t\t\t// find the end of the furthest reaching forward D-path in diagonal k.\n\t\t\t\twhile (($x < $upperA) && ($y < $upperB) && ($a[$x] == $b[$y]))\n\t\t\t\t{\n\t\t\t\t\t$x++;\n\t\t\t\t\t$y++;\n\t\t\t\t}\n\t\t\t\t$this->downVector[$k] = $x;\n\n\t\t\t\t// overlap ?\n\t\t\t\tif ($oddDelta && ($upK - $d < $k) && ($k < $upK + $d))\n\t\t\t\t{\n\t\t\t\t\tif ($this->upVector[$k] <= $this->downVector[$k])\n\t\t\t\t\t{\n\t\t\t\t\t\t$result['x'] = $this->downVector[$k];\n\t\t\t\t\t\t$result['y'] = $this->downVector[$k] - $k;\n\t\t\t\t\t\treturn $result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Extend the reverse path.\n\t\t\tfor ($k = $upK - $d; $k <= $upK + $d; $k += 2)\n\t\t\t{\n\n\t\t\t\t// find the only or better starting point\n\t\t\t\t$x = 0;\n\t\t\t\t$y = 0;\n\t\t\t\tif ($k == $upK + $d)\n\t\t\t\t{\n\t\t\t\t\t$x = $this->upVector[$k - 1]; // up\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$x = $this->upVector[$k + 1] - 1; // left\n\t\t\t\t\tif (($k > $upK - $d) && ($this->upVector[$k - 1] < $x))\n\t\t\t\t\t{\n\t\t\t\t\t\t$x = $this->upVector[$k - 1];\n\t\t\t\t\t} // up\n\t\t\t\t}\n\t\t\t\t$y = $x - $k;\n\n\t\t\t\twhile (($x > $lowerA) && ($y > $lowerB) && ($a[$x - 1] == $b[$y - 1]))\n\t\t\t\t{\n\t\t\t\t\t// diagonal\n\t\t\t\t\t$x--;\n\t\t\t\t\t$y--;\n\t\t\t\t}\n\t\t\t\t$this->upVector[$k] = $x;\n\n\t\t\t\t// overlap ?\n\t\t\t\tif (!$oddDelta && ($downK - $d <= $k) && ($k <= $downK + $d))\n\t\t\t\t{\n\t\t\t\t\tif ($this->upVector[$k] <= $this->downVector[$k])\n\t\t\t\t\t{\n\t\t\t\t\t\t$result['x'] = $this->downVector[$k];\n\t\t\t\t\t\t$result['y'] = $this->downVector[$k] - $k;\n\t\t\t\t\t\treturn $result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function breadFirstSearch($origin, $desitnation)\n {\n //mark all nodes as unvisited\n foreach($this->graph as $vetex => $adj)\n {\n $this->visited[$vertec] = false;\n }\n\n //create an empty queue\n $q = new SplQueue();\n\n //enqueue the origin vertex and mark as visted\n $q->enqueue($origin);\n $this->visited[$origin] = true;\n\n //this is used to track the path back from each node\n $path = array();\n $path[$origin] = new SplDoubleLinkedList();\n $path[$origin]->setIteratorMode(\n SpleDoubleLinkedLit::IT_MODE_FIFO|SpleDoublyLinkedList::IT_MODE_KEEP\n );\n\n $path[$origin]->push($origin);\n\n $found = false;\n //while queue is not empty and destination not found\n while(!$q->isEmpty() && $q->bottom != $destination)\n {\n $t = $q->dequeue();\n\n if(!empty($this->graph[$t]))\n {\n //for each adjacent neighbor\n foreach($this->graph[$t] as $vertex)\n {\n if(!$this->visited[$vertex])\n {\n //if not yet visited, enqueue vertex and mark\n //as visited\n $q->enqueue($vertex);\n $this->visited[$vertex] = true;\n //add vertex to current path\n $path[$vertex] = clone$path[$t];\n $path[$vertex]->push($vertex);\n }\n }\n }\n }\n\n if(isset($path[$destination]))\n {\n echo \"$origin to $desitnation in \",\n count($path[$destination]) - 1,\n \"hopsn\";\n $sep = '';\n foreach($path[$destination] as $vertex)\n {\n echo $sep, $vertex;\n $sep = '->';\n }\n echo \"n\";\n }\n else\n {\n echo \"No route from the $origin to $destination\";\n }\n }", "function yp_cmp_videos_maplestage_drama($a, $b) {\r\n\t\t$aexp = explode('/', $a[0]);\r\n\t\t$bexp = explode('/', $b[0]);\r\n\t\treturn yp_cmp_strings_length_first(trim($aexp[0]), trim($bexp[0]));\r\n\t}", "static public function DijkstraAlgorithmByDB($first, $finish) {\n $link_db = Piwidict::getDatabaseConnection();\n\n if ($first == $finish) return array(0,array($first));\n\n $edge_table = PWRelatedWords::getTableName(); // table of related words (words and distance between them)\n $path_table = PWShortPath::getTableName(); // table of shortest paths (first, last, next-to-last vertexes, length of path)\n//print \"$first, $finish\";\n $query = \"SELECT lemma_id1 FROM $edge_table WHERE lemma_id1='$first' or lemma_id2='$first' LIMIT 1\"; // check if any edge with $first exists\n $res_exist = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n if ($link_db -> query_count($res_exist) == 0) \n return array(0,NULL);\n\n $query = \"SELECT lemma_id1 FROM $edge_table WHERE lemma_id1='$finish' or lemma_id2='$finish' LIMIT 1\"; // check if any edge with $finish exists\n $res_exist = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n if ($link_db -> query_count($res_exist) == 0) \n return array(0,NULL);\n\n $success = 0; // the condition of finding the shortest path in the given vertex ($finish)\n $count_row = 1;\n\n $query = \"UPDATE $path_table SET mark=0 where lemma_id_1=\".$first; // mark all vertexes as unvisited (if already any paths in DB exists)\n// $query = \"DELETE FROM $path_table where lemma_id_1=\".$first; // mark all vertexes as unvisited (if already any paths in DB exists)\n $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n $prev = $first;\n $path_len = 0;\n//print \"<PRE>\";\n$count=0;\n//print $first;\n//return;\n while (!$success && $count_row) { // until all vertixes will not be visited\n $count++;\n// && $count<3\nprint \"<p>\".$count.\": \".$count_row.\".-----------------------------</p>\";\n//print_r($finish_arr);\n//print_r($len_arr);\n $query = \"SELECT * FROM $edge_table WHERE lemma_id1='$prev' or lemma_id2='$prev'\"; // search nearest vertexes to $prev (НЕТ необходимости сортировать, так как неважно в какой последовательности ставятся метки)\n $res_neib = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n while ($row_neib = $res_neib->fetch_object()) {\n if ($row_neib->lemma_id1 == $prev)\n $last = $row_neib->lemma_id2; // $last - nearest vertexes to $prev and last vertex for next paths\n else \n $last = $row_neib->lemma_id1;\n $new_path_len = $path_len + $row_neib->weight; // path length from $prev to $last (neighbour of $prev via semantic relations)\n\n $query = \"SELECT path_len,mark FROM $path_table WHERE lemma_id_1='$first' and lemma_id_n='$last'\"; // recounted only unvisited vertexes\n//print \"<P>$query\";\n $res_path = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n if ($link_db -> query_count($res_path) == 0) {\n // 1. this is new path from $start to $finish which is absent in table pw_short_path_LANG_CODE\n $query = \"INSERT INTO $path_table (`lemma_id_1`, `lemma_id_n`, `path_len`, `lemma_id_prev_n`, mark) VALUES ($first, $last, $new_path_len, $prev, 0)\";\n//print \"<P>$query\";\n $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n } else {\n // 2. already (one) path from $start to $finish does exist, then update (length and previous word) only if length of new path is shorter\n $row_path = $res_path->fetch_object();\n if ($row_path->mark==0 && $new_path_len < $row_path->path_len) {\n $query = \"UPDATE $path_table SET path_len=$new_path_len, lemma_id_prev_n=$prev WHERE lemma_id_1=$first and lemma_id_n=$last\";\n//print \"<P>$query\";\n $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n }\n }\n }\n\n $query = \"SELECT path_len, lemma_id_n FROM $path_table WHERE lemma_id_1='$first' and mark=0 order by path_len\"; // choose minimal distance of path from first to any unvisited vertex \n $res_min = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n $count_row = $link_db -> query_count($res_min);\n if (!$count_row) // all paths from start are marked as visited\n $path_len = 0;\n\n else { // choose vertex with minimal distance\n $row_min = $res_min->fetch_object(); // get only one row - minimal path length\n $path_len = $row_min->path_len; // choose minimal distance of path from first to any unvisited vertex \n $prev = $row_min->lemma_id_n; // choose unvisited vertex with minimal distance\n }\n//print \"<p>prev:$prev, path_len:\".$path_len;\n \n $query = \"UPDATE $path_table SET mark=1 where lemma_id_1=$first and lemma_id_n=$prev\"; // mark vertex $prev as unvisited\n//print \"<P>$query\";\n $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n if ($prev == $finish) // the shortest path in $finish are found!!\n $success=1; \n }\nprint \"<p>$count iterations\";\n\n if ($success) { // \n $path = array($finish);\n $prev = $finish;\n\n while ($prev != start) {\n $query = \"SELECT lemma_id_prev_n FROM $path_table WHERE lemma_id_1='$first' and lemma_id_n='$prev' order by path_len LIMIT 1\"; // choose minimal distance of path from first to any unvisited vertex \n $res = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n $row = $res->fetch_object();\n $prev = $row -> lemma_id_prev_n;\n\n array_unshift($path,$prev);\n }\n\n return array($path_len, $path); \n } else return array(NULL,NULL); // any path from $first to $finish are not found\n }", "function findNeighbor($Vertex_forWho,$Vertex_finder,$word,$differenceCount){\n\t\t//since some words like car had r as the end but cars had the r and s as end\n\t\t//this function kept breaking, because this was my base case, but to save myself\n\t\t// a headache i split them up into word sized tries\n\n\t\t//if the end of the word is met, then if the difference is only 1 push it back\n\t\t//as an edge to both finder and for who.\n\n\t\tif($Vertexfind->end == true){\n\t\t\tif($differenceCount == 1){\n\t\t\t\t$Vertex_forWho->neighbors[] = $Vertex_finder;\n\t\t\t\t$Vertex_finder->neighbors[] = $Vertex_forWho;\n\t\t\t}\n\t\t}//if the word is still 1 character long, check its edges and find the neighbors for it\n\t\telse if(strlen($word) == 1){\n\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\telse\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t}\n\t\t}//for any wordzie bigger than 1, add all the neighbors\n\t\telse if(strlen($word) > 1){\n\t\t\tif($differenceCount > 1)\n\t\t\t\treturn;\n\t\t\telse if($differenceCount == 0){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 0);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($differenceCount == 1){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function createResult()\n {\n $totalCostCheapestPathFromTo = array();\n $cheapestPathFromTo = array();\n $vertexSet = array_values($this->graph->getVertices());\n\n $nVertices = count($vertexSet);\n\n //Total cost from i to i is 0\n for ($i = 0; $i < $nVertices; ++$i) {\n\n $totalCostCheapestPathFromTo[$i][$i] = 0;\n }\n\n // Calculating shortestPath(i,j,k+1) = min(shortestPath(i,j,k),shortestPath(i,k+1,k) + shortestPath(k+1,j,k))\n for ($k = 0; $k < $nVertices; ++$k) {\n\n for ($i = 0; $i < $nVertices; ++$i) {\n\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $k);\n\n for ($j = 0; $j < $nVertices; ++$j) {\n\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $k);\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $j);\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $k, $j);\n\n // If we find that the path from (i, k) + (k, j) is shorter than the path (i, j), the new path is\n // calculated.\n if ($totalCostCheapestPathFromTo[$i][$k] + $totalCostCheapestPathFromTo[$k][$j] < $totalCostCheapestPathFromTo[$i][$j]) {\n\n $totalCostCheapestPathFromTo[$i][$j] = $totalCostCheapestPathFromTo[$i][$k] + $totalCostCheapestPathFromTo[$k][$j];\n\n // Testing if we are not repeating a vertex' path over itself before merging the paths\n if ($vertexSet[$i]->getId() != $vertexSet[$k]->getId() || $vertexSet[$k]->getId() != $vertexSet[$j]->getId()) {\n\n $cheapestPathFromTo[$vertexSet[$i]->getId()][$vertexSet[$j]->getId()] = array_merge($cheapestPathFromTo[$vertexSet[$i]->getId()][$vertexSet[$k]->getId()],\n $cheapestPathFromTo[$vertexSet[$k]->getId()][$vertexSet[$j]->getId()]);\n }\n\n }\n\n }\n\n }\n\n if($totalCostCheapestPathFromTo[$k][$k] < 0) {\n\n throw new UnexpectedValueException('Floyd-Warshall not supported for negative cycles');\n }\n }\n\n return new FloydWarshallResult($cheapestPathFromTo, $this->graph);\n }", "protected function calculateDistance($first, $second)\n {\n return \\levenshtein($first, $second);\n }", "public function breadthFirstSearch($origin, $destination, $maxTime) {\n // mark all nodes as unvisited\n foreach ($this->graph as $vertex => $adj) {\n $this->visited[$vertex] = false;\n }\n\n // create an empty queue\n $q = new SplQueue();\n\n // enqueue the origin vertex and mark as visited\n $q->enqueue($origin);\n $this->visited[$origin] = true;\n\n // this is used to track the path back from each node\n $path = array();\n $path[$origin] = new SplDoublyLinkedList();\n $path[$origin]->setIteratorMode(\n SplDoublyLinkedList::IT_MODE_FIFO|SplDoublyLinkedList::IT_MODE_KEEP\n );\n\n $path[$origin]->push($origin);\n\n $found = false;\n // while queue is not empty and destination not found\n while (!$q->isEmpty() && $q->bottom() != $destination) {\n $t = $q->dequeue();\n\n if (!empty($this->graph[$t])) {\n // for each adjacent neighbor\n foreach ($this->graph[$t] as $vertex) {\n $totalTime = 0;\n foreach($vertex as $v=>$time){\n if (!$this->visited[$v]) {\n // if not yet visited, enqueue vertex and mark\n // as visited\n $q->enqueue($v);\n $this->visited[$v] = true;\n // add vertex to current path\n $path[$v] = clone $path[$t];\n $path[$v]->push([$v => $time]);\n $totalTime += $time;\n if($v == $destination){\n $sep = '';\n $output = '';\n $totalTime = 0;\n foreach ($path[$destination] as $key => $value) {\n if($key == 0) {\n $output .= $sep. $value;\n $sep = '=>';\n continue;\n }\n foreach($value as $vertex => $time){\n $output .= $sep. $vertex;\n $totalTime += $time;\n }\n\n }\n $output .= $sep.$totalTime.PHP_EOL;\n if($totalTime < $maxTime) {\n echo $output;\n break;\n }else {\n $this->visited[$v] = false;\n unset($path[$v]);\n }\n }\n }\n }\n\n }\n }\n }\n //print_r($path);\n if (!isset($path[$destination])) {\n echo \"Path not found between $origin to $destination\".PHP_EOL;\n }\n }", "static public function DijkstraAlgorithmByArray($first, $finish) {\n $link_db = Piwidict::getDatabaseConnection();\n\n if ($first == $finish) return array(0,array($first));\n\n $vertex_arr = PWRelatedWords::getAllRelatedWords(); // list of unvisited vertexes generated from list of vertexes having an edge\n if (!in_array($first, $vertex_arr))\n return array(0,NULL); // search vertexes is not connected with any edge\n\n $infinity = 1000000;\n foreach ($vertex_arr as $v)\n $unvisited[$v] = $infinity;\n $unvisited[$first] = 0;\n\n $edge_table = PWRelatedWords::getTableName(); // table of related words (words and distance between them)\n\n $prev_arr = array(); // list of next-to-last for path from first to last vertexes\n $prev_arr[$first] = NULL;\n\n $prev=$first;\n $path_len = 0;\n// $dist_arr = array(); // <key>,<value>: list of distances <value> from $first to <key>\n// $dist_arr[$first] =0;\n\n $success = 0; // the condition of finding the shortest path in the given vertex ($finish)\n\n//print \"<PRE>\";\n$count=0;\n//print $first;\n//return;\n while (!$success && sizeof($unvisited) && $path_len<$infinity) { // until all vertixes will not be visited\n// && $count<10\nprint \"<p>\".$count.\": \".sizeof($unvisited);\n//.\".-----------------------------</p>\";\n//print_r($finish_arr);\n//print_r($len_arr);\n $query = \"SELECT * FROM $edge_table WHERE lemma_id1='$prev' or lemma_id2='$prev'\"; // search nearest vertexes to $prev (НЕТ необходимости сортировать, так как неважно в какой последовательности ставятся метки)\n $res_neib = $link_db -> query_e($query,\"Query failed in file <b>\".__FILE__.\"</b>, string <b>\".__LINE__.\"</b>\");\n\n while ($row_neib = $res_neib->fetch_object()) {\n if ($row_neib->lemma_id1 == $prev)\n $last = $row_neib->lemma_id2; // $last - nearest vertexes to $prev and last vertex for next paths\n else \n $last = $row_neib->lemma_id1;\n $new_path_len = $path_len + $row_neib->weight; // path length from $prev to $last (neighbour of $prev via semantic relations)\n\n// if (!isset($dist_arr[$last]) || $dist_arr[$last]>$new_path_len) { // this is new path from $first to $last OR \n if (isset($unvisited[$last]) && $unvisited[$last]>$new_path_len) { // this is new path from $first to $last OR \n // already (one) path from $first to $last does exist, but the new path is shorter\n// $dist_arr[$last] =\n $unvisited[$last] = $new_path_len;\n $prev_arr[$last] = $prev;\n }\n }\n $count++;\n\n $path_len = min(array_values($unvisited)); // choose minimal distance of path from first to any unvisited vertex \n $prev = array_search($path_len, $unvisited); // choose unvisited vertex with minimal distance\n\nprint \" = \".$path_len;\n\n unset($unvisited[$prev]); // mark this vertes as visited, delete it from unvisited list\n\n if ($prev == $finish) { // the shortest path in $finish are found!!\n $success=1; \n continue; \n }\n\n }\nprint \"<p>$count iterations\";\n\n if ($success) { // \n $path = array($finish);\n $prev = $prev_arr[$finish];\n\n while ($prev != NULL) {\n array_unshift($path,$prev);\n $prev = $prev_arr[$prev];\n }\n\n return array($path_len, $path); \n } else return array(NULL,NULL); // any path from $first to $finish are not found\n }", "function dijkstra(Graph $graph, $startIndex) {\n // init spt bool array to mark visited vertices\n // init dist array to mark distance between vertices from start\n // init parent array to all -1\n // set start dist to 0\n // set traverse ptr to start index\n // while not all vertices are visited\n // put index into spt\n // get edges of index\n // loop through all edges of this index\n // if distance to reach this vertex is bigger than this index dist + current weight\n // set this vertex dist to this index dist + current weight\n // set parent of this vertex to index\n // advance to next edge\n // loop through all vertices\n // if stored dist is bigger than current vertex dist\n // set dist to new smaller dist\n // set index to the smaller dist\n $spt = array_fill(0, $graph->getVerticeCount(), False);\n $dist = array_fill(0, $graph->getVerticeCount(), PHP_INT_MAX);\n $parent = array_fill(0, $graph->getVerticeCount(), -1);\n\n $dist[$startIndex] = 0;\n $index = $startIndex;\n\n while (in_array(False, $spt)) {\n $spt[$index] = True;\n $curr = $graph->getEdges()[$index];\n while (!empty($curr)) {\n if ($dist[$curr->data] > $dist[$index] + $curr->weight) {\n $dist[$curr->data] = $dist[$index] + $curr->weight;\n $parent[$curr->data] = $index;\n }\n $curr = $curr->next;\n }\n $minDist = PHP_INT_MAX;\n for ($i=0; $i < $graph->getVerticeCount(); $i++) { \n if (!$spt[$i] && $minDist > $dist[$i]) {\n $minDist = $dist[$i];\n $index = $i;\n }\n }\n }\n return $parent;\n}", "public function compute_string_distance($string1, $string2)\n {\n }", "public function findCheapest(string $city1, string $city2): array\n {\n $airport1 = $this->airportRepository->findByCity($city1);\n \n abort_if(is_null($airport1), 404, 'Airport in the city ' . $city1 . ' does not exist.');\n \n $airport2 = $this->airportRepository->findByCity($city2);\n \n abort_if(is_null($airport2), 404, 'Airport in the city ' . $city2 . ' does not exist.');\n \n if (Cache::has('routes')) {\n $routes = Cache::get('routes');\n } else {\n $routes = $this->routeRepository->findAll();\n }\n \n $graph = $this->dijkstraGraph->createGraph($routes, 'source_id', 'destination_id', 'price');\n \n $cheapestPath = $this->dijkstraGraph->shortestPath($airport1['id'], $airport2['id']);\n \n $airports = $this->airportRepository->findByIds($cheapestPath);\n \n $cheapestRoute = [];\n $price = 0;\n foreach ($cheapestPath as $key => $element) {\n $airport = $airports[$element];\n if ($key === array_key_first($cheapestPath)) {\n $cheapestRoute['start'] = $this->getRouteInformation($airport);\n $price += $graph[$cheapestPath[$key]][$cheapestPath[$key + 1]];\n } elseif ($key === array_key_last($cheapestPath)) {\n $cheapestRoute['end'] = $this->getRouteInformation($airport);\n } else {\n $cheapestRoute['through'][] = $this->getRouteInformation($airport);\n $price += $graph[$cheapestPath[$key]][$cheapestPath[$key + 1]];\n }\n }\n \n $cheapestRoute['price'] = $price;\n \n return $cheapestRoute;\n }", "function buildPath($cameFrom, $min){\n $path = array();\n $path[] = $min;\n while(in_array($min,array_keys($cameFrom))){\n $min = $cameFrom[$min];\n $path[] = $min;\n }\n return array_reverse($path);\n}", "function getPathIntersection($path1, $path2, $outputSeparator = \"/\")\n{\n if (DIRECTORY_SEPARATOR != \"/\") {\n $path1 = str_replace(DIRECTORY_SEPARATOR, \"/\", $path1);\n $path2 = str_replace(DIRECTORY_SEPARATOR, \"/\", $path2);\n }\n $path1 = trim($path1, \"/\");\n $path1Splitter = explode(\"/\", $path1);\n \n $path2 = trim($path2, \"/\");\n $path2Splitter = explode(\"/\", $path2);\n \n if (empty($path1) || empty($path2)) {\n return false;\n }\n \n for ($i = 0, $x = count($path1Splitter); $i < $x; ++$i) {\n $path1SplitterCut = array_slice($path1Splitter, $i);\n $path2SplitterCut = array_slice($path2Splitter, 0, $x - $i);\n \n if ($path1SplitterCut == $path2SplitterCut) {\n return implode($outputSeparator, $path1SplitterCut);\n }\n }\n \n return false;\n}", "function consolidatePath2($path, $type) {\n $cpath = array();\n /*\n What are the conditions that determine a transfer?\n 1. If the connection type is different (express -> local)\n 2. If the train in the next segment is different and the original one is not available\n 3. if the connection type is transfer\n */\n // debugging\n $debug = true;\n $path_array = $path->path;\n $count = count($path_array);\n // this is a direction path and there is only one or two paths.\n // that means it either goes from loc->station->loc or just loc->loc\n if ($type == \"dir\" && $count <= 2) {\n return \"walk\";\n }\n //set up the first segment\n $segment = $path_array[0];\n if ($type == \"s2s\") {\n $i = 1; \n }\n else {\n $cpath[] = $segment;\n $segment = $path_array[1];\n $i = 2;\n }\n $marker1 = $segment->m1;\n $current_lines = $segment->m1->getOverlapLines($segment->m2);\n $connection = $segment->connection;\n $total_time = $segment->t;\n $segment2 = $path_array[$i+1];\n // loop through the path, starting at the next segment.\n for (; $i < $count; $i++) {\n // grab the segment\n $segment2 = $path_array[$i];\n \n if ($debug) {\n echo \"@\" . $segment2->m1->name . \"<br/>\";\n echo \"lines = \";\n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n \n if ($connection == \"transfer\") {\n // we know this segment is a transfer, so they will have to get off the train\n echo \"transfer<br/>\";\n \n // end the segment\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // add the transfer segment\n // we need to get the transfer lines\n $lines = $segment2->m1->getOverlapLines($segment2->m2);\n $lines = getCorrectLines($lines, $segment2->connection);\n // create new segment\n $new_segment = new Segment($segment2->m1, $segment2->m2, $lines, $segment2->t, $segment2->connection);\n $cpath[] = $new_segment;\n \n // increment if we need to\n if ($i < $count) {\n // increment\n $i++;\n $segment = $path_array[$i];\n $marker1 = $segment->m1;\n $current_lines = $segment->m1->getOverlapLines($segment->m2);\n $connection = $segment->connection;\n $total_time = $segment->t;\n if ($i < $count) {\n // more segments available\n continue;\n }\n // we end here with this segment\n $new_segment = new Segment($segment->m1, $segment->m2, $current_lines, $total_time, $connection);\n $cpath[] = $new_segment;\n return $cpath;\n }\n }\n else if ($connection != $segment2->connection) {\n // the connection types are different, but trains can shift from express to local and vice versa.\n if ($debug) {\n echo \"old conn: \" . $connection . \" | new conn: \" . $segment2->connection . \"<br/>\";\n }\n // do we have the same train available?\n if (sameTrain($current_lines, $segment2)) {\n // it's the same train, so we just update our lines and continue\n $current_lines = updateLines($segment, $current_lines);\n $total_time += $segment2->t;\n $connection = $segment2->connection;\n continue;\n }\n // different trains, so we need to transfer\n \n // end the old segment and add to the path\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"new_segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // reset our variables for the next segment\n $segment = $segment2;\n $marker1 = $segment2->m1;\n $current_lines = $segment2->m1->getOverlapLines($segment2->m2);\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n continue;\n }\n else if (!sameTrain($current_lines, $segment2)) {\n // different trains, so we need to transfer\n if ($debug) {\n echo \"old lines: \";\n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n echo \"new line: \" . $segment2->lines[0]->name . \"<br/>\";\n } \n // end the old segment and add to the path\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"new_segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // reset our variables for the next segment\n $segment = $segment2;\n $marker1 = $segment2->m1;\n $current_lines = $segment2->m1->getOverlapLines($segment2->m2);\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n continue;\n }\n // otherwise, we keep going and merge the segments\n $current_lines = linesIntersect($current_lines, $segment2->m1->getOverlapLines($segment2->m2));\n if ($debug) {\n echo \"# current_lines after intersect: \" . count($current_lines) . \"<br/>\"; \n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n $current_lines = getCorrectLines($current_lines, $connection);\n if ($debug) {\n echo \"# current_lines after correction: \" . count($current_lines) . \"<br/>\"; \n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n } // for\n // add the last segment\n $new_segment = new Segment($marker1, $segment2->m2, $current_lines, $total_time, $connection);\n $cpath[] = $new_segment; \n return $cpath;\n}", "public static function levenshtein(\n string $str1,\n string $str2,\n int $insertionCost = 1,\n int $replacementCost = 1,\n int $deletionCost = 1\n ): int {\n $result = ASCII::to_ascii_remap($str1, $str2);\n\n return \\levenshtein($result[0], $result[1], $insertionCost, $replacementCost, $deletionCost);\n }", "function areTwoPathRelated($pathOne, $pathTwo) {\n\t if (!empty($pathOne) and !empty($pathTwo)) {\n\t if ($pathTwo==$pathOne) return 2;\n\t if (strpos($pathTwo,$pathOne)!==false) return -1;\n\t if (strpos($pathOne,$pathTwo)!==false) return 1;\n\t return 0;\n\t }\n\t}", "function MinimumDistance($distance, $shortestPathTreeSet, $verticesCount)\r\n\t{\r\n\t\tglobal $INT_MAX;\r\n\t\t$min = $INT_MAX;\r\n\t\t$minIndex = 0;\r\n\r\n\t\tfor ($v = 0; $v < $verticesCount; ++$v)\r\n\t\t{\r\n\t\t\tif ($shortestPathTreeSet[$v] == false && $distance[$v] <= $min)\r\n\t\t\t{\r\n\t\t\t\t$min = $distance[$v];\r\n\t\t\t\t$minIndex = $v;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $minIndex;\r\n\t}", "function sorter($a, $b)\n{\n $a = count(explode(\"/\", $a));\n $b = count(explode(\"/\", $b));\n if($a == $b)\n {\n return 0;\n }\n if($a > $b)\n {\n return 1;\n }\n return -1;\n}", "function find_min_vertex($v1,$vertices,$distance_table){\n $min = INF;\n $min_i = 0;\n\n foreach($vertices as $v2){\n $d = distance_lookup($v1,$v2,$distance_table);\n if($d < $min){\n $min = $d;\n $min_i = $v2;\n }\n }\n return array($min_i,$min);\n\n}", "function compareStrainByDistance($strainA, $strainB)\n{\n // Same hamming distance to reference\n if ($strainA['dist_to_ref'] == $strainB['dist_to_ref'])\n {\n //sort by alphetical order\n if($strainA['name'] != $strainB['name'])\n {\n return ($strainA['name'] < $strainB['name']) ? -1 : 1;\n }\n // in the other case, they are equal\n return 0;\n }\n return ($strainA['dist_to_ref'] < $strainB['dist_to_ref']) ? -1 : 1;\n}", "function fake_levenshtein($a,$b)\n{\n\t// Some stripping, for performance, and because white space doesn't matter so much in HTML anyway\n\t$a=preg_replace('#\\s#','',$a);\n\t$b=preg_replace('#\\s#','',$b);\n\n\t$a_len=strlen($a);\n\t$b_len=strlen($b);\n\tif (($a_len<255) && ($b_len<255))\n\t{\n\t\treturn levenshtein($a,$b);\n\t}\n\t$percent=0.0;\n\treturn max($a_len,$b_len)-similar_text($a,$b,$percent);\n}", "public function shortestPaths($source, $target, array $exclude = array()) {\n\n $this->distance = array_fill_keys(array_keys($this->graph), INF);\n $this->distance[$source] = 0;\n $this->previous = array_fill_keys(array_keys($this->graph), array());\n $this->queue = array($source => 0);\n\n while (!empty($this->queue))\n $this->processNextNodeInQueue($exclude);\n\n if ($source === $target)\n return array(array($source));\n\n elseif (empty($this->previous[$target]))\n return array();\n\n else\n return $this->extractPaths($target);\n }", "function find_string($string, $start,$end) {\n //print \"start: $start, end: $end\\n\";\n // Simple hashing to improve speed\n if (isset($this->_HASHED[$string])) return $this->_HASHED[$string];\n\n if (abs($start-$end)<=1) {\n // we're done, if it's not it, bye bye\n $txt = $this->get_string_number($start);\n if ($string == $txt) {\n $this->_HASHED[$string] = $start;\n return $start;\n } else\n return -1;\n } elseif ($start>$end) {\n return $this->find_string($string,$end,$start);\n } else {\n $half = (int)(($start+$end)/2);\n $tst = $this->get_string_number($half);\n $cmp = strcmp($string,$tst);\n if ($cmp == 0) {\n $this->_HASHED[$string] = $half;\n return $half;\n } elseif ($cmp<0)\n return $this->find_string($string,$start,$half);\n else\n return $this->find_string($string,$half,$end);\n }\n }", "function breadthFirstSearch($startVertex){\n\t\t$startVertex->visited = true;\n\t\t$Q = new SplQueue();\n\t\t$Q->push($startVertex);\n\t\twhile(!$Q->empty()){\n\t\t\t$x = new Vertex();\n\t\t\t$x = $Q->front(); $Q->pop();\n\t\t\tforeach($x->neighbors as $VertexPtr){\n\t\t\t\tif($VertexPtr->visited == false){\n\t\t\t\t\t$VertexPtr->visited = trie;\n\t\t\t\t\t$VertexPtr->pred = $x;\n\t\t\t\t\t$Q->push($VertexPtr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getNodePathForTitlePath($titlePath, $a_startnode_id = null)\n\t{\n\t\tglobal $ilDB, $log;\n\t\t//$log->write('getNodePathForTitlePath('.implode('/',$titlePath));\n\t\t\n\t\t// handle empty title path\n\t\tif ($titlePath == null || count($titlePath) == 0)\n\t\t{\n\t\t\tif ($a_startnode_id == 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $this->getNodePath($a_startnode_id);\n\t\t\t}\n\t\t}\n\n\t\t// fetch the node path up to the startnode\n\t\tif ($a_startnode_id != null && $a_startnode_id != 0)\n\t\t{\n\t\t\t// Start using the node path to the root of the relative path\n\t\t\t$nodePath = $this->getNodePath($a_startnode_id);\n\t\t\t$parent = $a_startnode_id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Start using the root of the tree\n\t\t\t$nodePath = array();\n\t\t\t$parent = 0;\n\t\t}\n\n\t\t\n\t\t// Convert title path into Unicode Normal Form C\n\t\t// This is needed to ensure that we can compare title path strings with\n\t\t// strings from the database.\n\t\trequire_once('include/Unicode/UtfNormal.php');\n\t\tinclude_once './Services/Utilities/classes/class.ilStr.php';\n\t\t$inClause = 'd.title IN (';\n\t\tfor ($i=0; $i < count($titlePath); $i++)\n\t\t{\n\t\t\t$titlePath[$i] = ilStr::strToLower(UtfNormal::toNFC($titlePath[$i]));\n\t\t\tif ($i > 0) $inClause .= ',';\n\t\t\t$inClause .= $ilDB->quote($titlePath[$i],'text');\n\t\t}\n\t\t$inClause .= ')';\n\n\t\t// Fetch all rows that are potential path elements\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t$joinClause = 'JOIN '.$this->table_obj_reference.' r ON t.child = r.'.$this->ref_pk.' '.\n\t\t\t\t'JOIN '.$this->table_obj_data.' d ON r.'.$this->obj_pk.' = d.'.$this->obj_pk;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$joinClause = 'JOIN '.$this->table_obj_data.' d ON t.child = d.'.$this->obj_pk;\n\t\t}\n\t\t// The ORDER BY clause in the following SQL statement ensures that,\n\t\t// in case of a multiple objects with the same title, always the Object\n\t\t// with the oldest ref_id is chosen.\n\t\t// This ensure, that, if a new object with the same title is added,\n\t\t// WebDAV clients can still work with the older object.\n\t\t$q = 'SELECT t.depth, t.parent, t.child, d.'.$this->obj_pk.' obj_id, d.type, d.title '.\n\t\t\t'FROM '.$this->table_tree.' t '.\n\t\t\t$joinClause.' '.\n\t\t\t'WHERE '.$inClause.' '.\n\t\t\t'AND t.depth <= '.(count($titlePath)+count($nodePath)).' '.\n\t\t\t'AND t.tree = 1 '.\n\t\t\t'ORDER BY t.depth, t.child ASC';\n\t\t$r = $ilDB->query($q);\n\t\t\n\t\t$rows = array();\n\t\twhile ($row = $r->fetchRow(DB_FETCHMODE_ASSOC))\n\t\t{\n\t\t\t$row['title'] = UtfNormal::toNFC($row['title']);\n\t\t\t$row['ref_id'] = $row['child'];\n\t\t\t$rows[] = $row;\n\t\t}\n\n\t\t// Extract the path elements from the fetched rows\n\t\tfor ($i = 0; $i < count($titlePath); $i++) {\n\t\t\t$pathElementFound = false; \n\t\t\tforeach ($rows as $row) {\n\t\t\t\tif ($row['parent'] == $parent && \n\t\t\t\tilStr::strToLower($row['title']) == $titlePath[$i])\n\t\t\t\t{\n\t\t\t\t\t// FIXME - We should test here, if the user has \n\t\t\t\t\t// 'visible' permission for the object.\n\t\t\t\t\t$nodePath[] = $row;\n\t\t\t\t\t$parent = $row['child'];\n\t\t\t\t\t$pathElementFound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Abort if we haven't found a path element for the current depth\n\t\t\tif (! $pathElementFound)\n\t\t\t{\n\t\t\t\t//$log->write('ilTree.getNodePathForTitlePath('.var_export($titlePath,true).','.$a_startnode_id.'):null');\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t// Return the node path\n\t\t//$log->write('ilTree.getNodePathForTitlePath('.var_export($titlePath,true).','.$a_startnode_id.'):'.var_export($nodePath,true));\n\t\treturn $nodePath;\n\t}", "function distance($a, $b)\n{\n if (strlen($a) !== strlen($b)) {\n throw new \\InvalidArgumentException(\"DNA strands must be of equal length.\", 1);\n }\n //\n // YOUR CODE GOES HERE\n //\n if ($a === $b)\n return 0;\n\n $charArrayA = str_split($a);\n $charArrayB = str_split($b);\n $hammingDistance = 0;\n foreach ($charArrayA as $idx => $value) {\n if( $charArrayA[$idx] !== $charArrayB[$idx]) {\n $hammingDistance++;\n }\n }\n\n return $hammingDistance;\n}", "function laticePath($x, $y){\r\n\tif($x === 0 && $y == 0){\r\n\t\treturn 1;\r\n\t} else if($x < 0 || $y < 0) {\r\n\t\treturn 0;\r\n\t}\r\n\treturn laticePath($x-1, $y) + laticePath($x, $y-1);\r\n}", "function windowString($str1, $str2) {\n if (empty($str1) || empty($str2)) {\n return \"\";\n }\n $expected = [];\n for ($i=0; $i < strlen($str2); $i++) { \n if (!isset($expected[$str2[$i]])) {\n $expected[$str2[$i]] = 1;\n } else {\n $expected[$str2[$i]]++;\n }\n }\n $actual = [];\n list($left, $right) = [0, 0];\n $result = []; // start and end index of the result string.\n while ($left < strlen($str1) && $right < strlen($str1)) {\n // all chars in str2 are in current left right boundaries in str1\n if (sizeof($expected) == sizeof($actual)) {\n // move ahead left pointer as long as char is not in expected table\n while (!isset($expected[$str1[$left]])) {\n $left++;\n }\n // left is now pointing to the first char that's also in expected\n if (empty($result) || $result[1] - $result[0] > $right - $left) {\n $result = [$left, $right];\n }\n // unset the char in actual table.\n if ($actual[$str1[$left]] == 1) {\n unset($actual[$str1[$left]]);\n } else {\n $actual[$str1[$left]]--;\n }\n $left++;\n } else { // not all chars are in yet\n if (isset($expected[$str1[$right]])) {\n if (!isset($actual[$str1[$right]])) {\n $actual[$str1[$right]] = 1;\n } else {\n $actual[$str1[$right]]++;\n }\n }\n if ($right < strlen($str1)-1) {\n $right++;\n } else {\n $left++;\n }\n }\n print_r($result);\n }\n return substr($str1, $result[0], $result[1] - $result[0]+1);\n}", "public function findPath(){\r\n\r\n $position = $this->_startPoint;\r\n $tile = $this->_getTile($position);\r\n\r\n while(!$this->_checkEnd($position)){\r\n $direction = $tile->move();\r\n $position = $this->_getNewPosition($position,$direction);\r\n $newTile = $this->_getTile($position);\r\n $newTile->enter($direction);\r\n $tile = $newTile;\r\n }\r\n\r\n return $this->_getResult();\r\n }", "public static function getStringDistance($method, $a, $b)\n\t{\n\t\t$instance;\n\n\t\tif($method==\"Levenshtein\"){\n\t\t\trequire_once(\"LevenshteinDistance.php\");\n\t\t\t$instance = new LevenshteinDistance($a, $b);\n\t\t\treturn $instance->calculateDistance();\n\t\t}\n\t\telse if($method==\"Hamming\"){\n\t\t\trequire_once(\"HammingDistance.php\");\n\t\t\t$instance = new HammingDistance($a, $b);\n\t\t\treturn $instance->calculateDistance();\n\t\t}\n\n\t\treturn -999;\n\t}", "function Similarity ($str, $a_link) \r\n{\t\r\n\t$str1=getDNSName($str);\r\n\t$adns1=getDNSName($a_link);\r\n $thresh=0.8;\r\n $pos=((strstr($adns1,$str1)) || (strstr($str1,$adns1)));\r\n if($pos===true)\r\n {\r\n\t\tglobal $v;\r\n\t\t$v=$str;\r\n\t\treturn true;\r\n\t}\r\n\t$maxlen=strlen($adns1);\r\n\t$minchanges = levenshtein($str1, $adns1);\r\n\t$temp=($maxlen-$minchanges)/$maxlen;\r\n\tif (($thresh<$temp) && ($temp<1))\r\n\t{ \t\r\n\t\tglobal $v;\r\n\t\t$v=$str;\r\n\t\treturn true; \r\n\t}\r\n\treturn false;\r\n}", "public function similStringhe($str1, $str2)\n\t\t{\n\t\t\tif( strlen($str1) == strlen($str2) )\n\t\t\t{\n\t\t\t\t$strlen = strlen($str1);\n\t\t\t\t$temp1 = $temp2 = 0;\n\t\t\t\n\t\t\t\tfor($i=0; $i<$strlen; $i++)\n\t\t\t\t{\n\t\t\t\t\tif( $str1[$i] == $str2[$i] )\n\t\t\t\t\t\t$temp1++;\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor($i=($strlen-1); $i>$temp1; $i--)\n\t\t\t\t{\n\t\t\t\t\tif( $str1[$i] == $str2[$i] )\n\t\t\t\t\t\t$temp2++;\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( abs($strlen-($temp1+$temp2)) <= 2 )\n\t\t\t\t\tif( is_numeric(substr($str1, $temp1, abs($strlen-($temp1+$temp2)))) )\n\t\t\t\t\t\treturn $temp1;\n\t\t\t\t\n\t\t\t}\n\t\t\treturn 0;\n\t\t}", "function similarity($str1, $str2) {\r\n\t\t$len1 = strlen($str1);\r\n\t\t$len2 = strlen($str2);\r\n\t\t\r\n\t\t$max = max($len1, $len2);\r\n\t\t$similarity = $i = $j = 0;\r\n\t\t\r\n\t\twhile (($i < $len1) && isset($str2[$j])) {\r\n\t\t\tif ($str1[$i] == $str2[$j]) {\r\n\t\t\t\t$similarity++;\r\n\t\t\t\t$i++;\r\n\t\t\t\t$j++;\r\n\t\t\t} elseif ($len1 < $len2) {\r\n\t\t\t\t$len1++;\r\n\t\t\t\t$j++;\r\n\t\t\t} elseif ($len1 > $len2) {\r\n\t\t\t\t$i++;\r\n\t\t\t\t$len1--;\r\n\t\t\t} else {\r\n\t\t\t\t$i++;\r\n\t\t\t\t$j++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn round($similarity / $max, 2);\r\n\t}", "function calculateDistance($first, $second)\r\n{\r\n return abs($first - $second);\r\n}", "public static function diff_match($a, $b, $level=\"line\")\n {\n // set_time_limit(0);\n $answer = \"\";\n if($level == \"line\" || $level == \"word\")\n {\n if($level == \"line\")\n {\n $as = explode(\"\\n\", $a);\n $bs = explode(\"\\n\", $b);\n }\n else\n {\n $as = explode(\" \", $a);\n $bs = explode(\" \", $b);\n }\n \n $last = array();\n $next = array();\n $start = -1;\n $len = 0;\n $answer = \"\";\n for($i = 0; $i < sizeof($as); $i++)\n {\n $start+= strlen($as[$i])+1;\n for($j = 0; $j < sizeof($bs); $j++)\n {\n if($as[$i] != $bs[$j])\n {\n if(isset($next[$j])) unset($next[$j]);\n }\n else\n {\n if(!isset($last[$j-1]))\n $next[$j] = strlen($bs[$j]) + 1;\n else\n $next[$j] = strlen($bs[$j]) + $last[$j-1] + 1;\n if($next[$j] > $len)\n {\n $len = $next[$j];\n $answer = substr($a, $start-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n else\n {\n $m = strlen($a);\n $n = strlen($b);\n $last = array();\n $next = array();\n $len = 0;\n $answer = \"\";\n for($i = 0; $i < $m; $i++)\n {\n for($j = 0; $j < $n; $j++)\n {\n if($a[$i] != $b[$j])\n {\n if(isset($next[$j])) unset($next[$j]);\n }\n else\n {\n if(!isset($last[$j-1]))\n $next[$j] = 1;\n else\n $next[$j] = 1 + $last[$j-1];\n if($next[$j] > $len)\n {\n $len = $next[$j];\n $answer = substr($a, $i-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n if($level == \"line\" && $answer == \"\") return self::diff_match($a, $b, \"word\");\n elseif($level == \"word\" && $answer == \"\") return self::diff_match($a, $b, \"letter\");\n else return $answer;\n }", "function strposa($string, $words=array(), $offset=0) {\n $chr = array();\n //check by simlarity\n foreach($words as $word) {\n $res = checkExistanceBySimilarity($string,$word);\n if ($res !== false) $chr[$word] = $res;\n }\n // check exist\n /*foreach($words as $word) {\n $res = strpos($string, $word, $offset);\n if ($res !== false) $chr[$word] = $res;\n }*/\n if(empty($chr)) return false;\n return min($chr);\n}", "public function __construct($strA, $strB){\n $this->strA = $strA;\n $this->strB = $strB;\n $this->lengthA = strlen($strA);\n $this->lengthB = strlen($strB);\n $this->distance = 0;\n }", "function GasStation($strArr) {\r\n $totalGasAtStation = 0;\r\n $totalGasToTravel = 0;\r\n $totalNumGasStation = array_shift($strArr);\r\n for ($i = 0; $i < $totalNumGasStation; $i++) {\r\n $gas = explode(':',$strArr[$i]);\r\n $totalGasAtStation = $totalGasAtStation + $gas[0];\r\n $totalGasToTravel = $totalGasToTravel + $gas[1];\r\n }\r\n if ($totalGasAtStation < $totalGasToTravel) {\r\n $strArr = \"impossible\";\r\n }\r\n // iterate through the routes \r\n else {\r\n \r\n $iteration = 0;\r\n $foundloop = false;\r\n while (($foundloop == false) && ($iteration <= $totalNumGasStation)) {\r\n $iteration++;\r\n $gasTank = 0;\r\n $isBrokeDown = false;\r\n $gasStationNum = 0;\r\n for ($gasStationNum; $gasStationNum < $totalNumGasStation; $gasStationNum++) {\r\n \r\n $gas = explode(':',$strArr[$gasStationNum]);\r\n $gasTank = $gasTank + $gas[0] - $gas[1];\r\n if ($gasTank < 0) {\r\n \r\n $isBrokeDown = true;\r\n break;\r\n }\r\n }\r\n \r\n if (($isBrokeDown == FALSE) && ($gasStationNum == 4)) {\r\n $strArr = $iteration;\r\n $foundloop = true;\r\n }\r\n else {\r\n $deltaGasStation = array_shift($strArr);\r\n $strArr[] = $deltaGasStation;\r\n\r\n }\r\n }\r\n }\r\n return $strArr; \r\n\r\n}", "function search_short($patt, $k, $text, $start_index = 0, $max_len = -1, $text_strlen = -1)\n {\n if ($text_strlen < 0) {\n $text_strlen = strlen($text);\n }\n\n if ($max_len < 0) {\n $max_len = $text_strlen;\n }\n\n $start_index = (int)max(0, $start_index);\n $n = min($max_len, $text_strlen - $start_index);\n $m = strlen($patt);\n $end_index = $start_index + $n;\n\n // If $text is shorter than $patt, use the built-in\n // levenshtein() instead:\n if ($n < $m) {\n $lev = levenshtein(substr($text, $start_index, $n), $patt);\n\n if ($lev <= $k) {\n return Array($start_index + $n - 1 => $lev);\n } else {\n return Array();\n }\n }\n\n $s = Array();\n\n for ($i = 0; $i < $m; $i++) {\n $c = $patt[$i];\n\n if (isset($s[$c])) {\n $s[$c] = min($i, $s[$c]);\n } else {\n $s[$c] = $i;\n }\n }\n\n if ($end_index < $start_index) {\n return Array();\n }\n\n $matches = Array();\n $da = $db = range(0, $m - $k + 1);\n\n $mk = $m - $k;\n\n for ($t = $start_index; $t < $end_index; $t++) {\n $c = $text[$t];\n $in_patt = isset($s[$c]);\n\n if ($t & 1) {\n $d = &$da;\n $e = &$db;\n } else {\n $d = &$db;\n $e = &$da;\n }\n\n for ($i = 1; $i <= $mk; $i++) {\n $g = min($k + 1, $e[$i] + 1, $e[$i + 1] + 1);\n\n // TODO: optimize this with a look-up-table?\n if ($in_patt)\n for ($j = $e[$i - 1]; ($j < $g && $j <= $mk); $j++) {\n if ($patt[$i + $j - 1] == $c) {\n $g = $j;\n }\n }\n\n $d[$i] = $g;\n }\n\n if ($d[$mk] <= $k) {\n $err = $d[$mk];\n $i = min($t-$err + $k + 1, $start_index + $n - 1);\n\n if (!isset($matches[$i]) || $err < $matches[$i]) {\n $matches[$i] = $err;\n }\n }\n }\n\n unset($da, $db);\n\n return $matches;\n }", "public static function relPathBetweenURLs($path_1,$path_2)\n\t{\n\t\tif(strpos($path_1,'innovaeditor')!==false)\n\t\t{\n\t\t\t$common=Formatter::longestCommonSubsequence($path_1,$path_2);\n\t\t\t$path_1_part=str_replace($common,'',$path_1);\n\t\t\t$path_2_part=str_replace($common,'',$path_2);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$path_1_part=str_replace('../','',$path_1); //assuming innovaeditor is always in root\n\t\t\t$path_2_part=$path_2;\n\t\t}\n\t\t$path_2_part_dirs=substr_count($path_2_part,'/');\n\t\t$pref_path='';\n\t\tfor($i=$path_2_part_dirs; $i>0; $i--)\n\t\t\t$pref_path .= '../';\n\t\treturn $pref_path.$path_1_part;\n\t}", "public function getMinBaths();", "function combineStrings($a, $b) {\n $k = strlen ($a);\n $j = strlen ($b);\n\n if ($k < $j) {return $a.$b.$a;}\nelse {return $b.$a.$b;}// if two strings has same length, it will run 'else'\n}", "function main($_o){\r\n\r\n $path = (!empty($_o[\"p\"])) ? $_o[\"p\"] : \"\";\r\n $path2 = \"P:/develope/www/dpa/__20120605/\" . $path;\r\n $path1 = \"P:/develope/www/dpa/eswine/\" . $path;\r\n\r\n $l_arr1 = transPath($path1);\r\n $l_arr2 = transPath($path2);\r\n print_r($l_arr1);\r\n print_r($l_arr2);\r\n\r\n //\r\n $l_diff1 = array_diff($l_arr1,$l_arr2);\r\n sort($l_diff1);\r\n $l_diff2 = array_diff($l_arr2,$l_arr1);\r\n sort($l_diff2);\r\n print_r($l_diff1);\r\n print_r($l_diff2);\r\n}", "function testStartsWith1 ()\n\t{\n\t\t\t$input1 = \"Barry\";\n\t\t\t$input2 = \"Barry is a programmer\";\n\t\t\t$this->assertTrue (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}", "public static function ComparePath($a, $b)\n\t{\n\t\treturn strcmp($a->GetPath(), $b->GetPath());\n\t}", "function phorum_api_diff_match($a, $b, $level=\"line\")\n{\n // set_time_limit(0); No, we don't like it.\n $answer = \"\";\n if ($level == \"line\" || $level == \"word\")\n {\n if ($level == \"line\") {\n $as = explode(\"\\n\", $a);\n $bs = explode(\"\\n\", $b);\n } else {\n $as = explode(\" \", $a);\n $bs = explode(\" \", $b);\n }\n\n $last = array();\n $next = array();\n $start = -1;\n $len = 0;\n $answer = \"\";\n for ($i = 0; $i < sizeof($as); $i++) {\n $start+= strlen($as[$i])+1;\n for ($j = 0; $j < sizeof($bs); $j++) {\n if ($as[$i] != $bs[$j]) {\n if (isset($next[$j])) unset($next[$j]);\n } else {\n if (!isset($last[$j-1]))\n $next[$j] = strlen($bs[$j]) + 1;\n else\n $next[$j] = strlen($bs[$j]) + $last[$j-1] + 1;\n if ($next[$j] > $len) {\n $len = $next[$j];\n $answer = substr($a, $start-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n else\n {\n $m = strlen($a);\n $n = strlen($b);\n $last = array();\n $next = array();\n $len = 0;\n $answer = \"\";\n for ($i = 0; $i < $m; $i++) {\n for ($j = 0; $j < $n; $j++) {\n if ($a[$i] != $b[$j]) {\n if (isset($next[$j])) unset($next[$j]);\n } else {\n if (!isset($last[$j-1]))\n $next[$j] = 1;\n else\n $next[$j] = 1 + $last[$j-1];\n if ($next[$j] > $len) {\n $len = $next[$j];\n $answer = substr($a, $i-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n\n if ($level == \"line\" && $answer == \"\") {\n return phorum_api_diff_match($a, $b, \"word\");\n } elseif ($level == \"word\" && $answer == \"\") {\n return phorum_api_diff_match($a, $b, \"letter\");\n } else {\n return $answer;\n }\n}", "private function findNext($iStartFrom, $sRoot, $iFirst, $bIncludeFirst, $bIncludeLast, $sString, &$iNewStartFrom)\n\t{\n\t $sSubString = substr($sString,$iStartFrom,strlen($sString)-$iStartFrom);\n\t $iTime = count($sRoot);\n\t $iStart = 0;\n\t $iEnd = 0;\n\t $pos = 0;\n\t $lastPos = 0;\n\t\n\t for ($i=0; $i<$iTime; $i++)\n\t {\n\t $pos = strpos($sSubString, $sRoot[$i], $lastPos);\n\t if ( $sRoot[$i] != substr($sSubString,0,strlen($sRoot[$i])) )\n\t if ($pos==false) return \"\";\n\t $lastPos = $pos + strlen($sRoot[$i]);\n\t if ($i==($iTime-1) ) $iEnd=$pos;\n\t }\n\t \n\t // new start from \n\t $iNewStartFrom = $iStartFrom + $iEnd + strlen($sRoot[$iTime-1]);\n\t \n\t if ($bIncludeLast==true)\n\t $iEnd = $iEnd+strlen($sRoot[$iTime-1]);\n\t\n\t $pos = 0;\n\t $lastPos = 0;\n\t for ($i=0;$i<=$iFirst;$i++)\n\t {\n\t $pos = strpos($sSubString,$sRoot[$i],$lastPos);\n\t $iStart = $pos;\n\t $lastPos = $pos+strlen($sRoot[$i])-1;\n\t }\n\t if ($bIncludeFirst==false)\n\t $iStart = $iStart + strlen($sRoot[$iFirst]);\n\t \n\t /*\n\t\techo $iStart . '<br />';\n\t\techo $iEnd . '<br />';\n\t\techo trim(substr($sSubString,$iStart,$iEnd-$iStart)); die;\n\t\t*/\n\t\treturn trim(substr($sSubString,$iStart,$iEnd-$iStart));\n\t}", "public function testfindCheapestRoute()\n {\n $travelRoute = new TravelRoute();\n\n $this->assertEquals([\n 'route' => 'GRU,BRC,SCL',\n 'price' => 15\n ], $travelRoute->findCheapestRoute('GRU', 'SCL'));\n }", "function strstrb($h,$n){\n return array_shift(explode($n,$h,2));\n}", "function strstrb($h,$n){\n return array_shift(explode($n,$h,2));\n}", "public function first(string $str) {\n\n }", "function testStartsWith6 ()\n\t{\n\t\t\t$input1 = \"Barry is a programmer\";\n\t\t\t$input2 = \"Barry is a programmer\";\n\t\t\t$this->assertTrue (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}", "function combineFileSystemPath ($path1, $path2) {\n if ($path1 == '' || $path2 == '') return $path2;\n $s = $path1;\n if (substr($s,-1) != '\\\\' && substr($s,-1) != '/') $s = $s . \"/\";\n if (substr($path2,0,1) == '\\\\' || substr($path2,0,1) == '/')\n $s = $s . substr($path2,1);\n else\n $s = $s . $path2;\n return $s; }", "function hammingDistance($strainReference, $firstStrain, $secondStrain)\n{\n $dist = 0;\n foreach ($strainReference as $key => $value)\n {\n //If we should consider the current marker in the distance calculus\n if(!in_array($value, [\"\", -1]))\n {\n if(array_key_exists($key, $firstStrain) && array_key_exists($key, $secondStrain))\n {\n if ($firstStrain[$key] != $secondStrain[$key])\n {\n $dist += 1;\n }\n }\n }\n }\n return $dist;\n}", "function testStartsWith2 ()\n\t{\n\t\t\t$input1 = \"Genevieve\";\n\t\t\t$input2 = \"Barry is a programmer\";\n\t\t\t$this->assertFalse (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}", "function twoParts($part1,$part2){\r\n $partone=str_replace('/','',$part1);\r\n $parttwo=str_replace('/','',$part2);\r\n $wholepart = $partone.'/'.$parttwo; \r\n return\"Path:\".$wholepart;\r\n\r\n }", "function getNodePath($a_endnode_id, $a_startnode_id = 0)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$pathIds = $this->getPathId($a_endnode_id, $a_startnode_id);\n\n\t\t// Abort if no path ids were found\n\t\tif (count($pathIds) == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t\n\t\t$types = array();\n\t\t$data = array();\n\t\tfor ($i = 0; $i < count($pathIds); $i++)\n\t\t{\n\t\t\t$types[] = 'integer';\n\t\t\t$data[] = $pathIds[$i];\n\t\t}\n\n\t\t$query = 'SELECT t.depth,t.parent,t.child,d.obj_id,d.type,d.title '.\n\t\t\t'FROM '.$this->table_tree.' t '.\n\t\t\t'JOIN '.$this->table_obj_reference.' r ON r.ref_id = t.child '.\n\t\t\t'JOIN '.$this->table_obj_data.' d ON d.obj_id = r.obj_id '.\n\t\t\t'WHERE '.$ilDB->in('t.child',$data,false,'integer').' '.\n\t\t\t'ORDER BY t.depth ';\n\t\t\t\n\t\t$res = $ilDB->queryF($query,$types,$data);\n\n\t\t$titlePath = array();\n\t\twhile ($row = $ilDB->fetchAssoc($res))\n\t\t{\n\t\t\t$titlePath[] = $row;\n\t\t}\n\t\treturn $titlePath;\n\t}", "public function longestCommonSubstring($otherStr)\n {\n // Uses dynamic programming to solve\n // http://en.wikipedia.org/wiki/Longest_common_substring_problem\n $encoding = $this->encoding;\n $stringy = static::create($this->str, $encoding);\n $strLength = $stringy->length();\n $otherLength = UTF8::strlen($otherStr, $encoding);\n\n // Return if either string is empty\n if ($strLength == 0 || $otherLength == 0) {\n $stringy->str = '';\n\n return $stringy;\n }\n\n $len = 0;\n $end = 0;\n $table = array_fill(\n 0, $strLength + 1,\n array_fill(0, $otherLength + 1, 0)\n );\n\n for ($i = 1; $i <= $strLength; $i++) {\n for ($j = 1; $j <= $otherLength; $j++) {\n $strChar = UTF8::substr($stringy->str, $i - 1, 1, $encoding);\n $otherChar = UTF8::substr($otherStr, $j - 1, 1, $encoding);\n\n if ($strChar == $otherChar) {\n $table[$i][$j] = $table[$i - 1][$j - 1] + 1;\n if ($table[$i][$j] > $len) {\n $len = $table[$i][$j];\n $end = $i;\n }\n } else {\n $table[$i][$j] = 0;\n }\n }\n }\n\n $stringy->str = UTF8::substr($stringy->str, $end - $len, $len, $encoding);\n\n return $stringy;\n }", "function oea($str1, $str2)\n{\n if ($str1 == $str2) {\n return false;\n }\n\n $length1 = strlen($str1);\n $length2 = strlen($str2);\n\n if ($length2 > $length1) {\n return oea($str2, $str1);\n }\n\n $theSame = false;\n if ($length1 == $length2) {\n $theSame = true;\n }\n $i = 0;\n $bubble = null;\n while ($i < $length1) {\n if ($str1[$i] != @$str2[$i]) {\n if (!is_null($bubble)) {\n return false;\n }\n if (!$theSame) {\n $bubble = $str1[$i];\n $str1 = substr($str1, 0, $i) . substr($str1, $i + 1);\n $length1 = strlen($str1);\n continue;\n }\n $bubble = true;\n }\n $i++;\n }\n return true;\n}", "private static function compare($a, $b) \n\t{\n\t\treturn min(max(strcmp($a,$b), -1), 1);\n\t}", "public function sort_folder_tree( $a, $b ) {\n\n\t\treturn strcmp( $a['text'], $b['text'] );\n\n\t}", "function caluculDistance($line,$nameStart,$nameEnd,$cat){\n\n\n if ( ! (($stationStart= getStationDB($nameStart,$line)) && ($stationEnd= getStationDB($nameEnd,$line)))) return \"stations do not exist\";\n //check direction\n\n if ($stationStart->getDist()< $stationEnd->getDist()) $keyword='ASC' ;\n else $keyword='DESC';\n\n\n $array =calculDistanceDB($stationStart,$stationEnd,$keyword,$cat);\n return $array;\n}", "function levenshtein_strip_search($to_strip,$subject,$backwards,$i)\n\t{\n\t\t$best=mixed();\n\t\t$best_at=$i;\n\n\t\t// Find all tag start/end positions (comparison reference points), loading them into the search list, ordered by position\n\t\t$up_to=min(strlen($subject),intval(floatval(strlen($to_strip))*1.5));\n\t\t$positions=array();\n\t\tfor (;$i<$up_to;$i++)\n\t\t{\n\t\t\tif ($i!=0)\n\t\t\t{\n\t\t\t\tif ($backwards)\n\t\t\t\t{\n\t\t\t\t\t$next_tag_a=strrpos(substr($subject,0,strlen($subject)-$i),'<'); // Makes performance reasonable, by only checking at tag points\n\t\t\t\t\t$next_tag_b=strrpos(substr($subject,0,strlen($subject)-$i),'>');\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$next_tag_a=strpos($subject,'<',$i); // Makes performance reasonable, by only checking at tag points\n\t\t\t\t\t$next_tag_b=strpos($subject,'>',$i);\n\t\t\t\t}\n\t\t\t\t$next_tag=(($next_tag_b!==false) && (($next_tag_a===false) || ((!$backwards) && ($next_tag_b<$next_tag_a)) || (($backwards) && ($next_tag_b>$next_tag_a))))?($next_tag_b+1):$next_tag_a;\n\t\t\t\tif ($next_tag===false)\n\t\t\t\t{\n\t\t\t\t\t$i=(strlen($subject)-1);\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$possible_i=$backwards?(strlen($subject)-$next_tag):$next_tag;\n\t\t\t\t\tif ($possible_i!=$i) $i=$possible_i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$lev=NULL;\n\t\t\t//$lev=fake_levenshtein($backwards?substr($subject,-$i):substr($subject,0,$i),$to_strip);\t\tFor efficiency the next loop has a more intelligent searching algorithm, to narrow down on the peak\n\t\t\t$positions[]=array($i,$lev);\n\t\t}\n\n\t\tdo\n\t\t{\n\t\t\t$cnt=count($positions);\n\t\t\t$point_a=intval(3.0*floatval($cnt)/8.0);\n\t\t\t$point_b=intval(5.0*floatval($cnt)/8.0);\n\t\t\tif (($cnt<24)/*The peak algorithm breaks down on small data sets due to integer rounding problems and local maxima*/ || ($point_a==$point_b)) break; // Okay now we need to scan manually over the few that are left\n\n\t\t\t// Take the 3/8 point of the search list, and find it's levenshtein distance\n\t\t\tif (is_null($positions[$point_a][1]))\n\t\t\t\t$positions[$point_a][1]=fake_levenshtein($backwards?substr($subject,-$positions[$point_a][0]):substr($subject,0,$positions[$point_a][0]),$to_strip);\n\n\t\t\t// Take the 5/8 point of the search list, and find it's levenshtein distance\n\t\t\tif (is_null($positions[$point_b][1]))\n\t\t\t\t$positions[$point_b][1]=fake_levenshtein($backwards?substr($subject,-$positions[$point_b][0]):substr($subject,0,$positions[$point_b][0]),$to_strip);\n\t\t\t// If the 3/8 point has a higher or equal levenshtein distance, throw away everything to the left of the 3/8 point\n\t\t\tif ($positions[$point_a][1]>=$positions[$point_b][1])\n\t\t\t{\n\t\t\t\tarray_splice($positions,0,$point_a);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t// Therefore the 5/8 point has a higher levenshtein distance: throw away everything to the right of the 5/8 point\n\t\t\t\tarray_splice($positions,$point_b);\n\t\t\t}\n\t\t}\n\t\twhile (true);\t// Repeats until the 3/8 or 5/8 points are the same, due to indivisibility ('break' line does this)\n\n\t\t// Loop over the remaining results, finding the smallest levenshtein distance remaining- this is our result\n\t\tforeach ($positions as $p)\n\t\t{\n\t\t\tlist($i,$lev)=$p;\n\t\t\tif (is_null($lev)) $lev=fake_levenshtein(substr($subject,0,$i),$to_strip);\n\n\t\t\tif ((is_null($best)) || ($lev<$best))\n\t\t\t{\n\t\t\t\t$best=$lev;\n\t\t\t\t$best_at=$i;\n\t\t\t}\n\t\t}\n\t\t$ret=$backwards?substr($subject,0,(strlen($subject)-$best_at)):substr($subject,$best_at);\n\n\t\treturn $ret;\n\t}", "function strcmp_from_utf8($str1, $str2)\n{\n $array_of_string1 = utf8StringSplit($str1); \n $array_of_string2 = utf8StringSplit($str2);\n $i = 0; // index into str1\n $j = 0; // index into str2\n // for each char in str1\n while ($i < count($array_of_string1))\n {\n $val1 = char_translate($array_of_string1[$i]);\n $i ++;\n if ($val1 == 0) // error\n return 0;\n // if there are still chars in str2\n if ($j < count($array_of_string2)) \n { \n $val2 = char_translate($array_of_string2[$j]);\n $j ++;\n if ($val2 == 0) // error\n return 0;\n if ($val1 < $val2)\n return -1;\n else if ($val1 > $val2)\n return 1; \n }\n }\n if ($j < count($array_of_string2)) // str2 longer that str1\n return -1;\n return 0; // equal\n}", "function compareSemesters($sA, $sB){\n\t$dA = split(' ', $sA);\n\t$dB = split(' ', $sB);\n\tif((count($dA) != 2) || (count($dB) != 2) || (count($dA) != count($dB))) return 0;\n\tif(intval($dA[0]) < intval($dB[0])) return 1;\n\telse if (intval($dA[0]) > intval($dB[0])) return -1;\n\telse {\n\t\t$times = array(\"Spring\" => 0, \"Summer\" => 1, \"Fall\" => 2);\n\t\tif($times[$dA[1]] < $times[$dB[1]]) return 1;\n\t\telse if($times[$dA[1]] > $times[$dB[1]]) return -1;\n\t\telse return 0;\n\t}\n}", "function wyz_cmp_listings_near_me( $a, $b ) {\n\tif ( $a['distance'] == $b['distance'] ) return 0;\n\treturn $a['distance'] < $b['distance'] ? -1 : 1;\n}", "function OneEditApart($s1, $s2) {\n\t// only calc these once\n\t$s1Len = strlen($s1);\n\t$s2Len = strlen($s2);\n\n\t// 0 edits apart, return false\n\tif ($s1 == $s2) {\n\t\treturn false;\n\t}\n\n\t// we want the shorter as the first param\n\tif ($s1Len > $s2Len) {\n\t\treturn OneEditApart($s2, $s1);\n\t}\n\n\t// if lengths differ by more than 1, return false\n\tif ($s2Len - $s1Len > 1) {\n\t\treturn false;\n\t}\n\n\t// keep current indexes of both words\n\t$s1i = $s2i = $edits = 0;\n\n\twhile ($s1i < $s1Len && $s2i < $s2Len) {\n\t\t// break processing and return if we have achieved more than one edit\n\t\tif ($edits > 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if letters match, next\n\t\tif ($s1[$s1i] == $s2[$s2i]) {\n\t\t\t$s1i++;\n\t\t\t$s2i++;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// insert case\n\t\tif ($s1[$s1i] == $s2[$s2i + 1]) {\n\t\t\t$edits++;\n\t\t\t$s1i++;\n\t\t\t$s2i = $s2i + 2;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// remove case\n\t\tif ($s1[$s1i + 1] == $s2[$s2i]) {\n\t\t\t$edits++;\n\t\t\t$s1i = $s1i + 2;\n\t\t\t$s2i++;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// replace case\n\t\t$edits++;\n\t\t$s1i++;\n\t\t$s2i++;\n\t}\n\n\t// get index difference, as it will impact our remaining length calc\n\t$iDiff = $s2i - $s1i;\n\n\t// add any differences in word lengths minus previous diff to inserts\n\t$edits = $edits + ($s2Len - $s1Len - $iDiff);\n\n\tif ($edits == 1) {\n\t\treturn true;\n\t}\n\n\t// more or less than 1\n\treturn false;\n\n}", "public function getBestPathTail()\n {\n // If we don't have any data, just return any\n if (empty($this->bestPathLengths)) {\n if ($this->initial) {\n $newNode = new PathNode($this->dimensions, $this->getStringIdentifier());\n\n $randomNode = new PathNode($this->dimensions, $newNode->getRandomNextNode());\n\n $randomNode->setParentNode($newNode);\n\n return $randomNode;\n } else {\n throw new Exception('This should not happen');\n }\n }\n\n $bestSoFar = 0;\n $bestPathIndex = null;\n\n foreach ($this->bestPathLengths as $stringIdentifier => $pathLength) {\n if ($pathLength > $bestSoFar) {\n $bestSoFar = $pathLength;\n $bestPathIndex = $stringIdentifier;\n }\n }\n\n return $this->bestPaths[$bestPathIndex];\n }", "function nodeDist($node1, $node2){\n $n1 = getNode($node1);\n $n2 = getNode($node2);\n return 3*distance($n1['lat'],$n1['lon'],$n2['lat'],$n2['lon']);\n}", "function boyermoore_search( $haystack, $needle )\n{\n /*\n * Calc string sizes\n */\n// $needle_len;\n// $haystack_len;\n $needle_len = strlen( $needle );\n $haystack_len = strlen( $haystack );\n\n /*\n * Simple checks\n */\n if( $haystack_len == 0 )\n {\n return NULL;\n }\n if( $needle_len == 0 )\n {\n return $haystack;\n }\n\n $badcharacter = array();\n $goodsuffix = array();\n /*\n * Initialize heuristics\n */\n $badcharacter[ALPHABET_SIZE];\n $goodsuffix[$needle_len + 1];\n\n prepare_badcharacter_heuristic( $needle, $needle_len, $badcharacter );\n prepare_goodsuffix_heuristic( $needle, $needle_len, $goodsuffix );\n\n /*\n * Boyer-Moore search\n */\n $s = 0;\n while( $s <= ( $haystack_len - $needle_len ))\n {\n $j = $needle_len;\n while( $j > 0 && $needle[$j - 1] == $haystack[$s + $j - 1] )\n $j--;\n\n if( $j > 0 )\n {\n $k = $badcharacter[( int ) $haystack[$s + $j - 1]];\n if( $k < ( int ) $j && ( $m = $j - $k - 1 ) > $goodsuffix[$j] ) { $s += $m; }\n else { $s += $goodsuffix[$j]; }\n }\n else\n {\n return $haystack + $s;\n }\n }\n\n return NULL;\n}", "protected function dijkstraEdges ($from)\n\t{\n\t\t//init\n\t\t$lengths = array(); // vertexId => length\n\t\t$prevVertices = array(); // i => vertexId\n\t\t$vertices = $this->getVerticesIds(); // i => vertexId\n\n\t\t$prevVertices[$from] = null;\n\t\t$lengths[$from] = 0;\n\n\t\t// alg\n\t\twhile(count($vertices) > 0){ // while some vertices remain\n\t\t\t$minValue = null;\n\t\t\t$minKey = null;\n\t\t\tforeach($vertices as $i => $vertexKey){ //pop the one with shortest path\n\t\t\t\tif (isset($lengths[$vertexKey])){\n\t\t\t\t\tif($minValue === null || $lengths[$vertexKey] < $minValue){\n\t\t\t\t\t\t$minValue = $lengths[$vertexKey];\n\t\t\t\t\t\t$minKey = $i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($minValue === null || $minKey === null){ //or pop random\n\t\t\t\treset($vertices);\n\t\t\t\tlist($minKey, $minValue) = each($vertices);\n\t\t\t}\n\t\t\t$u = $vertices[$minKey];\n\t\t\tunset($vertices[$minKey]);\n\n\t\t\tif (isset($lengths[$u])){\n\t\t\t\t$neighbours = array();\n\t\t\t\tforeach($this->edges[$u] as $key => $distance){ // get distances of neighbours\n\t\t\t\t\t$neighbours[$key] = $distance;\n\t\t\t\t}\n\t\t\t\tforeach($neighbours as $neighbourId => $neighbourDistance){\n\t\t\t\t\t$potentialLength = $lengths[$u] + $neighbourDistance;\n\t\t\t\t\tif(!isset($lengths[$neighbourId]) || $potentialLength < $lengths[$neighbourId]){ // check better route\n\t\t\t\t\t\t$lengths[$neighbourId] = $potentialLength;\n\t\t\t\t\t\t$prevVertices[$neighbourId] = $u;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $prevVertices;\n\t}", "public function solution(string $stringOne, string $stringTwo): bool\n {\n $stringOneLength = strlen($stringOne);\n $stringTwoLength = strlen($stringTwo);\n\n // if difference in length is more then two characters stop processing\n if (abs($stringOneLength - $stringTwoLength) > 1) {\n return false;\n }\n\n $stringLonger = $stringOneLength > $stringTwoLength ? $stringOne : $stringTwo;\n $stringShorter = $stringOneLength < $stringTwoLength ? $stringOne : $stringTwo;\n\n $changeOccurred = false;\n\n $j = 0;\n for ($i = 0, $iMax = strlen($stringLonger); $i < $iMax; $i++) {\n if (!isset($stringShorter[$j]) || $stringLonger[$i] !== $stringShorter[$j]) {\n if ($changeOccurred) {\n return false; // second difference occurred, stop processing\n }\n $changeOccurred = true;\n if ($stringTwoLength !== $stringOneLength) {\n continue;\n }\n }\n $j++;\n }\n\n return true;\n }", "function sortByTerm($a, $b) \n{\n\t$aStats = explode ( \":\", $a );\n\t$bStats = explode ( \":\", $b );\n\t\n return strcmp( $aStats[2],$bStats[2] );\n}", "function trimPaths($str)\n\t{\n\t\t$steps = explode('/', $str);\n\t\t//$str == \"/home/qreon/music/Radiohead/../\"\n\t\t//$steps == array('', 'home', 'qreon', 'music', 'Radiohead', '..', '')\n\n\t\treset($steps);\n\t\twhile(next($steps) !== false)\n\t\t{\n\t\t\tif(current($steps) == '..')\n\t\t\t{\n\t\t\t\tprev($steps);\n\t\t\t\t//On retourne à l'étape précédente\n\t\t\t\tarray_splice($steps, key($steps), 2);\n\t\t\t\t//On vire les deux cases à l'endroit actuel\n\t\t\t\tnext($steps);\n\t\t\t\t//On reavance pour annuler l'effet du prev()\n\t\t\t}\n\t\t}\n\t\tend($steps);\n\t\tunset($steps[key($steps)]);\n\n\t\t$res = '';\n\t\tforeach ($steps as $key => $value) {\n\t\t\t$res .= $value . '/';\n\t\t}\n\n\t\treturn $res;\n\t}", "public function testStartsWithALetter()\n {\n $route = new Route(['Csíkszereda', 'Székelyudvarhely', 'Szentegyáza', 'Lövéte', 'Almás'], 1);\n\n $results = $route->startsWith('S');\n\n $this->assertCount(2, $results);\n $this->assertContains('Székelyudvarhely', $results);\n $this->assertContains('Szentegyáza', $results);\n\n // Empty array if passed even\n $this->assertEmpty($route->startsWith('U'));\n }", "function getpath($path) {\n $findnode = array_shift($path); //pop the first value off the path, we will pass the rest of the path into the delegated object when we find it\n if (isset($findnode)) {\n //each path is a reference into one of our arrays\n if (array_key_exists($findnode, $this->root)) {\n return $this->root[$findnode]->getpath($path);\n } elseif (array_key_exists($findnode, $this->fields)) {\n return $this->fields[$findnode];\n } elseif (array_key_exists($findnode, $this->values)) {\n return $this->values[$findnode]->getpath($path);\n } elseif (array_key_exists($findnode, $this->statements)) {\n return $this->statements[$findnode]->getpath($path);\n }\n //we don't go looking down 'next', that isn't path referenceable for the purpose of getting a text value\n } else {\n //we reached the end of the path, return what we have.\n return \"$this\";\n }\n }", "abstract public function getVertexToFrom(Vertex $startVertex);", "function fiftyone_degrees_get_node_index_in_string($node, $useragent_bytes, $headers)\n{\n $characters = fiftyone_degrees_get_node_characters($node, $headers);\n $char_count = count($characters);\n $final_index = $char_count - 1;\n $ua_count = count($useragent_bytes);\n for ($index = 0; $index < $ua_count - $char_count; $index++) {\n for ($node_index = 0, $target_index = $index; \n $node_index < $char_count && $target_index < $ua_count; \n $node_index++, $target_index++) {\n\n if ($characters[$node_index] != $useragent_bytes[$target_index])\n break;\n else if ($node_index == $final_index)\n return $index;\n }\n }\n return -1;\n}", "public function short_route($routes){\r\n $min_route = NULL;\r\n $min_cost = NULL;\r\n\r\n foreach($routes as $route){\r\n $cost = $this->get_cost_route($route);\r\n if(!isset($min_cost) || $cost < $min_cost){\r\n $min_route = $route;\r\n $min_cost = $cost;\r\n }\r\n }\r\n\r\n return array('route' => $min_route, 'cost' => $min_cost);\r\n\r\n }", "function getnext($str){\n $i = 1;\n $j = 0;\n $next[1] = 0;\n while ($i < strlen($str)-1){\n if($j == 0 || $str[$i] == $str[$j]){\n ++$i;\n ++$j;\n $next[$i] = $j;\n }else{\n $j = $next[$j];\n }\n }\n print_r($next);\n }", "function prims_mst($distance_table){\n //TODO use sets or something similar to sets for this\n $u = array();\n $v = array_keys($distance_table);\n\n $new_edges = array();\n $all_vertexes = array_keys($distance_table);\n\n $a = array_pop($v);\n array_push($u,$a);\n\n //Keep looping until we've got all the edges\n $i = 0; //Loop protector to prevent infinite loops\n $max_ittr = count($all_vertexes)+4;\n while(!contains_all_verticies($u,$all_vertexes) && $i < $max_ittr){\n\n //Now go through all the edges in $v find it's closest neighbour in $u\n //Find the miinmum of those and put that vertex in $v\n $min_v = INF;\n $min_i = 0;\n $min_j = 0;\n foreach($v as $v1){\n $mins = find_min_vertex($v1,$u,$distance_table);\n if($mins[1] < $min_v){\n $min_v = $mins[1];\n $min_i = $mins[0];\n $min_j = $v1;\n }\n }\n //add the edge to the edges and the vertex to $u\n array_push($u,$min_j);\n array_push($new_edges,array($min_j,$min_i));\n\n $v = array_delete($v,$min_j);\n\n\n\n $i++;\n }\n\n return $new_edges;\n}", "function testStartsWith4 ()\n\t{\n\t\t\t$input1 = 'Barry';\n\t\t\t$input2 = null;\n\t\t\t$this->assertFalse (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}", "public function shortestTransitDaysAndCheapest()\n {\n $products = $this->p();\n usort($products, [$this, 'sortByTransitDaysThenCheapest']);\n return $products[0];\n }", "public static function str_longest_common_substring(\n string $str1,\n string $str2,\n string $encoding = 'UTF-8'\n ): string {\n if ($str1 === '' || $str2 === '') {\n return '';\n }\n\n // Uses dynamic programming to solve\n // http://en.wikipedia.org/wiki/Longest_common_substring_problem\n\n if ($encoding === 'UTF-8') {\n $str_length = (int) \\mb_strlen($str1);\n $other_length = (int) \\mb_strlen($str2);\n } else {\n $encoding = self::normalize_encoding($encoding, 'UTF-8');\n\n $str_length = (int) self::strlen($str1, $encoding);\n $other_length = (int) self::strlen($str2, $encoding);\n }\n\n // Return if either string is empty\n if ($str_length === 0 || $other_length === 0) {\n return '';\n }\n\n $len = 0;\n $end = 0;\n $table = \\array_fill(\n 0,\n $str_length + 1,\n \\array_fill(0, $other_length + 1, 0)\n );\n\n if ($encoding === 'UTF-8') {\n for ($i = 1; $i <= $str_length; ++$i) {\n for ($j = 1; $j <= $other_length; ++$j) {\n $str_char = \\mb_substr($str1, $i - 1, 1);\n $other_char = \\mb_substr($str2, $j - 1, 1);\n\n if ($str_char === $other_char) {\n $table[$i][$j] = $table[$i - 1][$j - 1] + 1;\n if ($table[$i][$j] > $len) {\n $len = $table[$i][$j];\n $end = $i;\n }\n } else {\n $table[$i][$j] = 0;\n }\n }\n }\n } else {\n for ($i = 1; $i <= $str_length; ++$i) {\n for ($j = 1; $j <= $other_length; ++$j) {\n $str_char = self::substr($str1, $i - 1, 1, $encoding);\n $other_char = self::substr($str2, $j - 1, 1, $encoding);\n\n if ($str_char === $other_char) {\n $table[$i][$j] = $table[$i - 1][$j - 1] + 1;\n if ($table[$i][$j] > $len) {\n $len = $table[$i][$j];\n $end = $i;\n }\n } else {\n $table[$i][$j] = 0;\n }\n }\n }\n }\n\n if ($encoding === 'UTF-8') {\n return (string) \\mb_substr($str1, $end - $len, $len);\n }\n\n return (string) self::substr($str1, $end - $len, $len, $encoding);\n }", "function testStartsWith5 ()\n\t{\n\t\t\t$input1 = null;\n\t\t\t$input2 = null;\n\t\t\t$this->assertFalse (\n\t\t\t\t\t$this->stringUtils->startsWith ($input2, $input1));\n\t}", "function getMinDistance($student, $tutor)\n{\n\t$minDistance = MAX_DISTANCE;\n\tforeach ($student as &$studentLoc) {\n\t\t//print \"$studentLoc<br>\";\n\t\tforeach ($tutor as &$tutorLoc){\n\t\t\t$distance = get_distance($studentLoc,$tutorLoc);\n\t\t\t//print \"$distance $tutorLoc<br>\";\n\t\t\tif($distance < $minDistance)\n\t\t\t\t$minDistance = $distance;\n\t\t}\n\t}\n\treturn $minDistance;\n}", "public function longestCommonPrefix($otherStr)\n {\n $encoding = $this->encoding;\n $maxLength = min($this->length(), UTF8::strlen($otherStr, $encoding));\n\n $longestCommonPrefix = '';\n for ($i = 0; $i < $maxLength; $i++) {\n $char = UTF8::substr($this->str, $i, 1, $encoding);\n\n if ($char == UTF8::substr($otherStr, $i, 1, $encoding)) {\n $longestCommonPrefix .= $char;\n } else {\n break;\n }\n }\n\n return static::create($longestCommonPrefix, $encoding);\n }", "public function findIndexNearDistance($targetDistance)\n {\n $left = 0;\n $right = count($this->elements) - 1;\n\n if ($left == $right) {\n return $left;\n }\n\n // if the distance is zero, there's no need to search (and it doesn't work anyway)\n // if it's a point before the start of the line, then just return the start of the line\n // Weathermap should *never* ask for this, anyway, either\n if ($targetDistance <= 0) {\n return $left;\n }\n\n // if it's a point past the end of the line, then just return the end of the line\n // Weathermap should *never* ask for this, anyway\n if ($this->elements[$right]->distance < $targetDistance) {\n return $right;\n }\n\n // if somehow we have a 0-length curve, then don't try and search, just give up\n // in a somewhat predictable manner\n if ($this->elements[$left]->distance === $this->elements[$right]->distance) {\n return $left;\n }\n\n while ($left <= $right) {\n $mid = (int) floor(($left + $right) / 2);\n\n if (($this->elements[$mid]->distance <= $targetDistance) && ($this->elements[$mid + 1]->distance > $targetDistance)) {\n return $mid;\n }\n\n if ($targetDistance <= $this->elements[$mid]->distance) {\n $right = $mid - 1;\n } else {\n $left = $mid + 1;\n }\n }\n\n throw new WeathermapInternalFail(\"Howie's crappy binary search is wrong after all.\\n\");\n }", "function getPathFull($a_endnode_id, $a_startnode_id = 0)\n\t{\n\t\t$pathIds =& $this->getPathId($a_endnode_id, $a_startnode_id);\n\n\t\t// We retrieve the full path in a single query to improve performance\n global $ilDB;\n\n\t\t// Abort if no path ids were found\n\t\tif (count($pathIds) == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t$inClause = 'child IN (';\n\t\tfor ($i=0; $i < count($pathIds); $i++)\n\t\t{\n\t\t\tif ($i > 0) $inClause .= ',';\n\t\t\t$inClause .= $ilDB->quote($pathIds[$i],'integer');\n\t\t}\n\t\t$inClause .= ')';\n\n\t\t$q = 'SELECT * '.\n\t\t\t'FROM '.$this->table_tree.' '.\n $this->buildJoin().' '.\n\t\t\t'WHERE '.$inClause.' '.\n 'AND '.$this->table_tree.'.'.$this->tree_pk.' = '.$this->ilDB->quote($this->tree_id,'integer').' '.\n\t\t\t'ORDER BY depth';\n\t\t$r = $ilDB->query($q);\n\n\t\t$pathFull = array();\n\t\twhile ($row = $r->fetchRow(DB_FETCHMODE_ASSOC))\n\t\t{\n\t\t\t$pathFull[] = $this->fetchNodeData($row);\n\n\t\t\t// Update cache\n\t\t\tif ($this->__isMainTree())\n\t\t\t{\n\t\t\t\t#$GLOBALS['ilLog']->write(__METHOD__.': Storing in tree cache '.$row['child']);\n\t\t\t\t$this->in_tree_cache[$row['child']] = $row['tree'] == 1;\n\t\t\t}\n\t\t}\n\t\treturn $pathFull;\n\t}", "function find_minimum($entities) {\r\n \r\n\tglobal $userconnection_distance;\r\n $keys = array_keys ($entities);\r\n $minid = $entities[$keys[0]];\r\n $mindist = $userconnection_distance[$minid];\r\n foreach ($keys as $key) {\r\n $tentity = $entities[$key];\r\n if ($userconnection_distance[$tentity] < $mindist) {\r\n $mindist = $userconnection_distance[$tentity];\r\n $minid = $tentity;\r\n }\r\n }\r\n return $minid;\r\n}", "function cmp($a, $b)\n{\n if(strlen($a[1]) == strlen($b[1]))\n return 0;\n else return (strlen($a[1]) > strlen($b[1]) ? -1 : 1);\n}", "function fiftyone_degrees_node_index_string_compare($node_index, $start_position, $value, $headers) {\n $characters = fiftyone_degrees_get_node_index_string($node_index, $headers);\n $end = count($characters) - 1;\n for ($i = $end, $v = $start_position + $end; $i >= 0; $i--, $v--) {\n $difference = $characters[$i] - $value[$v];\n if ($difference != 0)\n return $difference;\n }\n return 0;\n}", "function fm_reorder_folders_list($obj1, $obj2) {\r\n\t$size1 = explode(\"/\",$obj1['stored_filename']);\r\n\t$size2 = explode(\"/\",$obj2['stored_filename']);\r\n\r\n\tif (count($size1) == count($size2)) {\r\n\t\treturn 0;\r\n\t}\r\n\tif (count($size1) > count($size2)) {\r\n\t\treturn 1;\r\n\t}\r\n\tif (count($size1) < count($size2)) {\r\n\t\treturn -1;\r\n\t}\r\n}", "public function searchSort($a, $b)\n\t{\n\t\tglobal $excludedWords;\n\n\t\t$x = strlen($a) - (in_array($a, $excludedWords) ? 1000 : 0);\n\t\t$y = strlen($b) - (in_array($b, $excludedWords) ? 1000 : 0);\n\n\t\treturn $y < $x ? 1 : ($y > $x ? -1 : 0);\n\t}", "public function longestCommonSubstring($otherStr)\n {\n // http://en.wikipedia.org/wiki/Longest_common_substring_problem\n $encoding = $this->encoding;\n $stringy = static::create($this->str, $encoding);\n $strLength = $stringy->length();\n $otherLength = \\mb_strlen($otherStr, $encoding);\n // Return if either string is empty\n if ($strLength == 0 || $otherLength == 0) {\n $stringy->str = '';\n return $stringy;\n }\n $len = 0;\n $end = 0;\n $table = array_fill(0, $strLength + 1,\n array_fill(0, $otherLength + 1, 0));\n for ($i = 1; $i <= $strLength; $i++) {\n for ($j = 1; $j <= $otherLength; $j++) {\n $strChar = \\mb_substr($stringy->str, $i - 1, 1, $encoding);\n $otherChar = \\mb_substr($otherStr, $j - 1, 1, $encoding);\n if ($strChar == $otherChar) {\n $table[$i][$j] = $table[$i - 1][$j - 1] + 1;\n if ($table[$i][$j] > $len) {\n $len = $table[$i][$j];\n $end = $i;\n }\n } else {\n $table[$i][$j] = 0;\n }\n }\n }\n $stringy->str = \\mb_substr($stringy->str, $end - $len, $len, $encoding);\n return $stringy;\n }" ]
[ "0.63380337", "0.61368537", "0.6128786", "0.5749965", "0.5707489", "0.56799054", "0.55753684", "0.55061114", "0.5482678", "0.5438092", "0.54357094", "0.54146755", "0.53990185", "0.53851324", "0.53291917", "0.532149", "0.52419734", "0.5233982", "0.52203447", "0.5198791", "0.51956135", "0.51945525", "0.51928246", "0.5174435", "0.5163099", "0.5162619", "0.51615185", "0.51173353", "0.5108191", "0.5096137", "0.50866777", "0.5071522", "0.506246", "0.50594336", "0.50591505", "0.5054906", "0.50535095", "0.5031841", "0.5025844", "0.49478388", "0.4938645", "0.4910625", "0.48715794", "0.48614153", "0.4852905", "0.48308495", "0.4802127", "0.47973397", "0.4796859", "0.47884086", "0.47585505", "0.47522378", "0.47372407", "0.4728663", "0.4728663", "0.47275984", "0.47221568", "0.47118616", "0.47098845", "0.46949375", "0.4675164", "0.46422675", "0.46294555", "0.4619316", "0.46188772", "0.4618055", "0.4614374", "0.4588751", "0.4575022", "0.45679402", "0.45564392", "0.45524365", "0.45427406", "0.45362666", "0.45315593", "0.45294222", "0.45278296", "0.4524462", "0.45211253", "0.4517985", "0.45057207", "0.4501766", "0.45010793", "0.44989118", "0.449063", "0.44900855", "0.44817695", "0.4479517", "0.44717526", "0.44674042", "0.44659197", "0.44598386", "0.44576672", "0.445664", "0.44533333", "0.4428898", "0.4412329", "0.44090325", "0.43998963", "0.43968564" ]
0.6098298
3
middleware para dar paso solo a usuarios autentificados
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function authFilter() {\n\t\treturn function () {\n\t\t\tif (!kirby()->site()->user()) {\n\t\t\t\tpanel()->redirect('login');\n\t\t\t}\n\t\t};\n\t}", "public function authorize()\n {\n return true; //Autorizar al usuario para hacer peticiones \n }", "public function __construct(){\n $this->middleware('auth');\n\n $this->middleware(function ($request, $next) {\n\n $tipo= Auth()->user()->tipo;\n if(Auth::check() && Auth::user()->tipo=='Administrador'){\n return $next($request);\n }\n else if(Auth::check() && Auth::user()->tipo=='tecnico'){\n return $next($request);\n }else if(Auth::check() && Auth::user()->tipo=='campo'){\n return $next($request);\n }else if(Auth::check() && Auth::user()->tipo=='Productor'){\n return $next($request);\n\n }else{\n\n return redirect('alertas');\n }\n\n });\n }", "abstract protected function auth();", "public function authUser(){\n if(!isset($this->sessionBool) || empty($this->sessionBool)){\n die($this->alerts->ACCESS_DENIED);\n }else{\n if(!$this->sessionBool){\n die($this->alerts->ACCESS_DENIED);\n }\n } \n }", "public function mustbeuser()\n {\n if (!$this->hasuser())\n {\n $this->web()->noaccess();\n }\n }", "public function authorize()\n {\n return true; // Auth middleware already in use\n }", "public function __construct(){\n\n //1.se non sei loggato puoi accedere solo ad index e a show\n $this->middleware('auth'); //NON PASSATO? REGISTER O LOGIN\n\n //tutti gli user registrati hanno permesso di\n //gestire la propria messaggistica,\n //esplicitiamo comunque questa possibilità\n $this->middleware('permission:manage-owner|manage-guest');\n\n //In caso non si soddisfino le proprietà si riviene\n //mandati alla pagina 403:forbidden\n\n }", "public function auth(){ return $this->authForUser( User::$cUser ); }", "private function authorizeUser($user){\n\n }", "public function handle($request, Closure $next) {\n if ($this->auth->user()->admin()) {\n//aqui lo q hacemos es q verificamos si el usuario autentificado es de tipo admin y seguimos con el proceso\n return $next($request);\n } else { //y sino\n abort(401); //mandamos un abort 401 q es q nos muestra la vista de acceso denegado\n }\n\n }", "public function __construct(){\n\n\n //1.se non sei loggato puoi accedere solo ad index e a show\n $this->middleware('auth'); //NON PASSATO? REGISTER O LOGIN\n\n //tutti gli user registrati hanno permesso di\n //gestire la propria messaggistica,\n //esplicitiamo comunque questa possibilità\n $this->middleware('permission:manage-owner');\n\n //In caso non si soddisfino le proprietà si riviene\n //mandati alla pagina 403:forbidden\n\n }", "function authorizedUsersOnly(){\n global $authenticatedUser;\n if(empty($authenticatedUser)){\n header(\"HTTP/1.1 401 Unauthorized\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-401\");\n exit();\n }\n }", "public function __construct()\n {\n $this->middleware('adm'); // Verifica que la solicitud por enviar proviene de un usuario autenticado o no.\n $this->middleware('active'); //Verifica que la solicitud proviene de un usuario activo.\n }", "public function authorize()\n {\n return true; //esto es para validar sesiones, va a servir\n }", "public function __construct()\n {\n $this->middleware('auth');//este middleware hace q el resto de metodos sean privados y va requerir autenticacion en todo momento\n //o sea con esto voy a blokear todos los metodos ecepto cuando este idintificado\n }", "public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }", "public function __construct() {\n $this->middleware(function ($request, $next) {\n if(Auth::check()) {\n if(Auth::user()->role->precargas)\n {\n return $next($request);\n } \n return redirect('/inicio');\n \n }\n return redirect('/'); \n });\n }", "public function __construct(){\n $this->middleware(\"auth\"); //Solo van a poder abrir ordenes quienes esten con sesion iniciada\n $this->middleware('roles:0'); //Se listan los roles que tienen acceso a usuarios\n }", "function authorize()\n {\n try {\n $authRequest = $this->heimdall->validateAuth();\n $authRequest->setUser(new UserEntity());\n $this->heimdall->completeAuth($authRequest);\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }", "public function __cosnstruct(){\n $this->middleware('auth');\n }", "function preDispatch() {\n $auth = Zend_Auth::getInstance()->setStorage(new Zend_Auth_Storage_Session('admin'));\n if (!$auth->hasIdentity()) {\n $this->_redirect('login');\n } else {\n $user = $auth->getIdentity();\n $group = $user->code_groupe;\n if ($group != 'admin' && $group != 'acteur') {\n $this->view->user = $user;\n return $this->_redirect('index2');\n }\n $this->view->user = $user;\n }\n }", "public function __construct()\n {\n //therefore the below function can be used to access it\n //https://stackoverflow.com/questions/39175252/cant-call-authuser-on-controllers-constructor\n $this->middleware(function ($request, $next) {\n $this->user = Auth::user();\n //i.e not logged in\n\n\n if (is_null($this->user)) {\n return redirect(\"/login\");\n }\n\n if ($this->user->privelleges != \"admin\") {\n return redirect()->route('general.restricted');\n }\n\n //maybe update redirct to\n //Redirect::to('/login?attempt='. true) or something liek that\n return $next($request);\n });\n }", "public function __construct()\n { \n $this->middleware(function ($request, $next) {\n $this->user= \\Auth::user();\n $idrol = (int) $this->user->id_rol;\n\n $roles_permitidos = \"'superusuario', 'administrador'\" ;\n\n $acceso = collect(\\DB::select(\"SELECT * from roles where id = {$idrol} and rol in ( {$roles_permitidos} ) \"))->first();\n if(!$acceso){\n \\Auth::logout();\n abort(404);\n }\n\n return $next($request);\n });\n\n }", "function user()\n{\n if (Auth::guard('web')->check()) {\n return Auth::guard('web')->user();\n }elseif(Auth::guard('api')->check()){\n return Auth::guard('api')->user();\n }\n}", "public function authorize()\n {\n return true; // Auth->User();\n }", "public function doAuthentication();", "public function __construct()\n {\n $this->middleware('auth:employes'); //protege la ruta mensajes, solo se muestra haciendo login, se le paso employes como parametro para que no bloquie la ruta mensajes despues de hacer login\n\n $this->middleware('roles:Administrador');//protege la ruta listacontratos dentro de la sesion y le pasa por parametro los distintos roles ej: ('roles:administrador,jefeDeInventario') si se agrega o se quitan roles aqui, tambien se debe hacer en el link\n }", "protected function loginIfRequested() {}", "public function authHospital(){\n\n\t}", "public function __construct() {\n $this->middleware(function ($request, $next) {\n if(Auth::check()) {\n if(Auth::user()->role->recursos_humanos)\n {\n return $next($request);\n } \n return redirect('/inicio');\n \n }\n return redirect('/'); \n });\n }", "public function __construct()\n {\n $this->middleware('auth');// if the user not registred and his role not client he can't see the client view\n }", "function middleware_Loggedin()\n{\n return isset($_SESSION['auth']);\n}", "protected function isUserAllowedToLogin() {}", "public function __construct(){\n $this->middleware('auth');\n has_role('users',1);\n }", "public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $response->redirect(\"login\");\n }\n }", "public function handle($request, Closure $next, $authorization)\n {\n try {\n //Verficia la existencia del token\n $token = JWTAuth::parseToken();\n //Autoriza al usuario al ser autenticado el token\n $user = $token->authenticate();\n } catch (TokenExpiredException $e) {\n //Si el token expira\n return $this->unauthorized('Tu sesion ha expirado, por favor realiza el loguin nuevamente.');\n } catch (TokenInvalidException $e) {\n //Si el token no es valido\n return $this->unauthorized('Tu credenciales son invalidad, por favor vuelve a loguearte.');\n }catch (JWTException $e) {\n //Si el token expira\n return $this->unauthorized('Por favor, inicia sesion para continuar.');\n }\n //If user was authenticated successfully and user is in one of the acceptable roles, send to next request.\n/*\n $data = EstudianteProceso::distinct()->select('ProcesoActividad.Nombre')->join('ProcesoActividad','ProcesoActividad.IdProcesoActividad' ,'=','EstudianteProceso.IdProcesoActividad')->where('EstudianteProceso.IdEstudiante','=',$user->id)->get();\n\n foreach ($data as $dat) {\n if ($user && strcmp($dat->Nombre, $authorization) === 0) {\n return $next($request);\n }\n }\n\n*/\n //consulta los permisos del token enviado, si el permiso se encuentra en su tabla de la BD\n //permite continuar con el request\n $data = EstudianteProceso::distinct()->select('ProcesoActividad.Nombre')->join('ProcesoActividad','ProcesoActividad.IdProcesoActividad' ,'=','EstudianteProceso.IdProcesoActividad')->where([['EstudianteProceso.IdEstudiante',$user->id],['EstudianteProceso.Permiso','1'],['ProcesoActividad.Nombre',$authorization]])->first();\n\n\n if ($data) {\n return $next($request);\n }\n\n return $this->unauthorized();\n }", "public function authorize()\n {\n $usuario = Auth::User();\n //se ele e master\n if($usuario->tipo_usuario_id!=8){\n return false; \n }\n return true;\n }", "public function handle($request, Closure $next, $permissions)\n {\n if (1==1) {\n if (!JWTAuth::parseToken()->authenticate()->can($permissions)) {\n // if ($request->ajax()) {\n return response()->json([\n 'status'=> false,\n 'message' => 'no tienes permiso para => '.$permissions\n ],403);\n // }\n }\n } else {\n $guest = Role::whereSlug('guest')->first();\n\n if ($guest) {\n if (!$guest->can($permissions)) {\n if ($request->ajax()) {\n return response('Unauthorized.', 403);\n }\n\n abort(403, 'Unauthorized action.');\n }\n }\n }\n\n return $next($request);\n /*\n echo $user = JWTAuth::parseToken()->authenticate();\n\n $roles = DB::table('roles as r')\n ->join('role_user as ru','r.id','=','ru.role_id')\n ->select('r.slug','r.id')\n ->where('ru.user_id','=', $user->id)->get();\n //$user = User::find(1);\n\n echo \"query\".$roles;\n //echo $user = User::find(1)->roles();\n if ($user) {\n if($roles){\n foreach ($roles as $role) {\n $r = Role::whereSlug($role->slug);\n echo $role;\n if(!$r->can($permissions)){\n return response()->json([\n \"msj\" => \"No autorizado\",\n \"description\" => \"No tienes permiso para \".$permissions\n ],403);\n }else\n return $next($request);\n }\n }\n /* if (!$user->user()->can($permissions)) {\n if ($request->ajax()) {\n return response('Unauthorized.', 403);\n }\n\n abort(403, 'Unauthorized action.');\n }*/\n /* } else {\n $guest = Role::whereSlug('guest')->first();\n\n if ($guest) {\n if (!$guest->can($permissions)) {\n if ($request->ajax()) {\n return response('Unauthorized.', 403);\n }\n\n abort(403, 'Unauthorized action.');\n }\n }\n }\n*/\n }", "protected function authRequired()\n {\n return true;\n }", "public function __construct()\n {\n if(!Auth::check() ){\n $this->middleware('auth');\n }\n else {\n //Si esta logueado entonces se revisa el permiso\n if (Auth::user()->can('invernaderoplantula'))\n {\n }\n else {\n //Si no tiene el permiso entonces cierra la sesion y manda un error 404\n //Auth::logout();\n abort('404');\n }\n }\n }", "public function __construct()\n{\n $this->middleware('auth'); //only the authenticated user have access to the methods below. unauthenticated users will not have any access to these methods.\n $this->middleware('role:doctor'); //can add more authorisation to view the page e.g doctor\n}", "public function __construct()\n {\n /*permitir que usuarios autenticados accedan a una ruta determinada\n si estan autenticados redirecciona a home*/\n $this->middleware('auth');\n }", "public function setAuthenticated();", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\t//para ver si el usuario tiene acceso a este metodo\n //return false;\n return true;\n }", "private function _userAutehntication()\r\n {\r\n /* Check if the USERNAME and PASSWORD HTTP headers is set*/\r\n if(!(isset($_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_USERNAME']) and isset($_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_PASSWORD']))) {\r\n /* Error: Unauthorized User */\r\n $this->_sendResponse(401);\r\n }\r\n $username = $_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_USERNAME'];\r\n $password = $_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_PASSWORD']; \r\n \r\n /* Find the user */\r\n $user=User::model()->find('LOWER(username)=?',array(strtolower($username)));\r\n if($user===null) {\r\n /* Error: Unauthorized User, username doesn't exist */\r\n $this->_sendResponse(401, 'Error: Not a valid User');\r\n } else if(!$user->validatePassword($password)) {\r\n /* Error: Unauthorized User, Wrong Password */\r\n $this->_sendResponse(401, 'Error: Password is Wrong');\r\n }\r\n }", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function handle($request, Closure $next)\n {\n $user = Auth::user();\n\n if ( ! Auth::check()) {\n abort(403, 'No autorizado ');\n }\n\n if ($user==null)\n { return view('principal');}\n if(!$user->esAdmin()){ // si no es administrador lo mandamos a la página principal\n echo 'no admin';\n return redirect('/');\n\n }\n return $next($request);\n }", "public function __construct()\n{\n $this->middleware('auth');\n $this->middleware('role:user,admin'); //can add more authorisation to view the page e.g admin\n}", "public function handle($request, Closure $next,$admin)\n {\n $user =$request->user();\n return($user->acces==$admin?$next($request):redirect('/dashboard'));\n \n }", "public function authorize()\n {\n return \\Auth::guard('staff')->check();\n }", "public function authorize();", "public function authorize();", "public function __construct()\n {\n if(!Auth::check() ){\n $this->middleware('auth');\n }\n else {\n //Si esta logueado entonces se revisa el permiso\n if (Auth::user()->can('administracion'))\n {\n }\n else {\n //Si no tiene el permiso entonces cierra la sesion y manda un error 404\n //Auth::logout();\n abort('404');\n }\n }\n }", "public function __construct()\n {\n $this->middleware('checkauth', ['only' => ['getUser', 'setname', 'setemail', 'setpassword']]);\n// $this->middleware('checkuser', ['only' => ['setname', 'setemail', 'setpassword']]);\n }", "public function __construct()\n {\n $this->middleware('auth:userinmobiliarios',['only' => 'index']);\n }", "private function verificarUsuarioAdministrador(){\n $user = User::getUsuario();\n if( $user == 'NULL'|| !$user->admin){\n return redirect('/admin')->with('flash_message_error', 'Error acceso denegado.');\n }\n }", "public function buscarUsuarios(){\n\t\t}", "public function authorize()\n {\n return true;//auth()->user()->can(['crear movdinero']);\n }", "public function authorize()\n { \n //Returnando sempre true porque não há auth.\n return true;\n }", "public function handle($request, Closure $next)\n {\n if (empty($request->session()->get('user'))){\n return redirect()->route('login');\n }\n if(Session::get('user')['user_id'] !== 1){\n// var_dump(Session::get('user')['user_id']);\n// die;\n if(self::hasAuth(Session::get('user')['user_id']) === false) {\n return redirect()->route('error');\n }\n }\n// $auth = Route::current()->getActionName();\n// dump($auth);\n return $next($request);\n }", "function auth(){\n\t\t//TODO auth implementieren\n\t\treturn true;\n\t}", "public function __construct()\n{\n $this->middleware('auth'); //only the authenticated user have access to the methods below. unauthenticated users will not have any access to these methods.\n $this->middleware('role:patient'); //the user role authorised to see the page. can add more authorisation to view the page e.g patient\n}", "public function handle($request, Closure $next)\n {\n if(JWTAuth::parseToken()->authenticate()->hasRole('User'))\n {\n\n return $next($request);\n\n }//end of if\n \n }", "public function preAuth(Request $request, Response $response);", "public function preAuth(Request $request, Response $response);", "public function handle($request, Closure $next)\n {\n $user = User::all()->count();\n if (!($user == 1)) {\n if (!Auth::user()->hasPermissionTo('View User')) //If user does //not have this permission\n {\n// abort('401');\n return redirect('/home');\n }\n }\n\n if ($request->is('users/create'))\n {\n if (!Auth::user()->hasPermissionTo('Add User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('users'))\n {\n if (!Auth::user()->hasPermissionTo('View User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('users/*/edit'))\n {\n if (!Auth::user()->hasPermissionTo('Edit User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->isMethod('Delete'))\n {\n if (!Auth::user()->hasPermissionTo('Delete User'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('permissions/create'))\n {\n if (!Auth::user()->hasPermissionTo('Add Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('permissions'))\n {\n if (!Auth::user()->hasPermissionTo('View Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('permissions/*/edit'))\n {\n if (!Auth::user()->hasPermissionTo('Edit Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->isMethod('Delete'))\n {\n if (!Auth::user()->hasPermissionTo('Delete Permission'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->is('roles/create'))\n {\n if (!Auth::user()->hasPermissionTo('Add Role'))\n {\n return redirect('/home');\n }\n }\n\n// if ($request->is('roles'))\n// {\n// if (!Auth::user()->hasPermissionTo('View Role'))\n// {\n// return redirect('/home');\n// }\n// }\n\n if ($request->is('roles/*/edit'))\n {\n if (!Auth::user()->hasPermissionTo('Edit Role'))\n {\n return redirect('/home');\n }\n }\n\n if ($request->isMethod('Delete'))\n {\n if (!Auth::user()->hasPermissionTo('Delete Role'))\n {\n return redirect('/home');\n }\n }\n\n return $next($request);\n }", "public function handle($request, Closure $next)\n {\n # $userId = $request->user()->id;\n #$user = App\\User::find($userId);\n\n if($request->user() == null || !$request->user()->isAdmin()){\n return redirect('/');\n }\n\n return $next($request);\n }", "function usuario_autenticado() {\n\n if (!revisar_usuario()) {\n header('Location:login.php?user=paciente');\n exit();\n }\n}", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function handle($request, Closure $next)\n {\n $usersCount = User::count();\n //dd(Auth::user()->permiso_id >= 2);\n if ($usersCount >= 1) {\n if (!Auth::guest() && Auth::user()->permiso_id < 2) {\n return $next($request);\n }\n }\n else{\n $permisos = Permiso::all();\n return view('auth.register',['permisos'=>$permisos]);\n }\n \n\n return redirect(\"/\");\n\n \n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function __construct()\n {\n $this->middleware('auth');\n if (Auth::check()) {\n if (!Auth::user()->is('admin')) {\n flash('شما مجوز دسترسی به صفحهٔ مدیریت را ندارید');\n return Redirect::to(url('login'))->send();\n }\n }\n }", "public function authorize()\n {\n //Nos saltamos la autorizacion.\n return true;\n }", "public function authorize()\n\t{\n\t\t// La autorización siempre será true por que cualquier usuario podrá\n\t\t// crear álbumes y nosotros se los asociaremos al usuario\n\t\t// que tiene la sesión creada.\n\t\treturn true;\n\t}", "public function handle($request, Closure $next)\n {\n if (auth()->check()) {\n $user = auth()->user();\n if (!is_null($user)) {\n if ($user->status === 2) {\n $user_id = $user->id;\n $email = $user->email;\n Log::info('Авторизация под заблокированным пользователем!', [$user_id, $email]);\n\n if ($user->isImpersonated()) {\n $user->leaveImpersonation();\n return redirect()->route('manager.users')->withErrors(sprintf('Аккаунт #%d %s заблокирован, авторизация невозможна!', $user_id, $email));\n }\n\n auth()->logout();\n return redirect()->route('login')->withErrors('Ваш аккаунт заблокирован за нарушение правил пользования сервисом.');\n } elseif ($user->status === 3) {\n $user_id = $user->id;\n $email = $user->email;\n Log::info('Авторизация под удаленным пользователем!', [$user_id, $email]);\n\n if ($user->isImpersonated()) {\n $user->leaveImpersonation();\n return redirect()->route('manager.users')->withErrors(sprintf('Аккаунт #%d %s удален, авторизация невозможна!', $user_id, $email));\n }\n\n auth()->logout();\n return redirect()->route('login')->withErrors('Неправильный логин или пароль!');\n }\n }\n }\n\n return $next($request);\n }", "public function authorize()\n {\n $user = \n return false;\n }", "public function authorize()\n {\n return true; //admin guard\n }", "public function __construct() {\n\t\t$this->middleware(function ($request, $next) {\n\t\t\t$route = $request->route()->getName();\n\t\t\t$action = @explode('.', $route)[1];\n\n\t\t\t$actions = ['index', 'show', 'edit', 'update', 'destroy', 'grant-rights'];\n\t\t\t$forbidd = [];\n\n\t\t\t$user = \\Auth::user();\n\t\t\tswitch (true) {\n\t\t\t\tcase !$user: {\n\t\t\t\t\t$forbidd = array_diff($actions, ['show']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase !$user->isModerator(): {\n\t\t\t\t\t$forbidd = array_diff($actions, ['show', 'edit', 'update']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (in_array($action, $forbidd)) {\n\t\t\t\treturn $this->forbiddenResponse();\n\t\t\t}\n\n\t\t\treturn $next($request);\n\t\t});\n\t}", "public function __construct()\n {\n// $this->middleware('auth', ['only'=>'store']); // Single privilege for Auth\n $this->middleware('auth'); // All privilege for Auth\n }", "public function handle($request, Closure $next)\n {\nif(!Auth::user()->hasRole('Super_Admin')){\n\n return abort(500);\n}\n\n\n return $next($request);\n }", "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function accountInfo(): Response\n {\n // logged in, or are logged in via a remember me cookie\n $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');\n\n // ...\n }", "protected function authenticated($request){\n \n $credentials = $request->only('email', 'password');\n \n $user = User::where('email',$request->email)->first();\n\n if($user->categoria_lider_id == 3){\n return Redirect::to('home');\n }\n\n $total_inscritos_lideres = DB::table('jovens')->where('igreja_id',$user->igreja_id)->count(); \n\n return view('adminlte::lideres_home',compact('total_inscritos_lideres','user'));\n }", "protected function _secure()\n {\n // user already logged in?\n if($this->current_user && $this->current_user->user_id) \n {\n return;\n }\n \n $this->_current_user();\n \n if(!$this->current_user || !$this->current_user->user_id)\n {\n redirect('user');\n }\n // user is logged in \n //$this->current_user_role = $this->current_user->role ;\n \n \n }", "Public function __construct(){\n //check if user lgged in\n $this->middleware('auth');\n }", "function __construct(){\n $this->middleware(function ($request, $next) {\n $this->user= Auth::user();\n if($this->user->user_type!=1){\n return redirect('/admin/home');\n }\n return $next($request);\n });\n }", "public function handle($request, Closure $next)\n {\n if (Permitido::where('usu_permitidos',$request->input('usuario'),'permiso')->first()!=0 ) {\n\n\n return $next($request);\n }\n\n return redirect('sinpermiso');\n\n\n\n }", "public function __construct()\n {\n //Garantiza que los métodos del controlador sean con usuario autenticado. Esto se puede hacer también en la ruta\n $this->middleware('auth');\n }", "abstract public function authorize();", "abstract public function authorize();" ]
[ "0.6618867", "0.6606963", "0.6533042", "0.64604944", "0.6434175", "0.63664556", "0.63579863", "0.6345678", "0.6314017", "0.6300136", "0.6285142", "0.6285061", "0.627229", "0.62647265", "0.6255164", "0.62398744", "0.6233098", "0.6209343", "0.62017107", "0.61987084", "0.6187511", "0.61870927", "0.6181011", "0.6180873", "0.61797905", "0.6141576", "0.6128953", "0.6128113", "0.6123168", "0.6115693", "0.6114218", "0.61112535", "0.6100303", "0.60900354", "0.6080902", "0.60656726", "0.6063286", "0.6063131", "0.60568416", "0.6054497", "0.6052847", "0.6045108", "0.60441536", "0.6043224", "0.6040899", "0.6039061", "0.60319173", "0.6001636", "0.59940076", "0.5987374", "0.597925", "0.5973792", "0.59661645", "0.59661645", "0.59652114", "0.5962142", "0.5960864", "0.59559083", "0.5952097", "0.5951139", "0.59505117", "0.59473795", "0.5945108", "0.5944513", "0.5943232", "0.5943196", "0.5943196", "0.5942683", "0.5941847", "0.5940288", "0.5938543", "0.5938543", "0.5938543", "0.5938543", "0.5938543", "0.5938543", "0.5938543", "0.5938543", "0.5928656", "0.5922825", "0.5919942", "0.5918234", "0.59153247", "0.59148955", "0.5909451", "0.59085786", "0.5906601", "0.59052557", "0.5901166", "0.5899547", "0.5899547", "0.5891187", "0.5890522", "0.58894426", "0.5889373", "0.5889344", "0.58865225", "0.58861434", "0.58810174", "0.58730733", "0.58730733" ]
0.0
-1
funcion para mandar listado de usuarios por medio de json
public function users_json($filtro) { return User::where('name','LIKE','%'.$filtro.'%')->take(15)->get(); /*if ($request->ajax()){ //return User::get(['id','name']); return response()->json([ 'mensaje'=>$filtro ]) }*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ListaUsuarios() {\n\t//obtiene el id del usuario\n $sql = \"SELECT usuario.id, usuario.nombre_usuario, persona.primer_nombre, persona.primer_apellido, usuario.estado, rol.descripcion FROM usuario INNER JOIN persona ON usuario.persona_id = persona.id INNER JOIN rol ON usuario.rol_id = rol.id WHERE usuario.estado = 'ACTIVO'\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n\t$num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($num != 0) {\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\t\t$respuesta->mensaje = \"Usuarios listados\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"No existen registros de usuarios !\";\n\t\t$respuesta->codigo = 0;\n\t}\n\treturn json_encode($respuesta);\n}", "function ListaUsuario() {\n\t\n\t\t\t$sql = \"SELECT usu.*, CONCAT_WS(' ', per.primer_nombre, per.primer_apellido) as nombre_completo, usu.nombre_usuario, rol.descripcion FROM usuario usu\n\t\t\t\t\tINNER JOIN rol rol ON rol.id = usu.rol_id\n\t\t\t\t\tINNER JOIN persona per ON per.id = usu.persona_id\";\n\t\t\t$db = new conexion();\n\t\t\t$result = $db->consulta($sql);\n\t\t\t$num = $db->encontradas($result);\n\t\t\t$respuesta->datos = [];\n\t\t\t$respuesta->mensaje = \"\";\n\t\t\t$respuesta->codigo = \"\";\n\t\t\tif ($num != 0) {\n\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t\t\t}\n\t\t\t\t$respuesta->mensaje = \"Ok\";\n\t\t\t\t$respuesta->codigo = 1;\n\t\t\t} else {\n\t\t\t\t$respuesta->mensaje = \"No existen registros de roles.\";\n\t\t\t\t$respuesta->codigo = 0;\n\t\t\t}\n\t\t\treturn json_encode($respuesta);\n\t\t}", "public function listarUser() {\n if(IDUSER) {\n $eval = \"SELECT id,nombre,apellidos,email FROM users\";\n $peticion = $this->db->prepare($eval);\n $peticion->execute();\n $resultado = $peticion->fetchAll(PDO::FETCH_OBJ);\n exit(json_encode($resultado));\n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Fallo de autorizacion\"])); \n }\n }", "public function getUsers()\n {\n $usuarios = $this->Etapas->getUsers()->usuarios->usuario; //usuarios seg.users\n echo json_encode($usuarios);\n }", "function retornaUsuarios()\n{\n $PDO = db_connect();\n $sql = \"SELECT id,nome_completo,RA,semestre, usuario, img \n FROM sistema.users \n order by nome_completo ASC;\";\n $stmt = $PDO->prepare($sql);\n $stmt->execute();\n $users = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $usersKeyName = array();\n foreach ($users as $user) {\n $usersKeyName[trim($user['nome_completo'])] = $user;\n }\n $dadosCodificados = json_encode($usersKeyName);\n $objData = json_decode($dadosCodificados);\n return $objData;\n}", "public static function getUserList() {\n $db = DB::getInstance();\n $resp = \"\";\n try {\n $query = $db->query(\"SELECT id, first_name, last_name, username, lump, admin FROM `users` ORDER BY last_name ASC\", PDO::FETCH_ASSOC);\n $rows = $query->fetchAll();\n $resp = json_encode($rows);\n }\n catch (Exception $e) {\n $db->rollBack();\n $resp = $e->getMessage();\n }\n return $resp;\n }", "public function allUsersJson()\n {\n echo parent::allUsers();\n }", "public function getMembers()\n {\n \t$companyId = session('company_id');\n \t$userRepo = $this->em->getRepository('App\\Entity\\Management\\User');\n \t$users = $userRepo->getUsersByCompany($companyId);\n\n echo json_encode($users);\n\n }", "public function listAction()\n {\n /* Get User logged */\n $user = $this->get('security.context')->getToken()->getUser();\n\n /* Get List of users */\n $users = $this->container->get('theseus.user_manager')->getList();\n\n $array = [];\n $datas = array();\n foreach($users as $user)\n {\n $data['id'] = $user->getId();\n $data['firstname'] = $user->getFirstname();\n $data['lastname'] = $user->getLastname();\n if($user->getBirthday() != null) {\n $data['birthday'] = $user->getBirthday()->format('Y-m-d');\n } else {\n $data['birthday'] = '';\n }\n $data['phone'] = $user->getPhone();\n $data['created_at'] = $user->getCreatedAt()->format('Y-m-d H:i:s');\n $address = $user->getAddress();\n\n if($address != null) {\n\n $userAdddress['address'] = $address->getAddress();\n $userAdddress['city'] = $address->getCity();\n $userAdddress['country'] = $address->getCountry();\n $userAdddress['additionalAddress'] = $address->getAdditionalAddress();\n \n $data['address'] = $userAdddress;\n } else {\n $data['address'] = null;\n }\n $groups = array();\n foreach($user->getGroups() as $group) {\n $role = $group->getRoles();\n $groups[] = $role[0];\n $data['group'][] = $role;\n }\n $data['group'] = $groups;\n $datas[] = $data;\n }\n \n $array['data'] = $datas;\n \n return new JsonResponse($array);\n }", "function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}", "public function listausuarios(){\n $user = Usuario::with('rol')->paginate(15);\n $lista_usuarios = compact('user'); \n\n return $this->sendResponse($lista_usuarios, 'Listado de usuarios devueltos con éxito');\n\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function getUsersList()\n {\n }", "public function DatosUsuarios() {\n $users = Usuarios::join('Perfiles', 'Usuarios.IdPerfil', '=', 'Perfiles.ID')->get();\n $datos = array();\n foreach ($users->toArray() as $user) {\n $groupDes = Grupos::where('ID', '=', $user['IdGrupo']) ->select('Descripcion')->first();\n $user['Grupo'] = $groupDes->Descripcion;\n if (Session::get('idPeril') == 3) {\n $user['Perfil'] = \"{$user['Perfil']}<a href='#' title='Editar Perfil' class='editar' alt='{$user['IdUsuario']}'>\"\n . \"<span style='color:#FACC2E; padding-left:15px' class='glyphicon glyphicon-edit'></span>\"\n . \"</a>\";\n }\n $datos[] = $user;\n }\n\n return $datos = json_encode($datos);\n }", "private function usuarios(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"GET\") {\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 petición GET\n\t\t//se realiza la consulta a la bd\n\t\t$query = $this->_conn->query(\n\t\t\t\"SELECT id, nombre, email \n\t\t\t FROM usuario\");\n\t\t//cantidad de usuarios\n\t\t$filas = $query->fetchAll(PDO::FETCH_ASSOC); \n \t$num = count($filas);\n \t//si devolvio un resultado, se envia al cliente\n \tif ($num > 0) { \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['usuarios'] = $filas; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } //se envia un error \n\t $this->mostrarRespuesta($this->devolverError(2), 204);\n\t}", "public function buscarUsuarios(){\n\t\t}", "public function actionJSONusuariosmasutilizanmisoa()\n\t{\n\t\t$this->layout=FALSE;\n\t\theader('Content-type: application/json');\n\t\t\n\t\t$data=array();\n\t\t\n\t\t$id=Yii::app()->user->id;\n\t\t\n\t\t$sql = \"SELECT user.name as nombre, COUNT(visit.user) as visitas\n\t\t\t\tFROM visit, user, article \n\t\t\t\tWHERE user.id=visit.user and article.id=visit.article and article.creator=\".$id.\"\n\t\t\t\tGROUP BY user.name\n\t\t\t\tORDER BY COUNT(visit.user) DESC\"; \t\n\t\t$dbCommand = Yii::app()->db->createCommand($sql);\n\t\t$datosShare = $dbCommand->queryAll();\n\t\t\n\t\techo json_encode($datosShare);\n\t\tYii::app()->end();\t\t\n\t}", "public function ctrShowTableUser(){\n\n $item = null;\n $valor = null;\n\n $usuarios = ControllerUser::ctrShowUsers($item, $valor);\n\n $datosJson = '\n {\n \"data\":[';\n\n for($i = 0; $i < count($usuarios); $i++){\n \n $datosJson .= '[\n \"'.($i+1).'\",\n \"'.$usuarios[$i][\"id_institucion\"].'\",\n \"'.$usuarios[$i][\"acceso\"].'\",\n \"'.$usuarios[$i][\"nombre\"].'\",\n \"'.$usuarios[$i][\"labor\"].'\",\n \"'.$usuarios[$i][\"grupo\"].'\",\n \"'.$usuarios[$i][\"password\"].'\",\n \"'.$usuarios[$i][\"email\"].'\",\n \"'.$usuarios[$i][\"foto\"].'\",\n \"'.$usuarios[$i][\"verificacion\"].'\",\n \"'.$usuarios[$i][\"emailEncriptado\"].'\",\n \"'.$usuarios[$i][\"fecha\"].'\"\n ],';\n\n }\n\n $datosJson = substr($datosJson, 0, -1);\n\n $datosJson .= ']\n\n }\n\n ';\n\n echo $datosJson;\n\n }", "public function getAllGroupUser(){\n $client = new Client();\n $req = $client->request('GET', 'http://localhost:8000/allgroupuser');\n $res = $req->getBody();\n $data = json_decode($res);\n\n $groupUser = $data->groupUser;\n $permissions = $data->permissions;\n $message = $data->message;\n\n return json_encode(['groupUser' => $groupUser, 'permissions' => $permissions]);\n }", "public function actionGetUserListJson()\n\t{\n\t\t$email = $_REQUEST['email'];\n\t\t$password = $_REQUEST['password'];\n\n\t\t$sql = sprintf('SELECT Id\n\t\t\t\t\t\t\t\tFROM '. Users::model()->tableName() .' \n\t\t\t\t\t\t\tWHERE email = \"%s\" \n\t\t\t\t\t\t \t\t AND \n\t\t\t\t\t\t \t\t password = \"%s\"\n\t\t\t\t\t\t\tLIMIT 1', $email, md5($password));\n\t\t$userId = Yii::app()->db->createCommand($sql)->queryScalar();\n\t\t$result = \"Email or password not correct\";\n\t\tif ($userId == false) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\n\t\t$out = '';\n\t\t$dataFetchedTimeKey = \"UsersController.dataFetchedTime\";\n\t\t\n\t\n\t\t\t$sql = 'SELECT u.Id as id, u.realname,u.latitude, u.longitude, u.altitude, f.Id as friendShipId, u.dataArrivedTime, u.dataCalculatedTime,\n\t\t\t\t\t\t1 isFriend\n\t\t\t\tFROM '. Friends::model()->tableName() . ' f \n\t\t\t\tLEFT JOIN ' . Users::model()->tableName() . ' u\n\t\t\t\t\tON u.Id = IF(f.friend1 != '.$userId .', f.friend1, f.friend2)\n\t\t\t\tWHERE ((f.friend1 = '. $userId .') \n\t\t\t\t\t\t\t\t\t\tOR (f.friend2 ='. $userId .')) AND status= 1\n\t\t\t\t ' ;\n\n\t\t\t/* \n\t\t\t \t$sql = 'SELECT u.Id as id, u.realname,u.latitude, u.longitude, u.altitude, f.Id as friendShipId, u.dataArrivedTime, u.dataCalculatedTime,\n\t\t\t\t\t\t1 isFriend\n\t\t\t\tFROM '. Friends::model()->tableName() . ' f \n\t\t\t\tLEFT JOIN ' . Users::model()->tableName() . ' u\n\t\t\t\t\tON u.Id = IF(f.friend1 != '.Yii::app()->user->id.', f.friend1, f.friend2)\n\t\t\t\tWHERE (friend1 = '.Yii::app()->user->id.' \n\t\t\t\t\t\tOR friend2 ='.Yii::app()->user->id.') AND status= 1\n\t\t\t\t ' ;\n\t\t\t */\n\t\t\t\n\n\t\t$out = $this-> prepareJson($sql, \"userList\");\n\t\t\n\t\techo $out;\n\t\tYii::app()->session[$dataFetchedTimeKey] = time();\n\t\tYii::app()->end();\n\t}", "public static function listUsers()\n {\n //Init curl\n $curl = new curl\\Curl();\n\n // GET request to api\n $response = $curl->get(Yii::$app->params['listUsers']);\n\n $records = json_decode($response, true);\n\n foreach($records as $users){\n foreach($users as $user){\n $list[$user['id']] = $user['name'] . ' ' . $user['last_name'];\n }\n }\n\n return $list;\n }", "public function getList(){\n if ($this->request->isAJAX()) {\n $M_User = new M_User();\n $data = array();\n $data['data'] = $M_User->getAll(TRUE);\n }\n else {\n $data['status'] = \"Forbidden access : Not an AJAX request\";\n }\n return json_encode($data);\n }", "function getAllUsers(){\n\t\t\tglobal $db;\n\t\t\t\n\t\t\t$query = $db->query('SELECT * FROM user');\n\t\t\t$json = '{';\n\t\t\t\n\n\t\t\tif ($query->rowCount() > 0) {\n\t\t\t\t$json = $json . ' \"Users\" : [';\n\n\t\t\t\tforeach($query as $row) {\n\t\t\t\t\t$user = new user($row['Id'], null, null, 0, 0, null);\n\t\t\t\t\t\n\t\t\t\t\t$json = $json . $user->getUser() . \",\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$json = rtrim($json, ',');\n\t\t\t\t$json = $json . \" ] }\";\n\t\t\t\t\n\n\t\t\t\treturn $json;\n\t\t\t} else {\n\t\t\t return $json . ' \"Message\" : \"No users found\" }';\n\t\t\t}\n\t\t}", "public function getPartinUsersList(){\n return $this->_get(2);\n }", "function listarUsuarios(){\n \n $conex=Conexion::getInstance();\n $stmt = $conex->dbh->prepare(\"SELECT * FROM usuarios\"); \n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $stmt->execute();\n $listaUsuarios=[];\n while ($row = $stmt->fetch()){\n $listaUsuarios[]=array('id'=>$row['id'],'usuario'=>$row['usuario'],'nombre'=>$row['nombre'],'admin'=>$row['admin'],'password'=>$row['password']) ; \n }\n return $listaUsuarios;\n}", "function listarUsuariosId($id){\n\t\t$activo = true;\n\t\t$query = \"SELECT * FROM usuarios WHERE idUsuario='$id' and activo='$activo'\";\n\t\t$link = conectar(); //llama a la funcion conectar de conex.php\n\t\t$resultdb = $link->query($query); //envia el query a la BD\n\t\tif ($resultdb->num_rows == 1) {\n\t\t\t$usuario = $resultdb->fetch_assoc();\n\t\t}\n\t\t$link->close();//cierro conex\n\t\techo json_encode($usuario);//imprimo un JSON con los datos de la consulta\n\t}", "public function buscarUsuarios(){\n $usuarios = file_get_contents('usuarios.json');\n $arrUsuariosJSON = explode(PHP_EOL,$usuarios);\n $arrUsuarioPHP = [];\n array_pop($arrUsuariosJSON);\n foreach ($arrUsuariosJSON as $key => $usuario) {\n $arrUsuarioPHP[] = json_decode($usuario,true);\n }\n return $arrUsuarioPHP;\n }", "function userlist_callback() {\n\ttry {\n\t\t$response = wp_remote_get( API_CALL_URL . 'users/' );\n\t\t$data['data'] = json_decode( $response['body'] );\n\t\techo wp_json_encode( $data );\n\t} catch ( Exception $ex ) {\n\t\t$data['data'] = null;\n\t\techo wp_json_encode( $data );\n\t}\n\twp_die();\n}", "function getUsuarios(){\n\t\n\t\treturn conectar()->query( \"SELECT * FROM usuarios\");\n\t}", "function get_user_list(){\n\t\treturn array();\n\t}", "public static function getAllUsers() {\n $pdo = DataConnector::getConnection();\n $stmt = $pdo->prepare(\"SELECT * FROM users\"); \n $stmt->bindParam(\":id\",$id, PDO::PARAM_INT);\n $stmt->execute();\n $pArr = array();\n while($obj = $stmt->fetch(PDO::FETCH_OBJ)){\n $iPerson = array();\n $iPerson['id'] = $obj->id;\n $iPerson['username'] = $obj->username;\n $iPerson['email'] = $obj->email;\n $iPerson['permission'] = $obj->permission;\n $iPerson['registered'] = $obj->registered;\n $iPerson['last_login'] = $obj->last_login;\n $iPerson['last_activity'] = $obj->last_activity;\n array_push($pArr, $iPerson);\n }\n return json_encode($pArr);\n }", "public function getListaUtenti() {\n $response[\"status\"] = false;\n $listaUtenti = DAOUtente::getListaUtenti();\n if (count($listaUtenti) > 0) {\n $jaResp = array();\n foreach($listaUtenti as $row) {\n $infoUtente = new Utente();\n $infoUtente->setId($row['intIdPersona']);\n $infoUtente->setNUsername($row['strUsernamePersona']);\n $infoUtente->setNome($row['strNomePersona']);\n $infoUtente->setCognome($row['strCognomePersona']);\n $infoUtente->setForzaAggiornamento($row['boolForzaAggiornamento']);\n $infoUtente->setConfermataRegistrazione($row['booConfermataRegistrazione']);\n array_push($jaResp, $infoUtente->getJson());\n }\n $response[\"status\"] = true;\n $response[\"data\"] = $jaResp;\n }\n return json_encode($response);\n }", "function users_list_raw($offlim=NULL){\n $res = array();\n if(!is_null($offlim) and count($this->domains)>1) qz();\n foreach($this->domains as $ck=>$cd){\n $tmp = array();\n foreach((array)$cd->user_list($offlim) as $vdn)\n\t$tmp[$vdn] = $vdn;\n $res[$ck] = $tmp;\n }\n return $res;\n }", "public function lst(){\n\t\t$args = $this->getArgs();\n\t\t$uid = $_SESSION[\"user\"][\"uid\"];\n\t\t$base_url = substr($_SERVER[\"REQUEST_URI\"], 0, strrpos($_SERVER[\"REQUEST_URI\"], \"/\") + 1);\n\t\t$header = array(\n\t\t\t\tsprintf(\"%s\", Translate::get(Translator::USER_LIST_HEADER_ID)),\n\t\t\t\tsprintf(\"%s\", Translate::get(Translator::USER_LIST_HEADER_EMAIL)),\n\t\t\t\tsprintf(\"%s\", Translate::get(Translator::USER_LIST_HEADER_FNAME)),\n\t\t\t\tsprintf(\"%s\", Translate::get(Translator::USER_LIST_HEADER_LNAME)),\n\t\t\t\tsprintf(\"%s\", Translate::get(Translator::USER_LIST_HEADER_PHONE))\n\t\t);\n\t\t\n\t\t$config = array(\n\t\t\t\t\"config\" => array(\n\t\t\t\t\t\t\"page\" => (isset($args[\"GET\"][\"page\"]) ? $args[\"GET\"][\"page\"] : System::PAGE_ACTUAL_DEFAULT),\n\t\t\t\t\t\t\"column\" => (isset($args[\"GET\"][\"column\"]) ? $args[\"GET\"][\"column\"] : System::SORT_DEFAULT_COLUMN),\n\t\t\t\t\t\t\"direction\" => (isset($args[\"GET\"][\"direction\"]) ? $args[\"GET\"][\"direction\"] : System::SORT_DES),\n\t\t\t\t\t\t\"actual_pagesize\" => (isset($_SESSION[\"page_size\"]) ? $_SESSION[\"page_size\"] : System::PAGE_SIZE_DEFAULT),\n\t\t\t\t\t\t\"data_count\" => $this->getModel()->getCountUserList(),\n\t\t\t\t\t\t\"disable_menu\" => true,\n\t\t\t\t\t\t\"disable_select\" => true,\n\t\t\t\t\t\t\"disable_pagging\" => false,\n\t\t\t\t\t\t\"disable_set_pagesize\" => false\n\t\t\t\t),\n\t\t\t\t\"form_url\" => array(\n\t\t\t\t\t\t\"page\" => $base_url . \"-%d-%d-%s\",\n\t\t\t\t\t\t\"header_sort\" => $base_url . \"-%d-%d-%s\",\n\t\t\t\t\t\t\"form_action\" => $base_url\n\t\t\t\t),\n\t\t\t\t\"item_menu\" => array(),\n\t\t\t\t\"select_item_action\" => array(),\n\t\t\t\t\"style\" => array(\n\t\t\t\t\t\t\"marked_row_class\" => \"marked\",\n\t\t\t\t\t\t\"count_box_class\" => \"count_box\",\n\t\t\t\t\t\t\"pagging_box_class\" => \"pagging_box\",\n\t\t\t\t\t\t\"actual_page_class\" => \"actual_page\",\n\t\t\t\t\t\t\"table_header_class\" => \"head\",\n\t\t\t\t\t\t\"table_id\" => \"user_lst\",\n\t\t\t\t\t\t\"select_form_id\" => \"\",\n\t\t\t\t\t\t\"pagesize_form_id\" => \"pagesize_box\",\n\t\t\t\t\t\t\"list_footer_id\" => \"\"\n\t\t\t\t)\n\t\t);\n\t\t$data = $this->getModel()->getUserList($config[\"config\"][\"page\"], $config[\"config\"][\"actual_pagesize\"], $config[\"config\"][\"column\"], $config[\"config\"][\"direction\"], $config[\"config\"][\"disable_pagging\"]);\n\t\t$out = Paginator::generatePage($header, $data, $config);\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function getUserList() {\n $users = DB::select(\"select * from users\");\n $count = DB::table(\"users\") -> count();\n $data = [];\n foreach ($users as $user) {\n array_push($data, array(\n \"id\" => $user -> id,\n \"role\" => ($user -> role == 0)?\"Inactive\":($user -> role == 1?\"Active\":'[ Admin ]'),\n \"fname\" => $user -> fname,\n \"lname\" => $user -> lname,\n \"affiliation\" => $user -> affiliation,\n \"email\" => $user -> email,\n \"created_at\" => $user -> created_at,));\n };\n return array(\"code\" => 0, \"msg\" => \"\", \"count\" => $count, \"data\" => $data);\n }", "function listar_usuarios() {\n\t\t$query = \"SELECT colaboradores.*, colaboradores_permisos.*\n\t\tFROM colaboradores, colaboradores_permisos\n\t\tWHERE colaboradores.id_colaborador=colaboradores_permisos.id_colaborador\n\t\tAND colaboradores.estado=1\";\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}", "public static function getlist(){\n $sql = new Sql();\n \n return $sql->select(\"SELECT * FROM tb_usuarios ORDER BY deslogin\");\n }", "public function listarUsuarios()\r\n\t{\r\n\t\t$administradores=array();\r\n\t\ttry{\r\n\t\t\t//realizamos la consulta de todos los items\r\n\t\t\t$consulta = $this->db->prepare(\"select * from administrador\");\r\n\t\t\t$consulta->execute();\r\n\t\t\tfor($i=0; $row = $consulta->fetch(); $i++)\r\n\t\t\t{\r\n\t\t $fila['admin_cedula']=$row['ADMIN_CEDULA'];\r\n\t\t\t$fila['admin_login']=$row['ADMIN_LOGIN'];\r\n\t\t\t$fila['admin_nombre']=$row['ADMIN_NOMBRE'];\r\n\t\t\t$fila['admin_apellido']=$row['ADMIN_APELLIDO'];\r\n\t\t\t$fila['admin_status']=$row['ADMIN_STATUS'];\r\n\t\t\t$administradores[]=$fila;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tcatch(PDOException $e)\r\n\t\t{\r\n\t\t\techo $e;\r\n\t\t}\r\n\t\treturn $administradores;\t\t\r\n\t}", "public function ListarUsuarios()\n{\n\tself::SetNames();\n\t$sql = \" select * from usuarios \";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "function wfSpecialListusers( $par = null ) {\n\tglobal $wgRequest;\n\n\tlist( $limit, $offset ) = wfCheckLimits();\n\n\n\t$slu = new ListUsersPage();\n\t\n\t/**\n\t * Get some parameters\n\t */\n\t$groupTarget = isset($par) ? $par : $wgRequest->getVal( 'group' );\n\t$slu->requestedGroup = $groupTarget;\n\t$slu->requestedUser = $wgRequest->getVal('username');\n\n\treturn $slu->doQuery( $offset, $limit );\n}", "public function usuarios(){\n $cliente = DB::table('cliente')->get();\n return response()->json($cliente);\n }", "function lendingform_search_user($search = NULL) {\r\n \r\n $users = array();\r\n if (empty($search)) {\r\n $users = entity_load('user');\r\n } else {\r\n // Search users\r\n $users = entity_get_controller(PROJECT_ENTITY)->search_users($search);\r\n }\r\n \r\n $users_name_and_id = array();\r\n foreach ($users as $user) {\r\n $users_name_and_id[] = array(\r\n 'uid' => $user->uid,\r\n 'name' => lendingform_siemens_format_username($user),\r\n );\r\n }\r\n\r\n echo json_encode($users_name_and_id);\r\n \r\n exit();\r\n}", "public function listarContratoUser(){\n \n $model = new ContratoModel();\n \n if($model->getContratoUserModel($_POST[\"id\"])){\n \n \techo json_encode($model->getContratoUserModel($_POST[\"id\"]));\n \t\n \t}else{\n \t\n \t$retorno = array(\"retorno\" =>\"NO\");\n \t\n \t\techo json_encode($retorno);\n \t}\n \t\n \n }", "public function utilisateurListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Utilisateur\");//type array\n\t}", "function getAllUsuarios(){\n\t\t\tDB_DataObject::debugLevel(0);\n\t\t\t$obj = DB_DataObject::Factory('VenUsuario');\n\t\t\t$obj->find();\n\t\t\t$i = 0;\n\t\t\t$data='';\n\t\t\twhile($obj->fetch()){\n\t\t\t\t$data[$i]['idUsuario']=$obj->idUsuario;\n\t\t\t\t$data[$i]['idCargo']=$obj->idCargo;\n\t\t\t\t$nombreCargo=$this->getCargoById($obj->idCargo);\n\t\t\t\t$nombreCargo=utf8_encode($nombreCargo['nombre']);\n\t\t\t\t$data[$i]['cargo']= $nombreCargo;\n\t\t\t\t$data[$i]['nombre']=utf8_encode($obj->nombre);\n\t\t\t\t$data[$i]['apellido']=utf8_encode($obj->apellido);\n\t\t\t\t$data[$i]['email']=$obj->email;\n\t\t\t\t$data[$i]['usuario']=utf8_encode($obj->usuario);\n\t\t\t\t$data[$i]['contrasena']=utf8_encode($obj->contrasena);\n\t\t\t\t$data[$i]['puntos']=$obj->puntos;\n\t\t\t\t$data[$i]['estado']=$obj->estado;\n\t\t\t\t$data[$i]['fechaMod']=$obj->fechaMod;\n\t\t\t\t$data[$i]['fecha']=$obj->fecha;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$obj->free();\n\t\t\t//printVar($data,'getAllUsuarios');\n\t\t\treturn $data;\n\t\t}", "public function actionUserList($conversacion_id=null, $q = null, $id = null) {\n if($conversacion_id!=null){\n //busco la conversacion\n $conversacion=Conversacion::findOne($conversacion_id);\n //saco los partipiantes de la conversacion\n $participantes=$conversacion->conversacionParticipantes;\n //convierto $partcipantes en un array de ids\n $participantes_ids=[];\n foreach ($participantes as $participante){\n $participantes_ids[]=$participante->usuario_id;\n }\n } else {\n //si es nula el unico participante es el usuario actual de yii\n $participantes_ids=[Yii::$app->user->id];\n }\n\n //saco la lista de usuarios que no estan en la conversacion y que ademas coincidan con el nombre buscado\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n $out = ['results' => ['id' => '', 'text' => '']];\n if (!is_null($q)) {\n $query = new \\yii\\db\\Query;\n $query->select(['user.id','CONCAT( profile.first_name,\", \",profile.last_name ) AS text'])\n ->from('tbl_user as user, tbl_user_profile as profile')\n ->where('user.id=profile.user_id')\n ->andWhere(['like', 'CONCAT( profile.first_name,\", \",profile.last_name )', $q])\n ->andWhere(['not in', 'user.id', $participantes_ids])\n ->limit(20);\n\n $command = $query->createCommand();\n $data = $command->queryAll();\n $out['results'] = array_values($data);\n }\n elseif ($id > 0) {\n $out['results'] = ['id' => $id, 'text' => User::find($id)->userFullName];\n }\n return $out;\n }", "public function get_dados_usuario(int $id)\n {\n $output = array(); \n $data = $this->Usuarios_model->get_set_usuarios($id); \n foreach($data as $row) \n { \n $output['user_nome'] = $row->us_nome; \n $output['user_tel'] = $row->us_telefone; \n $output['user_email'] = $row->us_email; \n $output['user_endereco'] = $row->us_endereco; \n $output['user_cidade'] = $row->us_cidade; \n $output['user_estado'] = $row->us_estado; \n $output['user_nivel'] = $row->us_nivel; \n $output['user_status'] = $row->us_status; \n $output['user_login'] = $row->us_login; \n } \n echo json_encode($output); \n }", "public function reponseUserList()\n {\n //Inseri LOGs com faker names na base de dados\n $faker = Faker::create();\n Logs::create([\n \"logname\" => $faker->name()\n ]);\n\n //Retorna JSON com todos os registros dos Alunos\n return response()\n ->json(Alunos::all());\n }", "public function getUsuarios(){\n\t\t$filasPagina = 7;//registros mostrados por página\n\n\t\tif(isset($_GET['pagina'])){//si le pasamos el valor \"pagina\" de la url (si el usuario da click en la paginación)\n\t\t\t\tif($_GET['pagina']==1){\n\t\t\t\t$pagina=1; \n\t\t\t\theader(\"Location: principal.php?c=controlador&a=muestraUsuarios\");\n\t\t\t\t}else{\n\t\t\t\t\t$pagina=$_GET['pagina'];//índice que indica página actual\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$pagina=1;//índice que indica página actual\n\t\t\t}\n\n\t\t\t$empezarDesde = ($pagina-1) * $filasPagina;\n\n\t\t\t$sql = \" SELECT * FROM usuarios \";\n\n\t\t\t$resultado = $this->db->query($sql);\n\n\t\t\t$resultado->execute(array());\n\n\t\t\t$numFilas = $resultado->rowCount();//número de registos totales de la consulta\n\n\t\t\t//ceil — Redondear fracciones hacia arriba\n\t\t\t$totalPaginas = ceil($numFilas / $filasPagina);//calcula cuántas páginas serán en total para mostrar todos los registros\n\n\t\t\t$resultado->closeCursor();\n\n\t\t//------------------------- Consulta para mostrar los resultados ---------------------------\n\n\t\t\t$sql_limite = \" SELECT * FROM usuarios LIMIT $empezarDesde , $filasPagina \";\n\n\t\t\t$resultado = $this->db->query($sql_limite);//ejecutando la consulta con la conexión establecida\n\n\t\t\twhile($row = $resultado->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$this->objeto[] = $row;//llenando array con valores de la consulta\n\t\t\t}\n\n\t\treturn $this->objeto;\n\t}", "public function users(){\n\t\t// echo \"<br/> $hashedPassword\";\n\t\t// echo \"<br/>\";\n\t\n\t\t$usermodel = $this->model(\"User\");\n\t\t$result = json_encode($usermodel->getUsers());\n\t\t//for some reason it gives a wrong format if it doesn't print it first...\n\t\tprint_r($result);\n\t\treturn $result;\n\t}", "public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "function eve_api_user_list_user_private_page($corporation_id) {\n $header = array(\n 'characterName' => array(\n 'data' => t('Name'),\n 'field' => 'c.characterName',\n ),\n 'main' => array(\n 'data' => t('Main Character'),\n 'field' => 'u.name',\n ),\n 'api' => array(\n 'data' => t('API Data'),\n ),\n 'joined' => array(\n 'data' => t('Joined'),\n 'field' => 'u.created',\n ),\n 'access' => array(\n 'data' => t('Last Login'),\n 'field' => 'u.access',\n ),\n );\n\n $options = $output = array();\n\n $query = db_select('users', 'u')\n ->extend('PagerDefault')\n ->extend('TableSort');\n $query_join = $query->join('eve_api_characters', 'c', 'u.uid = c.uid');\n $query->join('eve_api_keys', 'ak', 'c.apiID = ak.apiID');\n $query->addField($query_join, 'characterID', 'cID');\n $result = $query->fields('u', array(\n 'name',\n 'created',\n 'access',\n 'uid',\n 'characterID',\n ))\n ->fields('c', array(\n 'characterName',\n 'corporationID',\n 'corporationName',\n 'corporationTicker',\n 'allianceID',\n 'allianceName',\n 'allianceTicker',\n ))\n ->fields('ak', array(\n 'keyID',\n 'vCode',\n ))\n ->condition('c.corporationID', $corporation_id, '=')\n ->condition('c.deleted', 0, '=')\n ->condition('u.status', 1, '=')\n ->condition('u.characterID', 0, '!=')\n ->limit(20)\n ->orderByHeader($header)\n ->execute();\n\n if ($result->rowCount()) {\n foreach ($result->fetchAll() as $row) {\n $options[] = array(\n 'characterName' => l($row->characterName, 'eve_api/user_list/' . $row->cID),\n 'main' => l($row->name, 'user/' . $row->uid),\n 'api' => t('Key ID: @keyID<br />Verification Code: @vCode', array('@keyID' => $row->keyID, '@vCode' => $row->vCode)),\n 'joined' => ($row->characterID == $row->cID) ? check_plain(date('Y-m-d H:i:s', $row->created)) : '',\n 'access' => ($row->characterID == $row->cID) ? ($row->access == 0) ? '' : check_plain(date('Y-m-d H:i:s', $row->access)) : '',\n );\n }\n }\n\n $output['corporation_user_list_description'] = array(\n '#type' => 'item',\n '#title' => t('List of Corporation Users and private information.'),\n '#weight' => 0,\n );\n\n $output['corporation_user_list'] = array(\n '#type' => 'markup',\n '#markup' => theme('table', array(\n 'header' => $header,\n 'rows' => $options,\n )),\n '#weight' => 10,\n );\n\n $output['page'] = array(\n '#theme' => 'pager',\n '#weight' => 20,\n );\n\n return $output;\n}", "public function Listar()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$result = array();\n\n\t\t\t$stm = $this->pdo->prepare(\"SELECT usuario.`correo`, `usuario`.`clave`, `rol`.`nomRol`, `datospersonales`.`Documento`\nFROM `usuario`\nLEFT JOIN `rol` ON `rol`.`nomRol` = `usuario`.`nomRol` \nLEFT JOIN `datospersonales` ON `datospersonales`.`Documento` = `usuario`.`Documento`\n WHERE correo is not null \");\n\t\t\t$stm->execute();\n\n\t\t\tforeach($stm->fetchAll(PDO::FETCH_OBJ) as $r)\n\t\t\t{\n\t\t\t\t$usu = new Usuario();\n\n\t\t\t\t$usu->__SET('correo', $r->correo);\n\t\t\t\t$usu->__SET('clave', $r->clave);\n\t\t\t\t$usu->__SET('nomRol', $r->nomRol);\n\t\t\t\t$usu->__SET('Documento', $r->Documento);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t$result[] = $usu;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}", "function abmUsuarios()\n {\n $this->checkCredentials();\n $users = $this->modelUser->getAllUsers();\n $this->view->showAbmUsuarios($users);\n }", "private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "public function UserListDetails()\n{\nglobal $dbObj,$common;\n\t\t\t\n$auth_token = $common->replaceEmpty('auth_token','');\n\t\t\t\n$result= array();\n\t\t\t \n if($action='userlist'){\n\t\t\t\t \n $sql= $dbObj->runQuery(\"select * from user where auth_token='\".$auth_token.\"' \");\n\t\t\n$num_row = mysql_num_rows($sql); \nif($num_row>0){\nwhile($logindetails = mysql_fetch_assoc($sql)) {\n$result = $logindetails;\n } \n \nheader('Content-Type: application/json');\n\t\t\t\necho json_encode($result);\t \t\t\t\t\n \n}\n\n\nelse {\n$results[] = \"No User List\";\necho json_encode($results);\n\t\t\t \n}\n\t\t\t\n}\n\n}", "public function infoUsuariosPorProyectoList(){\n\n $usuarios = UsersModel::infoUsuariosPorProyecto(\"usuario\", $_SESSION[\"id_project\"]);\n \n foreach ($usuarios as $row => $item) {\n echo '<option value=\"'.$item[\"Email\"].'\">'.$item[\"Email\"].'</option>'; \n }\n\n }", "public function infoUsuariosAjax(){\n\n $usuarios = UsersModel::mostrarInfoTablas(\"usuario\");\n\n return $usuarios;\n \n }", "function users() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $query = \"select * from users;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n\n if ($r->num_rows > 0) {\n $result = array(); \n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200);\n } else {\n $this->response('',204);\n }\n }", "public function userList() \n { \n $user = User::get(); \n return response([ 'data' => ToArray::collection($user), 'message' => 'Users list retrieved successfully'], $this->successStatus);\n }", "function rest_get($request, $data) {\n //Autentikacija\n if(!isset($_SESSION['username'])){\n header(\"Location: http://\" . $_SERVER[\"HTTP_HOST\"]. \"/error.html\");\n }\n $array = explode(\"/\", $request);\n $priv = $array[count($array)-2];\n $tmp = $array[count($array)-1];\n $username = htmlentities($tmp);\n $klasa = htmlentities($priv);\n try{\n $veza = connect();\n }catch (PDOException $ex){\n echo $ex->getMessage();\n die();\n }\n if($klasa===\"admin\"){\n if($username===\"all\"){\n $admini = $veza->query(\n \"SELECT username, registrovan, email FROM korisnici WHERE admin='1'\"\n );\n print \"{ \\\"admini\\\": \" . json_encode($admini->fetchAll()) . \"}\";\n }else{\n $admini = $veza->prepare(\n \"SELECT username, registrovan, email FROM korisnici WHERE admin='1' AND username=?\"\n );\n $admini->execute(\n array($username)\n );\n print \"{ \\\"admin\\\": \" . json_encode($admini->fetchAll()) . \"}\";\n }\n }\n\n}", "function showUsuarios()\r\n\t{\r\n\t\t$valuesUsuarios = $this->User->find('all', array('conditions' => array('User.active' => 1),'order' => 'User.first_lastname ASC'));\r\n\t\t\r\n\t\tforeach ($valuesUsuarios as $value)\r\n\t\t{\r\n\t\t\t$resultadosUsuarios[$value['User']['id']]= $value['User']['first_lastname'].' '.$value['User']['second_lastname'].', '.$value['User']['name'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $resultadosUsuarios;\r\n\t}", "public function mostrarTodosUsuarios()\n {\n return response()->json(Usuario::all());\n }", "public function managerList() \n { \n $manager = User::role(\"User\")->get();\n return response([ 'data' => ToArray::collection($manager), 'message' => 'Users list retrieved successfully'], $this->successStatus);\n }", "public function listUser(){\n\t\t$user = User::all();\n\t\treturn response()->json($user);\n\t}", "function getUsers(){\n }", "function getUsers(){\n }", "private function getUsersMailist() {\n $param = array(\n 'where' => 'registered = 1'\n );\n\n $users = $this->mailist->gets($param);\n\n return $users;\n }", "public function getList() {\n\t\t$this->request = array('uri' => array('path' => 'users.json'));\n\n\t\treturn $this->find('all');\n\t}", "public function getList()\r\n {\r\n $result = $this->query(\r\n \"SHOW USERS\",\r\n $this->getValueBuilder('Aviogram\\InfluxDB\\Entity\\Admin\\User')\r\n ->addField('user', 'getName', 'setName')\r\n ->addField('admin', 'isAdmin', 'setAdmin')\r\n );\r\n\r\n $return = new Collection\\Admin\\User();\r\n\r\n foreach ($result->getSeries() as $serie) {\r\n foreach($serie->getValues() as $value) {\r\n $return->append($value);\r\n }\r\n }\r\n\r\n return $return;\r\n }", "private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }", "public function getAjaxlistaUsers() {\n $almacen = User::select('users.id','users.name','role_user.role_id')\n\n ->join('role_user', 'users.id', '=', 'role_user.user_id')\n ->where('role_user.role_id', '=', 3)\n ->get();\n\n return response()->json(['data' => $almacen]);\n }", "public function PaginatedListOfUsers ()\n {\n $url = \"https://reqres.in/api/users\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_URL,$url);\n $result=curl_exec($ch);\n curl_close($ch);\n return $result;\n }", "public function getUsersAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $users = $em->getRepository('UserBundle:User')->findAll();\n\n return $this->json(array(\n 'users' => $users,\n ));\n }", "public function userLists()\n {\n\n try {\n if (isset($_REQUEST['AuthToken'])) {\n $AuthToken = $_REQUEST['AuthToken'];\n } else {\n $AuthToken = '';\n }\n if (!Master::check_master_token($AuthToken)) {\n return response([\n 'message' => \"Token Expired\",\n 'status' => 'TokenExpired'\n ], 400);\n }\n\n $offset = ($_GET['page'] - 1) * $_GET['per_page'];\n $sort_field = (isset($_GET['sort_field'])) ? $_GET['sort_field'] : \"id\";\n $sort_order = (isset($_GET['sort_order'])) ? $_GET['sort_order'] : \"desc\";\n\n $data = array();\n $data_count = 0;\n\n if (Schema::hasTable('admin_users')) {\n $sql = DB::table('admin_users');\n //search conditions\n if (isset($_GET['search']) && ($_GET['search'] != \"\")) {\n $q = $_GET['search'];\n $sql->where(function ($query) use ($q) {\n $query->where('name', 'LIKE', '%' . $q . '%')\n ->orWhere('email', 'LIKE', '%' . $q . '%')\n ->orWhere('phone', 'LIKE', '%' . $q . '%');\n });\n }\n $data = $sql->offset($offset)->limit($_GET['per_page'])->orderBy($sort_field, $sort_order)->get();\n\n //count of total tasks\n $csql = DB::table('admin_users');\n //search conditions for count\n if (isset($_GET['search']) && ($_GET['search'] != \"\")) {\n $q = $_GET['search'];\n $csql->where(function ($query) use ($q) {\n $query->where('name', 'LIKE', '%' . $q . '%')\n ->orWhere('email', 'LIKE', '%' . $q . '%')\n ->orWhere('phone', 'LIKE', '%' . $q . '%');\n });\n }\n $data_count = $csql->count();\n }\n\n //response\n return response([\n 'message' => \"\",\n 'pgData' => $data,\n 'totalRows' => $data_count,\n ], 200);\n } catch (Exception $e) {\n return response([\n 'message' => $e->getMessage()\n ], 400);\n }\n }", "public static function getUsersLists(){\n \t$data = Doctrine_Query::create()\n \t// ->distinct('u.DeviceToken')\n \t->select(\"u.firstName, u.DeviceToken\")\n \t->from(\"User u\")\n \t->where('u.deleted=0')\n \t->andWhere(\"u.roleId=2\")\n \t->andWhere('u.DeviceToken!= \"NULL\"')\n\t->andWhere(\"u.DeviceToken!= '(null)'\")\n \t->andWhere('u.DeviceToken!=\"\"')\n \t->groupBy('u.DeviceToken')\n \t//->getSqlQuery();\n\t->fetchArray();\n \t\n return $data;\n }", "public function listUsersAdmin(){\n $sql=\"SELECT id_people,dni,first_name,last_name,adress,email,is_active FROM people WHERE is_user=1\";\n $rs=$this->con->prepare($sql);\n $rs->execute();\n return $rs->fetchAll(PDO::FETCH_OBJ);\n }", "function BuscarPessoas()\r\n {\r\n require_once(\"UsuarioController.php\");\r\n $UsuarioController = new UsuarioController();\r\n\r\n $ret = $this->DAO->BuscarPessoas($_SESSION[\"DadosUser\"][\"Id\"]);\r\n $Lista = [];\r\n $Count = 0;\r\n\r\n foreach($ret as $Item)\r\n {\r\n if($Item[\"USUARIO_1\"] != $_SESSION[\"DadosUser\"][\"Id\"])\r\n {\r\n $_POST[\"Usuario\"] = $Item[\"USUARIO_1\"]; \r\n }\r\n else\r\n {\r\n $_POST[\"Usuario\"] = $Item[\"USUARIO_2\"];\r\n }\r\n \r\n $InfoUser = $UsuarioController->BuscarUsuario(1);\r\n\r\n $Lista[$Count] = $InfoUser;\r\n\r\n $Count++;\r\n }\r\n\r\n echo json_encode($Lista);\r\n }", "public function consultarUsuario(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT c.*, a.permissao FROM tbusuarios c, tbpermissao a where c.idpermissao = a.idpermissao and permissao <> 'SUPER-ADMIN'order by c.nome\";\n $sql = $this->conexao->query($sql);\n\n $dados = array();\n\n while ($row = $sql->fetch_assoc()) {\n $idusuario = $row[\"idusuario\"];\n $nome = $row[\"nome\"];\n $email = $row[\"email\"];\n $dtnascimento = $row[\"dt_nascimento\"];\n $telefone = $row[\"telefone\"];\n $dtnascimento = $row[\"dt_nascimento\"];\n $habilitado = $row[\"habilitado\"];\n $permissao = $row[\"permissao\"]; \n $idpermissao = $row[\"idpermissao\"]; \n\n $dado = array();\n $dado['idusuario'] = $idusuario;\n $dado['nome'] = $nome;\n $dado['email'] = $email;\n $dado['senha'] = $row['senha'];\n $dado['senha_confirma'] = $row['senha_confirma'];\n $dado['idpermissao'] = $idpermissao;\n $dado['permissao'] = $permissao;\n $dado['telefone'] = $telefone;\n $dado['dtnascimento'] = $dtnascimento;\n $dado['habilitado'] = $habilitado; \n $dados[] = $dado;\n }\n\n return $dados;\n\n }", "public function list(Request $request, Response $response, $args){\n// $ARGS['id'] nesta variavel passamos o terceito argumento para consulta\n// $this->get('/list/{id}' , 'TesteController:list')->setName('list');\nheader('Access-Control-Allow-Origin: *'); // Este cabeçalho aceita qualquer requisição\n$manager = $this->em->getRepository('\\App\\Model\\Users');\n$users = $manager->findBy($array = array('id' => $args['id']));\nif($users){\n foreach ($users as $user) {\n // response json com withJsons\n $data = $users = array(\n 'id' => $user->getId(),\n 'nome' => $user->getNome(),\n 'email' => $user-> getEmail(),\n 'tipouser' => $user->getTipouser());\n return $response->withJson($data , 200);\n }\n\n}else{\n $data = $array = array('message' => 'Usuario não encontrado' );\n return $response->withJson($data , 404);\n}\n}", "function users_list($how=0,$offlim=NULL){\n $res = array();\n if(!is_null($offlim) and count($this->domains)>1) qz();\n foreach($this->domains as $ck=>$cd){\n $tmp = array();\n foreach((array)$cd->user_list($offlim) as $vdn)\n\t$tmp[$vdn] = $this->user_disp($vdn);\n if(empty($tmp)) continue;\n if($how==1) $res[$ck] = $tmp; \n else $res = array_merge($res,$tmp);\n }\n return $res;\n }", "public function listarUsua(){\n\t\t$sql=\"SELECT USUARI_ID, USUARI_NOMBRES, USUARI_USUARIO\n\t\t FROM usuario ORDER BY USUARI_NOMBRES\";\n\t\treturn ejecutarConsulta($sql);\n\t}", "function getUsuariosLimit(){\n\t\t\tDB_DataObject::debugLevel(0);\n\t\t\t$obj = DB_DataObject::Factory('VenUsuario');\n\t\t\t//$obj->limit($this->limite);\n\t\t\t$obj->estado = 'A';\n\t\t\t$obj->find();\n\t\t\t$i = 0;\n\t\t\t$data='';\n\t\t\twhile($obj->fetch()){\n\t\t\t\t$data[$i]['idUsuario']=$obj->idUsuario;\n\t\t\t\t$data[$i]['idCargo']=$obj->idCargo;\n\t\t\t\t\n\t\t\t\t$nombreCargo=$this->getCargoById($obj->idCargo);\n\t\t\t\t$nombreCargo=utf8_encode($nombreCargo['nombre']);\n\t\t\t\t$data[$i]['cargo']= $nombreCargo;\n\n\t\t\t\t$data[$i]['nombre']=utf8_encode($obj->nombre);\n\t\t\t\t$data[$i]['apellido']=utf8_encode($obj->apellido);\n\t\t\t\t$data[$i]['email']=$obj->email;\n\t\t\t\t$data[$i]['usuario']=utf8_encode($obj->usuario);\n\t\t\t\t\n\t\t\t\t$data[$i]['contrasena']=utf8_encode($obj->contrasena);\n\t\t\t\t$data[$i]['puntos']=$obj->puntos;\n\t\t\t\t$data[$i]['estado']=$obj->estado;\n\t\t\t\t$data[$i]['fechaMod']=$obj->fechaMod;\n\t\t\t\t$data[$i]['fecha']=$obj->fecha;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$obj->free();\n\t\t\t//printVar($data,'getUsuariosLimit');\n\t\t\treturn $data;\n\t\t}", "public function ls_user_get()\n {\n $this->db->select('id, idrol,rol, nombre, correo, activo');\n $this->db->from('vusuarios');\n $query = $this->db->get();\n if ($query && $query->num_rows() >= 1) {\n $usuarios = $query->result();\n\n foreach ($usuarios as $row) {\n $row->id = (int) $row->id;\n $row->idrol = (int) $row->idrol;\n $row->rol = (int) $row->rol;\n $row->nombre = $row->nombre;\n $row->correo = (int) $row->correo;\n $row->activo = $row->activo;\n }\n $respuesta = array(\n 'usuarios' => $usuarios,\n );\n $status = 200;\n } else {\n $respuesta = array(\n 'message' => 'Valide sus datos de acceso',\n );\n $status = 401;\n }\n $this->response($respuesta, $status);\n }", "public static function getList(){\n\t\t$sql = new sql();\n\n\t\treturn $sql->select(\"SELECT * FROM usuarios ORDER BY email;\");\n\n\t}", "public function list_form_users($form_id){\n $this->db->select('u.id,uf.form_id,u.uuid,CONCAT_WS(\" \",u.firstname,u.lastname) as name,uf.form_id')\n ->from('user_form uf')\n ->join('users u','u.id = uf.user_id')\n ->where_in('uf.form_id',$form_id)\n ->where('u.activation = 1');\n $res = $this->db->get();\n return $res->result_array();\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 adminlogin(){\n\n \t return json_encode(User::All());\n }", "public function usersListAction()\n\t{\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\n\t\t$users = $em->getRepository('McmsUserBundle:User')->findAll();\n\n\t\treturn array('users' => $users);\n\t}", "public function traerTodos(){\n // Obtengo el contenido del JSON\n $archivo = file_get_contents(\"../json/usuarios.json\");\n\n // esto me arma un array con todos los usuarios\n $usuariosJSON = explode(PHP_EOL, $archivo);\n\n // Saco el último elemento que es una línea vacia\n array_pop($usuariosJSON);\n\n // Creo un array vacio, para guardar los usuarios\n $usuariosFinal = [];\n\n // Creo un array de usuarios generado desde el json\n foreach ($usuariosJSON as $usuario) {\n\n $usuariosFinal[] = json_decode($usuario, true);\n\n }\n\n return $usuariosFinal;\n }", "public function users_list() {\n return response()->json(User::latest()->get());\n }", "public function listarUsuarios(){\r\n $sql = \"SELECT U.IdUsuario, U.NombreCompleto, U.Usuario, U.Correo, U.Estado, U.IdRol, R.Rol\r\n FROM usuarios AS U\r\n INNER JOIN roles AS R ON U.IdRol = R.IdRol;\";\r\n $tabla = $this->conexion->getTable($sql);\r\n return $tabla;\r\n}", "public function membres()\n {\n $this->membres = $this->Member->list($_SESSION['guild_id']);\n }", "public function index()\n {\n return $this->respond(User::_(User::all()->toArray()));\n }", "public function GetAllDevise() {\n if ($this->get_request_method() != \"GET\") {\n $this->response('', 406);\n }\n\n $sql = $this->db->prepare(\"SELECT * FROM devise\");\n $sql->execute();\n if ($sql->rowCount() > 0) {\n $result = array();\n while ($rlt = $sql->fetchAll()) {\n $result[] = $rlt;\n }\n // If success everythig is good send header as \"OK\" and return list of users in JSON format\n $this->response($this->json($result[0]), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n }", "function ciniki_users_mergeDisplayNames($ciniki, $hash) {\n\n if( !is_array($ids) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.9', 'msg'=>'Invalid list of users'));\n }\n\n //\n // Query for the tenant users\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuoteIDs');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbRspQuery');\n $strsql = \"SELECT id, email, firstname, lastname, display_name, perms FROM ciniki_users \"\n . \"WHERE id IN (\" . ciniki_core_dbQuoteIDs($ciniki, $ids) . \") \"\n . \"ORDER BY lastname, firstname \";\n return ciniki_core_dbRspQuery($ciniki, $strsql, 'ciniki.users', $container_name, 'user', array('stat'=>'ok', $container_name=>array()));\n}", "function ListaAnimaisDoUsuario($id){\n\t$conteudo = file_get_contents(\"php://input\");\n\t$resposta = array();\n\n\t//Verifica se o conteudo foi recebido\n\tif(empty($conteudo)){\n\t\t$resposta = mensagens(2);\n\t}\n\telse{\n\t\t//Converte o json recebido pra array\n\t\t$dados = json_decode($conteudo,true);\n\t\t\n\t\t//Verifica se as informações esperadas foram recebidas\n\t\tif(!isset($dados[\"Email\"])){\n\t\t\t$resposta = mensagens(3);\n\t\t}\n\t\telse{\n\t\t\tinclude(\"conectar.php\");\n\t\t\t\n\t\t\t//Evita SQL injection\n\t\t\t$email = mysqli_real_escape_string($conexao,$dados[\"Email\"]);\n\t\t\t\n\t\t\t//Consulta animal + dono no banco\n\t\t\t$query = mysqli_query($conexao,\"SELECT A.idAnimal, A.Nome, A.Genero, A.Cor, A.Porte, A.Idade, A.Caracteristicas, A.QRCode, A.Foto, A.Desaparecido, A.FotoCarteira, A.DataFotoCarteira, A.idUsuario, A.idRaca, R.Nome as 'NomeRaca', R.Descricao as 'DescricaoRaca', U.Nome as 'NomeUsuario', U.Email, U.Telefone, U.Cidade, U.Bairro, E.idEspecie, E.Nome as 'NomeEspecie' FROM Animal as A INNER JOIN Usuario as U on A.idUsuario = U.idUsuario INNER JOIN Raca as R on A.idRaca = R.idRaca INNER JOIN Especie as E on E.idEspecie = R.idEspecie WHERE U.Email='\" .$email .\"'\") or die(mysqli_error($conexao));\n\t\t\t\n\t\t\t\n\t\t\t//Verifica se foi retornado algum registro\n\t\t\twhile($dados = mysqli_fetch_array($query))\n\t\t\t{\n\t\t\t\t$resposta[] = array('idAnimal' => $dados['idAnimal'],\n\t\t\t\t\t\t\t'Nome' => $dados['Nome'],\n\t\t\t\t\t\t\t'Genero' => $dados['Genero'],\n\t\t\t\t\t\t\t'Cor' => $dados['Cor'],\n\t\t\t\t\t\t\t'Porte' => $dados['Porte'],\n\t\t\t\t\t\t\t'Idade' => $dados['Idade'],\n\t\t\t\t\t\t\t'Caracteristicas' => $dados['Caracteristicas'],\n\t\t\t\t\t\t\t'QRCode' => $dados['QRCode'],\n\t\t\t\t\t\t\t'Foto' => $dados['Foto'],\n\t\t\t\t\t\t\t'Desaparecido' => $dados['Desaparecido'],\n\t\t\t\t\t\t\t'FotoCarteira' => $dados['FotoCarteira'],\n\t\t\t\t\t\t\t'DataFotoCarteira' => $dados['DataFotoCarteira'],\n\t\t\t\t\t\t\t'idUsuario' => $dados['idUsuario'],\n\t\t\t\t\t\t\t'idRaca' => $dados['idRaca'],\n\t\t\t\t\t\t\t'NomeRaca' => $dados['NomeRaca'],\n\t\t\t\t\t\t\t'DescricaoRaca' => $dados['DescricaoRaca'],\n\t\t\t\t\t\t\t'NomeUsuario' => $dados['NomeUsuario'],\n\t\t\t\t\t\t\t'Email' => $dados['Email'],\n\t\t\t\t\t\t\t'Telefone' => $dados['Telefone'],\n\t\t\t\t\t\t\t'Cidade' => $dados['Cidade'],\n\t\t\t\t\t\t\t'Bairro' => $dados['Bairro'],\n\t\t\t\t\t\t\t'idEspecie' => $dados['idEspecie'],\n\t\t\t\t\t\t\t'NomeEspecie' => $dados['NomeEspecie']);\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $resposta;\n}", "public function rest() {\n return CMap::mergeArray(\n parent::rest(), array(\n 'resource' => 'users',\n 'idProperty' => 'userID',\n 'container' => 'users',\n 'multiContainer' => 'DATA',\n )\n );\n }", "public function users($crud = 'list'){\n if($crud==='list'){\n $data['title']='User List';\n $this->load->server('settings/users/list',$data);\n }\n }", "public static function getUsers($request){\r\n //CONTEUDO DA PAGINA DE USUARIOS\r\n $content= View::render('admin/modules/users/index',[\r\n 'itens' => self::getUserItems($request,$obPagination),\r\n 'pagination' => parent::getPagination($request,$obPagination),\r\n\t\t\t'status' => self::getStatus($request)\r\n ]);\r\n\r\n //RETORNA A PAGINA COMPLETA \r\n return parent::getPanel('Usuarios - AliDEV',$content,'users');\r\n\r\n\r\n }" ]
[ "0.7205247", "0.69745815", "0.69037074", "0.68015057", "0.66284364", "0.6608564", "0.65391815", "0.65051633", "0.6489605", "0.6481397", "0.6477855", "0.64679056", "0.6454532", "0.6403157", "0.63972384", "0.63534904", "0.6348927", "0.6320919", "0.6300836", "0.6260939", "0.624951", "0.6232394", "0.623217", "0.62291545", "0.6206125", "0.61968386", "0.6187927", "0.6167429", "0.6161036", "0.6151944", "0.6122923", "0.61206645", "0.61082447", "0.60955155", "0.60843533", "0.6078481", "0.60771215", "0.6074352", "0.6070699", "0.6054762", "0.6041099", "0.60376334", "0.60265815", "0.6025101", "0.60243255", "0.6021965", "0.6015273", "0.60136414", "0.5995081", "0.59934586", "0.59908926", "0.5979009", "0.5978594", "0.5971419", "0.59712636", "0.5968974", "0.5963236", "0.5959938", "0.5952388", "0.5947154", "0.59457725", "0.59453946", "0.5943162", "0.59422547", "0.59388196", "0.5933112", "0.5933112", "0.5931469", "0.59189224", "0.59132946", "0.5911705", "0.5908444", "0.5902886", "0.5902499", "0.5899747", "0.58973", "0.5895658", "0.5891154", "0.58908516", "0.5874256", "0.5868322", "0.5866183", "0.58617806", "0.5859422", "0.58532304", "0.58510107", "0.58504885", "0.58500195", "0.5849832", "0.5832666", "0.582786", "0.582446", "0.58243144", "0.58235943", "0.58226246", "0.5820308", "0.58172417", "0.5816525", "0.5815527", "0.58103937" ]
0.5960745
57
funcion para guardar un nuevo empleado, recibe datos desde la vista html
public function store(UsersFormRequest $request) { $user=new User; $user->name=$request->get('nombre'); $user->codigoempleado=$request->get('codigo'); $user->puesto_id=$request->get('puesto_id'); //$user->rol_id=$request->get('rol_id'); $user->email=$request->get('email'); // funcion crypt encripta la contrasena que viene del formulario $user->password = bcrypt($request['password']); $user->confirmation_code = str_random(25); $user->save(); Toastr::success('Usuario Creado Satisfactoriamente :)' ,'Success'); //enviar correo de confirmacion Mail::to('[email protected]') ->send(new confirmation_user($user)); return Redirect::to('users'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function guardar($datos){\n $objResp = new xajaxResponse();\n\n if (($datos[\"txtId\"]==\"\")||($datos[\"txtDescripcion\"]==\"\")){\n $objResp->alert(\"Existen campos vacios!\\nPor favor revise e intente de nuevo.\");\n return $objResp;\n }else{\n $eq = new Equipo($datos[\"txtId\"], $datos[\"txtDescripcion\"], $datos[\"txtMarca\"], $datos[\"txtModelo\"], $datos[\"txtBien\"]);\n\n $r = $eq->guardar();\n\n if ($r == -1){\n $objResp->alert(\"Error en la conexión!\");\n }else if($r == 0){\n $objResp->alert(\"Error en la consulta!\");\n }else{\n $objResp->alert(\"Guardado con éxito!\");\n $objResp->redirect(\"equipos_vis.php\");\n }\n }\n return $objResp;\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}", "public function guardar(){\r\n\r\n\t $conexion = new Conexion();\r\n\t if($this->nombre ==true ){\r\n\t \t $consulta = $conexion->prepare('INSERT INTO ' . self::TABLA .' ( nombre,apellidos,edad,curso,transporteEscolar) \r\n\t \tVALUES(:nombre,:apellidos,:edad,:curso,:transporteEscolar)');\r\n\t \r\n\t $consulta->bindParam(':nombre', $this->nombre);\r\n\t $consulta->bindParam(':apellidos', $this->apellidos);\r\n\t $consulta->bindParam(':edad', $this->edad);\r\n\t $consulta->bindParam(':curso', $this->curso);\r\n\t $consulta->bindParam(':transporteEscolar', $this->transporteEscolar);\r\n\t $consulta->execute();\r\n\t\t\t$this->idAlumno = $conexion->lastInsertId();\r\n\t\t//\tif($respuesta1){\r\n\t\t//\t\treturn $respuesta1;\r\n\t\t//\t}\t\r\n\t\t\techo \"<h2 style='color:white;'>El Alumno se ha registrado con el id: \" . $this->idAlumno.\"</h2>\";\r\n\t\t\t printf (\"<br/><a href='registroAlumnos.php'><button class='lila'>Volver</button></a>\");\t\r\n\t\t}else{\r\n\t\t\techo \"<h2 style='color:white;'>No se pudo realizar el registro.</h2>\";\r\n\t\t\t printf (\"<br/><a href='registroAlumnos.php'><button class='lila'>Volver</button></a>\");\r\n\t\t}\r\n\t\t$conexion = null; \r\n\t\t}", "function insertar_temporada_producto(){\t\t\n\t\t$this->accion=\"Insertar Nueva Temporada\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\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=\"INSERT INTO temporadas2 VALUES ('', '$this->id', '$this->mostrar', '$this->prioridad', 'Por Fecha', '0', '$this->desde', '$this->hasta', '0', '0', '$this->alternativo', '0', '0', '$this->titulo', 'NULL', '$this->paxadicional', 'NULL', '$this->desde_a', '$this->hasta_a', '$this->precio_a', '0', 'NULL', '$this->desde_b', '$this->hasta_b', '$this->precio_b', '0', 'NULL', '0', '0', '0', '0', 'NULL')\";\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}\n\t}", "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 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 store(){\n \n // comprueba que llegue el formulario con los datos\n if(empty($_POST['guardar']))\n throw new Exception('No se recibieron datos');\n \n $mascota = new Mascotas(); //crear el nuevo usuario\n \n $mascota->nombre = DB::escape($_POST['nombre']);\n $mascota->sexo = DB::escape($_POST['sexo']);\n $mascota->biografia = DB::escape($_POST['biografia']);\n $mascota->fechanacimiento = DB::escape($_POST['fechanacimiento']);\n $mascota->fechafallecimiento = DB::escape($_POST['fechafallecimiento']);\n $mascota->idusuario = Login::get()->id;\n $mascota->idraza = intval($_POST['raza']);\n \n \n \n if(!$mascota->guardar())\n throw new Exception(\"No se pudo guardar $mascota->nombre\");\n \n $mensaje=\"Guardado la mascota $mascota->nombre\";\n include 'views/exito.php'; //mostrar éxito\n }", "public function guardarCambios(){\n $cedula = $_POST['cedula'];\n $nombre = $_POST['nombre'];\n $apellido = $_POST['apellido'];\n $edad = $_POST['edad'];\n \n //2. Crear un objeto Estudiante y enviar a actualizar\n $estudiante = new Estudiante($cedula,$nombre,$apellido,$edad); \n \n //3. llamar al modelo para guarde los cambios\n $this->model->actualizar($estudiante);\n \n //4. redirección index. \n header(\"location:index.php\");\n }", "public function store()\n {\n $ev=new EventlogRegister;\n $ev->registro(1,'Intento de guardar en tabla=Materias.',$this->req->user()->id);\n $this->validate($this->req,[\n 'nombre'=>'required'\n ]);\n $val=Materias::where('nombre',$this->req->input('nombre'));\n if($val->count()){\n return response()->json(['msj'=>'El elemento ya fue creado anteriormente. No se crea uno nuevo.']);\n }\n $obj=new Materias;\n $obj->nombre=$this->req->input('nombre');\n if ($this->req->has('descripcion')) {\n $obj->descripcion=$this->req->input('descripcion');\n }else{\n $obj->descripcion='';\n }\n $obj->save();\n $msj='Elemento Creado. Tabla=Materias, id='.$obj->id;\n $ev->registro(1,$msj,$this->req->user()->id);\n return response()->json(['msj'=>$msj]);\n }", "function guardar($nombre)\n\t{\n\t\ttry{\n\t \t\tinclude_once('../conexion/conexion.php');\n\t \t\t$conn = conexion();\n\t \t\t$idestado = \"1\";\n\t \t\t//prepare el sql and bind parameters\n\t \t\t$stmt = $conn->prepare('INSERT INTO tipousuario(nombre,idestado)\n\t \t\t VALUES(:a,:b)');\n\t \t\t$stmt->bindParam(':a', $a);\n\t \t\t$stmt->bindParam(':b', $b);\n\t \t\t//insert a row\n\t \t\t$a = $nombre;\n\t \t\t$b = $idestado;\n\t \t\t$stmt->execute();\n\t \t\techo \"<script> alert('Registro Almacenado')</script>\";\n\t \t}catch(PDOExcepcion $e){\n\t \t\techo \"Error:\".$e->getMessage();\n\t \t}\n\t}", "function guardar($datos){\n $objResp = new xajaxResponse();\n\n if (($datos[\"txtNombre\"]==\"\")||($datos[\"txtUbicacion\"]==\"\")){\n $objResp->alert(\"Coordinación sin nombre o ubicación!\\nPor favor revise e intente de nuevo.\");\n return $objResp;\n }else{\n $area = new Area($datos[\"txtId\"], $datos[\"txtNombre\"], $datos[\"txtUbicacion\"], $datos[\"cmbCoordinaciones\"]);\n\n $r = $area->guardar();\n\n if ($r == -1){\n $objResp->alert(\"Error en la conexión!\");\n }else if($r == 0){\n $objResp->alert(\"Error en la consulta!\");\n }else{\n $objResp->alert(\"Guardado con éxito!\");\n }\n\n $objResp->redirect(\"area_vis.php\");\n\n return $objResp;\n }\n}", "public function AgregarRegistro()\r\n {\r\n \r\n\t\r\n$tbl = <<<EOD\r\n\r\n<div id=\"jQueryDialog2\" style=\"\" title=\"Digita los campos\">\r\n<div id=\"wb_Form1\" style=\"position:absolute;left:16px;top:14px;z-index:3;\">\r\n<form name=\"FormBorrarItem\" method=\"post\" action=\"EditInv.php\" enctype=\"multipart/form-data\" target=\"_self\" id=\"Form1\">\r\n\r\nEOD;\r\n\r\nprint($tbl);\t\r\n\r\n\r\nfor($i=1; $i<$this->NumCols; $i++)\r\n\t\tprint('<input type=\"text\" style=\"width:243px;height:50px;line-height:70px;\" name=\"'.$this->NombreCol[$i].'\" value=\"\" placeholder=\"'.$this->NombreCol[$i].'\"> ');\r\n\t\t\r\n$tbl = <<<EOD\r\n\t\r\n\r\n<div id=\"Html1\" style=\"\">\r\n<input type=\"image\" src=\"iconos/aceptar1.png\" name=\"AgregarItem\" value=\"$this->tabla\"></div>\r\n</form>\r\n</div>\r\n</div>\t\r\n<div id=\"wb_Form2\" style=\"position:absolute;left:115px;top:6px;width:348px;height:178px;z-index:11;\">\r\n<form name=\"BorrarItem\" method=\"post\" action=\"EditInv.php\" enctype=\"multipart/form-data\" target=\"_self\" id=\"Form2\">\r\n<button id=\"AdvancedButton1\" type=\"submit\" name=\"cancelar\" value=\"$this->tabla;$idItem\" style=\"position:absolute;left:40px;top:56px;width:108px;height:108px;z-index:4;\">\r\n<div style=\"text-align:center\"></div>\r\n</button>\r\n\r\n<div id=\"wb_Text8\" style=\"position:absolute;left:56px;top:9px;width:253px;height:16px;z-index:6;text-align:center;\">\r\n<span style=\"color:#0000FF;font-family:'Bookman Old Style';font-size:13px;\"><strong><em>Vas a agregar un nuevo registro a la tabla $this->tabla</em></strong></span></div>\r\n\r\n</form>\r\n</div>\r\n\r\nEOD;\r\n\r\nprint($tbl);\t\r\n\t\r\n\t}", "function insertar_historial($id){\n\t\t$this->accion=\"Descripci&oacute; de Nota de Seguimiento\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$this->asignar_valores();\n\t\t\t$this->fecha = $this->convertir_fecha($this->fecha);\n\t\t\t$sql=\"INSERT INTO historial VALUES ('', '$this->tabla', '$this->pertenece', '$this->asunto', '$this->descripcion', '$this->fecha', '$this->hora', NOW())\";\n\t\t\t\n\t\t\t//echo $sql;\n\t\t\t\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/$this->tabla/editar.php?id=$id\");\n\t\t}\n\t\t\t\n\t}", "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 save($empleado){\n\t\t$db=Db::getConnect();\n\t\t\t\t\n\t\t$insert=$db->prepare('INSERT INTO empleado VALUES (NULL, :nombre,:apellidos,:id_provincia,\n\t\t\t:direccion,:estado,:id_tienda)');\n\n\t\t$insert->bindValue('nombre',$empleado->getNombre());\n\t\t$insert->bindValue('apellidos',$empleado->getApellidos());\n\t\t$insert->bindValue('id_provincia',$empleado->getProvincia());\n\t\t$insert->bindValue('direccion',$empleado->getDireccion());\t\t\n\t\t$insert->bindValue('estado',$empleado->getEstado());\n\t\t$insert->bindValue('id_tienda',$empleado->getTienda());\n\t\t$insert->execute();\n\n\t}", "function validarDatosRegistro() {\r\n // Recuperar datos Enviados desde formulario_nuevo_equipo.php\r\n $datos = Array();\r\n $datos[0] = (isset($_REQUEST['titulo']))?\r\n $_REQUEST['titulo']:\"\";\r\n $datos[0] = limpiar($datos[0]);\r\n $datos[1] = (isset($_REQUEST['url']))?\r\n $_REQUEST['url']:\"\";\r\n\r\n //-----validar ---- //\r\n $errores = Array();\r\n $errores[0] = !validarTitulo($datos[0]);\r\n $errores[1] = !validarURL($datos[1]);\r\n\r\n // ----- Asignar a variables de Sesión ----//\r\n $_SESSION['datos'] = $datos;\r\n $_SESSION['errores'] = $errores; \r\n $_SESSION['hayErrores'] = \r\n ($errores[0] || $errores[1]);\r\n \r\n}", "function guardarDatos()\n {\n $miArchivo = \"datos.json\";\n $arreglo = array();\n\n try{\n $datosForma = array(\n 'nombreProducto'=> $_POST['nombre'],\n 'nombreCliente'=> $_POST['cliente'],\n 'precio'=> $_POST['precio'],\n 'fechaPedido'=> $_POST['fechaPedido'],\n 'fechaEntrega'=> $_POST['fechaEntrega']\n );\n\n if(file_get_contents($miArchivo) != null)\n {\n $jsondata = file_get_contents($miArchivo);\n\n $arreglo = json_decode($jsondata,true);\n }\n\n array_push($arreglo, $datosForma);\n\n $jsondata = json_encode($arreglo, JSON_PRETTY_PRINT);\n\n if(file_put_contents($miArchivo, $jsondata))\n return true;\n else\n return false;\n }catch(Exception $e)\n {\n return false;\n }\n }", "function guardar($formulario,$profesor){\n\n $flag = 0;\n extract($formulario);\n $respuesta = new xajaxResponse(\"utf-8\");\n $conn = new conexionBD ( ); //Genera una nueva conexion\n\t \n $conn->EjecutarSQL(\"SET NAMES 'utf8'\");\n\n \n\n// al guardar los numeros de las lineas nos aseguramos que si borran una no perderemos las referencias.\n foreach($hdnIdCampos as $id){\n\n\n $profesor= $formulario['hdnProfesor_' . $id];\n $sqlpro = \"SELECT * FROM `equipamiento_eii`.`profesores` WHERE Nombre = '\".limpiar($profesor).\"' \"; \n $result = $conn->EjecutarSQL($sqlpro);\n $filas = mysql_num_rows($result);\n \n if($filas==0){ //CONTROL DE ERRORES. muy importante, si no guarda uno, no guarda nada.\n $conn->EjecutarSQL(\"ROLLBACK TRANSACTION A1\"); \n $MSG = \"El profesor seleccionado no existe.\\nPor favor, intentelo nuevamente.\";\n $respuesta->addAlert($MSG);\n return $respuesta;\n }\n $row = $conn->FetchArray($result);\n $monitor = str_replace('||','\"', $formulario['hdnMonitor_' . $id]);\n\n \n\t$Str_SQL = \"INSERT INTO material(`Id_profesor`, `PC` , `Fecha_PC` , `Portatil` , `Fecha_Portatil` , `Monitor` , `Fecha_Monitor`, `Otros`, `Fecha_Otros` ) \n VALUES ('','\". $formulario['hdnPC_' . $id] .\"', '\". fecha($formulario['hdnFechaPC_' . $id]) .\"', '\". $formulario['hdnPortatil_' . $id] .\"', '\". fecha($formulario['hdnFechaPortatil_' . $id]) .\"',\n '\".$monitor.\"',\n '\" . fecha($formulario['hdnFechaMonitor_' . $id]) . \"', '\" . $formulario['hdnOtros_' . $id] . \"', '\" . fecha($formulario['hdnFechaOtros_' . $id]) . \"')\";\n\n$Str_SQL2 = \"INSERT INTO material(`Id_profesor`, `PC` , `Fecha_PC` , `Portatil` , `Fecha_Portatil` , `Monitor` , `Fecha_Monitor`, `Otros`, `Fecha_Otros` ) \n VALUES ('\".$row['Id'].\"','\". $formulario['hdnPC_' . $id] .\"', '\". fecha($formulario['hdnFechaPC_' . $id]) .\"', '\". $formulario['hdnPortatil_' . $id] .\"', '\". fecha($formulario['hdnFechaPortatil_' . $id]) .\"',\n '\".$monitor.\"',\n '\" . fecha($formulario['hdnFechaMonitor_' . $id]) . \"', '\" . $formulario['hdnOtros_' . $id] . \"', '\" . fecha($formulario['hdnFechaOtros_' . $id]) . \"')\";\n\n\n if($row['Id_material']=='0'){\n if(!$conn->EjecutarSQL($Str_SQL)){ //CONTROL DE ERRORES. muy importante, si no guarda uno, no guarda nada.\n $conn->EjecutarSQL(\"ROLLBACK TRANSACTION A1\");\n $flag = 1;\n $MSG = \"Ha ocurrido un error al insertar los datos de los materiales.\\nPor favor, intentelo nuevamente.\";\n }\n\t }else{\n if(!$conn->EjecutarSQL($Str_SQL2)){ //CONTROL DE ERRORES. muy importante, si no guarda uno, no guarda nada.\n $conn->EjecutarSQL(\"ROLLBACK TRANSACTION A1\");\n $flag = 1;\n $MSG = \"Ha ocurrido un error al insertar los datos de los materiales.\\nPor favor, intentelo nuevamente.\";\n }\n\n }\n\t\n if($flag == 0){\n $lastid = mysql_insert_id();\n\n $conn->EjecutarSQL(\"SET NAMES 'utf8'\");\n \n\n \n //$row = $conn->FetchArray($result);\n $sql= \"UPDATE `equipamiento_eii`.`material` SET `Id_profesor` = '\".$row['Id'].\"' WHERE `material`.`Id` = '\".$lastid.\"' \";\n \n if(!$conn->EjecutarSQL($sql)){ //CONTROL DE ERRORES. muy importante, si no guarda uno, no guarda nada.\n $conn->EjecutarSQL(\"ROLLBACK TRANSACTION A1\"); \n $MSG = \"Ha ocurrido un error al actualizar los materiales.\\nPor favor, intentelo nuevamente.\";\n }\n \n\n if($row['Id_material']=='0'){\n $conn->EjecutarSQL(\"SET NAMES 'utf8'\"); \n $sql= \"UPDATE `equipamiento_eii`.`profesores` SET `Id_material` = '\".$row['Id'].\"' WHERE `profesores`.`Id` = '\".$row['Id'].\"' \";\n if(!$conn->EjecutarSQL($sql)){ \n printf(\"ultimo registro insertado tiene el id %d\\n\", $lastid);\n }\n\t\t $conn->EjecutarSQL(\"COMMIT TRANSACTION A1\");\t\t \n }\n $MSG = \"Datos guardados con exito\"; \n \n\t }\n \n\t}\n \n\t$respuesta->addAlert($MSG);\n return $respuesta;\n\n}", "public function guardar()\n\t{\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\t\t// Comprobar si es un registro nuevo o uno ya existente\n\t\tif ($this->update) {\n\n\t\t\t// Preparar la sentencia para actualizar el tipo de rol en la bd\n\t\t\t$sentencia = $conexion->conn->prepare(\"UPDATE \". static::$tablaConsulta . \" SET medio= ? WHERE id= ?\");\n\n\t\t\t// Pasar los campos del objecto a la sentencia\n\t\t\t$sentencia->bind_param(\n\t\t\t\t\t'si',\n\t\t\t\t\t$this->medio,\n\t\t\t\t\t$this->id\n\t\t\t);\n\n\t\t} else {\n\n\t\t\t// Preparar la sentencia para isertar el tipo de rol en la bd\n\t\t\t$sentencia = $conexion->conn->prepare(\"INSERT INTO \". static::$tablaConsulta . \" VALUES (null, ?)\");\n\n\t\t\t// Pasar los campos del objecto a la sentencia\n\t\t\t$sentencia->bind_param(\n\t\t\t\t\t's',\n\t\t\t\t\t$this->medio\n\t\t\t);\n\t\t}\n\n\n // Ejecutar la sentencia\n\t\tif ( $sentencia->execute() ) {\n\n\t\t\t// Devolver un uno si fue un exito\n\t\t\treturn 1;\n\t\t} else {\n\n\t\t\t// Devolver un 0 si ocurrio un error\n\t\t\treturn 0;\n\t\t}\n\t}", "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}", "public function GuardarEstado()\n\t{\n\t\t$query=\"INSERT INTO estado (idpais,estado,descripcion) VALUES ($this->id_pais,'$this->estado','$this->descripcion')\";\n\t\t$resp=$this->db->consulta($query);\n\t\t$this->id_estado = $this->db->id_ultimo();\n\t\t\n\t\t\n\t\t\n\t}", "public function crear()\n {\n // Comprobar si esta logeado como admin\n if( isset($_SESSION['admin']) ){\n\n $tipoReporte = new TipoReporte;\n\n $tipoReporte->reporte = $_POST['nuevoTipoReporte'];\n\n $tipoReporte->guardar();\n\n header('Location: ../reportes/tipos_reporte');\n\n } else {\n\n // Redirigir al perfil\n header('Location: ../perfil');\n }\n\n }", "public function save(){\r\n $consulta = $this->conexion->prepare(\"INSERT INTO \".$this->table.\" (idTarea, descripcion) VALUES (:idTarea, :descripcion)\"); \r\n $save = $consulta->execute(array(\r\n \"idTarea\" => $this->idTarea,\r\n \"descripcion\" => $this->descripcion\r\n ));\r\n \r\n $this->conexion = null; \r\n \r\n return $save;\r\n }", "function registrarDetalleDocumento(DetalleDocumento $nuevoDetalle){\n\n require 'parametrosBD.php';\n\n try{\n $conn = new PDO(\"mysql:host=$host;dbname=$nombreBaseDatos\", $usuario,$password);\n\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $query = $conn->prepare(\"INSERT INTO DETALLE_DOCUMENTO (idTipoDoc, folioDoc, codProd, precioUnitario, cantUnitaria, descuento, valor) \n VALUES (?, ?, ?, ?, ?, ?, ?)\");\n \n $result = $query->execute([$nuevoDetalle->getEncabezadoDocumento()->getTipoDoc()->getIdTipoDoc(),\n $nuevoDetalle->getEncabezadoDocumento()->getFolioDoc(), \n $nuevoDetalle->getProducto()->getCodProd(),\n $nuevoDetalle->getPrecioUnitario(),\n $nuevoDetalle->getCantUnitaria(),\n $nuevoDetalle->getDescuento(),\n $nuevoDetalle->getValor()]);\n \n if($result === true)\n {\n return 'ok';\n }\n else\n {\n return 'err';\n }\n\n }catch(PDOException $pe){\n\n return \"err : \" . $pe->getMessage();\n\n }\n }", "public function guardarRegistro2(){\r\n $this->database->execute(\"INSERT INTO empleados (nombreApellido, dni, email, pass) VALUES ('rodri', '12345678', '[email protected]', '123456'\");\r\n }", "public static function guardar(){\n // Almacena la cita y devuelve el id\n $cita = new Cita($_POST);\n $resultado = $cita->guardar();\n\n $id = $resultado['id'];// Id de la cita creada\n\n // Almacena la cita y el servicio\n $idServicios = explode(\",\", $_POST['servicios']);\n // Iteramos egun el numero de servicios elegidos y le ponemos la misma citaId\n foreach($idServicios as $idServicio){\n $args = [\n 'citaId' => $id,\n 'servicioId' => $idServicio\n ];\n $citaServicio = new CitaServicio($args); // Creamos el objeto para tabla 'citasservicios'(Pivote)\n $citaServicio->guardar(); // Guardamos en tabla 'citasservicios'\n }\n echo json_encode(['resultado' => $resultado]);\n }", "static public function ctrInsertOportunidad(){\n\n if(isset($_POST[\"opoEmpleado\"])){\n if(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"opofolio\"]) &&\n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ., ]+$/', $_POST[\"nuevoEmpresa\"]) && \n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ., ]+$/', $_POST[\"opoServicio\"]) &&\n preg_match('/^[0-9., ]+$/', $_POST[\"opoCantidad\"]) &&\n preg_match('/^[0-9., ]+$/', $_POST[\"opoImporte\"])){\n $tabla = \"oportunidad\";\n $datos = array(\n \"codigo\" => $_POST[\"opofolio\"],\n \"idUsuario\" => $_POST[\"opoEmpleado\"],\n \"idCliente\" => $_POST[\"opoCliente\"],\n \"empresa\" => $_POST[\"nuevoEmpresa\"],\n \"servicio\" => $_POST[\"opoServicio\"],\n \"idPieza\" => $_POST[\"opoModelo\"],\n \"cantidad\" => $_POST[\"opoCantidad\"],\n \"importe\" => $_POST[\"opoImporte\"],\n \"idPorcentaje\" => $_POST[\"opoEtapa\"],\n \"idAccion\" => $_POST[\"opoAccion\"],\n \"descripcion\" => $_POST[\"opoDescripcion\"],\n );\n\n $respuestas = ModeloOportunidad::mdlInsertOportunidad($tabla,$datos);\n\n \n if($respuestas == \"ok\"){\n \n echo '<script>\n localStorage.removeItem(\"folio\");\n localStorage.removeItem(\"Idempleado\");\n localStorage.removeItem(\"empleado\");\n\t\t\t\t\tSwal.fire({\n\n\t\t\t\t\t\ticon: \"success\",\n\t\t\t\t\t\ttitle: \"¡la oportunidad 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\n\t\t\t\t\t\t\twindow.location = \"oportunidad\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n \n }\n\n }else{\n \n echo '<script>\n\n\t\t\t\tSwal.fire({\n\n\t\t\t\t\t\ticon: \"error\",\n\t\t\t\t\t\ttitle: \"¡Los datos ingresados no pueden ir vacíos 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\twindow.location = \"oportunidad\";\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\n }\n }", "function displayNewPatient(){\n\t$contents=' <form id=\"ajouter_patient\" name=\"ajouter_patient\" method=\"post\" action=\"index.php\" onSubmit=\"return checkFormAjouter(this);\" />\n <fieldset id=\"fds_ajouter\">\n <legend>Ajouter un patient</legend>\n <p><label>NSS : </label>\n <input type=\"text\" maxlength=\"15\" id=\"nss\" name=\"nss\" onBlur=\"checkNssSynthese(this)\"/></p>\n <p><label>Nom : </label>\n <input type=\"text\" id=\"nom_patient\" name=\"nom_patient\" onBlur=\"checkTextAjouter(this)\"/></p>\n <p><label>Prénom : </label>\n <input type=\"text\" id=\"prenom_patient\" name=\"prenom_patient\" onBlur=\"checkTextAjouter(this)\"/></p>\n <p><label>Adresse : </label>\n <input type=\"text\" id=\"adresse_patient\" name=\"adresse_patient\" onBlur=\"checkTextAjouter(this)\"/></p>\n <p><label>Numéro Tel : </label>\n <input type=\"text\" maxlength=\"10\" id=\"num_tel_patient\" name=\"num_tel_patient\" onBlur=\"checkNumTelAjouter(this)\"/></p>\n <p><label>Date de naissance : </label>\n <input type=\"date\" id=\"date_patient\" name=\"date_patient\" onBlur=\"checkDateAjouter(this)\"/></p>\n <p><label>Département de naissance : </label>\n <input type=\"text\" id=\"departement_patient\" name=\"departement_patient\" onBlur=\"ajouterPays();checkDepartementAjouter(this);\"/></p>\n <p id=\"derP_ajouter\">\n <p><label>Solde : </label>\n <input type=\"text\" name=\"solde\" id=\"solde\"/>\n </p>\n <input type=\"submit\" id=\"ajouter_patient\" name=\"ajouter_patient\" value=\"Ajouter patient\"/>\n <input type=\"reset\" value=\"Effacer\"/></p>\n </fieldset>\n </form>';\n\t$contentsError='';\n\trequire_once('gabarit_agent.php');\n}", "function insertar_plan_temporada_producto(){\t\t\n\t\t$this->accion=\"Insertar Nuevo 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=\"INSERT INTO habitaciones2 VALUES ('', '$this->id', '$this->temporada', '$this->nombre', '$this->prioridad', '$this->mostrar', '$this->precio', '$this->descripcion', '$this->maxadultos', 'NULL', 'NULL', 'NULL')\";\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}\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}", "function sobreMeSalvar() {\n \n $usuario = new Estado_pessoal();\n $api = new ApiUsuario();\n $usuario->codgusuario = $_SESSION['unia']->codgusario;\n $this->dados = $api->Listar_detalhe_usuario($usuario);\n if (empty($this->dados->codgusuario) && $this->dados->codgusuario == NULL) {\n \n $this->dados = array('dados'=>$api->Insert_sobreMe(new Estado_pessoal ('POST')) );\n header(\"Location:\" .APP_ADMIN.'usuario/detalhe_usuario');\n } else {\n $this->dados = array('dados'=>$api->Actualizar_sobreMe(new Estado_pessoal ('POST')) );\n header(\"Location:\" .APP_ADMIN.'usuario/detalhe_usuario');\n }\n \n }", "private function pantalla_edicion($modo,$datos='') {\r\n\t\t\t if($datos == ''){//para que por defecto en insertar salga el nombre del producto vacio y el precio igual a 0\r\n\t\t\t\tunset($datos);\r\n\t\t\t\t$datos['nombre'] = '';\r\n\t\t\t\t$datos['precio'] = 0;\r\n\t\t\t }\r\n\t\t\t ?>\r\n\t\t\t <!DOCTYPE html>\r\n\t\t\t\t<html>\r\n\t\t\t\t\t<head>\r\n\t\t\t\t\t\t<title>Área privada de Tienda online</title>\r\n\t\t\t\t\t\t<link href=\"/ejercicio_unidad9_hector_garcia/css/estilos.css\" rel=\"stylesheet\" type=\"text/css\">\r\n\t\t\t\t\t</head>\r\n\t\t\t\t\t<body>\r\n\t\t\t\t\t\t<div id=\"main\">\r\n\t\t\t\t<?php\r\n\t\t\t\t\t$this -> cabecera();\r\n\t\t\t\t?>\r\n\t\t\t\t\t\t\t<div id=\"contenido\">\r\n\t\t\t\t\t\t\t\t<h2>Ficha de producto</h2>\r\n\t\t\t\t\t\t\t\t<form method=\"post\" action=\"http://localhost:8080/ejercicio_unidad9_hector_garcia/\">\r\n\t\t\t\t<?php\r\n\t\t\t\t\tif ($modo == 'insertar') {\r\n\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"acc\" value=\"insertar_producto\">\r\n\t\t\t\t<?php\r\n\t\t\t\t\t} else {\r\n\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"<?php echo (int)$datos['id']; ?>\">\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"acc\" value=\"modificar_producto\">\r\n\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t<label class=\"etiqueta\" for=\"nombre\">Nombre</label>\r\n\t\t\t\t\t\t\t\t<div class=\"campo\"><input type=\"text\" name=\"nombre\" id=\"nombre\" value=\"<?php echo htmlentities($datos['nombre']); ?>\"></div>\r\n\t\t\t\t\t\t\t\t<label class=\"etiqueta\" for=\"precio\">Precio</label>\r\n\t\t\t\t\t\t\t\t<div class=\"campo\"><input type=\"text\" name=\"precio\" id=\"precio\" value=\"<?php echo number_format($datos['precio'],2,',','.'); ?>\"></div>\r\n\t\t\t\t\t\t\t\t<div class=\"botonera\"><button type=\"submit\">Guardar</button></div>\r\n\t\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</body>\r\n\t\t\t\t</html>\r\n\t\t<?php\r\n\t\t}", "public function createHistorial(){\n\n $this->validate([\n\n 'folio'=>'required',\n 'dia'=>'required',\n 'hr_entrada'=>'required',\n\n ]);\n \n $datos = Empleado::where('folio', $this->folio)->first();\n\n $statu=1;\n\n if ($datos) {\n # code...\n Historial::create([\n 'folio' => $this->folio,\n 'fecha_entrada' => $this->dia,\n 'hora_entrada'=>$this->hr_entrada,\n 'id_statu'=>$statu\n ]);\n\n\n $this->folio='';\n\n $this->dia='';\n\n\n $this->hr_entrada='';\n\n $this->nombre=''; \n\n $this->apellido_p='';\n \n $this->apellido_m='';\n \n $this->puesto='';\n\n\n //ocultar modal , se utiliza el emit para ocultar el modal y se manda al script\n $this->emit('ocultarModal');\n \n //session()->flash('exito','Bienvenido tu registro fue exitoso.');\n\n $this->emit('mensajes');\n\n \n }else{\n session()->flash('Existe','Asigne corectamente su folio');\n }\n\n \n\n }", "public function insertar(){\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,jefe,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:jefe,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':jefe', $jefe);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los input\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $jefe=\"0706430980\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n //CUANDO NO TIENE JEFE--=EL EMPLEADO ES JEFE (NO ENVIAR EL PARAMETRO JEFE,LA BDD AUTOMTICAMENTE PONE NULL)\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los inputs\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n\n \n }", "function mostrarFormularioProyecto(){\n include_once($this->configuracion[\"raiz_documento\"] . $this->configuracion[\"clases\"] . \"/html.class.php\");\n $html = new html();\n $this->verificar = \"seleccion_valida(\".$this->formulario2.\",'cod_proyecto')\";\n \n //$cod_proyecto = $this->proyecto[0][0]; \n //$nom_proyecto = $this->proyecto[0][1];\n $tmp_proyectos = $this->consultarProyectos();\n for($i=0;$i<count($tmp_proyectos);$i++) {\n $proyectos[$i][0]=$tmp_proyectos[$i]['CRA_COD'];\n $proyectos[$i][1]=$tmp_proyectos[$i]['NOMBRE'];\n }\n $_REQUEST['cod_proyecto']=isset($_REQUEST['cod_proyecto'])?$_REQUEST['cod_proyecto']:'';\n \n ?>\n <script src=\"<? echo $this->configuracion[\"host\"]. $this->configuracion[\"site\"]. $this->configuracion[\"javascript\"] ?>/funciones.js\" type=\"text/javascript\" language=\"javascript\"></script>\n <form enctype='tipo:multipart/form-data,application/x-www-form-urlencoded,text/plain' method='POST' action='index.php' name='<? echo $this->formulario2 ?>'>\n <table id=\"tabla\" class=\"contenidotabla\" width=\"100%\">\n <div align=\"center\" ><b><?echo \"HOMOLOGACIONES PENDIENTES POR PROYECTO CURRICULAR \"; ?></b></div><hr>\n <?//opciones para agregar 5,10,15...50 estudiantes?>\n\n <thead class='sigma'>\n <th class='niveles centrar' > Proyecto Curricular</th>\n </thead>\n <tr >\n <td width=\"20%\" class='cuadro_plano centrar'>\n <?\n $mi_cuadro = $html->cuadro_lista($proyectos, \"cod_proyecto\", $this->configuracion,$_REQUEST['cod_proyecto'], 0, FALSE, 1, \"\",400);\n echo $mi_cuadro ;\n ?>\n <input type=\"hidden\" name=\"opcion\" value=\"consultarProyecto\">\n <input type=\"hidden\" name=\"pagina\" value=\"<? echo $this->formulario2 ?>\">\n \n </td>\n \n </tr>\n </table>\n <table width=\"100%\">\n <tr>\n <td align=\"center\">\n <input type=\"button\" value=\"Homologar\" onclick=\"if(<? echo $this->verificar; ?>){document.forms['<? echo $this->formulario2?>'].submit()}else{false}\"> </td>\n </tr>\n </table>\n </form>\n<?\n\n }", "function validarDatosRegistro() {\r\n // Recuperar datos Enviados desde formulario_nuevo_equipo.php\r\n $datos = Array();\r\n $datos[0] = (isset($_REQUEST['marca']))?\r\n $_REQUEST['marca']:\"\";\r\n $datos[1] = (isset($_REQUEST['modelo']))?\r\n $_REQUEST['modelo']:\"\";\r\n $datos[2] = (isset($_REQUEST['matricula']))?\r\n $_REQUEST['matricula']:\"\";\r\n \r\n //-----validar ---- //\r\n $errores = Array();\r\n $errores[0] = !validarMarca($datos[0]);\r\n $errores[1] = !validarModelo($datos[1]);\r\n $errores[2] = !validarMatricula($datos[2]);\r\n \r\n // ----- Asignar a variables de Sesión ----//\r\n $_SESSION['datos'] = $datos;\r\n $_SESSION['errores'] = $errores; \r\n $_SESSION['hayErrores'] = \r\n ($errores[0] || $errores[1] ||\r\n $errores[2]);\r\n \r\n}", "public function insertar() {\n $this->consultaValores->id=null;\n return $this->ejecutarConsulta('insertar');\n }", "public function ObtenerDat()\n {\n $this->validate([\n 'folio'=>'required'\n ]) ;\n\n $datos = Empleado::where('folio', $this->folio)->first();\n\n if($datos){\n\n $this->nombre= $datos->nombre; \n\n $this->apellido_p= $datos->apellido_p;\n \n $this->apellido_m= $datos->apellido_m;\n \n $this->puesto= $datos->puestos->puesto;\n \n if(!empty($this->imagen)){\n $this->imagen=$datos->imagen->store(\"public\");\n }else{\n $this->imagen= null;\n }\n\n }else{\n\n session()->flash('MensajeD','El empleado no trabaja en este Hotel.');\n\n $this->nombre= ''; \n\n $this->apellido_p= '';\n \n $this->apellido_m= '';\n \n $this->puesto= '';\n \n }\n\n }", "public function GuardarEmpleado()\n {\n //Creo la conexion a la DB.\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso();\n\n //Creo la consulta INSERT.\n $consulta = $objetoAccesoDato->RetornarConsulta(\"INSERT into empleado (nombre,turno,tipo)values('$this->nombre','$this->tipo','$this->turno')\");\n\n //Ejecuto la consulta.\n $consulta->execute();\n\n //Guardo su ID.\n $this->id = $objetoAccesoDato->RetornarUltimoIdInsertado();\n\n //Retorno\n return $this->id;\n }", "public function persist (){\n \n $this->query = \"INSERT INTO libros(titulo,autor,editorial) VALUES (:titulo, :autor, :editorial)\";\n\n // $this->parametros['id']=$user_data[\"id\"];\n $this->parametros['titulo']=$this->titulo;\n $this->parametros['autor']=$this->autor;\n $this->parametros['editorial']=$this->editorial;\n \n $this->get_results_from_query();\n\n\n $this->mensaje = \"Libro agregado exitosamente\";\n \n }", "function registrarEnvioDetalles(){\n\t\t$x = $this->pdo->prepare('INSERT INTO enviodetalles (cedulaCliente,empresa,telefono,fechaEnvio) VALUES (?,?,?,?)');\n\t\t$x->execute(array($this->cedulaCliente,$this->empresa,$this->telefono,$this->fechaEnvio));\n\t\treturn $x;\n\t}", "function run(){\n // que se darán en la plantilla.\n\n $htmlDatos = array();\n $htmlDatos[\"tipoalmacenTitle\"] = \"\";\n $htmlDatos[\"tipoalmacenMode\"] = \"\";\n $htmlDatos[\"talid\"] = \"\";\n $htmlDatos[\"taldsc\"]=\"\";\n $htmlDatos[\"taldir\"]=\"\";\n $htmlDatos[\"taltel\"]=\"\";\n $htmlDatos[\"actSelected\"]=\"selected\";\n $htmlDatos[\"inaSelected\"]=\"\";\n $htmlDatos[\"desSelected\"]=\"\";\n $htmlDatos[\"disabled\"]=\"\";\n\n\n if(isset($_GET[\"acc\"])){\n switch($_GET[\"acc\"]){\n //Manejando si es un insert\n case \"ins\":\n $htmlDatos[\"tipoalmacenTitle\"] = \"Ingreso de Nueva tipoalmacen\";\n $htmlDatos[\"tipoalmacenMode\"] = \"ins\";\n //se determina si es una acción del formulario\n if(isset($_POST[\"btnacc\"])){\n $lastID = insertartipoalmacen($_POST);\n if($lastID){\n redirectWithMessage(\"¡tipoalmacen Ingresada!\",\"index.php?page=tipoalmacen&acc=upd&talid=\".$lastID);\n }else{\n //Se obtiene los datos que estaban en el post\n $htmlDatos[\"talid\"] = $_POST[\"talid\"];\n $htmlDatos[\"taldsc\"]=$_POST[\"taldsc\"];\n $htmlDatos[\"taldir\"]=$_POST[\"taldir\"];\n $htmlDatos[\"taltel\"]=$_POST[\"taltel\"];\n $htmlDatos[\"actSelected\"]=($_POST[\"talest\"] ==\"ACT\")?\"selected\":\"\";\n $htmlDatos[\"inaSelected\"]=($_POST[\"talest\"] ==\"INA\")?\"selected\":\"\";\n $htmlDatos[\"desSelected\"]=($_POST[\"talest\"] ==\"DES\")?\"selected\":\"\";\n\n }\n }\n //si no es una acción del post se muestra los datos\n renderizar(\"tipoalmacen\", $htmlDatos);\n break;\n //Manejando si es un Update\n case \"upd\":\n if(isset($_POST[\"btnacc\"])){\n //implementar logica de guardado\n if(actualizartipoalmacen($_POST)){\n //forzando a que se actualice con los datos de la db\n redirectWithMessage(\"¡tipoalmacen Actualizada!\",\"index.php?page=tipoalmacen&acc=upd&talid=\".$_POST[\"talid\"]);\n }\n }\n if(isset($_GET[\"undid\"])){\n $tipoalmacen = obtenertipoalmacen($_GET[\"undid\"]);\n if($tipoalmacen){\n $htmlDatos[\"tipoalmacenTitle\"] = \"Actualizar \".$tipoalmacen[\"taldsc\"];\n $htmlDatos[\"tipoalmacenMode\"] = \"upd\";\n $htmlDatos[\"talid\"] = $tipoalmacen[\"talid\"];\n $htmlDatos[\"taldsc\"]=$tipoalmacen[\"taldsc\"];\n $htmlDatos[\"talrtn\"]=$tipoalmacen[\"taldir\"];\n $htmlDatos[\"taltel\"]=$tipoalmacen[\"taltel\"];\n $htmlDatos[\"talest\"]=$tipoalmacen[\"talest\"];\n $htmlDatos[\"actSelected\"]=($tipoalmacen[\"talest\"] ==\"ACT\")?\"selected\":\"\";\n $htmlDatos[\"inaSelected\"]=($tipoalmacen[\"talest\"] ==\"INA\")?\"selected\":\"\";\n $htmlDatos[\"desSelected\"]=($tipoalmacen[\"talest\"] ==\"DES\")?\"selected\":\"\";\n\n renderizar(\"tipoalmacen\", $htmlDatos);\n }else{\n redirectWithMessage(\"¡tipoalmacen No Encontrada!\",\"index.php?page=tipoalmacenes\");\n }\n }else{\n redirectWithMessage(\"¡tipoalmacen No Encontrada!\",\"index.php?page=tipoalmacenes\");\n }\n break;\n //Manejando un delete\n case \"dlt\":\n if(isset($_POST[\"btnacc\"])){\n //implementar logica de guardado\n if(borrartipoalmacen($_POST[\"talid\"])){\n //forzando a que se actualice con los datos de la db\n redirectWithMessage(\"¡tipoalmacen Borrada!\",\"index.php?page=tipoalmacenes\");\n }\n }\n if(isset($_GET[\"talid\"])){\n $tipoalmacen = obtenertipoalmacen($_GET[\"talid\"]);\n if($tipoalmacen){\n $htmlDatos[\"tipoalmacenTitle\"] = \"¿Desea borrar \".$tipoalmacen[\"taldsc\"] . \"?\";\n $htmlDatos[\"tipoalmacenMode\"] = \"dlt\";\n $htmlDatos[\"talid\"]=$tipoalmacen[\"talid\"];\n $htmlDatos[\"taldsc\"]=$tipoalmacen[\"taldsc\"];\n $htmlDatos[\"taldir\"]=$tipoalmacen[\"taldir\"];\n $htmlDatos[\"taltel\"]=$tipoalmacen[\"taltel\"];\n $htmlDatos[\"talest\"]=$tipoalmacen[\"talest\"];\n $htmlDatos[\"actSelected\"]=($tipoalmacen[\"talest\"] ==\"ACT\")?\"selected\":\"\";\n $htmlDatos[\"inaSelected\"]=($tipoalmacen[\"talest\"] ==\"INA\")?\"selected\":\"\";\n $htmlDatos[\"desSelected\"]=($tipoalmacen[\"talest\"] ==\"DES\")?\"selected\":\"\";\n\n $htmlDatos[\"disabled\"]='disabled=\"disabled\"';\n renderizar(\"tipoalmacen\", $htmlDatos);\n }else{\n redirectWithMessage(\"¡tipoalmacen No Encontrada!\",\"index.php?page=tipoalmacenes\");\n }\n }else{\n redirectWithMessage(\"¡tipoalmacen No Encontrada!\",\"index.php?page=tipoalmacenes\");\n }\n break;\n defualt:\n redirectWithMessage(\"¡Acción no permitida!\",\"index.php?page=tipoalmacenes\");\n break;\n }\n }\n\n\n }", "private function getHtmlAjoutItem(){\n $refAjout = $this->container->router->pathFor('ajoutItem', ['tokenModif' => Liste::all()->where('no', '=', $this->data->no)->first()->tokenModif, 'id' => $this->data->no] );\n $html = \"<h1>Ajout d'un item à la liste {$this->data->titre}</h1>\";\n $html .= <<<END\n<h1>Ajout d'objet : </h1>\n<form method=\"POST\" action=\"$refAjout\" enctype=\"multipart/form-data\">\n<div class=\"form\">\n <input type=\"text\" name=\"nom\" placeholder=\"nom\" required/>\n <input type=\"text\" name=\"descr\" placeholder=\"description\"/>\n <input type=\"text\" name=\"url\" placeholder=\"url\"/>\n <input type=\"text\" name=\"prix\" placeholder=\"prix\" required/>\n <div>\n \t<label>Image :</label>\n \t<input type=\"file\" name=\"fileToUpload\" id=\"fileToUpload\"/>\n </div>\n <button class=\"button\" type=\"submit\">Ajouter</button>\n</div>\n\n\t\n</form>\nEND;\n return $html;\n }", "static function salva(){\n if(!CUtente::verificalogin())header('Location: /Progetto/Utente/homepagedef');\n else{\n session_start();\n if($_SERVER['REQUEST_METHOD'] == \"POST\"){\n $nome=$_POST['nome'];\n $descrizione=$_POST['descrizione'];\n if($_POST['accessibilità']=='Privato')$pubblico=false;\n else $pubblico=true;\n $w=new EWatchlist($nome,$descrizione,$pubblico,$_SESSION['utente']->getUsername());\n if(isset($_POST['serie'])){\n if(!empty($_POST['serie'])){\n foreach ($_POST['serie'] as $serie){\n $s=FPersistentManager::load('id',$serie,'FSerieTv');\n $w->AggiungiSerie(clone ($s[0]));\n }\n }\n }\n\n\n\n FPersistentManager::store($w);\n $u=FPersistentManager::load('username',$_SESSION['utente']->getUsername(),'FUtente');\n $_SESSION['utente']=clone($u[0]);\n $_SESSION['watchlist']= $_SESSION['utente']->getWatchlist();\n\n\n header('Location: /Progetto/Utente/user?id='.$_SESSION['utente']->getUsername());\n\n }\n else header('Location: /Progetto/Utente/homepagedef');\n }\n }", "function registrarUsuario(){\n\n\t require(\"Conexion.php\");\t\n\t \n if(isset($_POST['insertar'])){\n\t\n\t $nombre=$_POST[\"nombre\"];\n $apellido=$_POST[\"apellido\"];\n\t $correo=$_POST[\"correo\"];\n\t $direccion=$_POST[\"direccion\"];\n\t $username=$_POST[\"nombre\"];\n\t $password=$_POST[\"password\"];\n\n\t $db=new Conexion();\n\t\n\t\t /* evitar duplicaciones*/\t\t\n $sql = \"select count(*) from datos_usuario where nombre ='$nombre'\";\n\t\t\n if ($resultado = $db->connect()-> query($sql)) {\n\n /* Comprobar el número de filas que coinciden con la sentencia SELECT */\n if ($resultado->fetchColumn() > 0) {\n\n /* Ejecutar la sentencia SELECT para mostrar el nombre duplicado*/\n $sql = \"select nombre from datos_usuario where nombre = '$nombre'\";\n foreach ($db->connect()->query($sql) as $fila) {\n \n\t\t $duplicado=$nombre;\n }\t\n\n\t echo '<script language=\"javascript\">alert(\"Usuario duplicado: '.$duplicado.' ya esta en uso.\");</script>';\n\n echo \"<script>\n setTimeout(function() {\n location.href = '../vista/registro_user.php';\n }, 0001);\n </script>\";\t\t\t \n }\n \n /* No coincide ningua fila inserta */\n else {\t\t\n\t\t\t/*no hay duplicaciones insertamos*/\n\t\n $query=$db->connect()->prepare(\"insert into datos_usuario (nombre, apellido, correo, direccion)\n\t values (:nombre, :apellido, :correo,:direccion)\");\t\t\t \n $query->execute(array(\":nombre\"=>$nombre, \":apellido\"=>$apellido,\":correo\"=>$correo,\"direccion\"=>$direccion));\n\t\n\t/*----------------segunda tabla-----------------------------*/\n\t $db=new Conexion();\n\t \n\t $sql2=\"insert into usuarios(username, password, rol_id) values (:username, :password, :rol_id)\";\n\t $query=$db->connect()->prepare($sql2);\n\t\t\t \n $query->execute(array(\":username\"=>$nombre, \":password\"=>$password, \":rol_id\"=>2));\n\t\n\t\t echo'<script type=\"text/javascript\">\n alert(\"Usuario registrado\");\n </script>';\n\t\n\t \n\t echo \"<script>\n setTimeout(function() {\n location.href = '../vista/login.php';\n }, 0001);\n </script>\";\t\n\t\t } \t\n }\n }\n }", "function criar_enquete(){\n\n// dados de formulario\n$conteudo = remove_html($_REQUEST['conteudo']);\n\n// tabela\n$tabela = TABELA_ENQUETE;\n\n// data\n$data = data_atual();\n\n// query\n$query = \"insert into $tabela values(null, '$conteudo', '$data');\";\n\n// valida conteudo\nif($conteudo != null){\n\ncomando_executa($query);\n\t\n};\n\n}", "public function save()\n {\n $ins = $this->valores();\n unset($ins[\"idInscription\"]);\n\n $ins['idUser'] = $this->userO->idUser;\n unset($ins[\"userO\"]);\n\n $ins['idProject'] = $this->project->idProject;\n unset($ins[\"project\"]);\n\n if (empty($this->idInscription)) {\n $this->insert($ins);\n $this->idInscription = self::$conn->lastInsertId();\n } else {\n $this->update($this->idInscription, $ins);\n }\n }", "public function store(){\n //comprueba que llegur el formulario con los datos\n if(empty($_POST['guardar']))\n throw new Exception('No se recibieron datos');\n \n $usuario= new Usuario();\n //guardar la info del formulario\n \n //user, pass, nombre, apellidos, email, direccion, poblacion, provincia, cp\n $usuario->user= $_POST['user'];\n $usuario->pass= $_POST['pass'];\n $usuario->nombre= $_POST['nombre'];\n $usuario->apellidos= $_POST['apellidos'];\n $usuario->email= $_POST['email'];\n $usuario->direccion= $_POST['direccion'];\n $usuario->poblacion= $_POST['poblacion'];\n $usuario->provincia= $_POST['provincia'];\n $usuario->cp= $_POST['cp'];\n \n if(!$usuario->guardar()) //guarda el usuario en la bdd\n throw new Exception(\"No se pudo guardar $usuario->nombre\");\n \n // preparar un mensaje global\n $GLOBALS['mensaje']= \"Guardado del usuario $usuario->user correcto.\";\n \n //llevar a los detalles del usuario\n $this->show($usuario->id); \n }", "function evt__enviar(){\n if($this->dep('datos')->tabla('mesa')->esta_cargada()){\n $m = $this->dep('datos')->tabla('mesa')->get();\n // print_r($m);\n $m['estado'] = 2;//Cambia el estado de la mesa a Enviado\n $this->dep('datos')->tabla('mesa')->set($m);\n // print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n // $this->dep('datos')->tabla('mesa')->resetear();\n \n $m = $this->dep('datos')->tabla('mesa')->get_listado($m['id_mesa']);\n if($m[0]['estado'] == 2){//Obtengo de la BD y verifico que hizo cambios en la BD\n //Se enviaron correctamente los datos\n toba::notificacion()->agregar(utf8_decode(\"Los datos fueron enviados con éxito\"),\"info\");\n }\n else{\n //Se generó algún error al guardar en la BD\n toba::notificacion()->agregar(utf8_decode(\"Error al enviar la información, verifique su conexión a internet\"),\"info\");\n }\n }\n \n }", "function saveComprobanteElectronicoError() {\n\t\tglobal $bd;\t\n\t\t$idregistro_pago = $_POST['idregistro_pago'];\n\t\t$jsonxml = $_POST['jsonxml'];\n\n\t\t$sql=\"insert into registro_pago_cpe_error (idregistro_pago, jsonxml) values (\".$idregistro_pago.\", \".$jsonxml.\")\";\n\t\t$bd->xConsulta_NoReturn($sql);\n\t\t// echo $sql;\n\t}", "function insertar_link(){\t\n\t\t$this->accion=\"Datos del Nuevo Enlace\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$this->asignar_valores();\n\t\t\t$sql=\"SELECT * FROM link WHERE nombre_cat='999999'\";\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=\"INSERT INTO link VALUES ('', '$this->tipo', '$this->nombre', '$this->etiqueta', '$this->claves', '$this->descripcion', '$this->prioridad','$this->icono')\";\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\texit();\n\t\t\t}\n\t\t}\t\t\t\n\t}", "function guardar($arreglo,$retornarID=true,$verQuery=false) {\n\t\t/**\n\t\t * \n\t\t * Metodo que guarda en la base de datos\n\t\t * @param $arreglo[] contiene todo el POST\n\t\t */\n\t\t$arreglo['primarykey'] = $this->GetPK($arreglo['tabla']);\n\t\t//set_error_handler(\"customError\");\n\t\tif ($verQuery){\n\t\t\t__imp($arreglo);\n\t\t}\n\t\t$this->select = '';\n\t\t$this->campos = array();\n\t\t/*\n\t\t * Crea el arrglo campos que filtra para los campos invlucrados partiendo de una Tabla y POST recibido\n\t\t */\n\t\t$this->campos = array();\n\t\t$this->select = '';\n\t\tforeach ($arreglo as $key=>$value) {\n if (stripos($key,'_')) {\n if ($arreglo['nombreModulo'].'_'.$arreglo['primarykey'] != $key) {\n \n if(str_replace($arreglo['nombreModulo'].'_', '', $key) == \"password\"){\n $value = MD5($value);\n }\n if(str_replace($arreglo['nombreModulo'].'_', '', $key) == \"start_date\" || str_replace($arreglo['nombreModulo'].'_', '', $key) == \"end_date\"){\n $value = convertir_fecha_mysql($value);\n }\n $this->campos[str_replace($arreglo['nombreModulo'].'_', '', $key)]=$this->escape_string(trim($value));\n }\n }\n\t\t}\n\t\t/*\n\t\t * Crear el Query para ser utilizado para el almacenamiento partiendo del arreglo\n\t\t * modo = INSERT, UPDATE, DELETE\n\t\t */\n\t\tswitch ($arreglo['modo']) {\n\t\t\tcase 'insert':\n $this->select = 'INSERT INTO '.$arreglo['tabla'].' ('.join(', ', array_keys($this->campos)).') VALUES '.\"('\".join(\"', '\", array_values($this->campos)).\"')\";\n //print $this->select;\n break;\n\t\t\tcase 'update':\n $keys = array_keys($this->campos);\n $values = array_values($this->campos);\n if ($_SESSION['config']['bd']['tipo'] == 'mysql') {\n for ($i = 0; $i < count($keys); $i++) {\n $this->select .= $keys[$i].'='.\"'\".$values[$i].\"',\";\n }\n $this->select = substr($this->select,0,-1);\n $this->select = 'UPDATE '.$arreglo['tabla'].' SET '.$this->select.' WHERE '.$arreglo['primarykey'].'='.\"'\".$arreglo['id'].\"'\";\n }elseif ($_SESSION['config']['bd']['tipo'] == 'sqlite') {\n for ($i = 0; $i < count($keys); $i++) {\n $this->select .= $keys[$i].'='.\"'\".$values[$i].\"',\";\n }\n $this->select = substr($this->select,0,-1);\n $this->select = 'UPDATE '.$arreglo['tabla'].' SET '.$this->select.' WHERE '.$arreglo['primarykey'].'='.\"'\".$arreglo['id'].\"'\";\n }\n\t\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 'delete':\n $this->select = \"UPDATE \".$arreglo['tabla'].\" SET active = 'N' WHERE \".$arreglo['primarykey'].\"=\".$arreglo['id'];\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\techo 'error verificar MODO';\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif ($_SESSION['config']['bd']['tipo'] == 'mysql') {\n\t\t\t/*\n\t\t\t * Apertura la transacciones en la Base de Datos\n\t\t\t */\n\t\t\t$this->query = 'START TRANSACTION;';\n\t\t\t$this->rs01 = $this->consulta($this->query);\n\t\t\t/*\n\t\t\t * Alamcena o Actualiza en la tabla \n\t\t\t */\n\t\t\t$this->query = $this->select;\n\t\t\tif ($verQuery){\n\t\t\t\techo '<h4>'.$this->query.'</h4>';\n\t\t\t}\n\t\t\t$this->rs01 = $this->consulta($this->query);\n\t\t\t$tabla_rel = substr($arreglo['tabla'], 0,1);\n\t\t\tif (($arreglo['modo'] == 'insert') && ($retornarID)) {\n\t\t\t\t$arreglo['nuevo_id'] = $this->lastID(); \n\t\t\t}else {\n\t\t\t\t$arreglo['nuevo_id'] = 0;\n\t\t\t}\n\t\t\t/*\n\t\t\t * Cierra la transaccion en la Base de datos\n\t\t\t */\n\t\t\tif ($this->rs01===false) {\n\t\t\t\t$this->query = 'ROLLBACK';\n\t\t\t\t$arreglo['status'] = 'fail';\n\t\t\t\t//$_SESSION['MSG'] = __messages($param=array('Type'=>'error','Title'=>__traducirDisplay('GuradarFAIL')));\t\n\t\t\t}else{\n\t\t\t\t$this->query = 'COMMIT';\n\t\t\t\t$arreglo['status'] = 'done';\n\t\t\t\t//$_SESSION['MSG'] = __messages($param=array('Type'=>'adv','Title'=>__traducirDisplay('GuardarDONE')));\n\t\t\t}\n\t\t\t$this->rs01 = $this->consulta($this->query);\n \n \n if(($arreglo['status'] = 'done') && ($arreglo['modo'] == 'insert') && ($arreglo['tabla'] == 'ev_company')){\n $arrUsers = array();\n //$newpass = substr(md5(uniqid(rand())), 0, 8);\n $arrUsers[\"admin\"] = array(\"name\" => \"admin_0\".$arreglo['nuevo_id'], \"password\" => '', 'user_id' => 0);\n $arrUsers[\"seller\"] = array(\"name\" => \"vendedor_0\".$arreglo['nuevo_id'], \"password\" => '', 'user_id' => 0);\n \n foreach($arrUsers AS $usertype=>$users){\n $newpass = substr(md5(uniqid(rand())), 0, 8);\n $this->query = \"INSERT INTO ev_user (company_id, name, usertype, creation_date, uid_creator, username, password) VALUES (\".$arreglo['nuevo_id'].\",'\".$users[\"name\"].\"','\".$usertype.\"','\".date('Y-m-d H:i').\"',\".$_SESSION['session']['user_id'].\",'\".$users[\"name\"].\"','\".md5($newpass).\"')\";\n $this->rs01 = $this->consulta($this->query);\n $arrUsers[$usertype][\"password\"] = $newpass;\n $arrUsers[$usertype][\"user_id\"] = $this->lastID();\n }\n \n $arreglo['users'] = $arrUsers;\n }\n \n\t\t}\n\t\t//$this->Auditoria($arreglo);\n\t\treturn $arreglo;\n\t}", "public function guardar($empresa) {\n if ($this->db->insert(\"empresa\", $empresa)) {\n //id de la empresa\n $empresa_id = $this->db->insert_id();\n $this->configuracion_model->logInterno(\"Se creo la empresa \" . $empresa_id);\n //le creamos un usuario con valor de 10 para que entre al sistema\n //sacamos los datos de la empresa ya insertados para su manejo\n //hacemos el array de la persona de la empresa para su insercion\n $persona = array(\n \"nombre\" => $empresa['nombre'],\n \"apellido\" => \"Principal\",\n \"documento\" => $empresa['nit'],\n \"direccion\" => $empresa['direccion'],\n \"email\" => $empresa['email'],\n \"telefono\" => $empresa['telefono']\n );\n //hacemos el array de la sede con los datos de la empresa\n $sede = array(\n \"nombre\" => $empresa['nombre'],\n \"direccion\" => $empresa['direccion'],\n \"telefono\" => $empresa['telefono'],\n \"email\" => $empresa['email'],\n \"empresa_id\" => $empresa_id\n );\n\n //insertamos a la persona-empresa\n if ($this->db->insert(\"persona\", $persona)) {\n $persona_id = $this->db->insert_id();\n $this->configuracion_model->logInterno(\"Se creo la persona \" . $persona_id);\n } else {\n return FALSE;\n }\n //insertamos a la sede\n if ($this->db->insert(\"sede\", $sede)) {\n $sede_id = $this->db->insert_id();\n $this->configuracion_model->logInterno(\"Se creo una sede \" . $sede_id);\n } else {\n return FALSE;\n }\n\n\n\n\n //sacamos la id de la persona-empresa para agregar el usuario\n //creamos el usuario para la insercion\n $usuario = array(\n \"user\" => $empresa['email'],\n \"pass\" => sha1($empresa['nit']),\n \"persona_id\" => $persona_id,\n \"grado\" => \"3\",\n \"valor\" => \"10\",\n \"empresa_id\" => $empresa_id,\n \"sede_id\" => $sede_id\n );\n\n\n //lo insertamos\n\n if ($this->db->insert(\"usuario\", $usuario)) {\n $this->configuracion_model->logInterno(\"Se crea e usuario \" . $this->db->insert_id());\n //Creamos los archivos de configuracion\n $configuracion = array(\n \"empresa_id\" => $empresa_id\n );\n } else {\n return FALSE;\n }\n //insertamos los datos de la configuracion\n if ($this->db->insert(\"configuracion\", $configuracion)) {\n $this->configuracion_model->logInterno(\"Se crea configuracion \" . $this->db->insert_id());\n\n /* creamos las categorias Default de la empresa en categoria y egresos_categoria */\n $categoria_default = array(\n \"nombre\" => \"Default\",\n \"descripcion\" => \"Default\",\n \"empresa_id\" => $empresa_id\n );\n if ($this->db->insert(\"categoria\", $categoria_default)) {\n $this->configuracion_model->logInterno(\"Se creo la categoria default \" . $usuario['user']);\n if ($this->db->insert(\"categoria_egreso\", $categoria_default)) {\n $this->configuracion_model->logInterno(\"Se creo la categoria_egreso default \" . $usuario['user']);\n }\n }\n\n\n return TRUE;\n } else {\n return FALSE;\n }\n } else {\n return FALSE;\n }\n }", "public function save($data) {\r\n $stmt = $this->mysql->prepare(\"INSERT INTO marca (id, nombre) VALUES (NULL ,?)\");\r\n $stmt->bind_param(\"s\", $data['nombre']);\r\n $result = $stmt->execute();\r\n if($stmt->error) {\r\n printf(\"Error: %s.\\n\", $stmt->error); \r\n } \r\n $stmt->close();\r\n return $result;\r\n \r\n }", "public function inserir_anuncio(){\n if(!isset($_SESSION))session_start();\n\n $cliente = unserialize($_SESSION['cliente']);\n\n $id_veiculo = $_POST['cb_veiculos'];\n $data_inicial = $_POST['data_inicial'];\n $data_final = $_POST['data_final'];\n $hora_inicial = $_POST['hora_inicial'];\n $hora_final = $_POST['hora_final'];\n $descricao = $_POST['descricao'];\n $valor_hora = $_POST['valor_hora'];\n $id_cliente = $cliente->getId();\n\n $anuncio = new Anuncio();\n $anuncio->setDescricao($descricao)\n ->setIdClienteLocador($id_cliente)\n ->setIdVeiculo($id_veiculo)\n ->setHorarioInicio($hora_inicial)\n ->setHorarioTermino($hora_final)\n ->setDataInicial($data_inicial)\n ->setDataFinal($data_final)\n ->setValor($valor_hora);\n\n\n $this->anunciosDAO->insert($anuncio);\n\n }", "function guardar_practicas()\n {\n $profe = filter_input(INPUT_POST, 'profe');\n $fecha = filter_input(INPUT_POST, 'fecha');\n $hora = filter_input(INPUT_POST, 'hora');\n $zona = filter_input(INPUT_POST, 'zona');\n $this->model->update_h($profe,$fecha,$hora);\n\n $alumno=$this->model->get_alumno($_SESSION['iduser']);\n $this->model->set_practica($profe,$fecha,$hora,$alumno[0]['id_alumnos'],$zona);\n }", "static public function ctrCrearTamanio(){\n\n\t\tif(isset($_POST[\"nuevoID\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"nuevoID\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoNombre\"])){\n\n\t\t\t\t$tabla = \"Tamanio\";\n\n\t\t\t\t$datos = array(\"ID\" => $_POST[\"nuevoID\"],\n\t\t\t\t\t \"Nombre\" => $_POST[\"nuevoNombre\"]);\n\n\t\t\t\t$respuesta = ModeloTamanio::mdlIngresarTamanio($tabla, $datos);\n\n\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El tamaño ha sido guardado correctamente\",\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\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"tamanio\";\n\n\t\t\t\t\t\t\t\t\t}\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\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: \"¡Los campos no pueden ir 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 = \"tamanio\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function insertar($objeto){\r\n\t}", "public function insert($contenido);", "function capturarCampo(Detallesmantenimientosdetablas $detalle,$numeroGrid,$ValorPorDefecto=false,$sinValorPorDefecto=''){\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\n return;\n } else if($tipo!='30') {\n Campos::columnaGrid($numeroGrid);\n echo $detalle->getNombreCampo();\n Campos::finColumnaGrid();\n }\n\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 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::fecha($id,$valorPorDefecto,$resFecha);\n }else if($tipo==2){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n C::fechaHora($id,$valorPorDefecto,$resFecha);\n }else if($tipo==3){\n C::hora($id, $valorPorDefecto);\n }else if($tipo==5){\n C::entero($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==6){\n C::flotante($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==7){\n C::texto($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==8){\n $filas=$detalle->getAltoCampo();\n C::textArea($id,$valorPorDefecto,$filas,$size,$javascript);\n }else if($tipo==9){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id, $rsT, $valorPorDefecto);\n }else if($tipo==10){\n $chequeado=false;\n if($valorPorDefecto==1){\n $chequeado=true;\n }\n C::chequeSiNo($id,'',$chequeado);\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, $rsT, $valorPorDefecto);\n }else if($tipo==20){\n C::editorHTMLPopUp($id, \"<p></p>\", $detalle->getNombreCampo());\n }else if($tipo==21){\n C::persona($id, $valorPorDefecto);\n }else if($tipo==25){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSetConBusqueda($id, $rsT, $valorPorDefecto);\n }else if($tipo==14){\n //Separador de campos\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 _guardar($id) {\r\n $this->_vista->errorForm = array();\r\n $val = new Validador($_POST);\r\n\r\n /* logica */\r\n // V A L I D A C I O N E S D E L F O R M U L A R I O\r\n // por php si javaScript no tuvo exito\r\n\r\n /*\r\n * Id:\r\n * Debe ser igual por Get y Post\r\n */\r\n if ($id != $this->getEntero('Id')) {\r\n $this->redireccionar('error/tipo/Registro_NoID');\r\n }\r\n $id = $this->getEntero('Id');\r\n\r\n /*\r\n * Select_Asignatura:\r\n * Requerido\r\n * Numerico\r\n */\r\n $campo = 'Select_Asignatura';\r\n $val->requerido($campo);\r\n $val->numerico($campo);\r\n $select_Asignatura = $val->getValor($campo);\r\n\r\n /*\r\n * Select_Carrera:\r\n * Requerido\r\n * Numerico\r\n */\r\n $campo = 'Select_Carrera';\r\n $val->requerido($campo);\r\n $val->numerico($campo);\r\n $select_Carrera = $val->getValor($campo);\r\n\r\n /*\r\n * Select_Grupo:\r\n * Requerido\r\n * Numerico\r\n */\r\n $campo = 'Select_Grupo';\r\n $val->requerido($campo);\r\n $val->numerico($campo);\r\n $select_Grupo = $val->getValor($campo);\r\n\r\n /*\r\n * Select_Ciclo:\r\n * Requerido\r\n * Numerico\r\n */\r\n $campo = 'Select_Ciclo';\r\n $val->requerido($campo);\r\n $val->numerico($campo);\r\n $select_Ciclo = $val->getValor($campo);\r\n\r\n /*\r\n * Descripcion\r\n * Letras y Numeros\r\n */\r\n $campo = 'Descripcion';\r\n $val->alfanumerico($campo);\r\n $descripcion = $val->getValor($campo);\r\n\r\n /*\r\n * Select_Espacio:\r\n * Requerido\r\n * Numerico\r\n */\r\n $campo = 'Select_Espacio';\r\n $val->requerido($campo);\r\n $val->numerico($campo);\r\n $select_Espacio = $val->getValor($campo);\r\n\r\n //errores\r\n $this->_vista->errorForm = $val->getErrorLista();\r\n\r\n if (count($this->_vista->errorForm)) {\r\n // se encontraron errores\r\n /* script o css a utilizar por la vista */\r\n $this->_vista->setJs('bootstrapValidator.min');\r\n $this->_vista->setCss('bootstrapValidator.min');\r\n $this->_vista->setJs('validarForm', 'curso');\r\n\r\n $this->_vista->curso = new Curso();\r\n\r\n $this->_vista->curso->setId($id);\r\n $this->_vista->curso->getAsignatura()->setId($select_Asignatura);\r\n $this->_vista->curso->getCarrera()->setId($select_Carrera);\r\n $this->_vista->curso->getGrupo()->setId($select_Grupo);\r\n $this->_vista->curso->getCiclo()->setId($select_Ciclo);\r\n $this->_vista->curso->setDescripcion($descripcion);\r\n $this->_vista->curso->getEspacio()->setId($select_Espacio);\r\n\r\n // listas\r\n $this->_vista->listaAsignaturas = $this->_vista->curso->getAsignatura()->lista();\r\n $this->_vista->listaCarreras = $this->_vista->curso->getCarrera()->lista();\r\n $this->_vista->listaGrupos = $this->_vista->curso->getGrupo()->lista();\r\n $this->_vista->listaCiclos = $this->_vista->curso->getCiclo()->lista();\r\n $this->_vista->listaEspacios = $this->_vista->curso->getEspacio()->lista();\r\n\r\n\r\n //redirigir a la vista\r\n $id ?\r\n $this->_vista->render('curso/editar') :\r\n $this->_vista->render('curso/nuevo');\r\n } else {\r\n // no se encontraron errores\r\n $curso = new Curso();\r\n\r\n $curso->getAsignatura()->setId($select_Asignatura);\r\n $curso->getCarrera()->setId($select_Carrera);\r\n $curso->getGrupo()->setId($select_Grupo);\r\n $curso->getCiclo()->setId($select_Ciclo);\r\n $curso->setDescripcion($descripcion);\r\n $curso->getEspacio()->setId($select_Espacio);\r\n\r\n if ($id == 0) {\r\n //insertar\r\n // comprobar que campo Uda, grupo, ciclo no repetido en curso\r\n if ($curso->existe($select_Asignatura, $select_Carrera, $select_Grupo, $select_Ciclo, $select_Espacio)) {\r\n $this->redireccionar('error/tipo/Registro_SiExiste');\r\n }\r\n $curso->insertar();\r\n } else {\r\n //actualizar\r\n /*\r\n * Validar Repetido:\r\n * No Repetido\r\n */\r\n $existe = $curso->existe($select_Asignatura, $select_Carrera, $select_Grupo, $select_Ciclo, $select_Espacio);\r\n if ($existe != $id && $existe != 0) {\r\n $this->redireccionar('error/tipo/Registro_SiExiste');\r\n }\r\n\r\n $curso->setId($id);\r\n $curso->actualizar();\r\n }\r\n\r\n $this->redireccionar(\"curso/index/{$curso->getEspacio()->getId()}\");\r\n }\r\n }", "public function inserir()\n {\n }", "public function insertarHistoria(){\n\t\t$motivo = $_POST[\"motivo\"];\n\t\t$lugar = $_POST[\"lugar\"];\n\t\t$dosis = \"---\";\n\t\t$id_enf = $_SESSION[\"id_enf\"];\n\t\t$id_pac = $_POST[\"id_pac\"];\n\t\t$id_ser = $_POST[\"servicio\"];\n\t\t$sql = \"INSERT INTO historia VALUES (null, '\".$motivo.\"', CURRENT_DATE(), '\".$lugar.\"', '\".$dosis.\"', '\".$id_enf.\"','\".$id_pac.\"','\".$id_ser.\"')\";\n\t\t$this->db->query($sql);\n\t}", "public function guardar_lectura(){\n\t\t\n\t\t$userdata = $this->session->userdata('user_data');\n $empId = $userdata[0]['id_empresa'];\n\n\t\t$id_equipo = $_POST['id_equipo'];\n\t\t$id_parametro = $_POST['id_parametro'];\n\t\t$fecha = $_POST['fecha'];\n\t\t$valor = $_POST['valor'];\n\n\t\t$insert = array(\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t'paramId' => $id_parametro,\n\t\t\t\t\t\t\t\t\t'id_equipo' =>$id_equipo ,\n\t\t\t\t\t\t\t\t\t'valor' => $valor,\n\t\t\t\t\t\t\t\t\t'fechahora'=> $fecha,\n\t\t\t\t\t\t\t\t\t'id_empresa' => $empId\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t);\n\t\t$result = $this->Lecturas->guardar_lectura($insert);\n\t\techo json_encode($result); \n\t}", "public function agregar_empresa_controlador(){\n\t\t$codigo=mainModel::limpiar_cadena($_POST[\"cc-reg\"]);\n\t\t$nombre=mainModel::limpiar_cadena($_POST[\"nombre-reg\"]);\n\t\t$telefono=mainModel::limpiar_cadena($_POST[\"telefono-reg\"]);\n\t\t$email=mainModel::limpiar_cadena($_POST[\"email-reg\"]);\n\t\t$direccion=mainModel::limpiar_cadena($_POST[\"direccion-reg\"]);\n\t\t$director=mainModel::limpiar_cadena($_POST[\"director-reg\"]);\n\t\t$telefono2=mainModel::limpiar_cadena($_POST[\"telefono2-reg\"]);\n\t\t$year=mainModel::limpiar_cadena($_POST[\"year-reg\"]);\n\t\t\n\t\t\n\t\t$consulta1=mainModel::ejecutar_consulta_simple(\"SELECT EmpresaCodigo FROM empresa WHERE EmpresaCodigo='$codigo'\");\n\t\t\t\t\n\t\t\tif ($consulta1->rowCount()<=0){\n\n\t\t\t\t$consulta2=mainModel::ejecutar_consulta_simple(\"SELECT EmpresaNombre FROM empresa WHERE EmpresaNombre='$nombre'\");\t\n\n\t\t\t\tif($consulta2->rowCount()<=0){\n\t\t\t\t\t$datosEmpresa=[\n\t\t\t\t\t\t\"Codigo\"=>$codigo,\n\t\t\t\t\t\t\"Nombre\"=>$nombre,\n\t\t\t\t\t\t\"Telefono\"=>$telefono,\n\t\t\t\t\t\t\"Email\"=>$email,\n\t\t\t\t\t\t\"Direccion\"=>$direccion,\n\t\t\t\t\t\t\"Director\"=>$director,\n\t\t\t\t\t\t\"Telefono2\"=>$telefono2,\n\t\t\t\t\t\t\"Year\"=>$year\n\t\t\t\t\t\t];\n\t\t\t\t\t$guardarEmpresa=empresaModelo::agregar_empresa_modelo($datosEmpresa);\n\t\t\t\t\tif($guardarEmpresa->rowCount()>=1){\n\t\t\t\t\t\t$alerta=[\n\t\t\t\t\t\t\t\"Alertas\"=>\"recargar\",\n\t\t\t\t\t\t\t\"Titulo\"=>\"Registro exitoso\",\n\t\t\t\t\t\t\t\"Texto\"=>\"Se ha registrado la empresa en el sistema\",\n\t\t\t\t\t\t\t\"Tipo\"=>\"success\"\n\t\t\t\t\t\t\t];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$alerta=[\n\t\t\t\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\t\t\"Texto\"=>\"No se ha podido registrar la Empresa en el sistema\",\n\t\t\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\"Texto\"=>\"El nombre de la empresa que acaba de ingresar ya se encuentra resgitrada en el sistema\",\n\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alertas\"=>\"simple\",\n\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\"Texto\"=>\"El NIT que acaba de ingresar ya se encuentra resgitrada en el sistema\",\n\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t\t];\n\t\t\t}\n\t\t\treturn mainModel::sweet_alert($alerta);\n\t}", "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 mostrarDatos(){\r\n\t\t$html = null;\t\t\r\n\r\n\t\t$month = date('m');\r\n \t$year = date('Y');\r\n \t$day = date(\"d\");\r\n\r\n\t\t$data['fechaEmision'] = date('Y-m-d');\r\n\r\n\t\t$fecemi = $data['fechaEmision'];\r\n\r\n\t\t$canales=$_POST['canales'];\r\n\t\t$datos['canales'] = $canales;\r\n\r\n\t\t$inicio = $_POST['fechainicio'];\r\n\t\t$fin = $_POST['fechafin'];\r\n\r\n\t\t$data['documento'] = $_POST['documento'];\r\n\t\t$serie = $data['documento'];\r\n\r\n\t\t$idserie=$_POST['documento'];\r\n\r\n\t\tif (substr($serie, 0, 1) == 'B') {\r\n\r\n\t\t\t//html de tabla dinámica que se va a generar\r\n\t\t\t$html .= \"<hr>\";\r\n\t\t\t$boletaSuma = $this->comprobante_pago_mdl->getDatosSumaBoleta($inicio, $fin, $canales, $serie);\r\n\t\t\tforeach ($boletaSuma as $bs):\r\n\t\t\t\t$suma=$bs->suma;\r\n\t\t\t\t$sumaDos=number_format((float)$suma, 2, '.', ',');\r\n\t\t\t\t$html .=\"<H1><span class='label label-succes label-white middle'><b>Total de cobros Boletas: S/. \".$sumaDos.\"</b></span></H1>\";\r\n\t\t\tendforeach;\r\n\t\t\t$html .= \"<div align='center' class='col-xs-12'>\";\r\n\t\t\t\t$html .= \"<table align='center' id='tablaDatos' class='table table-striped table-bordered table-hover' style='width:100%'>\";\r\n\t\t\t\t\t$html .= \"<thead>\";\r\n\t\t\t\t\t\t$html .=\"<tr>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Fecha de Cobro</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>N° de certificado</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Nombres y Apellidos</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>DNI</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Plan</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Importe (S/.)</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Estado</th>\";\r\n\t\t\t\t\t\t$html .=\"</tr>\";\r\n\t\t\t\t\t$html .= \"</thead>\";\r\n\t\t\t\t\t$html .= \"<tbody>\";\r\n\r\n\t\t\t\t\t\t$boleta = $this->comprobante_pago_mdl->getDatosBoleta($inicio, $fin, $canales, $serie);\r\n\t\t\t\t\t\tforeach ((array) $boleta as $b):\r\n\r\n\t\t\t\t\t\t\t$importe = $b->cob_importe;\r\n\t\t\t\t\t\t\t$importe = $importe/100;\r\n\t\t\t\t\t\t\t$importe2=number_format((float)$importe, 2, '.', ',');\r\n\t\t\t\t\t\t\t$newDate = date(\"d/m/Y\", strtotime($b->cob_fechCob));\r\n\r\n\t\t\t\t\t\t\t$html .= \"<tr>\";\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$newDate.\"<input type='text' class='hidden' id='fechaEmi' name='fechaEmi[]' value='\".$b->cob_fechCob.\"'></td>\";\r\n\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$b->cert_num.\"<input type='text' class='hidden' id='numSerie' name='numSerie[]' value='\".$b->numero_serie.\"'></td>\";\r\n\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$b->contratante.\"<input type='text' class='hidden' id='contratante' name='contratante[]' value='\".$b->cont_id.\"'></td>\";\r\n\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$b->cont_numDoc.\"<input type='text' class='hidden' id='cobro' name='cobro[]' value='\".$b->cob_id.\"'></td>\";\r\n\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$b->nombre_plan.\"<input type='text' class='hidden' id='idplan' name='idplan[]' value='\".$b->idplan.\"'></td>\";\r\n\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='center'>S/. \".$importe2.\"<input type='text' class='hidden' id='importeTotal' name='importeTotal[]' value='\".$importe2.\"'></td>\";\r\n\r\n\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$b->descripcion.\"</td>\";\r\n\t\t\t\t\t\t\t$html .= \"</tr>\";\r\n\r\n\t\t\t\t\t\tendforeach;\r\n\t\t\t\t\t$html .= \"</tbody>\";\r\n\t\t\t\t$html .= \"</table>\";\r\n\t\t\t$html .= \"</div>\";\r\n\r\n\t\t} elseif (substr($serie, 0, 1) == 'F') {\r\n\r\n\t\t\t$html .= \"<hr>\";\r\n\r\n\t\t\t$facturaSuma = $this->comprobante_pago_mdl->getDatosSumaFacturas($inicio, $fin, $canales, $serie);\r\n\t\t\tforeach ($facturaSuma as $fs):\r\n\t\t\t\t$suma=$fs->suma;\r\n\t\t\t\t$sumaDos=number_format((float)$suma, 2, '.', ',');\r\n\t\t\t\t$html .=\"<H1><span class='label label-succes label-white middle'><b>Total de cobros Facturas: S/. \".$sumaDos.\"</b></span></H1>\";\r\n\t\t\tendforeach;\r\n\r\n\t\t\t$html .= \"<div align='center' class='col-xs-12'>\";\r\n\t\t\t\t$html .= \"<table align='center' id='tablaDatos' class='table table-striped table-bordered table-hover'>\";\r\n\t\t\t\t\t$html .= \"<thead>\";\r\n\t\t\t\t\t\t$html .=\"<tr>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Fecha de emisión</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Razon Social</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Nombre Comercial</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>RUC</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Plan</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Importe (S/.)</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Cantidad</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Estado</th>\";\r\n\t\t\t\t\t\t\t$html .=\"<th>Seleccione</th>\";\r\n\t\t\t\t\t\t$html .=\"</tr>\";\r\n\t\t\t\t\t$html .= \"</thead>\";\r\n\t\t\t\t\t$html .= \"<tbody>\";\r\n\r\n\t\t\t\t\t\t$factura = $this->comprobante_pago_mdl->getDatosFacturas($inicio, $fin, $canales, $serie);\r\n\r\n\t\t\t\t\t\t$tot=0; \r\n\t\t\t\t\t\t$totcant=0;\r\n\r\n\t\t\t\t\t\tforeach ((array)$factura as $f):\r\n\r\n\t\t\t\t\t\t\t$importeDos = $f->cob_importe;\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$cant=$f->cant;\r\n\t\t\t\t\t\t\t$totcant=$totcant+$cant;\r\n\t\t\t\t\t\t\t$sub=$cant*$importeDos;\r\n\t\t\t\t\t\t\t$tot=$tot+$sub;\r\n\t\t\t\t\t\t\t$cant2=number_format((float)$cant, 0, '', ',');\r\n\t\t\t\t\t\t\t$importe2=number_format((float)$importeDos, 2, '.', '');\r\n\t\t\t\t\t\t\t$sub2=number_format((float)$sub, 2, '.', ''); \r\n\r\n\t\t\t\t\t\t\tif ($cant2 > 0) {\r\n\t\t\t\t\t\t\t\t$html .= \"<tr>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='left'><input class='form-control input-mask-date' type='date' id='fechaEmi' name='fechaEmi[]' required='Seleccione una fecha de inicio' value=\".$fecemi.\"></td>\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$f->razon_social_cli.\"<input type='text' class='hidden' id='numSerie' name='numSerie[]' value='\".$f->numero_serie.\"'></td>\";\r\n\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$f->nombre_comercial_cli.\"<input type='text' class='hidden' id='empresa' name='empresa[]' value='\".$f->idclienteempresa.\"'></td>\";\r\n\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$f->numero_documento_cli.\"</td>\";\r\n\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='left'>\".$f->nombre_plan.\"<input type='text' class='hidden' id='idplan' name='idplan[]' value='\".$f->plan_id.\"'></td>\";\r\n\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='center'>S/. \".$importe2.\"<input type='text' class='hidden' id='importeTotal' name='importeTotal[]' value='\".$importe2.\"'></td>\";\r\n\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='center'>\".$cant2.\"</td>\";\r\n\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='left'>Pendiente</td>\";\r\n\r\n\t\t\t\t\t\t\t\t\t$html .= \"<td align='center'>\";\r\n\t\t\t\t\t\t\t\t\t\t//$html .= \"<div class='form-check'>\";\r\n\t\t\t\t\t\t\t\t\t\t $html .= \"<input class='form-check-input' type='checkbox' name='checkPlan[]' value='\".$f->plan_id.\"' id='\".$f->plan_id.\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t//$html .= \"</div>\";\r\n\t\t\t\t\t\t\t\t\t$html .= \"</td>\";\r\n\r\n\t\t\t\t\t\t\t\t$html .= \"</tr>\";\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tendforeach;\r\n\t\t\t\t\t$html .= \"</tbody>\";\r\n\t\t\t\t$html .= \"</table>\";\r\n\t\t\t$html .= \"</div>\";\r\n\t\t}\r\n\t\techo json_encode($html);\r\n\t}", "function guardar_producto($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// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t$tipo = ($datos['tipo']==1) ? 1 : 4 ;\n\n\n\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_productos\n\t\t\t\t\t\t(codigo, nombre, precio, linea, costo_servicio, id_unidad_venta, id_unidad_compra,\n\t\t\t\t\t\t\ttipo_producto\n\t\t\t\t\t\t)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$datos['codigo'].\"','\".$datos['nombre'].\"',\".$datos['precio_venta'].\",\n\t\t\t\t\t\t1, \".$datos['costo'].\", \".$datos['unidad_venta'].\", \".$datos['unidad_compra'].\", \".$tipo.\"\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t// Guarda los campos de foodware\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_campos_foodware\n\t\t\t\t\t\t(id_producto, ganancia)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$result.\"', '\".$datos['margen_ganancia'].\"')\";\n\t\t// return $sql;\n\t\t$result_foodware =$this->query($sql);\n\n\t\treturn $result;\n\t}", "function enviar_presupuesto(){\n $this->asignar_ingreso3();\n $nombre_sede = $this->sede;\n $resultado = $this->datoSede($nombre_sede);\n $cuerpo =\"<img src='http://prevaler.diazcreativos.net.ve/imagenes/logo_admin.png' /><br /><br />\n\t\t<u>Datos de Entrada:</u><br />\";\n $cuerpo .=\"<br />\";\n $cuerpo .= \"<strong>Nombre: </strong>\".utf8_decode($this->nombre1).\"<br />\" ;\n $cuerpo .= \"<strong>Apellido: </strong>\".$this->apellido1.\"<br />\" ;\n $cuerpo .= \"<strong>RIF/Cédula: </strong>\".$this->cedula1.\"<br />\" ;\n $cuerpo .= \"<strong>Fecha de Nacimiento: </strong>\".$this->fecha1.\"<br />\";\n $cuerpo .= \"<strong>E-mail: </strong>\".$this->email.\"<br />\" ;\n $cuerpo .= \"<strong>Teléfono: </strong>\".$this->telefono.\"<br />\" ;\n $cuerpo .= \"<strong>Domicilio: </strong>\".$this->direccion1.\"<br />\" ;\n $cuerpo .= \"<strong>Empresa: </strong>\".$this->empresa.\"<br />\";\n $cuerpo .= \"<strong>Especialidad Médica: </strong>\".$this->especialidad.\"<br />\";\n $cuerpo .= \"<strong>Médico Elegido: </strong>\".$this->medico.\"<br />\";\n $cuerpo .= \"<strong>Diagnóstico: </strong>\".$this->diagnostico.\"<br />\";\n $cuerpo .= \"<strong>Procedimiento: </strong>\".$this->procedimiento.\"<br /><br />\";\n if ($this->seguro != null) {\n $cuerpo .= \"<strong>Presupuesto Con Póliza de Seguro </strong><br /><br />\";\n $cuerpo .= \"<strong>Titular de la Póliza: </strong>\".utf8_decode($this->nombre_pol).\"<br />\" ;\n $cuerpo .= \"<strong>Cédula del Titular de la Póliza: </strong>\".$this->cedula_pol.\"<br />\" ;\n $cuerpo .= \"<strong>Empresa Aseguradora: </strong>\".$this->seguro.\"<br />\" ;\n }else{\n $cuerpo .= \"<strong>Presupuesto Sin Póliza de Seguro </strong><br /><br />\";\n $cuerpo .= \"<strong>Datos de Facturación </strong><br /><br />\";\n $cuerpo .= \"<strong>Nombre: </strong>\".utf8_decode($this->nombre2).\"<br />\" ;\n $cuerpo .= \"<strong>Apellido: </strong>\".$this->apellido2.\"<br />\" ;\n $cuerpo .= \"<strong>RIF/Cédula: </strong>\".$this->cedula2.\"<br />\" ;\n $cuerpo .= \"<strong>Fecha de Nacimiento: </strong>\".$this->fecha2.\"<br />\";\n $cuerpo .= \"<strong>Dirección: </strong>\".$this->direccion2.\"<br />\" ;\n }\n\n $cuerpo .= \"<br />\";\n $cuerpo .= \"---- Fin ----\";\n $cuerpo .= \"<br />\";\n $subject= \"Solicitud de Presupuesto Web Prevaler\";\n $subject2= \"Solicitud de Presupuesto Web Prevaler\";\n\n switch ($resultado['id_sede']) {\n case '1':\n $correo_envio=\"[email protected]\";\n break;\n case '2':\n $correo_envio=\"[email protected]\";\n break;\n case '3':\n $correo_envio=\"[email protected]\";\n break;\n case '4':\n $correo_envio=\"[email protected]\";\n break;\n case '8':\n $correo_envio=\"[email protected]\";\n break;\n\n default:\n $correo_envio=\"[email protected]\";\n break;\n }\n\n $basemailfor=$resultado['email_sede'];\n //$basemailfor=$correo_envio;\n $basemailfrom = $this->email;\n $respuesta =\"<img src='http://prevaler.diazcreativos.net.ve/imagenes/logo_admin.png' /><br />\n\t\t<strong>Saludos Sr(a).: $this->nombre1 $this->apellido1</strong><br /><br />\n\t\tNosotros hemos recibido su Solicitud de Presupuesto, nuestro departamento de atención al cliente le responderá lo más pronto posible<br />\n\t\tGracias por contactar a Prevaler.<br />\n\t\tPrevaler<br /><br />\n\t\tTel&eacute;fonos: <br/>\n\t\t\".$resultado['telefono_sede'].\"<br />\n\t\tTwitter: <a href='https://twitter.com/Prevaler_VE'>@Prevaler_VE</a><br />\n\t\tInstagram: <a href='https://www.instagram.com/prevaler_ve/'>@prevaler_ve</a><br />\n\t\t\".$resultado['email_sede'].\"\n\t\t<br /><br />\n\t\tAtentamente,<br />\n\t\tClínica Prevaler.\";\n $this->mensaje=\"<strong>&iexcl;Excelente!</strong> Su Solicitud de Presupuesto ha sido enviado exitosamente.\";\n\n $mail = new PHPMailer();\n $mail->From = $basemailfrom;\n $mail->FromName = utf8_decode($subject);\n $mail->AddAddress($basemailfor, $this->nombre.\" \".$this->apellido);\n $mail->Subject = utf8_decode($subject);\n $mail->Body = $cuerpo;\n $mail->AltBody = $cuerpo;\n $mail->isHTML(true);\n $exito = $mail->Send();\n\n $mail2 = new PHPMailer();\n $mail2->From = $basemailfor;\n $mail2->FromName = utf8_decode($subject2);\n $mail2->AddAddress($basemailfrom, $this->nombre.\" \".$this->apellido);\n $mail2->Subject = utf8_decode($subject2);\n $mail2->Body = $respuesta;\n $mail2->AltBody = $respuesta;\n $mail2->isHTML(true);\n $exito = $mail2->Send();\n }", "function insert_new_klient() {\n $nazev = isset($_POST['nazev']) ? htmlspecialchars($_POST['nazev']) : \"\";\n $kontakt = isset($_POST['kontakt']) ? htmlspecialchars($_POST['kontakt']) : \"\";\n $email = isset($_POST['email']) ? htmlspecialchars($_POST['email']) : \"\";\n $telefon = isset($_POST['telefon']) ? htmlspecialchars($_POST['telefon']) : \"\";\n $states = isset($_POST['states']) ? $_POST['states'] : \"0\";\n $poznamka = isset($_POST['poznamka']) ? htmlspecialchars($_POST['poznamka']) : \"\";\n\n include_once(\"app/class/DBClass.php\");\n $myModel = new DBClass;\n $data .= $myModel->insertNewCustomer($nazev, $kontakt, $email, $telefon, $states, $poznamka);\n\n header('Location: index.php?action=klienti');\n}", "public function guardarUsuario()\n {\n \n //ACCESO A DATOS\n $usu = new Usuario('usuarios');\n if (isset($this->request['usuario']))\n {\n $usu->load(\"id=\".$_SESSION['id']);\n }\n\n $usu->usuario=$this->request['usuario'];\n $usu->password=$this->request['nuevapassword'];\n $usu->fechamodificacion=date('Y-m-d');\n \n \n if($usu->save()){\n $this->cerrarSesion ();\n header('Location: /appnutri/index.php');\n }else echo'<script> \n alert(\"Error. No se pudo cerrar la conexion\") \n window.location=\"/appnutri/index.php\";\n </script>';\n \n }", "function salvarCadastro() {\n $this->layout = '_layout.perfilUsuario';\n $usuario = new Usuario();\n // $usuario->codgusario = $this->getParametro(0);\n $api = new ApiUsuario();\n $sec = new Validador();\n \n if(isset($_FILES[\"foto\"][\"name\"])){\n $arquivo =$_FILES[\"foto\"][\"name\"];\n $path_dir = \"fotos/\". $arquivo;\n $vs= move_uploaded_file($_FILES[\"foto\"][\"tmp_name\"], $path_dir);\n }\n /**\n * recebe\n */\n \n $senha = $sec->criptografarUrl($_POST['senha']);\n \n \n $usuario->setNome($_POST['nome']);\n $usuario->setApelido($_POST['apelido']);\n $usuario->setNumeroEstudante(addslashes($_POST['numeroEstudante']));\n $usuario->setTelefone($_POST['telefone']);\n $usuario->setEmail($_POST['email']);\n $usuario->setNivel($_POST['nivel']);\n $usuario->setSenha($senha);\n $usuario->setFoto(isset($arquivo)?$arquivo:'');\n \n /**\n * condiçao pra actualizar ou inserir \n */\n if(isset($_POST['codgusario']) && !empty($_POST['codgusario'])):\n \n \n $query = $api->salavarInsert(new Usuario('POST'));\n \n else:\n $query = $api->salavarInsert($usuario);\n \n endif;\n \n $this->dados = array('salvar' => $query);\n $this->view();\n }", "function generar_form_entrega($pagina_llamado,$id_mov,$es_pedido_material,$mostrar_botones_entregar=1)\r\n{\r\n\tglobal $estado,$deposito_origen,$deposito_destino,$id_licitacion,$nrocaso,$permiso,$hay_entregas_hechas;\r\n global $pm_rma_producto_sl;\r\n \r\n \r\n\t $flag=0;\r\n\t $items=get_items_mov($id_mov);\r\n\t?>\r\n\t <script>\r\n\t function des_entregar_func(id_detalle_movimiento)\r\n\t {\r\n\t \t if(confirm('¿Está seguro que desea Des-Entregar esta fila?'))\r\n\t \t {\r\n\t \t \tdocument.all.des_entregar_fila.value=id_detalle_movimiento;\r\n\t \t \treturn true;\r\n\t \t }\r\n\t \t else\r\n\t \t return false;\r\n\t }//de function des_entregar_func(id_detalle_movimiento)\r\n\r\n\t function ajustar_cantidad_fila(id_fila_ajustar,cant_pedida,cant_entregada)\r\n\t {\r\n\r\n\t \tif(confirm('La cantidad de esta fila será reducida de '+cant_pedida+' a '+cant_entregada+' prodcutos, y los descontados quedarán disponibles en Stock.\\n¿Está seguro que desea continuar?'))\r\n\t \t{\r\n\t \t\tdocument.all.fila_ajustar_cantidad.value=id_fila_ajustar;\r\n\t \t\treturn true\r\n\t \t}\r\n\t \telse\r\n\t \t return false;\r\n\r\n\t }//de ajustar_cantidad_fila(id_fila_ajustar,cant_pedida,cant_entregada)\r\n\r\n\t </script>\r\n\t <input type=\"hidden\" name=\"des_entregar_fila\" value=\"\">\r\n\r\n\t <table align=\"center\" width=\"100%\" bordercolor=\"Black\" border=\"1\">\r\n\t\t\t <tr>\r\n\t\t\t <td colspan=\"3\" align=\"center\">\r\n\t\t\t <font size=\"3\"><b>Entrega de Productos</b></font>\r\n\t\t\t <input type=\"hidden\" name=\"fila_ajustar_cantidad\" value=\"\">\r\n\t\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t <?\r\n\t\t\t $hay_sin_entregar=0;\r\n\t\t\t for($x=0;$x<$items['cantidad'];$x++)\r\n\t\t\t {\r\n\t\t\t //traemos el log de los recibidos + la cantidad de productos recibidos\r\n\t\t\t //y las observaciones\r\n\t\t\t $query=\"select cantidad,observaciones,log_recibidos_mov.* from recibidos_mov join log_recibidos_mov using(id_recibidos_mov)\r\n\t\t\t where id_detalle_movimiento=\".$items[$x]['id_detalle_movimiento'].\" and recibidos_mov.ent_rec=0\";\r\n\t\t\t $datos_entregados_mov=sql($query) or fin_pagina();\r\n if ($datos_entregados_mov->fields['cantidad'] && !$flag)\r\n $flag=1;\r\n\r\n\t //las siguientes variables se usan para el control de los totales recibidos\r\n\t //un poco mas abajo en el codigo\r\n\t $entregados=($datos_entregados_mov->fields['cantidad'])?$datos_entregados_mov->fields['cantidad']:0;\r\n\t $enviados=$items[$x]['cantidad'];\r\n\t $producto=$items[$x]['descripcion'];\r\n\t $id_detalle_movimiento=$items[$x]['id_detalle_movimiento'];\r\n\t $id_prod_esp=$items[$x]['id_prod_esp'];\r\n\t $total_pedido=$items[$x]['cantidad'];\r\n\r\n\t if($entregados==0)\r\n\t $hay_sin_entregar=1;\r\n\t\t\t else\r\n\t\t\t $hay_entregas_hechas=1;\r\n\r\n\t $todo_recib=\"\";\r\n\t if($items[$x]['cantidad']<=$datos_entregados_mov->fields['cantidad'])\r\n\t $todo_recib=\"readonly\";\r\n\r\n ?>\r\n\t\t\t <tr>\r\n\t\t\t <td>\r\n\t\t\t\t <table width=\"100%\" align=\"center\">\r\n\t\t <tr id=mx>\r\n\t\t <td>\r\n\t\t <table width=\"100%\">\r\n\t\t <tr id=mx>\r\n\t\t <td>\r\n\t\t\t <?\r\n\t\t\t if($pagina_llamado==\"packaging\")\r\n\t\t\t\t {\r\n\t\t\t\t \t if($entregados<$total_pedido)\r\n\t\t\t\t \t {?>\r\n\t\t\t\t \t <input type=\"checkbox\" name=\"entregar_<?=$id_detalle_movimiento?>\" value=\"1\" class=\"estilos_check\" id=\"check_entregar_<?=$x?>\">\r\n\t\t\t\t\t\t <?\r\n\t\t\t\t \t }\r\n\t\t\t }//de if($pagina_llamado==\"packaging\")\r\n\t\t\t else //$pagina_llamado==\"entregar_sin_cb\"\r\n\t\t\t {\r\n\t\t\t \t if($es_pedido_material && $entregados==0 && permisos_check(\"inicio\",\"permiso_eliminar_fila_pm_autorizada\"))\r\n\t\t\t\t\t\t {?>\r\n\t\t\t\t\t\t <input type=\"checkbox\" name=\"eliminar_<?=$id_detalle_movimiento?>\" value=\"1\" class=\"estilos_check\">\r\n\t\t\t\t\t\t <?\r\n\t\t\t\t\t\t }\r\n\t\t\t }//del else de if($pagina_llamado==\"packaging\")\r\n\t\t\t\t\t ?>\r\n\t\t\t Producto: <?=$producto?>\r\n\t\t\t </td>\r\n\t\t\t <td width=\"1%\" align=\"right\">\r\n\t\t\t <?\r\n\t\t\t if($pagina_llamado==\"entregar_sin_cb\" && $es_pedido_material && permisos_check(\"inicio\",\"permiso_ajustar_cantidad_PM\") && $entregados>0 && ($entregados<$total_pedido))\r\n\t\t \t {?>\r\n\t\t \t \t<input type=\"submit\" name=\"ajustar_cantidad_PM\" value=\"A\" title=\"Ajustar Cantidad de la Fila\" class=\"little_boton\" onclick=\"return ajustar_cantidad_fila(<?=$id_detalle_movimiento?>,<?=$total_pedido?>,<?=$entregados?>)\">\r\n\t\t \t <?\r\n\t\t \t }//de if($es_pedido_material && permisos_check(\"inicio\",\"permiso_ajustar_cantidad_PM\"))\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t </td>\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t </table>\r\n\t\t </td>\r\n\t\t <td width=\"10%\" nowrap>U$S <?=(($items[$x]['precio'])!=\"\")?number_format($items[$x]['precio'],2,'.',''):\"\";?></td>\r\n\t\t <td width=\"13%\" nowrap>\r\n\t\t Total Pedidos <?=$total_pedido?>\r\n\t\t </td>\r\n\t\t <td width=\"13%\" nowrap>\r\n\t\t Entregados <?=$entregados?>\r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t </table>\r\n\t\t <script>\r\n\t\t\t\t\t//ventana de codigos de barra entrega\r\n\t\t\t\t\tvar vent_cb_<?=$id_detalle_movimiento?>=new Object();\r\n\t\t\t\t\tvent_cb_<?=$id_detalle_movimiento?>.closed=true;\r\n\r\n\t\t\t\t\t//ventana de entrega sin codigos de barra\r\n\t\t\t\t\tvar vent_sin_cb_<?=$id_detalle_movimiento?>=new Object();\r\n\t\t\t\t\tvent_sin_cb_<?=$id_detalle_movimiento?>.closed=true;\r\n\t\t\t\t</script>\r\n\t\t <table width=\"100%\" align=\"center\">\r\n\t\t\t\t <tr>\r\n\t\t\t\t <td colspan=\"2\">\r\n\t\t\t\t \t<table align=\"center\" width=\"100%\" border=\"1\" bordercolor=#E0E0E0 bgcolor=\"#ACACAC\">\r\n\t\t\t\t \t <?\r\n\t\t\t\t \t $observaciones_recib=$datos_entregados_mov->fields['observaciones'];\r\n\t\t\t\t \t //generamos el log de recibidos para cada producto\r\n\t\t\t\t \t while(!$datos_entregados_mov->EOF)\r\n\t\t\t\t \t {?>\r\n\t\t\t\t \t <tr>\r\n\t\t\t\t \t <td>\r\n\t\t\t\t \t <font color=\"Black\">\r\n\t\t\t\t \t <b>\r\n\t\t\t\t\t \t Cantidad Entregada: <?=$datos_entregados_mov->fields['cantidad_recibida']?>\r\n\t\t\t\t\t \t <?\r\n\t\t\t\t\t \t if($datos_entregados_mov->fields['cantidad_recibida']<0 && abs($datos_entregados_mov->fields['cantidad_recibida'])==$total_pedido)\r\n\t\t\t\t\t \t {\r\n\t\t\t\t\t \t ?>\r\n\t\t\t\t\t \t (Fila Des-Entregada)\r\n\t\t\t\t\t \t <?\r\n\t\t\t\t\t \t }\r\n\t\t\t\t\t \t elseif($datos_entregados_mov->fields['cantidad_recibida']<0)\r\n\t\t\t\t\t \t {\r\n\t\t\t\t\t \t \techo \"(Código de Barras borrado)\";\r\n\t\t\t\t\t \t }\r\n\t\t\t\t\t \t ?>\r\n\t\t\t\t \t </b>\r\n\t\t\t\t \t </font>\r\n\t\t\t\t \t </td>\r\n\t\t\t\t \t <td>\r\n\t\t\t\t \t <font color=\"Black\">\r\n\t\t\t\t \t <b>Usuario: <?=$datos_entregados_mov->fields['usuario']?></b>\r\n\t\t\t\t \t </font>\r\n\t\t\t\t \t </td>\r\n\t\t\t\t \t <td align=\"right\">\r\n\t\t\t\t \t <font color=\"Black\">\r\n\t\t\t\t \t <b>Fecha: <?=fecha($datos_entregados_mov->fields['fecha'])?></b>\r\n\t\t\t\t \t </font>\r\n\t\t\t\t \t </td>\r\n\t\t\t\t \t </tr>\r\n\t\t\t\t \t <?\r\n\t\t\t\t \t $datos_entregados_mov->MoveNext();\r\n\t\t\t\t \t }//de while(!$datos_entregados_mov->EOF)\r\n\t\t ?>\r\n\t\t </table>\r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t <td>\r\n\t\t <?\r\n\t\t //si hay que mostrar los botones de entregar\r\n\t\t if($mostrar_botones_entregar) { \r\n\t\t \t\r\n\t //me fijo si es rma san luis para diferenciar los casos\r\n\t ($pm_rma_producto_sl) ? $rma_san_luis =1 : $rma_san_luis = 0;\r\n\t\t \t \r\n\t\t \t $link_cb=encode_link(\"entregar_codigos_barra.php\",array(\"total_comprado\"=>$total_pedido,\"total_entregado\"=>$entregados,\"producto_nombre\"=>\"$producto\",\"id_prod_esp\"=>$id_prod_esp,\"id_movimiento\"=>$id_mov,\"id_detalle_movimiento\"=>$id_detalle_movimiento,\"es_pedido_material\"=>$es_pedido_material,\"deposito_origen\"=>$deposito_origen,\"deposito_destino\"=>$deposito_destino,\"id_licitacion\"=>$id_licitacion,\"nro_caso\"=>$nrocaso,\"rma_san_luis\"=>$rma_san_luis));\r\n\t $link_sin_cb=encode_link(\"entregar_sin_codigos_barra.php\",array(\"total_comprado\"=>$total_pedido,\"total_entregado\"=>$entregados,\"producto_nombre\"=>\"$producto\",\"id_prod_esp\"=>$id_prod_esp,\"id_movimiento\"=>$id_mov,\"id_detalle_movimiento\"=>$id_detalle_movimiento,\"es_pedido_material\"=>$es_pedido_material,\"deposito_origen\"=>$deposito_origen,\"deposito_destino\"=>$deposito_destino,\"id_licitacion\"=>$id_licitacion,\"nro_caso\"=>$nrocaso,\"rma_san_luis\"=>$rma_san_luis));\r\n\t\t\t ?>\r\n\t\t\t <input type=\"button\" name=\"entregar_cb_<?=$items[$x]['id_detalle_movimiento']?>\" value=\"Entregar Productos\" onclick=\"if(vent_cb_<?=$id_detalle_movimiento?>.closed)vent_cb_<?=$id_detalle_movimiento?>=window.open('<?=$link_cb?>','','top=130, left=250, width=450px, height=500px, scrollbars=1, status=1,directories=0');else vent_cb_<?=$id_detalle_movimiento?>.focus();\" <?=$permiso?>>\r\n\t\t\t <?\r\n\t\t\t if(permisos_check(\"inicio\",\"permiso_entregar_sin_cb\"))\r\n\t\t\t {\r\n\t\t\t ?>\r\n\t\t\t <input type=\"button\" name=\"entregar_sin_cb_<?=$items[$x]['id_detalle_movimiento']?>\" value=\"Entregar sin CB\" onclick=\"if(vent_sin_cb_<?=$id_detalle_movimiento?>.closed)vent_sin_cb_<?=$id_detalle_movimiento?>=window.open('<?=$link_sin_cb?>','','top=130, left=250, width=400px, height=350px, scrollbars=1, status=1,directories=0');else vent_sin_cb_<?=$id_detalle_movimiento?>.focus();\" <?=$permiso?>>\r\n\t\t\t <?\r\n\t\t\t }//de if(permisos_check(\"inicio\",\"permiso_entregar_sin_cb\"))\r\n\t\t\t if($entregados>0 && permisos_check(\"inicio\",\"permiso_des_entregar_PM_MM\"))\r\n\t\t\t {?>\r\n\t\t\t \t<input type=\"submit\" name=\"des_recibir_<?=$items[$x]['id_detalle_movimiento']?>\" value=\"Des-Entregar\" onclick=\"return des_entregar_func(<?=$items[$x]['id_detalle_movimiento']?>)\" <?=$permiso?>>\r\n\t\t\t <?\r\n\t\t\t }//de if(permisos_check(\"inicio\",\"permiso_des_recibir_PM_MM\"))\r\n\t\t }//de if($mostrar_botones_entregar)\r\n\t\t\t\t\t ?>\r\n\r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t </table>\r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t\t<?\r\n\t\t\t }//de for($x=0;$x<$items['cantidad'];$x++)\r\n\r\n\t\t\tif($mostrar_botones_entregar)\r\n\t\t\t{?>\r\n\t\t\t <tr>\r\n\t\t\t <td align=\"center\">\r\n\t\t <?\r\n\t if($es_pedido_material && permisos_check(\"inicio\",\"permiso_eliminar_fila_pm_autorizada\") && $hay_sin_entregar && $estado!=3)\r\n\t {?>\r\n\t \t&nbsp;<input type=\"submit\" name=\"eliminar_fila\" value=\"Eliminar Filas Autorizadas\" onclick=\"if(confirm('¿Está seguro que desea eliminar las filas seleccionadas?'))return true; else return false;\">\r\n\t <?\r\n\t }\r\n\t ?>\r\n\t </td>\r\n\t </tr>\r\n\t <?\r\n\t\t\t}//de if($mostrar_botones_entregar)\r\n\t\t\t?>\r\n </table>\r\n\t<?\r\n}", "function registrar(){\r\n\r\n include('config.php');\r\n\r\n date_default_timezone_set('America/Cuiaba');\r\n $pdo = new PDO('mysql:host='.HOST.';dbname='.DATABASE, USUARIO, SENHA);\r\n\r\n $cursos = array('Engenharia da Computação', 'Engenharia de Controle e Automação', 'Engenharia de Minas', 'Engenharia de Trasportes', 'Engenharia Quimica');\r\n \r\n $nome = $_POST['nome'];\r\n $email = $_POST['email'];\r\n $rga = $_POST['rga'];\r\n $semestre = $_POST['semestre']; \r\n $data = date('Y-m-d H:i:s');\r\n $senha = $_POST['senha'];\r\n $confirmaSenha = $_POST['confirmaSenha'];\r\n $curso = '';\r\n \r\n for($i = 1; $i <= 5; $i++){ //verificando qual o curso pelo rga\r\n\r\n if($rga['9'] == $i)\r\n $curso = $cursos[$i];\r\n \r\n \r\n }\r\n \r\n\r\n $sql = $pdo->prepare(\"INSERT INTO `tabela_estudantes` VALUES (null,?,?,?,?,?,?,?)\"); //inserirndo na tabela vendas\r\n\r\n $sql->execute(array($nome, $senha, $data, $email, $curso, $semestre, $rga));\r\n\r\n echo '<h6 style=\"color: rgb(255, 255, 255);\">Usuario registrado com sucesso!</h6>';\r\n\r\n }", "function guardar_lab_registro($objeto){\n\n\t\t$sql = \"INSERT INTO\n\t\t\t\t\t\tprd_lab_registro (id_producto, id_orden_produccion, num_mezclas, fecha_elaboracion, fecha_recepcion, fecha_liberacion,\n\t\t\t\t\t\tfecha_caducidad, fecha_analisis, lote_analisis, lote_fabricacion, lote_produccion)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t(\".$objeto['producto'] . \", '\" .$objeto['orden_produccion']. \"', \" . $objeto['numero_mezclas'] . \", '\" .\n\t\t\t\t\t\t\t$objeto['fecha_elaboracion'] . \"', '\" . $objeto['fecha_recepcion'] . \"', '\" . $objeto['fecha_liberacion'] . \"', '\" .\n\t\t\t\t\t\t\t$objeto['fecha_caducidad'] . \"', '\" . $objeto['fecha_analisis'] . \"', '\" . $objeto['lote_analisis'] . \"', '\" .\n\t\t\t\t\t\t\t$objeto['lote_fabricacion'] . \"', '\" . $objeto['lote_produccion'] . \"')\";\n\n\t\t$result =$this->insert_id($sql);\n\t\treturn $result;\n\n\n\t}", "function salva($vls){\n//sleep(2)tempo de espera de enivio da requisição;\n$mensagens = [];\n$contem_erros = false;\nif ($vls['descri'] == '') {\n\t$contem_erros = true;\n\t$mensagens['descri'] = 'A descrição está em branco';\n}\n\nif ($vls['marca'] == '') {\n\t$contem_erros = true;\n\t$mensagens['marca'] = 'A marca está em branco';\n}\nif ($vls['modelo'] == '') {\n $erros = true;\n $mensagens['modelo'] = \"O modelo esta em branco\";\n}\nif ($vls['tipov'] == '') {\n\t$contem_erros = true;\n\t$mensagens['tipov'] = 'O tipo de veículo está em branco';\n}\n\nif ($vls['quantp'] == '') {\n\t$contem_erros = true;\n\t$mensagens['quantp'] = 'A quantidade de passageiros está em branco';\n}\nif ($vls['vlvenda'] == '') {\n $erros = true;\n $mensagens['vlvenda'] = \"O valor de venda está em branco\";\n}\nif ($vls['vlcompra'] == '') {\n\t$contem_erros = true;\n\t$mensagens['vlcompra'] = 'O valor de compra está em branco';\n}\n\nif ($vls['dtcompra'] == '') {\n\t$contem_erros = true;\n\t$mensagens['dtcompra'] = 'A data de compra está em branco';\n}\nif ($vls['estato'] == '') {\n $erros = true;\n $mensagens['estato'] = \"O status do veículo esta em branco\";\n}\n if (! $contem_erros) {//se não conter erros executara o inserir\n $id = null;\n $campos = \"`id_car`, `descricao`, `marca`, `modelo`, `tipov`, `qntpass`, `vlvenda`, `vlcompra`, `datcompra`, `estato`\";\n $sql = \"INSERT INTO `carro` ($campos) VALUES (:id, :descri, :marca, :modelo, :tipov, :quantp, :vlvenda, :vlcompra, :dtcompra, :estato)\";\n $rs = $this->db->prepare($sql);\n$rs->bindParam(':id', $id , PDO::PARAM_INT);\n$rs->bindParam(':descri', $vls['descri'] , PDO::PARAM_STR);\n$rs->bindParam(':marca', $vls['marca'] , PDO::PARAM_STR);\n$rs->bindParam(':modelo', $vls['modelo'] , PDO::PARAM_STR);\n$rs->bindParam(':tipov', $vls['tipov'] , PDO::PARAM_STR);\n$rs->bindParam(':quantp', $vls['quantp'] , PDO::PARAM_STR);\n$rs->bindParam(':vlvenda', $vls['vlvenda'] , PDO::PARAM_STR);\n$rs->bindParam(':vlcompra', $vls['vlcompra'] , PDO::PARAM_STR);\n$rs->bindParam(':dtcompra', $vls['dtcompra'] , PDO::PARAM_STR);\n$rs->bindParam(':estato', $vls['estato'] , PDO::PARAM_STR);\n\n$result = $rs->execute();\n\n\nif ($result) {\n //passando vetor em forma de json\n $mensagens['sv'] = \"salvo com sucesso!\";\n \t echo json_encode([\n \t 'mensagens' => $mensagens,\n \t 'contem_erros' => false\n \t ]);//chama a funçaõ inserir na pagina acao.php\n\n }\n }else {\n\t// temos erros a corrigir\n\techo json_encode([\n\t\t'contem_erros' => true,\n\t\t'mensagens' => $mensagens\n\t]);\n}\n}", "public function registrar_objeto_controlador(){\n\t\t\t$Nombre=mainModelo::limpiar_cadena($_POST['objeto-txt']);\n\t\t\t$Marca=mainModelo::limpiar_cadena($_POST['marcaobjeto-txt']);\n\t\t\t$Modelo=mainModelo::limpiar_cadena($_POST['modeloobjeto-txt']);\n\t\t\t$Cantidad=mainModelo::limpiar_cadena($_POST['cantidadobjeto-txt']);\n\t\t\t$Tipo=mainModelo::limpiar_cadena($_POST['tipoobjeto-txt']);\n\t\t\t$Propietario=mainModelo::limpiar_cadena($_POST['docpropietario-txt']); \n\t\t\t$codigo= objetoModelo::codigo_auto();\n\t\t\t$codigo= ($codigo->rowCount()+1);\n\t\t\t\n\t\t\t$dataobjeto=[\n\t\t \"Codigo\"=>$codigo,\n\t\t\t\t\"Nombre\"=>$Nombre,\n\t\t\t\t\"Marca\"=>$Marca,\n\t\t\t\t\"Modelo\"=>$Modelo,\n\t\t\t\t\"Cantidad\"=>$Cantidad,\n\t\t\t\t\"Tipo\"=>$Tipo,\n\t\t\t\t\"Estado\"=>'A',\n\t\t\t\t\"Propietario\"=>$Propietario\n\t\t\t];\n\t\t\t\n\t\t\t$guardarObjeto=ObjetoModelo::registrar_objeto_modelo($dataobjeto);\n\n\t\t\tif ($guardarObjeto->rowCount()==1) {\n\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alerta\"=>\"limpiar\",\n\t\t\t\t\t\"Titulo\"=>\"Objeto registrado\",\n\t\t\t\t\t\"Texto\"=>\"Registro exitoso!\",\n\t\t\t\t\t\"Tipo\"=>\"success\"\n\t\t\t ];\n\t\t }else{\n\t\t\t\t\n\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alerta\"=>\"simple\",\n\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\"Texto\"=>\"No se ha podido registrar el objeto!\",\n\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t];\n\t\t }\n\t\t\treturn mainModelo::sweet_alert($alerta);\n\t\t}", "function guardar_sublink(){\n $this->accion=\"New Sub-Link Data\";\n if (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n $this->asignar_valores();\n $this->id=$_GET['id'];\n $sql=\"SELECT * FROM sublink WHERE nombre_sub='$this->nombre'\";\n $consulta=mysql_query($sql) or die(mysql_error());\n if($resultado=mysql_fetch_array($consulta)){\n $this->mensaje=1;\n }else{\n $sql=\"INSERT INTO sublink VALUES ('', '$this->nombre', '$this->prioridad')\";\n $consulta=mysql_query($sql) or die(mysql_error());\n if(isset($this->id) && $this->id!=\"\")\n header(\"location:/admin/link/sublink.php?id=$this->id\");\n else\n header(\"location:/admin/link/sublink_lista.php\");\n }\n }\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 getEventosScreenshotElemento() {\n\t global $mdb2;\n\t global $log;\n\t global $current_usuario_id;\n\t global $data;\n\t global $marcado;\n\t global $usr;\n\t include 'utils/get_eventos.php';\n\t $event = new Event;\n\t $graficoSvg = new GraficoSVG();\n\n\t if($this->extra[\"imprimir\"]){\n\t \t$objetivo = new ConfigEspecial($this->objetivo_id);\n\n\t\t\t$nombre_objetivo = $objetivo->nombre;\n\t\t\t//echo $nombre_objetivo;\n\n\t \t$usuario = new Usuario($current_usuario_id);\n\t\t\t$usuario->__Usuario();\n\t \t$json = get_eventos($current_usuario_id, $this->objetivo_id, date(\"Y-m-d H:i\", strtotime($this->timestamp->getInicioPeriodo())), date(\"Y-m-d H:i\",strtotime($this->timestamp->getTerminoPeriodo())), $usuario->clave_md5);\n\t \t$T =& new Template_PHPLIB(REP_PATH_TABLETEMPLATES);\n\t\t $T->setFile('tpl_tabla', 'contenedor_tabla.tpl');\n\t\t $T->setVar('__nombre_obj', $nombre_objetivo);\n\t\t $T->setVar('__contenido', $json);\n\t\t $T->setVar('__valid_contenido', true);\n\t\t $this->resultado = $T->parse('out', 'tpl_tabla');\n\t }else{\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\t\t $T->setVar('__valid_contenido', false);\n\t\t # Variables para eventos especiales marcados por el cliente codigo 9.\n\t\t $timeZoneId = $usr->zona_horaria_id;\n\t\t $arrTime = Utiles::getNameZoneHor($timeZoneId);\n\t\t $timeZone = $arrTime[$timeZoneId];\n\t\t $arrayDateStart = array();\n\t\t $tieneEvento = 'false';\n\t\t $data = null;\n\t\t $ids = null;\n\n\t\t $sql1 = \"SELECT * FROM reporte._detalle_marcado(\".pg_escape_string($current_usuario_id).\",ARRAY[\".pg_escape_string($this->objetivo_id).\"],'\".pg_escape_string($this->timestamp->getInicioPeriodo()).\"','\".pg_escape_string($this->timestamp->getTerminoPeriodo()).\"')\";\n\t// \t \t print($sql1);\n\t\t \t$res1 =& $mdb2->query($sql1);\n\t\t \tif (MDB2::isError($res1)) {\n\t\t \t $log->setError($sql1, $res1->userinfo);\n\t\t \t exit();\n\t\t \t}\n\t\t \tif($row1= $res1->fetchRow()){\n\t\t \t $dom1 = new DomDocument();\n\t\t \t $dom1->preserveWhiteSpace = FALSE;\n\t\t \t $dom1->loadXML($row1['_detalle_marcado']);\n\t\t \t $xpath1 = new DOMXpath($dom1);\n\t\t \t unset($row1[\"_detalle_marcado\"]);\n\t\t \t}\n\t\t \t$tag_marcardo_mantenimientos = $xpath1->query(\"/detalles_marcado/detalle/marcado\");\n\t\t \t# Busca y guarda si existen marcados dentro del xml.\n\t\t \tforeach ($tag_marcardo_mantenimientos as $tag_marcado){\n\t\t \t $ids = $ids.','.$tag_marcado->getAttribute('mantenimiento_id');\n\t\t \t $marcado = true;\n\t\t \t}\n\t\t \t# Verifica que existan marcados por el usuario.\n\t\t \tif ($marcado == true) {\n\t\t \t $dataMant =$event->getData(substr($ids, 1), $timeZone);\n\t\t \t $character = array(\"{\", \"}\");\n\t\t \t $objetives = explode(',',str_replace($character,\"\",($dataMant[0]['objetivo_id'])));\n\t\t \t $tieneEvento = 'true';\n\t\t \t $data = json_encode($dataMant);\n\t\t \t}\n\t\t\tif (isset($this->extra[\"monitor_id\"]) and isset($this->extra[\"pagina\"])) {\n\t\t\t if($this->extra[\"semaforo\"]==2){\n\t\t\t $semaforo=2;\n\t\t\t }else{\n\t\t\t $semaforo=1;\n\t\t\t }\n\t\t\t //$T->setVar('__contenido_id', 'even__'.$this->extra[\"monitor_id\"]);\n\t\t\t $T->setVar('__contenido_tabla', $this->getDetalleEventosScreenshotElementos($this->extra[\"monitor_id\"], $this->extra[\"pagina\"], $semaforo));\n\t\t\t $T->parse('lista_contenedores', 'LISTA_CONTENEDORES', true);\n\t\t\t $T->setVar('__tiene_evento', $tieneEvento);\n\t\t\t return $this->resultado = $T->parse('out', 'tpl_tabla');\n\t\t\t}\n\t\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t\t$sql = \"SELECT foo.nodo_id FROM (\".\n\t\t\t\t \"SELECT DISTINCT unnest(_nodos_id) AS nodo_id FROM _nodos_id(\".\n\t\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\t\tpg_escape_string($this->objetivo_id).\",'\".\n\t\t\t\t\tpg_escape_string($this->timestamp->getInicioPeriodo()).\"','\".\n\t\t\t\t\tpg_escape_string($this->timestamp->getTerminoPeriodo()).\"')) AS foo, nodo n \".\n\t\t\t\t \"WHERE foo.nodo_id=n.nodo_id ORDER BY orden\";\n\t//\t\tprint($sql);\n\t\t\t$res =& $mdb2->query($sql);\n\t\t\tif (MDB2::isError($res)) {\n\t\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\t\texit();\n\t\t\t}\n\t\t\t$monitor_ids = array();\n\t\t\twhile($row = $res->fetchRow()) {\n\t\t\t\t$monitor_ids[] = $row[\"nodo_id\"];\n\t\t\t}\n\t\t\t/* SI NO HAY DATOS MOSTRAR MENSAJE */\n\t\t\tif (count($monitor_ids) == 0) {\n\t\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$T->setVar('__tiene_evento', $tieneEvento);\n\t\t\t/* LISTA DE MONITORES */\n\t\t\t$orden = 1;\n\t\t\tforeach ($monitor_ids as $monitor_id) {\n\t\t\t\t$T->setVar('__contenido_id', 'even_'.$monitor_id);\n\t\t\t\t$T->setVar('__contenido_tabla', $this->getDetalleEventosScreenshotElementos($monitor_id, 1, 1, $orden));\n\t\t\t\t$T->parse('lista_contenedores', 'LISTA_CONTENEDORES', true);\n\t\t\t\t$orden++;\n\t\t\t}\n\t\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\t\t\tif ($data != null){\n\t\t\t\t$this->resultado.= $graficoSvg->getAccordion($data,'accordionEvento');\n\t\t\t}\n\t\t}\n\t}", "public function gestiona() //= template method\r\n {\r\n if ( ! $this->formularioEnviado($_POST) ) {\r\n echo $this->generaFormulario();\r\n } else {\r\n $result = $this->procesaFormulario($_POST);\r\n if ( is_array($result) ) {\r\n echo $this->generaFormulario($result, $_POST);\r\n } else {\r\n header('Location: '.$result);\r\n exit();\r\n }\r\n }\r\n }", "public function ingresarEmpleadoSinID(){\n $conexion = new Conexion;\n $con = new mysqli($conexion->servername, $conexion->username, $conexion->password, $conexion->dbname);\n $sql = \"INSERT INTO empleado (rut, nombre, password, categoria, estado ) VALUES ('\".$this->rut.\"', '\".$this->nombre.\"','\".$this->password.\"', '\".$this->categoria.\"', 1)\";\n if ($con->connect_error) {\n die(\"Conexión fallida: \" . $con->connect_error);\n } \n if ($con->query($sql) === TRUE) {\n echo \"Empleado ingresada correctamente.\";\n } else {\n echo \"Error: \" . $sql . \"<br>\" . $con->error;\n }\n $con->close();\n }", "function guardar(){\n\t\t//METODO QUE GUARDA UNA NUEVA CURSADA O ACTUALIZA UNA EXISTENTE\n\t\t\n\t\tif(!$this->cambios)\n\t\t\treturn;\n\t\t\n\t\tif($this->id_carrera == \"\")\n\t\t\tthrow new Exception(\"La carrera no es válida.\");\n\t\t\n\t\tif($this->materia == 0)\n\t\t\tthrow new Exception(\"La materia no es válida.\");\n\t\t\n\t\tif($this->anio == 0)\n\t\t\tthrow new Exception(\"El año no es válido.\");\n\t\t\n\t\tif($this->f_inicio == \"\")\n\t\t\tthrow new Exception(\"La fecha de inicio no es válida.\");\n\t\t\n\t\tif($this->f_fin == \"\")\n\t\t\tthrow new Exception(\"La fecha de finalización no es válida.\");\n\t\t\n\t\tif($this->porc_asistencia < 0)\n\t\t\tthrow new Exception(\"Ocurrió un error.\");\n\t\t\n\t\t$conn = new Conexion();\n\t\t\n\t\tif($this->nuevo){\n\t\t\t\n\t\t\ttry{\n\t\t\t\t$sql = 'INSERT INTO cursada(id_carrera, materia, anio, f_inicio, f_fin, cuatrimestre, porc_asistencia)\n\t\t\t\t\t\tVALUES(:id_carrera, :materia, :anio, :f_inicio, :f_fin, :cuatrimestre, :porc_asistencia)';\n\t\t\t\t\n\t\t\t\t$consulta = $conn->prepare($sql);\n\t\t\t\t \n\t\t\t\t$consulta->bindParam(':id_carrera', $this->id_carrera, PDO::PARAM_STR);\n\t\t\t\t$consulta->bindParam(':materia', $this->materia, PDO::PARAM_INT);\n\t\t\t\t$consulta->bindParam(':anio', $this->anio, PDO::PARAM_INT);\n\t\t\t\t$consulta->bindParam(':f_inicio', $this->f_inicio, PDO::PARAM_STR);\n\t\t\t\t$consulta->bindParam(':f_fin', $this->f_fin, PDO::PARAM_STR);\n\t\t\t\t$consulta->bindParam(':cuatrimestre', $this->cuatrimestre, PDO::PARAM_INT);\n\t\t\t\t$consulta->bindParam(':porc_asistencia', $this->porc_asistencia, PDO::PARAM_STR);\n\t\t\t\t\n\t\t\t\t$consulta->execute();\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\tthrow new Exception('Error al insertar la nueva cursada: '.$e->getMessage());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function store(){\n \n if(!Login::isAdmin())\n throw new Exception(\"Debes ser administrador\");\n \t//recibos el id del modulo\n $idModulo = intval($_POST['idModulo']);\n if($idModulo==0)\n throw new Exception(\"No eligio un Modulo\");\n\n $enunciado = DB::escape($_POST['enunciado']);\n $dificultad = intval($_POST['dificultad']);\n $tipoRespuesta1 = isset($_POST['tipoRespuesta1'])?1:0;\n $tipoRespuesta2 = isset($_POST['tipoRespuesta2'])?1:0;\n $tipoRespuesta3 = isset($_POST['tipoRespuesta3'])?1:0;\n $tipoRespuesta4 = isset($_POST['tipoRespuesta4'])?1:0;\n $respuesta1 = DB::escape($_POST['respuesta1']);\n $respuesta2 = DB::escape($_POST['respuesta2']);\n $respuesta3 = DB::escape($_POST['respuesta3']);\n $respuesta4 = DB::escape($_POST['respuesta4']);\n\n \n \t//crea el nuevo pregunta con los datos POST\n $pregunta = new Pregunta();\n $pregunta->enunciado=$enunciado;\n $pregunta->dificultad=$dificultad;\n \n $idPregunta = $pregunta->guardar($idModulo);\n\n if(!$idPregunta) //guardar en la BDD\n throw new Exception(\"No se pudo guardar la pregunta:<br>$pregunta->enunciado\");\n\n $respuestas = new Respuesta();\n $respuestas->texto = $respuesta1;\n $respuestas->correcta= $tipoRespuesta1; \n\n if(!$respuestas->guardar($idPregunta))\n throw new Exception(\"No se pudo guardar la respuesta:<br>$respuestas->texto <br>pregunta id: $idPregunta <br>$tipoRespuesta1\");\n\n $respuestas = new Respuesta();\n $respuestas->texto = $respuesta2;\n $respuestas->correcta= $tipoRespuesta2; \n\n if(!$respuestas->guardar($idPregunta))\n throw new Exception(\"No se pudo guardar la respuesta:<br>$respuestas->texto\");\n\n $respuestas = new Respuesta();\n $respuestas->texto = $respuesta3;\n $respuestas->correcta= $tipoRespuesta3; \n\n if(!$respuestas->guardar($idPregunta))\n throw new Exception(\"No se pudo guardar la respuesta:<br>$respuestas->texto\");\n\n $respuestas = new Respuesta();\n $respuestas->texto = $respuesta4;\n $respuestas->correcta= $tipoRespuesta4; \n\n if(!$respuestas->guardar($idPregunta))\n throw new Exception(\"No se pudo guardar la respuesta:<br>$respuestas->texto\");\n\n\n //cagar los usuarios\n $usuario=Login::getUsuario();\n \n \t//muestra la vista de exito\n $mensaje = \"Guardado Correcto de la pregunta: <br>$pregunta->enunciado\";\n require_once 'view/exito.php'; //mostrar exito\n }", "static public function ctrCrearHistorial(){\n\n\t\tif(isset($_POST[\"nuevoTitulo\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoTitulo\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ),\\r\\n ]+$/', $_POST[\"nuevaDescripcionHistorial\"])){\n\n\t\t\t\t$tabla = \"historial\";\n\n\t\t\t\t$idPaciente = $_GET[\"idPaciente\"];\n\n\t\t\t\t$datos = array(\"titulo\" => Cifrar::encrypt($_POST[\"nuevoTitulo\"]),\n\t\t\t\t\t\t\t \"descripcion\" => Cifrar::encrypt($_POST[\"nuevaDescripcionHistorial\"]));\n\n\t\t\t\t$respuesta = ModeloHistorial::mdlIngresarHistorial($tabla, $idPaciente, $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.fire({\n\t\t\t\t\t\t\t icon: \"success\",\n\t\t\t\t\t\t\t title: \"El historial ha sido guardado 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 = \"\";\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.fire({\n\t\t\t\t\t\t icon: \"error\",\n\t\t\t\t\t\t title: \"¡El historial 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 = \"\";\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 alta_tipo_entrada(){\n\t\t$u= new Tipo_entrada();\n\t\t$related = $u->from_array($_POST);\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han registrado los datos del Tipo de Entrada.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "function mostrarEstudiantesProyecto($estudiantes,$codEstudiante){\n $cod_proyecto= $_REQUEST['cod_proyecto'];\n \n?>\n <form enctype='tipo:multipart/form-data,application/x-www-form-urlencoded,text/plain' method='POST' action='index.php' name='<? echo $this->formulario2 ?>'>\n <table id=\"tabla\" class=\"contenidotabla\" width=\"100%\">\n <div align=\"center\" ><b><?echo \"Estudiantes a Homologar por Pendientes - Cod. Proyecto \".$cod_proyecto; ?></b></div><hr>\n <?//opciones para agregar 5,10,15...50 estudiantes?>\n\n <thead class='sigma'>\n <th class='niveles centrar' > No.</th>\n <th class='niveles centrar' > Código Actual</th>\n <th class='niveles centrar' > Nombre</th>\n </thead>\n <?\n for($i=0;$i<count($estudiantes);$i++){\n $cod_estudiante = isset($estudiantes[$i]['COD_ESTUDIANTE'])?$estudiantes[$i]['COD_ESTUDIANTE']:''; \n $nombre = isset($estudiantes[$i]['NOMBRE'])?$estudiantes[$i]['NOMBRE']:''; \n ?>\n\n <tr >\n <td width=\"5%\" class='cuadro_plano centrar'><? echo $i+1;?></td>\n <td width=\"20%\" class='cuadro_plano centrar'><? echo $cod_estudiante;?></td>\n <td width=\"50%\" class='cuadro_plano'><? echo $nombre;?></td>\n </td>\n </tr>\n <?\n }\n ?>\n </table>\n <table width=\"100%\">\n <tr>\n <td align=\"center\">\n <input type=\"button\" value=\"Homologar\" onclick=\"document.forms['<? echo $this->formulario2?>'].submit()\"> \n <input type=\"hidden\" name=\"opcion\" value=\"registrar\">\n <input type=\"hidden\" name=\"action\" value=\"<? echo $this->formulario ?>\">\n <input type=\"hidden\" name=\"tipo_homologacion\" value=\"estudiantes\">\n <input type=\"hidden\" name=\"cod_proyecto\" value=\"<? echo $cod_proyecto; ?>\">\n </td>\n </tr>\n </table>\n </form>\n\n <?\n }", "public function RegistrarSalas()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"nombresala\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select nombresala from salas where nombresala = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"nombresala\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$query = \" insert into salas values (null, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $nombresala);\n\t\t$stmt->bindParam(2, $salacreada);\n\n\t\t$nombresala = strip_tags($_POST[\"nombresala\"]);\n\t\t$salacreada = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t$stmt->execute();\n\n\n\t\techo \"<div class='alert alert-success'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> LA SALA DEL RESTAURANT FUE REGISTRADA EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"2\";\n\t\texit;\n\t}\n}", "static public function mdlGuardarDetalleIngreso($tabla,$datos){\n\n\t\t$sql=\"INSERT INTO $tabla (\n\t\t\t\t\t\t\t\t\t\t\ttipo,\n\t\t\t\t\t\t\t\t\t\t\tdocumento,\n\t\t\t\t\t\t\t\t\t\t\ttaller,\n\t\t\t\t\t\t\t\t\t\t\tfecha,\n\t\t\t\t\t\t\t\t\t\t\tarticulo,\n\t\t\t\t\t\t\t\t\t\t\tcantidad,\n\t\t\t\t\t\t\t\t\t\t\talmacen,\n\t\t\t\t\t\t\t\t\t\t\tidcierre\n\t\t\t\t\t\t\t\t\t\t) \n\t\t\t\t\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t:tipo,\n\t\t\t\t\t\t\t\t\t\t\t:documento,\n\t\t\t\t\t\t\t\t\t\t\t:taller,\n\t\t\t\t\t\t\t\t\t\t\t:fecha,\n\t\t\t\t\t\t\t\t\t\t\t:articulo,\n\t\t\t\t\t\t\t\t\t\t\t:cantidad,\n\t\t\t\t\t\t\t\t\t\t\t:almacen,\n\t\t\t\t\t\t\t\t\t\t\t:idcierre\n\t\t\t\t\t\t\t\t\t\t\t)\";\n\n\t\t$stmt=Conexion::conectar()->prepare($sql);\n\n $stmt->bindParam(\":tipo\",$datos[\"tipo\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":documento\",$datos[\"documento\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":taller\",$datos[\"taller\"],PDO::PARAM_STR);\n $stmt->bindParam(\":fecha\",$datos[\"fecha\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":articulo\",$datos[\"articulo\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":cantidad\",$datos[\"cantidad\"],PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":almacen\",$datos[\"almacen\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":idcierre\",$datos[\"idcierre\"],PDO::PARAM_INT);\n\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\n\t\t}\n\n\t\t$stmt=null;\n\t}", "public function examen(){\r\n\t\tparent::conectaBDMy();\t \r\n\t\t$this->idExamen=\"\";\t\t\r\n\t\t$this->tipoExamen=\"\";\t\r\n\t\t$this->descripcion=\"\";\r\n\t}", "function insertar(){\n $nombre=$_POST[\"nombre\"];\n $apellido=$_POST[\"apellido\"];\n $edad=$_POST[\"edad\"];\n $curso=$_POST[\"curso\"];\n $correo=$_POST[\"correo\"];\n $consulta=\"INSERT INTO usuarios (Nombre, Apellido, Edad, Curso, Correo) VALUES('\".$nombre.\"', '\".$apellido.\"', '\".$edad.\"', '\".$curso.\"', '\".$correo.\"')\";\n echo $consulta. \"<br>\";\n \n $conexion->consulta($consulta);\n //$resultado = $conector->query($consulta);\n mostrarListado();\n\n }", "public function guardarSalida()\n {\n $data = $this->input->post('data');\n\t\t\t\t$noco = $this->input->post('datosTabla');\n $res = $this->Camiones->guardarSalida($data);\n\n\t\t\t\tif ($res['status']) {\n\n\t\t\t\t\t\t// si hay no consumibles se guardan aca\n\t\t\t\t\t\tif (isset($noco)) {\n\t\t\t\t\t\t\tforeach ($noco as $value) {\n\t\t\t\t\t\t\t\t$codigo[0] = $value['codigo'];\n\t\t\t\t\t\t\t\t$destino = $value['destino'];\n\t\t\t\t\t\t\t\t$depo_id = \"\";\n\t\t\t\t\t\t\t\t$rsp = $this->Noconsumibles->movimientoNoConsumibles($codigo, 'EN_TRANSITO', $depo_id, $destino);\n\t\t\t\t\t\t\t\tif ($rsp == null) {\n\t\t\t\t\t\t\t\t\tlog_message('ERROR','#TRAZA|TRAZASOFT|GENERAL|CAMION|guardarSalida() >> ERROR: no se pudo guardar el movimiento del Noconsumible ');\n\t\t\t\t\t\t\t\t\t$res = false;\n\t\t\t\t\t\t\t\t\tbreak 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\tlog_message('ERROR','#TRAZA|TRAZASOFT|CAMION|guardarSalida() >> ERROR: fallo el guardarSalida($data)');\n\t\t\t\t}\n\n echo json_encode($res);\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 }", "function handleInsertQuoteForm(){\n // On récupère la saisie\n //$text = filter_input(INPUT_POST, \"texte\", FILTER_SANITIZE_STRING);\n //$author = filter_input(INPUT_POST, \"auteur\", FILTER_SANITIZE_STRING);\n\n $data = filter_input_array(INPUT_POST, [\n \"texte\" => FILTER_SANITIZE_STRING,\n \"auteur\" => FILTER_SANITIZE_STRING\n ]);\n // Validation de la saisie\n $errors = validateInput($data);\n \n // Insertion uniquement s'il n'y a pas d'erreurs\n if(count($errors) == 0) {\n try {\n insertQuote($data);\n // Redirection vers la liste des citations\n header(\"location:liste-des-citations.php\");\n exit;\n } catch (Exception $ex) {\n $error[] = \"Il y a une erreur dans l'exécution de la requête\";\n }\n }\n\n return $errors;\n}", "function guardar($arg) {\n\t\tSessionHandler()->check_session();\n\t\tdate_default_timezone_set('America/Argentina/La_Rioja');\n\n\t\t$ids = explode('@', $arg);\n\t\t$mesa = $ids[0];\n\t\t$bebida = $ids[1];\n\t\t$cantidad = $ids[2];\n\t\t$pedidoId = $ids[3];\n\n\t\t//COMPROBAR STOCK DE BEBIDA.\n\t\t\n\t\tif ($pedidoId != null || $pedidoId != 0 || $pedidoId != \"\") {\n\t\t\t$bp = new BebidaPedido();\n\t\t\t$bp->pedido = $pedidoId;\n\t\t\t$bp->bebida = $bebida;\n\t\t\t$bp->cantidad = $cantidad;\n\t\t\t$bp->save();\n\n\t\t\t$md = new Mesa();\n\t\t\t$md->mesa_id = $mesa;\n\t\t\t$md->get();\n\t\t\t$md->disponible = 2;\n\t\t\t$md->save();\n\t\t\tprint($pedidoId);exit;\n\t\t}\n\n\t\t$this->model->fecha = date('Y-m-d');\t\t\n\t\t$this->model->mesa = $mesa;\t\t\n\t\t$this->model->estado = 1;\t\t\n\t\t$this->model->save();\n\t\t\n\t\t$md = new Mesa();\n\t\t$md->mesa_id = $mesa;\n\t\t$md->get();\n\t\t$md->disponible = 2;\n\t\t$md->save();\n\t\t\n\t\t$pedido_id = $this->model->pedido_id;\n\t\t\n\t\t$bp = new BebidaPedido();\n\t\t$bp->pedido = $pedido_id;\n\t\t$bp->bebida = $bebida;\n\t\t$bp->cantidad = $cantidad;\n\t\t$bp->save();\n\t\tprint($pedido_id);exit;\n\n\t}", "function guardar_clientes($data)\n {\n $insert = $this->db->insert('clientes', $data);\n return $insert;\n }", "function inserisci_record(Spesa $spesa){\n //variaibili che arrivano dall'oggetto creato\n $titolo = $spesa->getTitoloSpesa();\n $tipologia = $spesa->getTipologiaSpesa();\n $data_p = converti_data_pagamento_spesa($spesa->getDataPagamentoSpesa());\n $data_s = converti_data_scadenza_spesa($spesa->getDataScadenzaSpesa());\n $autore = $spesa->getAutoreSpesa();\n $importo = verifica_importo_spesa($spesa->getImportoSpesa());\n\n $mysqli = connetti();\n\n $sql = \"INSERT INTO `spesa` (`titolo_spesa`, `tipologia_spesa`, `data_pagamento_spesa`, `data_scadenza_spesa`, `autore_spesa`, `importo_spesa`) \n VALUES('$titolo','$tipologia','$data_p','$data_s','$autore',$importo)\";\n\n if($mysqli->query($sql)){\n header(\"Location:index.php\");\n }else{\n header(\"Location:inserisci_spesa.php\");\n }\n chiudi_connessione($mysqli);\n}", "private function _save(){\r\n\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n foreach ($_POST as $name => $value) {\r\n $config = HTMLPurifier_Config::createDefault();\r\n $purifier = new HTMLPurifier($config);\r\n $clean_html = $purifier->purify($value);\r\n\r\n $parts = explode('/', $name);\r\n $path = ROOT.DS.'site'.DS.'content';\r\n\r\n for($i = 0; $i < count($parts); $i++){\r\n $path .= DS.$parts[$i];\r\n if($i == (count($parts)-1)){\r\n file_put_contents($path.'.html', $clean_html);\r\n } else {\r\n if(!file_exists($path)){\r\n mkdir($path);\r\n }\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n }", "function insertNewEmpleado($datos){\n\t\tglobal $conexion;\n\n\t\t$EMPLEADO = returnJsonDecode($datos);\n\t\t$SUCURSAL = returnJsonDecode($EMPLEADO['SUCURSAL']);\n\t\t\n\t\t$sql = \"CALL insert_empleados(\n\t\t\t'\".$EMPLEADO['DOCUMENTO'].\"',\n\t\t\t'\".$EMPLEADO['NOMBRES'].\"',\n\t\t\t'\".$EMPLEADO['APELLIDOS'].\"',\n\t\t\t \".$SUCURSAL['ID'].\"\n\t\t)\";\n\n\t\tif(mysqli_query($conexion, $sql)){\n\t\t\t$id = mysqli_insert_id($conexion);\n\t\t\t$resp['status'] = 'success';\n\t\t\t$resp['data'] = $id;\n\t\t\t$resp['message'] = 'Registro creado con Exito';\n\t\t}else{\n\t\t\t$resp['status'] = 'error';\n\t\t\t$resp['data'] = 0;\n\t\t\t$resp['message'] = 'Error al crear registro. Error: ' . mysqli_error($conexion);\n\t\t}\n\n\n\t\treturn json_encode($resp);\n\t}", "function registrarDetalles () {\n\t\t$x = $this->pdo->prepare('INSERT INTO detalles (cedulaCliente,codProducto,cantidad,total,estado) VALUES (?,?,?,?,?)');\n\t\t$x->execute(array($this->cedulaClienteD,$this->codProducto,$this->cantidad,$this->total,$this->estado));\n\t\treturn $x;\n\t}", "public function Insert($dados){\n $sql = \"insert into tbl_pedido (idProduto, idUsuario, quantidade,idStatus,data,idEnderecoUsuario)\n values ('\".$dados->idProduto.\"',\n '\".$dados->idUsuario.\"',\n '\".$dados->quantidade.\"','1',CURDATE(),'1')\";\n\n\n\n //echo $sql;\n\n // conexao com o banco\n $conex = new Mysql_db();\n $PDO_conex = $conex->Conectar();\n\n if ($PDO_conex->query($sql)) {\n // echo \"</br> sucesso\";\n\n if (isset($_SESSION['idUsuario'])) {\n $idUser = $_SESSION['idUsuario'];\n\n session_destroy();\n @session_start();\n\n $_SESSION['idUsuario'] = $idUser;\n\n\n\n }\n }\n\n header(\"location:pagamento.php\");\n\n $conex->Desconectar();\n\n }" ]
[ "0.62827706", "0.61665577", "0.60428816", "0.602961", "0.6013646", "0.5928319", "0.59200823", "0.58634037", "0.58603096", "0.5851076", "0.58400494", "0.58233744", "0.58169895", "0.5810551", "0.5800319", "0.5773256", "0.5746879", "0.5740569", "0.5713654", "0.57114065", "0.5685248", "0.56796664", "0.5679479", "0.56612986", "0.56591266", "0.5653142", "0.56403935", "0.5622638", "0.5609471", "0.5598399", "0.5590535", "0.5577768", "0.5575242", "0.556986", "0.5560091", "0.5557494", "0.55559665", "0.55444664", "0.55414534", "0.55381274", "0.5532238", "0.55297786", "0.5529254", "0.55188054", "0.5514613", "0.5509426", "0.5502849", "0.5500597", "0.5499009", "0.5493777", "0.54879546", "0.54783624", "0.54762954", "0.54752785", "0.54744893", "0.54702204", "0.5469922", "0.5468894", "0.5456412", "0.54420155", "0.54402167", "0.54379207", "0.5432573", "0.5431452", "0.5429134", "0.5427542", "0.54238814", "0.5422389", "0.54177475", "0.54175264", "0.54154056", "0.54146224", "0.54124975", "0.5407728", "0.5405973", "0.54034024", "0.54013807", "0.5399584", "0.53995115", "0.53983706", "0.53964853", "0.53953755", "0.5395151", "0.53946507", "0.53946257", "0.5393189", "0.5386609", "0.5384031", "0.53823286", "0.53823155", "0.53800446", "0.53731877", "0.5368304", "0.53654695", "0.5362072", "0.53608024", "0.53607947", "0.5353068", "0.5351867", "0.53496146", "0.5348637" ]
0.0
-1
funcion para eliminar un usuario por su id
public function destroy($id) { $user=User::findOrFail($id); $User->Delete(); //Post::destroy($id); Return Redirect::to('users'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eliminarUser($id) {\n $sql = \"DELETE FROM usuario WHERE id='\" . $id . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }", "public function eliminar($id){\r\n //se eliminan todos los datos de este usuario de la tabla asignación\r\n return $this->db->delete('user', array('id' => $id));\r\n }", "public function eliminarUsuario()\n {\n $bd = new Bd($this->tabla);\n $sql = \"DELETE FROM usuarios WHERE id=\" . $_GET['id'];\n\n $resultado = $bd->consulta($sql);\n if ($resultado == true) {\n header('location: gestionUsuarios.php');\n }\n }", "function eliminarDiaryUser($id) {\n $sql = \"DELETE FROM diario WHERE id='\" . $id . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }", "public function eliminarUsuario($id){\n\t\t\t\n\t\t\tif(!$this->filtrarInt($id)){/**Comprobamos que nos pasan un id desde la vista*/\n \t$this->redireccionar('administrador');/**Si no lo pasan, nos devuelve a la pantalla administrador*/\n \t}\n\t\t\t\t\t\t\n\t\t\t $this->_administrador->eliminarUsuario(/**Si nos pasan el id desde la vista, llamamos a la funcion del modelo para eliminar el usuario*/\n \n\t\t\t\t\t$this->filtrarInt($id)/** Con esta linia le pasamos a la funcion el id del usuario que se borrara*/\n\t\t\t);\n\t\t\t\n\t\t\t$this->redireccionar('administrador');/**Cuando se haya borrado, nos devolvera a la vista del administrador*/\n\t\t\n\t\t}", "public function eliminarUsuarioAction($id){\n\t\t//Conectar con la base de datos.\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$usuario = $em->getRepository('TheClickCmsAdminBundle:Usuarios')->find($id);\n\t\t$em->remove($usuario);\n\t\t$em->flush();\n\t\treturn new Response('Usuario Eliminado');\n\t}", "function eraseUserById($var)\n {\n $bdd = connexMedoo();\n $bdd->delete(\"utilisateurs\", [\n 'id' => $var\n ]);\n }", "function eliminar(){\n global $conexion, $data;\n $id = $data[\"id\"];\n $eliminado = $data[\"eliminado\"];\n $resultado = mysqli_query($conexion,\"UPDATE usuario SET usu_eliminado='$eliminado' WHERE usu_id='$id'\");\n echo validarError($conexion, true, $resultado);\n }", "public static function eliminar_usuario($id){\n\t\techo \"En delete\";\n\t\t\n\t\t$query = \"DELETE FROM usuarios WHERE id=:id LIMIT 1\";\n\n\t\t/**\n\t\t * Call getConexion()\n\t\t */\n\t\tself::getConexion();\n\n\n\n\t\t$resultado = self::$cn->prepare($query);\n\t\t$resultado->bindParam(\":id\", $id);\n\t\t$resultado->execute();\n\n\t\tif ($resultado->execute()) {\n\t\t\treturn true;\n\t\t}\n \n\t\treturn false;\n\n\t}", "function deleteUser($id){\n\t\t$this->db->where('id_usuario', $id);\n\t\t$this->db->delete('usuarios');\n\t}", "public function utilisateurSupprimerUn($id)\n\t{\n\t\tGestion::supprimer(\"Utilisateur\",\"idUtilisateur\",$id);// votre code ici\n\t}", "public function eliminar($id)\n {\n //\n }", "public function eliminar($id)\n {\n //\n }", "protected\n function eliminar($id)\n {\n }", "protected function eliminar($id)\n {\n }", "public function eliminar($id){\n \n $this->validarToken();\n\n $datosUsuario = User::find($id);\n if($datosUsuario){\n $datosUsuario->delete();\n return ['status' => true];\n }\n \n return ['status' => false];\n}", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "function borrar(){\n $id=$_POST[\"id\"];\n $consulta=\"DELETE FROM usuarios WHERE id = \".$id.\"\";\n echo $consulta. \"<br>\";\n \n\n $resultado = $conector->query($consulta);\n mostrarListado();\n }", "function deleteUsuario($id)\n{\n\t$con = getDBConnection();\n\t$sql = \"DELETE FROM usuarios WHERE id = :id\";\n\t$stmt = $con->prepare($sql);\n\t$stmt->bindParam(':id', $id);\n\t$stmt->execute();\n}", "function removeUser($id)\n {\n $connect = new Config();\n $sql = 'DELETE FROM user_db WHERE id = :id';\n $query = $connect->connectPDO()->prepare($sql);\n $query->bindParam(':id', $id, \\PDO::PARAM_INT);\n $query->execute();\n }", "public function deleteUsuario(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_usuario WHERE usuario_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }", "public function delete($id_user){\n\t\t\t \n\t\t\t$this -> query = \"DELETE FROM usuari WHERE id='$id_user'\";\n\t\t\t$this -> executa_query();\n\t\t}", "public function eliminarUsuario($id){\n DB::table('usuarios')->where('id', '=', $id)->delete();\n return redirect('/Session/PanelControl')->with('status_exito', \"Éxito, elimino el usuario.\");\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 delUser($id_usuario){\n $sql = new Sql();\n $remUse = $sql->query('DELETE FROM usuarios WHERE id_usuario = :id_usuario', array(':id_usuario'=>$id_usuario));\n if(!is_array($remUse)){\n return true;\n }else{\n return false;\n }\n }", "public function eliminarPorId($id)\n {\n }", "public function eliminarAnuncio($id){\n\t\t\t\n\t\t\tif(!$this->filtrarInt($id)){/**Comprobamos que nos pasan un id desde la vista*/\n \t$this->redireccionar('administrador');/**Si no lo pasan, nos devuelve a la pantalla administrador*/\n \t}\n\t\t\t\t\t\t\n\t\t\t $this->_administrador->eliminarAnuncio(/**Si nos pasan el id desde la vista, llamamos a la funcion del modelo para eliminar el usuario*/\n \n\t\t\t\t\t$this->filtrarInt($id)/** Con esta linia le pasamos a la funcion el id del usuario que se borrara*/\n\t\t\t);\n\t\t\t\n\t\t\t$this->redireccionar('administrador');/**Cuando se haya borrado, nos devolvera a la vista del administrador*/\n\t\t\n\t\t}", "public function eliminarUsuario(){\r\n $sql =\"DELETE FROM usuarios WHERE IdUsuario = '{$this->idUsuario}';\";\r\n $res = $this->conexion->setQuery($sql);\r\n return $res;\r\n}", "public function deleteUsuario($id)\n {\n $stmt = Conexion::conectar()->prepare('DELETE from usuarios where idUsuario=:id');\n $stmt->bindParam(\":id\",$id);\n $stmt->execute();\n }", "function eliminar($id_usuario){\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 = \"DELETE FROM\n\t\t\t\t\tusuario\n\t\t\t\t\tWHERE(id_usuario='$id_usuario'\n\t\t\t\t\t\t)\n\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$conexion -> cerrar();\n\t\tif($resultado == TRUE)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function eliminarUsuario()\r\n {\r\n if(isset($_REQUEST['id'])){\r\n\r\n $userController = new App\\Controllers\\UserController;\r\n $result = $userController->deleteUser($_REQUEST['id']);\r\n \r\n /**\r\n * Variable de sesión usada para mostrar la notificación del\r\n * resultado de la solicitud.\r\n */\r\n $_SESSION['result'] = $result;\r\n }\r\n\r\n header('Location: ?c=Registro&a=usuarios');\r\n\r\n }", "function borrarUsuari($id){\n $conn=connexioBD();\n $sql=\"DELETE FROM usuaris WHERE id='$id'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n $conn->close();\n}", "public function remove($id) {\n $this->db->where('id_user', $id);\n $this->db->delete('user');\n }", "function delete($id){\n\t\tglobal $con;\n\t\t$query = \"delete from user where id = '$id'\";\n\t\t$res=$con->query($query);\n\t\treturn $res;\n\t}", "public function eliminar_usuario($id_usuario)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Searching if user exists in DB\n\n\t\t\t$sql_search = \"SELECT id_usuario FROM usuarios\n\t\t\t\t\t\t WHERE id_usuario = :id_usuario\";\n\n\t\t\t$resultado_search = $this->db->prepare($sql_search);\n\t\t\t$resultado_search->bindValue(\":id_usuario\", $id_usuario);\n\n\t\t\t// failed query\n\t\t\tif(!$resultado_search->execute())\n\t\t\t{\n\t\t\t\theader(\"Location:index.php?usuarios&m=1\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\n\t\t\t\t// User has been found in the DB\n\t\t\t\tif($resultado_search->rowCount() > 0)\n\t\t\t\t{\n\t\t\t\t\t// we are gonna delete the user by id\n\n\t\t\t\t\t$sql_delete = \"DELETE FROM usuarios \n\t\t\t\t\t\t\t\t WHERE id_usuario = :id_usuario\";\n\n\t\t\t\t\t$resultado_delete = $this->db->prepare($sql_delete);\n\t\t\t\t\t$resultado_delete->bindValue(\":id_usuario\", $id_usuario);\n\n\t\t\t\t\t// failed query\n\t\t\t\t\tif(!$resultado_delete->execute())\n\t\t\t\t\t{\n\t\t\t\t\t\theader(\"Location:index.php?usuarios&m=1\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif($resultado_delete->rowCount() > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// User has been deleted successfully\n\t\t\t\t\t\t\theader(\"Location:index.php?usuarios&m=3\");\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// User has not been deleted\n\t\t\t\t\t\t\theader(\"Location:index.php?usuarios&m=4\");\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 user has not been found in DB\n\t\t\t\t\theader(\"Location:index.php?usuarios&m=5\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}", "function eliminarUsuario($idUsuario){\n\t\t$this->actualizarPerfilesUsuario(array(),$idUsuario);\n\t\treturn $this->delete($idUsuario);\n\n\t\t/*$sql=\"UPDATE \".$this->tabla.\" set id_estado=2 where id_usuario=\".$idUsuario;\n\t\t$query=$this->oDBM->query($sql);\n\t\treturn $this->oDBM->affected_rows();*/\n\t}", "public function delete($id) {\n // On supprime l'utilisateur\n $this->getDb()->delete('utilisateurs', array('user_id' => $id));\n }", "function user_remove($user_id)\n{\n if (!isset($user_id) || user_level(5))\n return false;\n\n return mysql_query(\"DELETE FROM `amsn_users` WHERE `id` = '\" . (int)$user_id . \"' LIMIT 1\");\n}", "function supprimer($userID)\n{\n require('_connexionbdd.php');\n\n if ($userID != null) {\n $bdd = my_pdo_connexxionWeCon();\n $req = $bdd->prepare(\"DELETE FROM sousmembres WHERE identifiant = ?\");\n $req -> execute(array($userID));\n }\n}", "public function eliminarusuario($codigo){\r\n\t//Preparamos la conexion a la bdd:\r\n\t$pdo=Database::connect();\r\n\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t$sql=\"delete from usuario where codigo=?\";\r\n\t$consulta=$pdo->prepare($sql);\r\n//Ejecutamos la sentencia incluyendo a los parametros:\r\n\t$consulta->execute(array($codigo));\r\n\tDatabase::disconnect();\r\n}", "function removeUser($id) {\n $this->db->delete('user', array('userID' => $id));\n }", "function borrarUsuario($id){\n // en este caso se necesita que el id del usuario sea igual al que mando la url\n $where = array(\n \"id\" => $id\n );\n $this->db->where($where);\n $this->db->delete('users');\n // esto haria la sentencia: DELETE FROM users where id = $id;\n return true;\n }", "function eliminarClientes($idCliente){\n\t\t\t\t\n\t\t\t//SQL\n\t\t\t$query = \"DELETE FROM users WHERE id = $idCliente;\";\n\t\t\t$rst = $this->db->enviarQuery($query,'CUD');\n\t\t\treturn $rst;\n\t\t}", "public function deleteUser($id){\n$sql = \"DELETE FROM utilisateurs WHERE id = :id\";\n $stmt= $this->pdo->prepare($sql);\n $stmt->execute([\n 'id' => $id\n ]);\n}", "public function eliminarUsuario($id)\n\t{\n\t\t$usuario = $this->usuarioModelo->obtenerUsuarioId($id);\n\n\t\t$datos = [\n\t\t\t'id_usuario' => $usuario->int_id_usuario,\n\t\t\t'nombre' => $usuario->str_nombre,\n\t\t\t'apellido' => $usuario->str_apellido,\n\t\t\t'email' => $usuario->str_email,\n\t\t\t'telefono' => $usuario->str_telefono,\n\t\t\t'password' => $usuario->str_password\n\t\t];\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t\n\t\t\t$datos = [\n\t\t\t\t'id_usuario' => $id\n\t\t\t];\n\n\t\t\tif ($this->usuarioModelo->dar_Baja_Usuario($datos)) {\n\t\t\t\tredireccionar('/UsuarioController/listadoUsuarios');\n\t\t\t}else{\n\t\t\t\tdie('Algo Salió Mal');\n\t\t\t}\n\t\t}\n\n\t\t$this->vista('UsuarioView/deleteUsuarioForm', $datos);\n\t}", "function eliminarUsuario($id) {\n\n $conex=Conexion::getInstance();\n $sql = \"delete from usuarios where id = ?\"; //prepared statements\n $query = $conex->dbh-> prepare($sql);\n $result = $query -> execute(array($id)); //prepared statements value\n \n if($result){\n echo \"<script>alert('Eliminado')</script>\";\n }else{\n echo \"<script>alert('error al eliminar')</script>\";\n }\n \n}", "public function eliminar($conexion,$id){\r\n // PROCEDIMIENTO ALMACENADO\r\n $query=\"call eliminar_acudiente('$id')\";\r\n $consulta=mysqli_query($conexion,$query);\r\n if($consulta){\r\n $respuesta=\"Eliminado con exito\";\r\n \r\n }else{\r\n $respuesta=\"problemas al Eliminar\";\r\n }\r\n return $respuesta;\r\n }", "function eliminarpermiso()\n {\n $oconexion = new conectar();\n //se establece conexión con la base de datos\n $conexion = $oconexion->conexion();\n //consulta para eliminar el registro\n $sql = \"UPDATE permiso SET eliminado=1 WHERE id_permiso=$this->id_permiso\";\n // $sql=\"DELETE FROM estudiante WHERE id=$this->id\";\n //se ejecuta la consulta\n $result = mysqli_query($conexion, $sql);\n return $result;\n }", "public function eliminar($id)\n {\n /**\n * Establezco el nivel de acceso \n */\n// Session::acceso('admin');\n $this->_acl->acceso('eliminar_post');\n\n if (!$this->filtrarInt($id)) {\n// $this->redireccionar('option=Personal');\n }\n\n if (!$this->_paciente->getContacto($this->filtrarInt($id))) {\n// $this->redireccionar('option=Personal');\n }\n\n $resultado = $this->_paciente->eliminarOSocialPaciente('id = ' . $this->filtrarInt($id));\n\n if ($resultado > 0) {\n echo $resultado;\n exit;\n } else {\n echo 'No se pudo eliminar el registro';\n exit;\n }\n// $this->redireccionar('option=Personal');\n }", "public function remove($id){\n\n $remove = Users::find($id);\n\n if(!empty($remove)){\n\n $status = false;\n\n try {\n $remove = Users::find($id);\n $remove->delete();\n $status = true;\n } catch(\\Exception $e){\n return json_encode(['status' => 'error', 'message' => $e->getMessage()]);\n } \n\n if($status){\n return json_encode(['status' => 'success', 'message' => 'Usuário removido com sucesso!']);\n }\n }else{\n return json_encode(['status' => 'error', 'message' => 'Usuário não encontrado!']);\n }\n }", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "function hapus_user($id){\n\t\tmysql_query(\"DELETE FROM users where id ='$id'\");\n\t}", "public function delete($usuario_has_hojaruta);", "public static function Eliminar($idUsuario)\n\t\t{\n\t\t\t$bd = BD::Instancia();\n\t\t\t$consulta = \"\";\n\t\t\t$res = new Comunicacion();\n\t\n\t\t\tif($idUsuario == '')\n\t\t\t{\t\n\t\t\t\t$res->exito = false;\n\t\t\t\t$res->mensaje = t(\"Error deleting user\");\n\t\t\t\t$res->errores = t(\"User not defined\");\n\t\t\t\treturn $res;\n\t\t\t}\n\t\n\t\t\t// si se elimina un administrador hay que asegurarse de que no es el único, sino nadie más podría administrar\n\t\t\t$consulta = \"SELECT COUNT(*) FROM usuario WHERE usuario_id!= '\". $idUsuario .\"' AND usuario_rol_id = '1' \";\n\t\n\t\t\t$numFilas = $bd->ContarFilas($consulta); \n\t\t\tif ( $numFilas == 0 )\n\t\t\t{\n\t\t\t\t$res->exito = false;\n\t\t\t\t$res->mensaje = t(\"Error deleting user\");\n\t\t\t\t$res->errores = t(\"This is the only administrator account. You can't delete it\");\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\t\n\t\t\t$consulta = \"DELETE FROM usuario WHERE usuario_id='\". $idUsuario .\"'\";\n\t\t\t$bd->Ejecutar($consulta);\n\t\t\t\n\t\t\t// los registros que eran propiedad de este usuario ahora pasan a ser del administrador\n\t\t\t$bd->Ejecutar(\"UPDATE profesional SET profesional_usuario_id='1' WHERE profesional_usuario_id='\".$idUsuario.\"' \");\n\t\t\t$bd->Ejecutar(\"UPDATE documento SET documento_usuario_id='1' WHERE documento_usuario_id='\".$idUsuario.\"' \");\n\t\t\t$bd->Ejecutar(\"UPDATE obra SET obra_usuario_id='1' WHERE obra_usuario_id='\".$idUsuario.\"' \");\n\t\t\t$bd->Ejecutar(\"UPDATE bibliografia SET bibliografia_usuario_id='1' WHERE bibliografia_usuario_id='\".$idUsuario.\"' \");\n\t\t\t$bd->Ejecutar(\"UPDATE intervencion SET intervencion_usuario_id='1' WHERE intervencion_usuario_id='\".$idUsuario.\"' \");\n\t\t\t\n\t\t\t// si todo ha ido bien construimos la respuesta JSON y la devolvemos\n\t\t\tif( $bd->ObtenerErrores() == \"\" )\n\t\t\t{\t\t\t\t\n\t\t\t\t$res->exito = true;\n\t\t\t\t$res->mensaje = t(\"User deleted successfully\");\n\t\t\t\t$res->errores = \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$res->exito = false;\n\t\t\t\t$res->mensaje = t(\"Error deleting user\");\n\t\t\t\t$res->errores = $bd->ObtenerErrores();\n\t\t\t}\n\t\t\treturn $res;\n\t\t}", "function delete($id){\n\t\tglobal $conn;\n\t\t$sqlCmd = \"DELETE FROM user WHERE id=:id\";\n\t\t$stmt = $conn->prepare($sqlCmd);\n\t\t$stmt->bindParam(':id',$id);\n\t\t$stmt->execute();\n\t}", "public function actionDelete($id){\r\n\t\t$x = new Admin_User_Model_User();\r\n\t\t$x->setId($id)->delete();\r\n\t\t//$id = $this->getId();\r\n\t\t$mensajes = \r\n\t\t\tCore_App::getInstance()\r\n\t\t\t\t->loadLayoutDom()\r\n\t\t\t\t->getLayout()\r\n\t\t\t\t->getBlock('contenedor_mensajes');\r\n\t\t$eliminada = true;//deleteEnLaBase()\r\n\t\tif($eliminada){\r\n\t\t\tif($mensajes)\r\n\t\t\t\t$mensajes->addSuccessMessage(htmlentities('Usuario eliminado correctamente'));\r\n\t\t}\r\n\t\telse{\r\n\t\t\tif($mensajes)\r\n\t\t\t\t$mensajes->addErrorMessage(htmlentities(\"No se pudo eliminar usuario, error en la operación\"));\r\n\t\t}\r\n\t\treturn($eliminada);\r\n\t}", "public function eliminar() {\n\t\t\n\t\t\n\t\t$juradodni = $_GET[\"dniJurado\"];\n\t\t\n\t\t$this -> JuradoMapper -> delete($juradodni);\n\n\t\t\n\t\t$this -> view -> redirect(\"jurado\", \"listar\");\n\t\t//falta cambiar\n\t}", "static function removeUser() : string\n {\n return \"DELETE\n FROM users\n WHERE id = :id;\";\n }", "public function destroy($id){\n // Buscar usuario en la base dedatos\n $user=User::find($id);\n // Eliminar el usuario\n $user->delete();\n // Preparar el mensaje ha mostrar\n flash('Se ha eliminado '.$user->name.' exitosamente.')->success();\n // Redireccionar al listado de usuarios\n return redirect()->route('admin.user.index');\n }", "public function delete_user($user);", "public function eliminar($id) {\n $eliminarUsuario = new SqlQuery(); //creo instancia de la clase encargada de armar sentencias\n (string) $tabla = get_class($this); //adquiero el nombre de la clase para usar en la tabla\n try {\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienzo la transacción\n $this->refControladorPersistencia->ejecutarSentencia(\n $eliminarUsuario->eliminar($tabla, $id)); //Uso la funcion correspondiente de controlador pesistencia \n $this->refControladorPersistencia->get_conexion()->commit(); //ejecuto la acción para eliminar de forma lógica a los ususario\n } catch (PDOException $excepcionPDO) {//excepcion para controlar los errores\n echo \"<br>Error PDO: \" . $excepcionPDO->getTraceAsString() . '<br>';\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si hay algún error hace rollback\n }\n return [\"eliminado\"=>\"eliminado\"];\n }", "function delete_usuario($user_id)\n {\n return $this->db->delete('usuarios',array('user_id'=>$user_id));\n }", "public function destroy($usuario_id)\n {\n }", "public function deleteUser($idUser){\n $query = \"DELETE FROM final_usuario WHERE idUser=\".$idUser;\n return $this->con->action($query);\n }", "function user_remove($user_info)\n {\n }", "static public function ctrBorrarUsuario(){\n\t\tif (isset($_POST['idUsuario'])) {\n\t\t\tif ($_POST['fotoUsuario'] != \"\") {\n\t\t\t\tunlink($_POST[\"fotoUsuario\"]);\n\t\t\t\trmdir('Views/img/usuarios/'.$_POST['usuario']);\n\t\t\t}\n\t\t$answer=adminph\\User::find($_POST['idUsuario']);\n\t\t$answer->delete();\n\t\t}\n\t}", "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 eliminarUsuario() {\n $this->db->delete('usuarios', array('usuario' => $this->input->post(\"usuario\"))); \n return \"true\";\n }", "function delete($user_id) {\n $oldName = get_user_by_id($user_id['id']);\n $oldImage = 'img/demo/avatars/' . $oldName['image'];\n if(!empty($oldName['image'])) {\n if(file_exists($oldImage)) {\n unlink($oldImage);\n }\n }\n\n $db = new PDO(\"mysql:host=localhost; dbname=registration\", \"root\", \"root\");\n $sql = \"DELETE FROM users WHERE id=:id\";\n $statement = $db->prepare($sql);\n $statement->execute([\n 'id' => $user_id['id'],\n ]);\n\n}", "public function destroy($id){\n try{\n //Revisamos en la base de datos la existencia del usuario\n $user = User::find($id);\n //Validamos si existe en la base de datos el usuario\n if( !empty ( $user ) ){\n $user->delete();\n //Imprimimos mensaje flash\n Flash('¡ Se eliminó a ' . $user->username . ' de forma correcta !')->warning();\n //Redireccionamos\n return redirect()->route('users.index');\n }else{\n //Error debido a la inexistencia del usuario en la base de datos\n Flash('¡ Error al eliminar usuario, pongase en contacto con el Administrador del Sistema !')->error();\n //Redireccionamos\n return redirect()->route('users.index');\n }\n \n }catch(\\Exception $e){\n //Error al intentar eliminar usuario\n Flash('¡ Error al eliminar usuario, pongase en contacto con el Administrador del Sistema !')->error();\n //Redireccionamos\n return redirect()->route('users.index');\n }\n }", "public function supprimeruserAction($id)\n {\n\n $user = $this->getDoctrine()->getRepository('FrontBundle:user')->find($id);\n\n if ($user != null) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($user);\n $em->flush();\n $this->addFlash(\"success\", \"Utilisateur supprimé avec succès\");\n }\n return $this->redirectToRoute('listeutilisateur');\n\n }", "public static function eliminarPorID($id)\n\t{\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\n\t\t// Elimina al rol de la bd encontrado por id\n\t\t$conexion->conn->query(\"DELETE FROM \". static::$tablaConsulta . \" WHERE id = $id LIMIT 1\");\n\t}", "function eliminarUsuario($params = null)\n {\n $this->helper->checkLoggedIn();\n //compruebo permisos\n $this->helper->checkAdmin();\n $usuario_id = $params[':ID'];\n $this->model->removeUsuario($usuario_id);\n header(\"Location: \" . ADMIN);\n }", "function hapus_pengguna($id){\n\n $this->db->where('id_user', $id);\n $this->db->delete('tb_user'); \n\n \n \n\t}", "public function eliminarEmpresaAction($id){\n\t\t//Conectar con la base de datos.\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$empresa = $em->getRepository('TheClickCmsAdminBundle:Empresa')->find($id);\n\t\t$em->remove($empresa);\n\t\t$em->flush();\n\t\treturn new Response('Usuario Eliminado');\n\t}", "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 }", "function delete_tipo_usuario($id)\n {\n return $this->db->delete('tipo_usuario',array('id'=>$id));\n }", "public function destroy()\n {\n $id=$this->seguridad->verificateInt($_REQUEST['delete_id']);\n $token = $_REQUEST['token'];\n $usuario = parent::showImgUser($id);\n if($id && $token)\n {\n if($usuario->img_usuario != 'assets/uploud/profile/default.svg')\n {\n unlink($usuario->img_usuario);\n }\n parent::deleteUser($id,$token);\n }\n }", "public function RemoveUser($id)\r\n {\r\n $this->customPDO->Remove('users', 'WHERE User_Id = ' . $id);\r\n }", "function eliminar_empresa($empresa_id) {\n\t\t$this -> db -> where('empresa_id', $empresa_id);\n\t\t//La empresa owner no se puede eliminar\n\t\t$this -> db -> where('owner', 0);\n\t\t$data['activated'] = 0;\n\n\t\t//Audit field\n\t\t$data['user'] = $this->auth_frr->is_logged_in();\n\n\t\tif ($this -> db -> update('empresas', $data)) {\n\t\t\t//Eliminamos los usuarios que hayan pertenecido a esa empresa\n\t\t\t$this -> db -> where('empresa_id', $empresa_id);\n\t\t\tif ($this -> db -> update('users', $data))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t} else\n\t\t\treturn false;\n\t}", "public function delete($id)\n {\n\n\n $user = new AppUser();\n $user->setId($id);\n\n\n if ($user->delete($id)) {\n //ajoute un message qui s'affichera sur la prochaine page ! \n //pour l'affichage, voir dans header.tpl.php\n $_SESSION['alert'] = \"el usuario ha sido eliminado\";\n //on redirige vers la liste des categories\n $this->redirectToRoute(\"admin-user-list\");\n }\n }", "public function borrar($id){\n session_destroy();\n // borra todos los campos del usuario por el id recibido del controlador\n R::trash(R::load('usuarios',$id));\n // redirige ala pagina principal\n redirect(base_url());\n // recibe la variable id del controlador usuarios.php linea 221\n }", "public function remove() {\n\n // Updates DB (data & metadata)\n $this->attributes->removeAll($this->get(\"id\"));\n $this->db->delete(XCMS_Tables::TABLE_USERS, array(\n \"id\" => $this->get(\"id\")\n ));\n\n }", "function delete($id)\n\t{\n\t\tglobal $connect;\n\t\t$sql = \"DELETE FROM USER WHERE ID='\".$id.\"'\";\n\t\t$req = $connect->prepare($sql);\n\t\t$req->execute() or die(print_r($connect->erroInfo()));\n\t\theader('Location: adminShowUser.php');\n\t}", "function Elimina($id){\r\n\t\r\n\t\t$db=dbconnect();\r\n\t\r\n\t\t/*Definición del query que permitira eliminar un registro*/\r\n\t\t$sqldel=\"DELETE FROM productos WHERE id_producto=:id\";\r\n\t\r\n\t\t/*Preparación SQL*/\r\n\t\t$querydel=$db->prepare($sqldel);\r\n\t\t\t\r\n\t\t$querydel->bindParam(':id',$id);\r\n\t\t\r\n\t\t$valaux=$querydel->execute();\r\n\t\r\n\t\treturn $valaux;\r\n\t}", "static function ctrBorrarUsuario()\n\t{\n\n\t\tif(isset($_GET['idUsuario']))\n\t\t{\n\t\t\t$tabla = \"usuarios\";\n\t\t\t$datos = $_GET['idUsuario'];\n\n\t\t\t// vamos a eliminar la foto\n\t\t\t//si hay una foto entonces eliminamos \n\t\t\tif($_GET['fotoUsuario'] != \"\")\n\t\t\t{\n\t\t\t\t// unlink — Borra un fichero\n\t\t\t\t// vamos a borrar ese archivo o imagen en esa carpeta\n\t\t\t\t// unlink($_POST['fotoUsuario']);\n\t\t\t\tunlink($_GET['fotoUsuario']);\n\n\t\t\t\t//rmdir borra directorio\n\t\t\t\trmdir('vistas/img/usuarios/'.$_GET[\"usuario\"]);\n\t\t\t}\n\n\t\t\t// solicitamos una repuesta al modelo de usuario en el metodo mdlBorrarUsuario\n\t\t\t$respuesta = ModeloUsuarios::mdlBorrarUsuario($tabla,$datos);\n\n\t\t\tif($respuesta)\n\t\t\t{\n\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\ttitle: \"El usuario se elimino 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\tcloseOnConfirm: false\n\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t</script>';\n\t\t\t}\n\t\t}\n\t}", "public function eliminarAction()\n {\n $this->disableAutoRender();\n\n /* Recibo la lista de Ids separado por comas */\n $idList = $this->_getParam('id');\n\n if ($idList) {\n /* Convierto la lista a un Array */\n $idArray = explode (\",\", $idList);\n\n /* Recorro el array eliminando cada Id */\n foreach ($idArray as $id) {\n try {\n $resultado = $this->_modeloMovimiento->eliminar($id, $this->_usuario);\n \n if($resultado == 0) { /* Si no se eliminó */\n echo 'error|No está autorizado a eliminar este registro'; \n exit;\n }\n \n \n } catch(Exception $ex) {\n $message = $ex->getMessage();\n echo 'error|'.$message;\n }\n }\n }\n }", "public function eliminar()\n\t{\n\t\t// Toma el id del rol actual\n\t\t$id = $this->id;\n\n\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\n\t\t// Elimina al rol de la bd encontrado por id\n\t\tif($conexion->conn->query(\"DELETE FROM \". static::$tablaConsulta . \" WHERE id = $id LIMIT 1\")) {\n\n\t\t\t// Devolver un uno si fue un exito\n\t\t\treturn 1;\n\n\t\t} else {\n\n\t\t\t// Devolver un 0 si ocurrio un error\n\t\t\treturn 0;\n\t\t}\n\t}", "public function deleteUser($u_id){\n $sql = \"DELETE FROM `tbl_register_user` WHERE `u_id` = '$this->u_id'\";\n // echo $sql; exit;\n return $this->connect->qry($sql);\n }", "public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non pu&ograve; essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }", "public function deleteUser($userId);", "public function eliminar($id)\n {\n if (AuthHelper::obtenerUsuarixAdmin() == 2){\n\n if (!empty($_POST['pais'])) {\n $id = $_POST['pais'];\n }\n $this->modelpaises->eliminar($id);\n header(\"Location: \" . BASE_URL . 'home');\n } else {\n $this->view->mostrarError(\"Acceso denegado\");\n }\n }", "function delete_usuario($idUsuario)\n {\n return $this->db->delete('usuario',array('idUsuario'=>$idUsuario));\n }", "function eliminarRuta($id) {\n $sql = \"DELETE FROM ruta WHERE id='\" . $id . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }", "public static function eliminarUsuario($id)\n {\n $query = \"DELETE FROM users WHERE id = :id\";\n\n self::getConexion();\n\n $resultado = self::$cnx->prepare($query);\n\n $resultado->bindParam(\":id\", $id);\n\n $resultado->execute();\n\n if ($resultado->execute()) {\n return true;\n }\n\n return false;\n }", "function eliminar($id_autor){\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 = \"DELETE FROM\n\t\t\t\t\tautor\n\t\t\t\t\tWHERE(id_autor='$id_autor'\n\t\t\t\t\t\t)\n\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$conexion -> cerrar();\n\t\tif($resultado == TRUE)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function deleteUser_PrivilageById($id) {\n\t\t$SQL=\"DELETE FROM user_privilage_tab WHERE id='$id'\";\n\t\t$this->db->executeQuery($SQL);\n\n\t}", "public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }", "public function delete_userById($id)\n\t{\n\t\t$sql=\"delete from user where id=$id\";\n\t\t$result=$this->db->query($sql);\n\t\treturn $result;\n\t}" ]
[ "0.82975763", "0.82448316", "0.8014268", "0.79512155", "0.77961487", "0.77444947", "0.77340704", "0.76649714", "0.76553255", "0.7626816", "0.7625946", "0.7574667", "0.7574667", "0.7566734", "0.75603926", "0.75444955", "0.75394404", "0.75394404", "0.75394404", "0.75248384", "0.7520017", "0.750587", "0.74933976", "0.74805903", "0.74785", "0.74706095", "0.7457919", "0.74548334", "0.7436958", "0.74234027", "0.7420156", "0.7419374", "0.740585", "0.7402574", "0.7394105", "0.73734283", "0.7365355", "0.7359042", "0.73588985", "0.73522556", "0.7351688", "0.73432714", "0.7322069", "0.73081887", "0.7305686", "0.729797", "0.7292561", "0.726897", "0.7247904", "0.72476083", "0.72453123", "0.7245126", "0.7237351", "0.7233322", "0.72130746", "0.72099364", "0.7209041", "0.7206699", "0.72049326", "0.71971864", "0.718276", "0.71818334", "0.71810806", "0.71793014", "0.7178506", "0.7177105", "0.71738464", "0.71671176", "0.71646786", "0.71610385", "0.7160425", "0.7151074", "0.7145971", "0.71289927", "0.71250004", "0.712485", "0.7124306", "0.71207523", "0.71079516", "0.7104517", "0.7103326", "0.70928335", "0.7089992", "0.70833665", "0.7080536", "0.7076789", "0.70743364", "0.70733166", "0.707007", "0.7066722", "0.7065864", "0.7061085", "0.7054984", "0.7053222", "0.70506597", "0.7042298", "0.70351934", "0.70335287", "0.7032121", "0.70294493", "0.7028578" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('type_identifications')->delete(); $type = array( array('enable' => '1', 'icon' => 'fas fa-search-location', 'iso' => 'CC', 'name_es' => 'Cédula', 'name_en' => 'Identification card', 'name_pt' => 'Horário', 'color' => '#34F56B', 'created_at' => '2019-01-01 12:00:00', 'updated_at' => '2019-01-01 12:00:00'), array('enable' => '1', 'icon' => 'fas fa-search-location', 'iso' => 'CE', 'name_es' => 'Cédula Extranjeria', 'name_en' => 'Foreign Identification Card', 'name_pt' => 'Cartão de Identificação Estrangeira', 'color' => '#34F56B', 'created_at' => '2019-01-01 12:00:00', 'updated_at' => '2019-01-01 12:00:00'), array('enable' => '1', 'icon' => 'fas fa-search-location', 'iso' => 'PPN', 'name_es' => 'Pasaporte', 'name_en' => 'Passport', 'name_pt' => 'Passaporte', 'color' => '#34F56B', 'created_at' => '2019-01-01 12:00:00', 'updated_at' => '2019-01-01 12:00:00'), array('enable' => '1', 'icon' => 'fas fa-search-location', 'iso' => 'NIT', 'name_es' => 'Número de Identificación Tributaria', 'name_en' => 'Tax identification number', 'name_pt' => 'Número de identificação Tributária', 'color' => '#34F56B', 'created_at' => '2019-01-01 12:00:00', 'updated_at' => '2019-01-01 12:00:00'), ); DB::table('type_identifications')->insert($type); }
{ "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
Define the model's default state.
public function definition() { return [ 'name' => $this->faker->name(), 'email' => $this->faker->unique()->safeEmail(), 'email_verified_at' => now(), 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 'remember_token' => Str::random(10), 'cpf_cnpj' => $this->generateCpfOrCnpj(), 'user_type' => $this->generateUserType() ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDefaultState()\r\n\t{\r\n\t}", "static function get_default_state();", "public function getDefaultUserState();", "private function setDefaultStates(): void\n {\n foreach ($this->arr_attributes as $strParamName) {\n $this->states[$strParamName] = $this->params->get($strParamName, 0);\n }\n }", "abstract protected function getDefaultModel();", "public function applyDefaultValues()\n {\n $this->is_active = false;\n $this->is_closed = false;\n }", "protected function getDefaultModelObject() : void\n {\n return;\n }", "public function applyDefaultValues()\n {\n $this->active = false;\n }", "protected function makeDefault()\n {\n $this->options = [];\n $this->menuSource = MenuSource::STATIC_SOURCE;\n $this->action = new Action(ActionType::MENU(), 'Default menu name', 'Default menu text');\n }", "public function set()\n {\n\t\tif ($this->model->state())\n $this->model->set();\n }", "public function __default()\n\t{\n\n\t}", "protected function initial_set_default() {\n\t\tif ( isset( $this->field[ 'config' ][ 'default' ] ) ) {\n\t\t\t$this->default = $this->field[ 'config' ][ 'default' ];\n\t\t} else {\n\t\t\t$this->default = '';\n\t\t}\n\t}", "public function applyDefaultValues()\n\t{\n\t\t$this->type = 1;\n\t\t$this->total_index = 0;\n\t\t$this->is_published = true;\n\t\t$this->is_featured = false;\n\t\t$this->comments_count = 0;\n\t}", "public function setModelDefaults() \n {\n if (!empty($this->model->defaultFieldValues())) {\n \n foreach($this->model->defaultFieldValues() as $field => $defaultValue) {\n\n $this->model->$field = $defaultValue;\n }\n } \n }", "function getDefaultState(){\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('is_default'=>true));\r\n\t\t$recordSet = $this->db->get(TBL_MST_STATES);\r\n\t\t$data=$recordSet->result() ;\r\n\t\treturn $data[0]->id;\r\n\t}", "public function setValueDefault()\n {\n $this->isActive = true;\n $this->createdAt = new \\DateTime();\n }", "public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }", "public function getDefaultStateName() {\n return $this->values->get('DefaultStateName');\n }", "public function default() {\n \n $this->data = ModuleConfig::settings();\n // [Module_Data]\n }", "public static function bootStateMachine()\n {\n static::creating(function ($model) {\n $fieldState = $model->getFieldState();\n if (empty($model->$fieldState)) {\n $model->$fieldState = $model->getInitialState();\n }\n $model->beforeTransition($model->fromTransition, $model->toTransition);\n $model->setStateChangeAt();\n });\n static::created(function ($model) {\n $model->afterTransition($model->fromTransition, $model->toTransition);\n });\n static::saving(function ($model) {\n $model->beforeTransition($model->fromTransition, $model->toTransition);\n $model->setStateChangeAt();\n });\n static::saved(function ($model) {\n $model->afterTransition($model->fromTransition, $model->toTransition);\n });\n }", "public function getInitialState(): StateContract\n {\n return $this->newState(['value' => 1]);\n }", "function _setModelState()\r\n {\r\n $state = parent::_setModelState(); \r\n $app = JFactory::getApplication();\r\n $model = $this->getModel( $this->get('suffix') );\r\n $ns = $this->getNamespace();\r\n\r\n $state['filter_id_from'] = $app->getUserStateFromRequest($ns.'id_from', 'filter_id_from', '', '');\r\n $state['filter_id_to'] = $app->getUserStateFromRequest($ns.'id_to', 'filter_id_to', '', '');\r\n $state['filter_name'] = $app->getUserStateFromRequest($ns.'name', 'filter_name', '', '');\r\n $state['filter_enabled'] = $app->getUserStateFromRequest($ns.'enabled', 'filter_enabled', '', '');\r\n $state['filter_taxclass'] = $app->getUserStateFromRequest($ns.'taxclass', 'filter_taxclass', '', '');\r\n $state['filter_shippingtype'] = $app->getUserStateFromRequest($ns.'shippingtype', 'filter_shippingtype', '', '');\r\n \r\n foreach (@$state as $key=>$value)\r\n {\r\n $model->setState( $key, $value ); \r\n }\r\n return $state;\r\n }", "public function state();", "public function setUserDefaultStatus($userDefaultStatus);", "public function setStateModel($stateModel) {}", "public function getBaseState() {}", "public function init()\r\n {\r\n $this->_helper->db->setDefaultModelName('DefaultMetadataValue');\r\n }", "public function set_to_default()\n\t{\n\t\t// SimpleDB requires a value for every attribue...\n\t\t$this->_name = NULL;\n\t\t$this->_contextid = NULL;\n\t\t$this->_userid = NULL;\n $this->_deleted = 0;\n\t\t$this->_lastmodified = 0;\t\n\t}", "public function create_default() {\n if (!$this->model->has_default()) {\n $default_data = [\n 'id' => 1,\n 'name' => 'Beregu',\n 'desc' => 'team vs team',\n ];\n $this->model->create_default($default_data);\n\n $default_data = [\n 'id' => 2,\n 'name' => 'Individu',\n 'desc' => 'individu vs individu',\n ];\n $this->model->create_default($default_data);\n }\n }", "public function __construct(State $model)\n\t{\n\t\t$this->model = $model;\n\t}", "public function getStateModel() {}", "public function set_default_data() {\n\t\t$this->button_text_color = '#FFFFFF';\n\t\t$this->button_background_color = '#6699CC';\n\n\t\t$this->header_text_color = '#FFFFFF';\n\t\t$this->header_background_color = '#6699CC';\n\n\t\t$this->button_text = 'Do Not Sell My Data';\n\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\n\t\t$this->ot_logo = '';\n\t\t$this->display_position = 'right';\n\t\t$this->floating_button\t= '';\n\t\t$this->isLinkEnabled \t= 'textlink';\n\t}", "public function applyDefaultValues()\n\t{\n\t\t$this->points = '0';\n\t\t$this->type = 0;\n\t\t$this->hidden = 0;\n\t\t$this->relationship_status = 0;\n\t\t$this->show_email = 1;\n\t\t$this->show_gender = 1;\n\t\t$this->show_hometown = 1;\n\t\t$this->show_home_phone = 1;\n\t\t$this->show_mobile_phone = 1;\n\t\t$this->show_birthdate = 1;\n\t\t$this->show_address = 1;\n\t\t$this->show_relationship_status = 1;\n\t\t$this->credit = 0;\n\t\t$this->login = 0;\n\t}", "public function initializeDefaults()\n {\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->ativo = true;\n\t\t$this->tipo_acesso = 'M';\n\t\t$this->estado_civil = 'O';\n\t\t$this->nivel_acesso = '1';\n\t\t$this->usuario_validado = false;\n\t}", "public function setDefaultAttribute($value){\n $this->attributes['default'] = ($value === 'true' || $value ? true : false);\n}", "private function _set_default()\r\n\t{\r\n\t\tif($this->input->post('default'))\r\n\t\t{\r\n\t\t\t$this->db->update('showcases',array('default' => 0));\r\n\t\t\t$this->db->where('id', $this->input->post('default'));\r\n\t\t\t$this->db->update('showcases',array('default' => 1));\r\n\t\t\t\r\n\t\t\t$this->set_message('success', 'Vetrina predefinita aggiornata con successo!');\r\n\t\t\tredirect($this->list);\r\n\t\t}\r\n\t}", "public function __default()\r\n \t{\r\n \t if( self::isArg( 'notifwindow') )\r\n \t {\r\n $this->view = \"common_notifwindow\";\r\n \t $this->viewArgs['table'] = self::getArg( \"table\", AT_posint, true );\r\n \t }\r\n \t else\r\n \t {\r\n $this->view = \"dummygame_dummygame\";\r\n self::trace( \"Complete reinitialization of board game\" );\r\n }\r\n \t}", "public function applyDefaultValues()\n {\n $this->is_not = false;\n $this->rank = 0;\n }", "private function _load_default_model(){\n\n\t\t$default_model_name = strtolower(get_class($this)) . '_model';\n\n\t\tif(file_exists(APPPATH . 'models/' . $default_model_name . '.php')){\n\n\t\t\t$this->load->model($default_model_name, strtolower(get_class($this)));\n\t\t\t$this->_default_model = strtolower(get_class($this));\n\t\t}\n\n\t}", "public function model()\n {\n return State::class;\n }", "public function model()\n {\n return State::class;\n }", "public function getDefault();", "public function setDefaultValues()\n\t{\t\t\n\t\t\t \n\t}", "protected function initialiseModel()\n {\n parent::initialiseModel();\n\n $this->SelectedTab = 0;\n }", "final protected function _defaults(){\n if(! $this->_defaults) return;\n foreach($this->_defaults as $conf => $default_value){\n if(! self::inform($conf)) self::define($conf, $default_value);\n }\n }", "public function useDefaults()\n\t{\n\t\t$this->use_defaults = true;\n\t}", "public function set_behaviors_default_data() {\n\n\t\t$this->is_google_personalize_enabled = 'checked';\n\t\t$this->google_confirmation_title = 'Personalized advertisements';\n\t\t$this->google_confirmation_message = 'Turning this off will opt you out of personalized advertisements delivered from Google on this website.';\n\t\t$this->confirmbutton = 'Confirm';\n\t\t$this->is_email_enabled = 'checked';\n\t\t$this->email_address = '';\n\t\t$this->popup_main_title = 'Do Not Sell My Personal Information';\n\t\t$this->link_text = 'Privacy Policy';\n\t\t$this->link_url = '';\n\t\t$this->privacy_policy_message = 'Exercise your consumer rights by contacting us below';\n\t\t$this->is_phone_enabled = 'checked';\n\t\t$this->phone_number = '';\n\t\t$this->form_link_text = 'Exercise Your Rights';\n\t\t$this->form_link_url = '';\n\t\t$this->form_enable = 'checked';\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\t\t$this->selectuseroption\t\t\t\t = 'All';\n\t\t$this->isIABEnabled \t\t\t\t = 'checked';\n\t\t$this->isLSPAenable \t\t\t\t = '';\n\t}", "public function makeDefault() {\n $this->update([\n 'color' => null,\n 'size' => null\n ]);\n }", "public function applyDefaultData()\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $config = $objectManager->get('\\Magento\\Framework\\App\\Config\\ScopeConfigInterface');\n\n $this->setsup_is_active(1);\n $this->setsup_locale($config->getValue('general/locale/code'));\n $this->setsup_currency($config->getValue('currency/options/base'));\n $this->setsup_country($config->getValue('general/country/default'));\n\n return $this;\n }", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n\t}", "public function setDefaultStateName($stateName) {\n $this->values->put('DefaultStateName', $stateName);\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "function init() {\n $this->options['selected'] = isset($this->options['value']) ?\n true : @(bool)$this->options['default'];\n }", "public function applyDefaultValues()\n {\n $this->jml_lantai = '1';\n $this->asal_data = '1';\n $this->last_sync = '1901-01-01 00:00:00';\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function init() {\n\t\t// use this method to initialize default values.\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "protected function cliModelInit()\n {\n }", "function getDefaultValue() \n {\n return $this->getValueByFieldName( 'statevar_default' );\n }", "public function __default()\r\n {\r\n if( self::isArg( 'notifwindow') ) {\r\n $this->view = \"common_notifwindow\";\r\n $this->viewArgs['table'] = self::getArg( \"table\", AT_posint, true );\r\n } else {\r\n $this->view = \"thecrew_thecrew\";\r\n self::trace( \"Complete reinitialization of board game\" );\r\n }\r\n }", "public function toggleDefault()\n {\n $this->language->default = ! $this->language->default;\n }", "public static function set_default_values() {\n\t\t?>\n\t\tcase \"nu_phone\" :\n\t\t\tfield.label = \"Phone\";\n\t\t\tfield.isRequired = true;\n\t\t\tfield.description = \"Numbers only. e.g. 8885551212\";\n\t\t\tbreak;\n\t\t<?php\n\t}", "function post_model_init($from_cache = FALSE)\n {\n }", "public static function preModel(){\n\t\t\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "protected function get_default() {\n\t\treturn false;\n\t}", "protected function setDefaultTemplate(): void\n {\n $this->setDefaultData(function(Generator $faker) {\n return [\n 'password' => 'xx',\n 'username' => $faker->email,\n 'modified' => time(),\n // set the model's default values\n // For example:\n // 'name' => $faker->lastName\n ];\n });\n }", "public function __default()\r\n {\r\n if (self::isArg('notifwindow')) {\r\n $this->view = \"common_notifwindow\";\r\n $this->viewArgs['table'] = self::getArg(\"table\", AT_posint, true);\r\n } else {\r\n $this->view = \"lettertycoon_lettertycoon\";\r\n self::trace(\"Complete reinitialization of board game\");\r\n }\r\n }", "function setDefault($value)\n {\n $this->_defValue = $value;\n }", "protected function setDefaults()\n {\n return;\n }", "public function getStatesModel()\n\t{\n\t\treturn $this->statesModel = new StatesModel();\n\t}", "public function defaultData();", "public function getDefaultValue();", "public function getDefaultValue();", "public function applyDefaultValues()\n\t{\n\t\t$this->closed = 0;\n\t\t$this->lastfmid = 0;\n\t\t$this->hasphotos = 0;\n\t}", "public function applyDefaultValues()\n\t{\n\t\t$this->platform = 'pc';\n\t\t$this->experience_score = 0;\n\t\t$this->up_votes = 0;\n\t\t$this->down_votes = 0;\n\t\t$this->is_guest = 0;\n\t\t$this->is_admin = 0;\n\t\t$this->today_votes = 0;\n\t\t$this->email_on = 1;\n\t}", "private function getStateDefaultStatus($state)\n {\n\t\tif(\\Cart2Quote\\License\\Model\\License::getInstance()->isValid()) {\n\t\t\t$status = false;\n $stateNode = $this->_getState($state);\n if ($stateNode) {\n $status = $this->quoteStatusFactory->create()->loadDefaultByState($state);\n $status = $status->getStatus();\n }\n return $status;\n\t\t}\n\t}" ]
[ "0.7777968", "0.7227369", "0.6859444", "0.6794495", "0.6766826", "0.6432679", "0.6407766", "0.63705724", "0.618799", "0.61857885", "0.6159356", "0.61544454", "0.6152191", "0.6142335", "0.6118183", "0.61073357", "0.6104514", "0.60409725", "0.603845", "0.60202765", "0.5987768", "0.59867936", "0.5977734", "0.5966543", "0.59482", "0.5903093", "0.5881663", "0.5878075", "0.58718926", "0.584973", "0.58419377", "0.58406657", "0.5832023", "0.58249885", "0.5823338", "0.58060426", "0.580562", "0.58031726", "0.58028543", "0.57669836", "0.57437235", "0.57437235", "0.57434803", "0.5727684", "0.5711686", "0.5691569", "0.5673103", "0.56685823", "0.56637836", "0.56601995", "0.5660191", "0.5650848", "0.56367344", "0.56367344", "0.56367344", "0.56367344", "0.56367344", "0.56367344", "0.56367344", "0.56367344", "0.56367344", "0.56344336", "0.5634264", "0.5625433", "0.5625433", "0.5625433", "0.5625433", "0.5625433", "0.5618295", "0.5616011", "0.5616011", "0.5616011", "0.5598112", "0.5597064", "0.55887794", "0.55717903", "0.55700463", "0.55634606", "0.5554245", "0.5544438", "0.5544438", "0.5544438", "0.5544438", "0.5544438", "0.5544438", "0.5544438", "0.5544438", "0.5544438", "0.5544438", "0.55315626", "0.552863", "0.55277765", "0.5527703", "0.55124813", "0.5510168", "0.5510142", "0.5509545", "0.5509545", "0.5506462", "0.5504579", "0.5487522" ]
0.0
-1
Indicate that the model's email address should be unverified.
public function unverified() { return $this->state(function (array $attributes) { return [ 'email_verified_at' => null, ]; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function notVerified()\n {\n return $this->state([\n 'email_verified_at' => NULL,\n ]);\n }", "public function unverified()\n {\n return $this->state(function (array $attributes) {\n return [\n 'email_verified_at' => (rand(0, 10) > 2),\n ];\n });\n }", "protected function usersEmailNotVerified()\n\t{\n\t\tif ( !$this->user->email_verified ) {\n\t\t\t$this->setError('Users email not verified.', 403);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function emailNotVerified($request)\n {\n $user = User::where('email', $request->get('email'))->first();\n if ($user->verified === 0) {\n return true;\n } else {\n return false;\n }\n }", "public function isUnverified()\n {\n return !$this->isVerified();\n }", "public function verifyEmail()\n {\n $this->verified = true;\n\n $this->save();\n\n $this->activationToken->delete();\n }", "public function unverify()\n {\n $this->unsetVerifiedFlag()->save();\n\n // :TODO: Fire an event here\n }", "function unverify_person() {\n $person=person();\n $fname=$this->params['field_name'].'_verified';\n $person->$fname=FALSE;\n return true;\n }", "public function markEmailAsVerified();", "public function verified()\n {\n $this->verified = 1;\n $this->email_token = null;\n $this->save();\n }", "public function verified()\n {\n $this->verified = 1;\n $this->email_token = null;\n $this->save();\n }", "public function user_doesnt_receive_email_when_not_registered()\n {\n Notification::fake();\n\n $this\n ->from($this->passwordRequestRoute())\n ->post($this->passwordEmailRoute(), [\n 'email' => '[email protected]',\n ])\n ->assertRedirect($this->passwordRequestRoute())\n ->assertSessionHasErrors('email');\n\n Notification::assertNotSentTo(\n User::factory()->make([\n 'email' => '[email protected]',\n ]),\n UserForgotPasswordNotification::class\n );\n }", "public function testEmailNotAvailable()\n {\n $user = factory(User::class)->create();\n $this->assertFalse(User::isEmailAvailable($user->email));\n }", "public function setUnverifiedEmail (string $email_address): ?array {\n\t\treturn $this->update(['unverified_email' => $email_address]);\n\t}", "public function cancelEmail()\n {\n $this->emailUpdate = false;\n $this->email = $this->customer->email;\n }", "public function testVerification()\n {\n Notification::fake();\n\n $this->user->email_verified_at = null;\n\n $this->user->save();\n\n $this->user->notify(new VerifyEmail);\n\n // $request = $this->post('/email/resend');\n //\n // $request->assertSuccessful();\n\n Notification::assertTimesSent(1, VerifyEmail::class);\n\n Notification::assertSentTo($this->user,VerifyEmail::class);\n }", "public function testEmailIsNotValidatedByDefault()\n {\n $this->expectNotToPerformAssertions();\n\n new FirstLastNameUser('Edwin', 'van der Sar', 'not valid email address');\n }", "function is_verified()\n {\n return false;\n }", "public function isEmailVerified()\n {\n return $this->is_verified === \"Y\";\n }", "public function hasVerifiedEmail();", "public function verify()\n {\n $this->update(['email_verified_at' => Carbon::now()]);\n }", "public function confirmEmail()\n {\n $this->email_confirmation_token = null;\n $this->is_email_verified = 1;\n return $this->save();\n }", "public function validEmailInvalidDataProvider() {}", "public function isEmailDisabled()\n {\n return !Mage::getStoreConfigFlag('markdown/markdown/enable_email');\n }", "public function isEmailVerification()\n {\n if (strtolower($this->CI->preferences->type('system')->item('users_emailVerification')) == 'optional') {\n return true;\n } else {\n if ($this->isEmailVerified()) {\n return true;\n } else {\n return false;\n }\n }\n }", "public function isEmailVerified()\n {\n if ($this->getUserData()->userEmailVerification) {\n return true;\n } else {\n return false;\n }\n }", "public function testLoginEmailNotVerified(): void { }", "function verify_email()\n\t{\n\t\tlog_message('debug', 'Account/verify_email');\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['msg'] = get_session_msg($this);\n\t\tlog_message('debug', 'Account/verify_email:: [1] post='.json_encode($_POST));\n\t\t# skip this step if the user has already verified their email address\n\t\tif($this->native_session->get('__email_verified') && $this->native_session->get('__email_verified') == 'Y'){\n\t\t\tredirect(base_url().'account/login');\n\t\t}\n\n\t\t# otherwise continue here\n\t\tif(!empty($_POST['emailaddress'])){\n\t\t\t$response = $this->_api->post('account/resend_link', array(\n\t\t\t\t'emailAddress'=>$this->native_session->get('__email_address'),\n\t\t\t\t'baseLink'=>base_url()\n\t\t\t));\n\n\t\t\t$data['msg'] = (!empty($response['result']) && $response['result']=='SUCCESS')?'The verification link has been resent':'ERROR: The verification link could not be resent';\n\t\t}\n\n\t\t$data = load_page_labels('sign_up',$data);\n\t\t$this->load->view('account/verify_email', $data);\n\t}", "public function isEmailVerified()\n {\n return (bool) $this->email_verified_at;\n }", "private static function canRemoveEmail() {\n\t\treturn\n\t\t\tRights::hasRight(Right::getByName('Premanager', 'registerWithoutEmail'));\n\t}", "public function validateEmailConfirmedUnique()\n\t{ \n\t\tif ( $this->email )\n\t\t{\n\t\t\t$exists = User::findOne([\n\t\t\t\t'email' => $this->email,\n\t\t\t]);\n\n\t\t\tif ( $exists )\n\t\t\t{\n\t\t\t\t$this->addError('email', 'This E-mail has already been taken.');\n\t\t\t}\n\t\t}\n\t}", "public function filterValidEmailsProvider() {}", "public function confirmEmail()\n {\n $this->mail_confirmed = Carbon::now();\n $this->mail_token = null;\n $this->save();\n }", "public function requestVerificationEmail()\n {\n if (!$this->request->is('post')) {\n $this->_respondWithMethodNotAllowed();\n return;\n }\n\n $user = $this->Guardian->user();\n if (!$user->verified) {\n $this->Users->Tokens->expireTokens($user->id, TokensTable::TYPE_VERIFY_EMAIL);\n $token = $this->Users->Tokens->create($user, TokensTable::TYPE_VERIFY_EMAIL, 'P2D');\n try {\n $this->getMailer('User')->send('verify', [$user, $token->token]);\n $this->set('message', __('Please check your inbox.'));\n } catch (\\Exception $e) {\n $this->_respondWithBadRequest();\n $this->set('message', 'Mailer not configured.');\n }\n } else {\n $this->set('message', __('Your email address is already verified.'));\n }\n\n $this->set('_serialize', ['message']);\n }", "public function verifyEmail()\n {\n return $this->getBoolean('verify_email');\n }", "public function validateUserEmail()\n {\n if (!$this->hasErrors() && !$this->getUser()) {\n $this->addError('id', Yii::t('skeleton', 'Your email was not found.'));\n }\n }", "public function testEmailVerificationTokenNotGiven(): void {\n\t\t$user = $this->createUser();\n\t\t$newEmail = '[email protected]';\n\t\t$response = $this->withHeaders([\n\t\t\t'Accept' => 'application/json',\n\t\t\t'Content-Type' => 'application/json',\n\t\t])->getJson($this->route.'/email/verify/');\n\t\t$response->assertStatus(HttpStatus::STATUS_NOT_FOUND);\n\t\t$this->assertDatabaseMissing('users',[\n\t\t\t'id' => $user->id,\n\t\t\t'email' => $newEmail\n\t\t]);\n\t}", "public function sendEmailVerificationNotification()\n {\n if (!allowSendEmail()) {\n $this->markEmailAsVerified();\n return;\n }\n\n $this->notify(new VerifyEmailNotification);\n }", "public function testEmailVerificationUserNotFound(): void {\n\t\t$user = $this->createUser();\n\t\t$newEmail = '[email protected]';\n\t\t$token = $this->createToken($user->id, $newEmail);\n\t\t$user->delete();\n\t\t$response = $this->withHeaders([\n\t\t\t'Accept' => 'application/json',\n\t\t\t'Content-Type' => 'application/json',\n\t\t])->getJson($this->route.'/email/verify/'.$token->token);\n\t\t$response->assertStatus(HttpStatus::STATUS_UNAUTHORIZED);\n\t\t$response->assertJson([\n\t\t\t'error' => 'This e-mail verification token is invalid.'\n\t\t]);\n\t\t$this->assertDatabaseMissing('users', [\n\t\t\t'id' => $user->id,\n\t\t\t'email' => $newEmail\n\t\t]);\n\t}", "public function resetOriginalEmail() : void;", "public function setVerified()\n {\n $this->update([\n 'verified' => true,\n ]);\n }", "private function ignoreAddressValidation()\n {\n $this->_quote->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->_quote->getIsVirtual()) {\n $this->_quote->getShippingAddress()->setShouldIgnoreValidation(true);\n if (!$this->_config->getValue('requireBillingAddress')\n && !$this->_quote->getBillingAddress()->getEmail()\n ) {\n $this->_quote->getBillingAddress()->setSameAsBilling(1);\n }\n }\n }", "public function isEmailVerified() : bool\n {\n return true && $this->email_verified_at;\n }", "public function getIsVerifiedAttribute(): bool\n {\n $entity = $this->email_verification()->first();\n\n if (is_null($entity) || is_null($entity->is_verified)) {\n return false;\n }\n\n return true;\n }", "public function isVerified()\n {\n return !is_null($this->verified_at);\n }", "public function verifyEmailAction()\n {\n $userId = $this->params()->fromRoute('userId', null);\n $token = $this->params()->fromRoute('token', null);\n\n if ($userId === null || $token === null) {\n return $this->notFoundAction();\n }\n\n $user = $this->getUserMapper()->findById($userId);\n\n if (!$user) {\n return $this->notFoundAction();\n }\n\n if ($this->userRegistrationService->verifyEmail($user, $token)) {\n // email verified\n return $this->redirectToPostVerificationRoute();\n }\n\n // email not verified, probably invalid token\n $vm = new ViewModel();\n $vm->setTemplate('ht-user-registration/user-registration/verify-email-error.phtml');\n\n return $vm;\n\n }", "public function verifyAction()\n {\n $email = Request::post('email', Filter::FILTER_EMAIL, false);\n\n if (!$email || !Validator_Email::validate($email)) {\n Response::jsonError($this->moduleLang->get('email_invalid'));\n }\n\n $model = Model::factory('User');\n\n $userIds = $model->getList(\n ['limit' => 1],\n [\n 'email' => $email,\n 'enabled'=> true\n ],\n ['id']\n );\n\n if (count($userIds) == 0) {\n Response::jsonError($this->moduleLang->get('email_user_unknown'));\n }\n\n $userId = $userIds[0]['id'];\n\n $user = Db_Object::factory('User', $userId);\n $authCode = Utils::hash(uniqid(time(),true));\n\n $confDate = new DateTime('now');\n $confDate = $confDate->add(new DateInterval('P1D'))->format('Y-m-d H:i:s');\n\n try{\n $user->setValues(array(\n 'confirmation_code' => $authCode,\n 'confirmation_expiried' => $confDate\n ));\n if(!$user->save())\n throw new Exception('Cannot update user info');\n }catch (Exception $e){\n Response::jsonError($this->_lang->get('CANT_EXEC'));\n }\n\n $this->sendEmail($user);\n\n Response::jsonSuccess(array(\n 'msg' => $this->moduleLang->get('pwd_success')\n ));\n }", "public function emailNotUsed($email) {\n\t\t$this->db->query(\"SELECT email FROM users WHERE email = :email\");\n\n\t\t// Bind values\n\t\t$this->db->bind(':email', $email);\n\t\t\n\t\t// Assign\n\t\t$thisUser = $this->db->single();\n\t\t\n\t\tif(!$thisUser) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getEmail_always_returnCorrectly()\n {\n $this->assertEquals($this->user['email'], $this->entity->getEmail());\n }", "public function testReturnsFalseWhenEmailIsInvalid()\n {\n $validator = new ContactValidator();\n $this->assertFalse($validator->validateEmail('testnowhere.com'));\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new AffiliateVerifyEmail);\n }", "public function validEmailValidDataProvider() {}", "public function destinatary_email_verification_is_good()\n {\n //Se usa para fngir envío de correo\n Mail::fake();\n $this->withoutMiddleware();\n\n //1. Given -> Teniendo un usuario\n $user = factory(User::class)->create();\n $petition = factory(Petition::class)->create([\n 'ID_user' => $user->ID,\n ]);\n\n //2. When -> Se envía un correo a dicho usuario\n Mail::to($user)->send(new UserCreatedEmail($user,$petition));\n\n //3. Then -> Entonces el coreo destinatario es el mismo que el ingresado por el usuario\n Mail::assertSent(UserCreatedEmail::class, function ($mail) use ($user,$petition) {\n return $mail->to[0]['address'] === $user['email'];\n });\n }", "static function confirm_account_email() {\n $model = \\Auth::$model;\n $user = $model::requested();\n\n if (!$user->nil()) {\n if ($user->validate()) {\n $code = confirm_account_email($user->email);\n\n if ($code === -1) {\n flash('Sua conta já está confirmada, basta acessá-la.', 'warning');\n } else if ($code == true)\n flash(\"Enviamos um e-mail para <small><b>$user->email</b></small> com as instruções para você confirmar sua conta.\");\n else\n flash('Não foi possível lhe enviar o e-mail. Por favor, tente novamente mais tarde.', 'error');\n\n go('/');\n } else {\n flash('Verifique os dados do formulário.', 'error');\n }\n }\n\n globals('user', $user);\n }", "public function enableEmailNoRecordExists()\n {\n // Get user mapper\n $userMapper = $this->getUserMapper();\n \n // Check if user mapper is empty\n if (empty($userMapper)) {\n // Throw an exception\n throw new \\RuntimeException(\"User mapper is required, none given.\");\n }\n \n // Attact validator\n return $this->attactEmailValidator('User\\Validator\\NoRecordExists', array(\n 'field' => 'email',\n 'mapper' => $userMapper,\n ));\n }", "public function checkEmailVerification(Request $request)\n { \n \n try {\n $user = User::where('id', auth()->user()->id)->first();\n \n if(!is_null($user->email_verified_at)) {\n return response()->json(['message' => 'Email is verified']);\n } else {\n throw new Exception('User email is not verified. Please verify your email or resend verification link from your profile page');\n } \n \n } catch (Exception $e) {\n return response()->json([\n 'errors' => $e->getMessage()\n ], Response::HTTP_UNPROCESSABLE_ENTITY);\n } \n\n }", "public function sendEmail()\n {\n $user = User::findOne([\n 'store_id' => Yii::$app->storeSystem->getId(),\n 'email' => $this->email,\n 'status' => User::STATUS_INACTIVE\n ]);\n\n if ($user === null) {\n return false;\n }\n\n $content = CommonHelper::render(Yii::getAlias('@common/mail/emailVerify-html.php'), [\n 'user' => $user,\n ], $this, Yii::getAlias('@common/mail/layouts/html.php'));\n\n Yii::$app->mailSystem->send($this->email, Yii::t('app', 'Resend verification email'), $content);\n return true;\n }", "public function testUnverifiedUser()\n {\n $user = User::factory()->create(['verified' => false]);\n\n $working_routes = ['verification'];\n $skipped_routes = [\n 'privacy_policy', 'img/{filename}', 'test_mails/{mail}/{send?}',\n // TODO: test these routes separately\n 'network/admin/checkout/transaction/delete/{transaction}',\n 'economic_committee/transaction/delete/{transaction}',\n 'communication_committee/epistola/edit/{epistola}',\n 'communication_committee/epistola/restore/{epistola}',\n 'communication_committee/epistola/mark_as_sent/{epistola}',\n 'communication_committee/epistola/delete/{epistola}',\n 'routers/{ip}',\n 'routers/{ip}/edit',\n 'routers/{ip}/delete',\n\n //livewire routes, do not need testing\n 'livewire/message/{name}',\n 'livewire/upload-file',\n 'livewire/preview-file/{filename}',\n 'livewire/livewire.js',\n 'livewire/livewire.js.map'\n\n ];\n //$forbidden_routes = array_merge($this->protected_localization_routes);\n $routeCollection = Route::getRoutes();\n foreach ($routeCollection as $route) {\n $response = $this->getResponse($user, $route);\n\n if (in_array($route->uri(), $working_routes)) {\n $response->assertStatus(200);\n } elseif (in_array($route->uri(), $skipped_routes)) {\n // Skipping these...\n } else {\n $this->assertTrue(in_array($response->status(), [302, 403]), \"Got \" . $response->status() . \" for \" . $route->uri());\n }\n }\n }", "protected function validateUserEmail($userInfo) {\n $config = \\Drupal::service('config.factory')->get('auth0.settings');\n $requires_email = $config->get('auth0_requires_verified_email');\n\n if ($requires_email) {\n if (!isset($userInfo['email']) || empty($userInfo['email'])) {\n throw new EmailNotSetException();\n }\n if (!$userInfo['email_verified']) {\n throw new EmailNotVerifiedException();\n }\n }\n }", "public function testRequireEmail()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }", "public function verify()\n {\n $this->verified = true;\n\n $this->save();\n\n $this->verifyUser()->delete();\n }", "public function resetPassword(){\n\t\t$sql = \"UPDATE user SET verified=0 WHERE email = :email LIMIT 1\";\n\t\t\n\t\ttry{\n\t\t\t$stmt = $this->$this->_db->prepare($sql);\n\t\t\t$stmt->bindParam(\":email\", $_POST['email'], PDO::PARAM_STR);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->closeCursor();\n\t\t}catch(PDOException $e){\n\t\t\treturn $e->getMessage();\n\t\t}\n\t\t\n\t\tif(!$this->sendResetEmail($_POST['email'], $_POST['v'])){\n\t\t\treturn \"Sending the email failed\";\n\t\t}\n\t\treturn TRUE;\n\t}", "public function checkEmail($sender,$param)\r\n\t{\r\n\t\t$userRecord=TblUsers::finder()->findBy_email($this->Email->Text);\r\n\r\n\t\tif($userRecord != null)\r\n\t\t\t$param->IsValid = false;\r\n\t}", "public function isVerified()\n {\n return ! is_null($this->domain_verified_at);\n }", "public function disable()\n {\n $user = User::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n $user->status = 2;\n $user->confirmation_code = NULL;\n $user->save();\n return Redirect::to('logout');\n }", "protected static function _email(){\n if (self::$_ruleValue) {\n $str = filter_var(trim(self::$_elementValue), FILTER_VALIDATE_EMAIL);\n if (!$str) {\n self:: setErrorMessage(\"Enter valid email\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public function emailConfirmation() {\n try {\n return $this->getEmailVerificationUtils()->verifyConfirmationRequest();\n } catch (\\Illuminate\\Database\\QueryException $ex) {\n return $this->getExceptionUtils()->storeException($ex);\n } catch (\\Exception $ex) {\n return $this->getExceptionUtils()->storeException($ex);\n }\n }", "function UnigueEmail($check)\r\n {\r\n //μέσω αυτής της συνάρτησης ελέγχεται εάν χρησιμοποιείται ήδη το email\r\n //που έδωσε ο χρήστης και τον ενημερώνει αντίστοιχα μέσω του error που \r\n //υπάρχει για το συγκεκριμένο πεδίο στο αντίστοιχο view(register.ctp)\r\n\r\n //έλεγχος για το αν ήδη υπάρχει το email που επιλέγει ο χρήστης γίνεται\r\n //σε 2 περιπτώσεις:\r\n //α)Κατά την εγγραφή του χρήστη\r\n //β)Κατά την επεξεργασία προφίλ του χρήστη σε περίπτωση που επεξεργαστεί\r\n // το email του.\r\n $email = array_shift($check);\r\n\r\n if(!$this->getLoggedIn() || (strcmp($this->editEmail, 'yes')==0))\r\n {\r\n $conditions = array(\r\n// 'User.email'=>$this->data['User']['email']\r\n 'User.email'=>$email\r\n );\r\n if(!$this->id)\r\n {\r\n if($this->find('count', array('conditions'=>$conditions))>0) \r\n {\r\n// $this->invalidate('email_unique');\r\n return false; \r\n }\r\n }\r\n return true;\r\n }\r\n else\r\n return true;\r\n }", "public function is_email() {\n return $this->is_email;\n }", "function is_email_address_unsafe($user_email)\n {\n }", "public function user_unactive() {\n if ($this->input->post('submitRegistration')) {\n $userData = array(\n 'email' => $this->input->post('email'),\n 'token' => md5($this->input->post('email'))\n );\n\n $this->Common_Model->insert($userData, 'wh_user_activations');\n\n $userData['message'] = 'Click the below link to activate your account. <br /><a href=\"' . base_url() . 'Site_Login/activate_account/' . $userData['token'] . '\">Activate</a>';\n $userData['subject'] = 'Account activation';\n\n $result = $this->sendMail($userData);\n if ($result) {\n return true;\n } else {\n return false;\n }\n }\n }", "public function email_must_be_unique_on_update()\n {\n User::factory()->create([\n 'email' => '[email protected]',\n ]);\n\n $this\n ->from(\"nova/resources/users/{$this->user->id}/edit\")\n ->put(\n \"nova-api/users/{$this->user->id}\",\n [\n 'email' => '[email protected]',\n ]\n )\n ->assertRedirect(\"nova/resources/users/{$this->user->id}/edit\")\n ->assertSessionHasErrors('email');\n }", "public function an_otp_mail_is_not_send_if_credentials_are_incorrect()\n {\n Mail::fake();\n //$this->withExceptionHandling();\n $user = factory(User::class)->create();\n $res= $this->post('/login',['email' => $user->email,'password'=>'wshhhdhhdhdhd']);\n Mail::assertNotSent(OTPMail::class);\n\n //$res->assertRedirect('/');\n\n }", "public function unconfirmedTask()\n\t{\n\t\t$xprofile = User::getInstance();\n\t\t$email_confirmed = $xprofile->get('activation');\n\n\t\t// Incoming\n\t\t$return = Request::getString('return', urlencode('/'));\n\n\t\t// Check if the email has been confirmed\n\t\tif ($email_confirmed == 1 || $email_confirmed == 3)\n\t\t{\n\t\t\tApp::redirect(urldecode($return));\n\t\t}\n\n\t\t// Check if the user is logged in\n\t\tif (User::isGuest())\n\t\t{\n\t\t\t$return = base64_encode(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=' . $this->_task, false, true));\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=com_users&view=login&return=' . $return, false),\n\t\t\t\tLang::txt('COM_MEMBERS_REGISTER_ERROR_LOGIN_TO_CONFIRM'),\n\t\t\t\t'warning'\n\t\t\t);\n\t\t}\n\n\t\t// Set the pathway\n\t\t$this->_buildPathway();\n\n\t\t// Set the page title\n\t\t$this->_buildTitle();\n\n\t\t// Instantiate a new view\n\t\t$this->view\n\t\t\t->set('title', Lang::txt('COM_MEMBERS_REGISTER_UNCONFIRMED'))\n\t\t\t->set('email', $xprofile->get('email'))\n\t\t\t->set('return', $return)\n\t\t\t->set('sitename', Config::get('sitename'))\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->display();\n\t}", "public function testUserCanNotLoginWithIncorrectEmail()\n {\n $user = factory(User::class)->create();\n factory(Login::class)->create([\n 'user_id' => $user->id,\n 'password' => bcrypt($password = 'boss'),\n ]);\n\n $response = $this->from(route('login'))->post(route('login'), [\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n\n $response->assertRedirect(route('login'));\n $response->assertSessionHasErrors('email');\n $this->assertGuest();\n }", "function reset_email()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Reset email\n if ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_new_email_failed'));\n }\n }", "public function isEmail();", "function reset_email()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Reset email\n\t\tif ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_failed'));\n\t\t}\n\t}", "public function do_delete_verified_email( $email ) {\r\n\r\n\t\tset_error_handler( array( $this, 'ses_error_handler' ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_set_error_handler\r\n\r\n\t\t$response = $this->get_client()->deleteVerifiedEmailAddress( $email );\r\n\r\n\t\tif (\r\n\t\t\tis_array( $response ) &&\r\n\t\t\tisset( $response['RequestId'] )\r\n\t\t) {\r\n\t\t\tDebug::clear();\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "private function invalidate()\n {\n $this->addMessage(\n ErrorMessage::getDefaultMessage(Error::ERROR_ADDRESS_UNEQUAL),\n Error::ERROR_ADDRESS_UNEQUAL\n );\n }", "public static function email_confirm_account() {\n\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n # definindo conta como não confirmada.\n $u->hash_confirm_account = $u->hash_confirm_account ?: \\Security::random(32);\n\n if ($u->emailConfirmAccount())\n flash('Email com as instruções para Confirmação de conta para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }", "public function testUsersEmailAuth()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testGetInvalidUserByEmail(): void {\n\t\t// Grab an email that does not exist\n\t\t$user = User::getUserByUserEmail($this->getPDO(), \"[email protected]\");\n\t\t$this->assertNull($user);\n\t}", "function disable_user($email) {\n // Build the query\n $query = \"UPDATE UserAccount SET enabled=0 WHERE email = ?\";\n // Execute the query\n $result = $this->db->query($query, $email);\n // Check if the row was affected\n if ($this->db->affected_rows() == 1) {\n $message = \"Success: account disabled.\";\n } else {\n $message = \"Error: failed to disable account.\";\n }\n // Return the result message\n return $message;\n }", "public function actionEmailunique()\n\t{\n\t\t$email = $_GET['email'];\n\t\t$isexits = '0';\n\t\t$check=UsersDetails::model()->find(\"user_details_email='$email'\");\n\t\tif(isset($check))\t\t\t\t\n\t\t\t$isexits = '1'; //This email already used.\n\t\techo $isexits;\n\t\tYii::app()->end();\n\t}", "public function testUpdateMemberMailChimpEmailChangeDisallowed(): void\n {\n // If there is no list id or member id, skip\n if (!$this->createListMember($listId,$memberId, true))\n {\n return;\n }\n\n /** @noinspection PhpParamsInspection Mock given on purpose */\n $controller = new MembersController($this->entityManager, $this->mockMailChimp());\n\n $memberData = static::$memberData;\n $orgEmail = strtolower($memberData['email_address']);\n $memberData['email_address'] = $newEmail = strtolower('NEW_' . $orgEmail);\n //putting long expression as param is error prone\n $jsonResponse = $controller->update($this->getRequest($memberData), $listId, $memberId);\n $expectedError = $this->getMailChimpResponseEmailChangedError($orgEmail, $newEmail);\n $this->assertMailChimpEmailChangeDisallowedResponse($jsonResponse, $expectedError);\n }", "public function getOptoutEmail()\n {\n return $this->optoutEmail;\n }", "public function sendEmailVerificationNotification(): void\n {\n $this->notify(new VerifyEmail);\n }", "public function resendEmailVerification($email)\n {\n return $this->start()->uri(\"/api/user/verify-email\")\n ->urlParameter(\"email\", $email)\n ->put()\n ->go();\n }", "public function testEmailConstraints()\n {\n\n $user = new User();\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_DEFAULT]);\n Assert::assertEquals('email', $constraintViolationList->get(0)->getPropertyPath());\n\n $user->setEmail('invalid_email');\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_DEFAULT]);\n Assert::assertEquals('email', $constraintViolationList->get(0)->getPropertyPath());\n\n $user->setEmail('[email protected]');\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_DEFAULT]);\n Assert::assertEquals('email', $constraintViolationList->get(0)->getPropertyPath());\n }", "public function verify($token) {\n User::where('email_token', $token)\n ->firstOrFail()\n ->update([\n 'email_token' => null,\n 'verified' => 1\n ]);\n\n //$user->update(['email_token' => null]);\n /*$email_token_update = $user->email_token = null;\n $email_token_update->save(); */\n\n return redirect('/home')->with('successfulVerification', 'Account Verified!');\n\n }", "static function password_expired_email() {\n $model = \\Auth::$model;\n $user = $model::requested();\n\n if (!$user->nil()) {\n if ($user->validate()) {\n\n password_expired_email($user) ?\n flash(\"Enviamos um e-mail para <small><b>$user->email</b></small> com as instruções para você criar uma nova senha.\") :\n flash('Não foi possível lhe enviar o e-mail. Por favor, tente novamente mais tarde.', 'error');\n\n go('/');\n } else {\n flash('Verifique os dados do formulário.', 'error');\n }\n }\n\n globals('user', $user);\n }", "public function isVerified();" ]
[ "0.7280733", "0.7271229", "0.7068452", "0.68330437", "0.67798954", "0.67478627", "0.6568747", "0.6547996", "0.6448611", "0.6389749", "0.6343343", "0.63205785", "0.6270268", "0.62203705", "0.61936986", "0.617083", "0.6119046", "0.6116034", "0.61124635", "0.6093073", "0.6038284", "0.59688914", "0.5959191", "0.5948464", "0.59073615", "0.58967716", "0.58530337", "0.5844009", "0.584355", "0.58369535", "0.5823309", "0.58147645", "0.57915384", "0.57880706", "0.57744396", "0.573867", "0.5722368", "0.5707514", "0.5700516", "0.5698585", "0.5692531", "0.5677175", "0.5660556", "0.56403816", "0.561479", "0.5613001", "0.560747", "0.55936426", "0.55870795", "0.55701786", "0.55649567", "0.5563228", "0.5547557", "0.55439913", "0.554044", "0.5539692", "0.5535585", "0.5523466", "0.55232096", "0.5520215", "0.5518388", "0.5515947", "0.5507392", "0.5477877", "0.5477273", "0.546158", "0.54585284", "0.54537857", "0.54535604", "0.5446523", "0.54325074", "0.5421804", "0.5407709", "0.5396626", "0.5395958", "0.539386", "0.5389515", "0.538607", "0.53765607", "0.53747463", "0.5370714", "0.5368839", "0.53674525", "0.53627074", "0.5361001", "0.53600746", "0.5359089", "0.5354192", "0.5352294", "0.53440714", "0.5340992", "0.53394324", "0.53371984" ]
0.7322359
6
Render a form element from the provided $element, using content from $buttonContent or the element's "label" attribute
public function render(ElementInterface $element, $buttonContent = null) { $openTag = $this->openTag($element); $icon = $this->renderIcon($element); if (null === $buttonContent) { $buttonContent = $element->getLabel(); if (null === $buttonContent) { throw new Exception\DomainException(sprintf( '%s expects either button content as the second argument, ' . 'or that the element provided has a label value; neither found', __METHOD__ )); } if (null !== ($translator = $this->getTranslator())) { $buttonContent = $translator->translate( $buttonContent, $this->getTranslatorTextDomain() ); } } if (! $element instanceof LabelAwareInterface || ! $element->getLabelOption('disable_html_escape')) { $escapeHtmlHelper = $this->getEscapeHtmlHelper(); $buttonContent = $escapeHtmlHelper($buttonContent); } return $openTag . $icon . $buttonContent . $this->closeTag(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render(ElementInterface $element, $buttonContent = null)\n {\n if (null === $buttonContent) {\n $buttonContent = $element->getLabel();\n if (null === $buttonContent) {\n throw new Exception\\DomainException(\n sprintf(\n '%s expects either button content as the second argument, ' .\n 'or that the element provided has a label value; neither found',\n __METHOD__\n )\n );\n }\n\n if (null !== ($translator = $this->getTranslator())) {\n $buttonContent = $translator->translate(\n $buttonContent,\n $this->getTranslatorTextDomain()\n );\n }\n $element->setLabel('');\n }\n\n $value = $element->getValue();\n $checkedBoole = ($value == 1 || $value == 'on');\n \n\n $checkedClass = $checkedBoole?'active\"':'';\n\n $hiddenElement = '';\n if ($element->useHiddenElement()) {\n $hiddenAttributes = [\n 'name' => $element->getName(),\n 'value' => $element->getUncheckedValue(),\n ];\n\n $hiddenElement = sprintf(\n '<input type=\"hidden\" %s%s',\n $this->createAttributesString($hiddenAttributes),\n '>'\n );\n $element->setUseHiddenElement(false);\n }\n\n $buttonContent = $hiddenElement . PHP_EOL\n . '<div class=\"btn-group\" data-toggle=\"buttons\">' . PHP_EOL\n . '<label class=\"btn btn-default ' . $checkedClass . '\">' . PHP_EOL\n . parent::render($element) . $buttonContent . PHP_EOL . '</label>' . PHP_EOL\n . '</div>' . PHP_EOL;\n\n return $buttonContent;\n }", "public function renderElement($element)\r\n\t{\r\n\t\tif ($element instanceof TbFormInputElement) {\r\n\t\t\tif ($element->type === 'hidden') {\r\n\t\t\t\treturn \"<div style=\\\"display:none\\\">\\n\" . $element->renderInput() . \"</div>\\n\";\r\n\t\t\t} else {\r\n\t\t\t\treturn $element->render();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn parent::renderElement($element);\r\n\t}", "function render($element, $form)\n {\n }", "public function renderElement($element);", "function _renderSubmit($element) {\n $elementClasses = \"btn btn-default \" . $element->getAttribute(\"class\", \"\");\n $element->setAttribute(\"class\", $elementClasses);\n $html = $this->render($element->getName());\n return $html;\n }", "public function render(ElementInterface $element) {\n /**\n * Ser for input hidden nao gera as divs\n */\n if ($element instanceof \\Zend\\Form\\Element\\Hidden ||\n $element instanceof \\Zend\\Form\\Element\\Csrf) {\n return $this->getView()->formInput($element);\n } elseif ($element instanceof \\Zend\\Form\\Element\\Image) {\n $html = '<div class=\"form-group\">';\n $html .= $this->getView()->formImage($element);\n $html .= '</div>';\n return $html;\n return $this->getView()->formImage($element);\n } elseif ($element instanceof \\MySDK\\Form\\Element\\Code) {\n return $element->getValue();\n }elseif($element instanceof \\Zend\\Form\\Element\\Submit){\n //@todo melhorar renderzação do field ubmite\n return '<label for=\"\"></label><input name=\"' . $element->getName() . '\" placeholder=\"\" class=\"' . $element->getAttributes()['class'] . '\" value=\"' . $element->getValue() . '\" type=\"' . $element->getAttributes()['type'] . '\">';\n\n } else {\n $gridFieldClassPrefix = 'col-xs-';\n $gridFieldSizeDefault = 2;\n\n $size = $element->getOption('size') ? $element->getOption('size') : $gridFieldSizeDefault;\n $classError = $this->getView()->formElementErrors($element) ? \"has-error\" : '';\n $inputSize = $element->getOption('inputSize') ? $element->getOption('inputSize') : '';\n $classGrid = $element->getOption('classGrid') ? $element->getOption('classGrid') : '';\n $classFormGroup = $element->getOption('classFormGroup') ? $element->getOption('classFormGroup') : '';\n $getLabal = $element->getLabel();\n $getType = $element->getAttributes()['type'];\n $getName = $element->getAttributes()['name'];\n $getPlaceholder = $element->getAttributes()['placeholder']?$element->getAttributes()['placeholder']:'';\n $getClass = $element->getAttributes()['class'];\n $mask = $element->getOption('mask') ? $element->getOption('mask') : false;\n\n\n\n $html = '';\n // $html .= ' <div class=\"' . $gridFieldClassPrefix . $size . ' ' . $classGrid . '\">';\n $html .='<div class=\"row\">';\n $html .='<div class=\"' . $gridFieldClassPrefix . $size . '\">';\n\n $html .= ' <div class=\"form-group ' . ' ' . $classFormGroup . ' ' . $inputSize . ' ' . $classError . '\">';\n\n $html .= '<label for=\"' . $getName . '\">'.$getLabal.'</label>';\n $html .= '<input type=\"' . $getType . '\" name=\"' . $getName . '\" placeholder=\"' . $getPlaceholder . '\" class=\"' . $getClass . '\" value=\"\">';\n\n $html .= $this->getView()->formElementErrors()\n ->setMessageOpenFormat('<span class=\"help-block\">')\n ->setMessageSeparatorString('<br/>')\n ->setMessageCloseString('</span>')\n ->render($element);\n\n $html .= ' </div>';\n $html .= ' </div>';\n $html .= ' </div>';\n// $html .= ' </div>';\n\n if (false != $mask) {\n $html .= \"<script>\";\n $html .= \"$(document).ready(function(){ $('input[name=\\\"\" . $getName . \"\\\"]').mask('\" . $mask . \"') });\";\n $html .= \"</script>\";\n }\n\n return $html;\n }\n }", "public function render($content)\n\t{\n\t\t$element = $this->getElement();\n\t\tif (!$element instanceof L8M_JQuery_Form_Element_M2N) {\n\t\t\t// wir wollen nur das Element\n\t\t\treturn $content;\n\t\t}\n\n\t\t$view = $element->getView();\n\t\tif (!$view instanceof Zend_View_Interface) {\n\t\t\t// verwenden von View Helfers, deshalb ist nichts zu tun\n\t\t\t// wenn keine View vorhanden ist\n\t\t\treturn $content;\n\t\t}\n\n\t\t$cssSortable = NULL;\n\t\tif ($element->isSortable()) {\n\t\t\t$cssSortable = ' m2n-sortable';\n\t\t}\n\n\t\t$loadAction = Doctrine_Query::create()\n\t\t\t->from('Default_Model_Action m')\n\t\t\t->addWhere('m.resource = ? ', array('system.auto-complete.load'))\n\t\t\t->limit(1)\n\t\t\t->execute()\n\t\t\t->getFirst()\n\t\t;\n\n\t\tif (($element->isMediaRealtion() || count($element->getOptionValuesForRender()) > 19) &&\n\t\t\t$loadAction) {\n\n\t\t\t$html = $this->_renderComplexHTML($element, $view);\n\t\t} else {\n\t\t\t$html = $this->_renderEasyHTML($element, $view);\n\t\t}\n\n\t\tob_start();\n\n?>\n<div class=\"m2n-form-element box<?php echo $cssSortable; ?>\">\n\t<?php echo $html; ?>\n\t<ul class=\"selected-values\">\n<?php\n\n\t\t$foreignAlias = $element->getForeignAlias();\n\t\tforeach ($element->getSelectedOptionValuesForRender() as $itemModel) {\n\t\t\tif ($element->isTranslateable()) {\n\t\t\t\t$transValues = $itemModel->Translation;\n\t\t\t} else {\n\t\t\t\t$transValues = array();\n\t\t\t}\n\t\t\tif ($element->hasExtraValue()) {\n\t\t\t\t$extraValueElement = $this->_renderExtraValue($itemModel->value, L8M_Library::getUsableUrlStringOnly($itemModel[$foreignAlias]->id));\n\t\t\t} else {\n\t\t\t\t$extraValueElement = NULL;\n\t\t\t}\n\t\t\tif ($element->hasRealtionValues()) {\n\t\t\t\t$extraValueElement .= $this->_renderRelationValues(L8M_Library::getUsableUrlStringOnly($itemModel[$foreignAlias]->id), $itemModel->id);\n\t\t\t}\n\n\t\t\techo '<li class=\"selecte_tab\" id=\"' . $element->getName() . '_' . L8M_Library::getUsableUrlStringOnly($itemModel[$foreignAlias]->id) . '_selected_id\">';\n\t\t\techo '<input type=\"text\" class=\"hidden item-value\" id=\"' . $element->getName() . '_selected_input_id_' . L8M_Library::getUsableUrlStringOnly($itemModel[$foreignAlias]->id) . '\" name=\"' . $element->getName() . '[]\" value=\"' . L8M_Library::getUsableUrlStringOnly($itemModel[$foreignAlias]->id) . '\" data-id=\"' . L8M_Library::getUsableUrlStringOnly($element->getName() . '_selector_link_' . $itemModel[$foreignAlias]->id . '_li') . '\" />';\n\t\t\techo '<span>' . $itemModel[$foreignAlias][$element->getUseForeignColumn()] . '</span>';\n\t\t\techo ' ' . $extraValueElement . $this->_renderTranslateable($transValues, L8M_Library::getUsableUrlStringOnly($itemModel[$foreignAlias]->id)) . ' ';\n\t\t\techo '<a class=\"remove ' . $element->getName() . '_remove\" href=\"\" id=\"' . $element->getName() . '_' . L8M_Library::getUsableUrlStringOnly($itemModel[$foreignAlias]->id) . '_selected\" onclick=\"' . $element->getName() . '_remove(this); return false;\">' . $view->translate('Remove') . '</a>';\n\t\t\techo '</li>';\n\t\t}\n?>\n\t</ul>\n</div>\n<script type=\"text/javascript\">\n\t//<![CDATA[\n\n\t\t$(\"a.<?php echo $element->getName(); ?>_add\").click(function() {\n\n\t\t\tvar m2nValue = '';\n\t\t\tvar m2nInfo = '';\n\t\t\tvar m2nID = $(\"#<?php echo $element->getName(); ?>_selector li.active\").attr('id');\n\n\t\t\tif ($(\"#<?php echo $element->getName(); ?>_selector li\").length == 0 &&\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>_selector\").attr('value') != '' &&\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>_\" + $(\"#<?php echo $element->getName(); ?>_selector\").attr('value') + '_selected_id').length == 0) {\n\n\t\t\t\tm2nValue = $(\"#<?php echo $element->getName(); ?>_selector\").attr('value');\n\t\t\t\tm2nInfo = $(\"#<?php echo $element->getName(); ?>_selector option:selected\").text();\n\t\t\t} else\n\t\t\tif ($(\"#<?php echo $element->getName(); ?>_selector li.active\").length != 0 &&\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>_selector li.active span.value\").html().length != 0 &&\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>_selector li.active span.info\").html().length != 0) {\n\n\t\t\t\tm2nValue = $(\"#<?php echo $element->getName(); ?>_selector li.active span.value\").html();\n\t\t\t\tm2nInfo = $(\"#<?php echo $element->getName(); ?>_selector li.active span.info\").html();\n\t\t\t\t$(\"ul#<?php echo $element->getName(); ?>_selector li\").removeClass('active');\n\t\t\t}\n\n\t\t\tif (m2nValue &&\n\t\t\t\tm2nInfo &&\n\t\t\t\tm2nID &&\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>_selected_input_id_\" + m2nValue).length == 0) {\n\n\t\t\t\tvar transFormElement = ' ';\n\n\t\t\t\tvar randNumber = Math.floor(Math.random() * 11);\n\t\t\t\tvar currentUnixTime = Math.round((new Date()).getTime() / 1000);\n\t\t\t\tvar referencedElementName = 'ref_' + currentUnixTime.toString() + '_' + randNumber.toString();\n\n<?php\n\n\t\tif ($element->isTranslateable()) {\n\n?>\n\t\t\t\ttransFormElement = ''\n\t\t\t\t+ '<div id=\"<?php echo $element->getName(); ?>_tabs-' + m2nValue + '\" class=\"multitabs\">'\n\t\t\t\t+ '<ul>'\n<?php\n\n\t\t\tforeach (L8M_Locale::getSupported() as $lang) {\n\n?>\n\t\t\t\t+ '<li><a href=\"#<?php echo $element->getName(); ?>_tabs-' + m2nValue.toString() + '-<?php echo $lang; ?>\"><?php echo $lang; ?></a></li>'\n<?php\n\n\t\t\t}\n\n?>\n\t\t\t\t+ '</ul>'\n<?php\n\n\t\t\tforeach (L8M_Locale::getSupported() as $lang) {\n\n?>\n\t\t\t\t+ '<div id=\"<?php echo $element->getName(); ?>_tabs-' + m2nValue + '-<?php echo $lang; ?>\">'\n\t\t\t\t+ '<div>'\n\t\t\t\t+ '<input type=\"text\" name=\"<?php echo $element->getName(); ?>_tabs_<?php echo $lang; ?>_' + m2nValue.toString() + '\" id=\"<?php echo $element->getName(); ?>_tabs_<?php echo $lang; ?>_' + m2nValue.toString() + '\" value=\"\" />'\n\t\t\t\t+ '</div>'\n\t\t\t\t+ '</div>'\n<?php\n\n\t\t\t}\n\n?>\n\t\t\t\t+ '</div>'\n\t\t\t\t+ ' ';\n<?php\n\n\t\t}\n\n\t\tif ($element->hasExtraValue()) {\n\n?>\n\t\t\t\ttransFormElement = ''\n\t\t\t\t+ '<div id=\"<?php echo $element->getName(); ?>_tabs_div-' + m2nValue + '\" class=\"extravalue-tab\">'\n\t\t\t\t+ '<input type=\"text\" name=\"<?php echo $element->getName(); ?>_tabs_' + m2nValue.toString() + '\" id=\"<?php echo $element->getName(); ?>_tabs_' + m2nValue.toString() + '\" value=\"\" />'\n\t\t\t\t+ '</div>'\n\t\t\t\t+ ' ';\n<?php\n\n\t\t}\n\n\t\tif ($element->hasRealtionValues()) {\n\t\t\tif ($element->hasMultipleRelationM2nValuesRows()) {\n\t\t\t\techo 'var mrMVRClass = \" border\";';\n\t\t\t} else {\n\t\t\t\techo 'var mrMVRClass = \"\";';\n\t\t\t}\n?>\n\t\t\t\ttransFormElement = transFormElement\n\t\t\t\t+ '<div class=\"relation-values' + mrMVRClass + '\">'\n\t\t\t\t+ '<ul class=\"relation-values\">'\n\t\t\t\t+ '<li class=\"relation-value\">'\n\t\t\t\t+ '<table>';\n<?php\n\n\t\t\tif ($element->hasRelation2y()) {\n\n?>\n\t\t\t\ttransFormElement = transFormElement\n\t\t\t\t+ '<tr>'\n\t\t\t\t+ '<td>'\n\t\t\t\t+ '<?php echo $view->translate($element->getRelationValueColumnLablel('reverenced_id')); ?>'\n\t\t\t\t+ '</td>'\n\t\t\t\t+ '<td>'\n\t\t\t\t+ '<select id=\"' + referencedElementName + '\" name=\"<?php echo $element->getName(); ?>_tabs_' + m2nValue.toString() + \"_rv['referenced_id'][]\" + '\" class=\"unsortable\"></select>'\n\t\t\t\t+ '</td>'\n\t\t\t\t+ '</tr>';\n<?php\n\n\t\t\t}\n\n\t\t\tforeach ($element->getRealtionValueColumns() as $relationColumnName => $relationColumnDefinition) {\n\t\t\t\t$inputClass = NULL;\n\t\t\t\tif (isset($relationColumnDefinition['type']) &&\n\t\t\t\t\t$relationColumnDefinition['type'] == 'date') {\n\n\t\t\t\t\t$inputClass = 'date';\n\t\t\t\t}\n?>\n\t\t\t\ttransFormElement = transFormElement\n\t\t\t\t+ '<tr>'\n\t\t\t\t+ '<td>'\n\t\t\t\t+ '<?php echo $view->translate($element->getRelationValueColumnLablel($relationColumnName)); ?>'\n\t\t\t\t+ '</td>'\n\t\t\t\t+ '<td>'\n<?php\n\n\t\t\t\tif (isset($relationColumnDefinition['type']) &&\n\t\t\t\t\t$relationColumnDefinition['type'] == 'boolean') {\n\n?>\n\t\t\t\t+ '<input type=\"text\" class=\"hidden <?php echo $inputClass; ?>\" name=\"<?php echo $element->getName(); ?>_tabs_' + m2nValue.toString() + \"_rv['<?php echo $relationColumnName; ?>'][]\" + '\" value=\"0\" />'\n\t\t\t\t+ '<input type=\"checkbox\" class=\"<?php echo $inputClass; ?>\" name=\"<?php echo $element->getName(); ?>_tabs_' + m2nValue.toString() + \"_rv['<?php echo $relationColumnName; ?>'][]\" + '\" value=\"1\" />'\n<?php\n\n\t\t\t\t\t} else {\n\n?>\n\t\t\t\t+ '<input type=\"text\" class=\"<?php echo $inputClass; ?>\" name=\"<?php echo $element->getName(); ?>_tabs_' + m2nValue.toString() + \"_rv['<?php echo $relationColumnName; ?>'][]\" + '\" value=\"\" />'\n<?php\n\n\t\t\t\t}\n\n?>\n\t\t\t\t+ '</td>'\n\t\t\t\t+ '</tr>';\n<?php\n\n\t\t\t}\n\n?>\n\t\t\t\ttransFormElement = transFormElement\n\t\t\t\t+ '</table>'\n\t\t\t\t+ '<a href=\"\" class=\"remove\" onclick=\"<?php echo $element->getName(); ?>_relationValuesRemove(this); return false;\"><?php echo $view->translate('Remove'); ?></a>'\n\t\t\t\t+ '</li>'\n\t\t\t\t+ '</ul>'\n\t\t\t\t+ '<a href=\"\" class=\"add\" onclick=\"<?php echo $element->getName(); ?>_relationValuesAdd(this); return false;\"><?php echo $view->translate('Add'); ?></a>'\n\t\t\t\t+ '</div>';\n<?php\n\n\t\t}\n\n?>\n\t\t\t\tvar elementText = ''\n\t\t\t\t+ '<li class=\"selecte_tab\" id=\"<?php echo $element->getName(); ?>_' + m2nValue.toString() + '_selected_id\">'\n\t\t\t\t+ '<input type=\"text\" class=\"hidden item-value\" id=\"<?php echo $element->getName(); ?>_selected_input_id_' + m2nValue.toString() + '\" name=\"<?php echo $element->getName(); ?>[]\" value=\"' + m2nValue.toString() + '\" data-id=\"' + m2nID + '\" />'\n\t\t\t\t+ '<span>' + m2nInfo + '</span>'\n\t\t\t\t+ transFormElement\n\t\t\t\t+ '<a class=\"remove <?php echo $element->getName(); ?>_remove\" href=\"\" id=\"<?php echo $element->getName(); ?>_' + m2nValue.toString() + '_selected\" onclick=\"<?php echo $element->getName(); ?>_remove(this); return false;\"><?php echo $view->translate('Remove'); ?></a>'\n\t\t\t\t+ '</li>';\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.selected-values\").append(elementText);\n<?php\n\n\t\tif ($element->isTranslateable()) {\n\n?>\n\t\t\t\t$('#<?php echo $element->getName(); ?>_tabs-' + m2nValue.toString()).tabs();\n<?php\n\n\t\t}\n\n\t\tif ($element->hasRelation2y()) {\n\n?>\n\n\t\t\t\t$.get(\"/system/auto-complete/model-collection/?model=<?php echo $element->getRelation2yModelName(); ?>&id=\" + m2nValue.toString(), function(data){\n\t\t\t\t\t$(\"#\" + referencedElementName).append(data);\n\t\t\t\t});\n<?php\n\n\n\n\t\t}\n\n?>\n\t\t\t}\n\t\t\t$.datepicker.setDefaults( $.datepicker.regional[ \"<?php echo L8M_Locale::getLang(); ?>\" ] );\n\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.selected-values div.relation-values input.date\").datepicker({\n\t\t\t\tdateFormat: 'yy-mm-dd'\n\t\t\t});\n\t\t\t<?php echo $element->getName(); ?>_updateUsed();\n\t\t\treturn false;\n\t\t});\n\n\t\tfunction <?php echo $element->getName(); ?>_relationValuesAdd(elem) {\n\t\t\tvar m2nValue = $(elem).parent().parent().find('input.item-value').attr('value');\n\n\t\t\tvar randNumber = Math.floor(Math.random() * 11);\n\t\t\tvar currentUnixTime = Math.round((new Date()).getTime() / 1000);\n\t\t\tvar referencedElementName = 'ref_' + currentUnixTime.toString() + '_' + randNumber.toString();\n\n\t\t\tvar transFormElement = '<li class=\"relation-value\">'\n\t\t\t+ '<table>';\n<?php\n\n\t\tif ($element->hasRelation2y()) {\n\n?>\n\t\t\t\ttransFormElement = transFormElement\n\t\t\t\t+ '<tr>'\n\t\t\t\t+ '<td>'\n\t\t\t\t+ '<?php echo $view->translate($element->getRelationValueColumnLablel('reverenced_id')); ?>'\n\t\t\t\t+ '</td>'\n\t\t\t\t+ '<td>'\n\t\t\t\t+ '<select id=\"' + referencedElementName + '\" name=\"<?php echo $element->getName(); ?>_tabs_' + m2nValue.toString() + \"_rv['referenced_id'][]\" + '\" class=\"unsortable\"></select>'\n\t\t\t\t+ '</td>'\n\t\t\t\t+ '</tr>';\n<?php\n\n\t\t}\n\n\t\tforeach ($element->getRealtionValueColumns() as $relationColumnName => $relationColumnDefinition) {\n\t\t\t$inputClass = NULL;\n\t\t\tif (isset($relationColumnDefinition['type']) &&\n\t\t\t\t$relationColumnDefinition['type'] == 'date') {\n\n\t\t\t\t$inputClass = 'date';\n\t\t\t}\n?>\n\t\t\ttransFormElement = transFormElement\n\t\t\t+ '<tr>'\n\t\t\t+ '<td>'\n\t\t\t+ '<?php echo $view->translate($element->getRelationValueColumnLablel($relationColumnName)); ?>'\n\t\t\t+ '</td>'\n\t\t\t+ '<td>'\n<?php\n\n\t\t\tif (isset($relationColumnDefinition['type']) &&\n\t\t\t\t$relationColumnDefinition['type'] == 'boolean') {\n\n?>\n\t\t\t+ '<input type=\"text\" class=\"hidden <?php echo $inputClass; ?>\" name=\"<?php echo $element->getName(); ?>_tabs_' + m2nValue.toString() + \"_rv['<?php echo $relationColumnName; ?>'][]\" + '\" value=\"0\" />'\n\t\t\t+ '<input type=\"checkbox\" class=\"<?php echo $inputClass; ?>\" name=\"<?php echo $element->getName(); ?>_tabs_' + m2nValue.toString() + \"_rv['<?php echo $relationColumnName; ?>'][]\" + '\" value=\"1\" />'\n<?php\n\n\t\t\t} else {\n\n?>\n\t\t\t+ '<input type=\"text\" class=\"<?php echo $inputClass; ?>\" name=\"<?php echo $element->getName(); ?>_tabs_' + m2nValue.toString() + \"_rv['<?php echo $relationColumnName; ?>'][]\" + '\" value=\"\" />'\n<?php\n\n\t\t\t}\n\n?>\n\t\t\t+ '</td>'\n\t\t\t+ '</tr>';\n<?php\n\n\t\t}\n\n?>\n\t\t\ttransFormElement = transFormElement\n\t\t\t+ '</table>'\n\t\t\t+ '<a href=\"\" class=\"remove\" onclick=\"<?php echo $element->getName(); ?>_relationValuesRemove(this); return false;\"><?php echo $view->translate('Remove'); ?></a>'\n\t\t\t+ '</li>';\n\n\t\t\t$(elem).parent().find('ul.relation-values').append(transFormElement);\n\n<?php\n\n\t\tif ($element->hasRelation2y()) {\n\n?>\n\n\t\t\t\t$.get(\"/system/auto-complete/model-collection/?model=<?php echo $element->getRelation2yModelName(); ?>&id=\" + m2nValue.toString(), function(data){\n\t\t\t\t\t$(\"#\" + referencedElementName).append(data);\n\t\t\t\t});\n<?php\n\n\t\t}\n\n?>\n\n\t\t\t$.datepicker.setDefaults( $.datepicker.regional[ \"<?php echo L8M_Locale::getLang(); ?>\" ] );\n\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.selected-values div.relation-values input.date\").datepicker({\n\t\t\t\tdateFormat: 'yy-mm-dd'\n\t\t\t});\n\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.selected-values div.relation-values input[type=checkbox]\").unbind('click');\n\t\t\t//$(\"#<?php echo $element->getName(); ?>-element ul.selected-values div.relation-values input[type=checkbox]\").click(function(){\n\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.selected-values\").on('click', 'div.relation-values input[type=checkbox]', function(){\n\t\t\t\tif ($(this).attr('checked') == 'checked') {\n\t\t\t\t\t$(this).parent().children('input[type=text].hidden').remove();\n\t\t\t\t} else {\n\t\t\t\t\t$(this).before('<input type=\"text\" class=\"hidden\" name=\"' + $(this).attr('name') + '\" value=\"0\" />');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfunction <?php echo $element->getName(); ?>_relationValuesRemove(elem) {\n\t\t\t$(elem).parent().remove();\n\t\t}\n\n\t\tfunction <?php echo $element->getName(); ?>_remove(item) {\n\t\t\t$(\"#\" + item.id + '_id').remove();\n\t\t\t<?php echo $element->getName(); ?>_updateUsed();\n\t\t\treturn false;\n\t\t};\n\n\t\tfunction <?php echo $element->getName(); ?>_updateUsed() {\n\t\t\t$(\"ul#<?php echo $element->getName(); ?>_selector li\").removeClass('active');\n\t\t\t$(\"#<?php echo $element->getName(); ?>-element div.m2n-form-element-extra ul li\").removeClass('used');\n\n\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.selected-values li input[type=text]\").each(function (index, domEle) {\n\t\t\t\t$(\"#\" + $(domEle).attr('data-id')).addClass('used');\n\t\t\t})\n\t\t\treturn false;\n\t\t};\n\n\t\tfunction <?php echo $element->getName(); ?>_updateNavi() {\n\t\t\tvar actPos = parseInt($(\"#<?php echo $element->getName(); ?>-element ul.m2n-form-element-extra-navi a.prev\").attr('rel'));\n\t\t\tvar maxResults = parseInt($(\"#<?php echo $element->getName(); ?>-element ul.m2n-form-element-extra-navi a.next\").attr('rel'));\n\t\t\tvar maxPossibleResults = maxResults + (75 - (maxResults % 75));\n\n\t\t\tif (actPos == 1) {\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.m2n-form-element-extra-navi a.prev\").hide();\n\t\t\t} else {\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.m2n-form-element-extra-navi a.prev\").show();\n\t\t\t}\n\n\n\t\t\tif (maxPossibleResults / 75 <= actPos) {\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.m2n-form-element-extra-navi a.next\").hide();\n\t\t\t} else {\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.m2n-form-element-extra-navi a.next\").show();\n\t\t\t}\n\n\t\t\tif (<?php echo $element->getOptionValuesCountForRender(); ?> < 75) {\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.m2n-form-element-extra-navi li:first-child\").html('<?php echo $element->getOptionValuesCountForRender() . ' ' .$view->translate('of') . ' ' . $element->getOptionValuesCountForRender(); ?>');\n\t\t\t} else {\n\t\t\t\tvar showItems = actPos * 75;\n\t\t\t\tif (showItems > <?php echo $element->getOptionValuesCountForRender(); ?>) {\n\t\t\t\t\tshowItems = <?php echo $element->getOptionValuesCountForRender(); ?>;\n\t\t\t\t}\n\t\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.m2n-form-element-extra-navi li:first-child\").html(showItems.toString() + ' <?php echo $view->translate('of') . ' ' . $element->getOptionValuesCountForRender(); ?>');\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$(document).ready(function(){\n\t\t\t$.datepicker.setDefaults( $.datepicker.regional[ \"<?php echo L8M_Locale::getLang(); ?>\" ] );\n\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.selected-values div.relation-values input.date\").datepicker({\n\t\t\t\tdateFormat: 'yy-mm-dd'\n\t\t\t});\n\t\t\t<?php echo $element->getName(); ?>_updateUsed();\n\t\t\t<?php echo $element->getName(); ?>_updateNavi();\n\n\t\t\t//$(\"#<?php echo $element->getName(); ?>-element ul.selected-values div.relation-values input[type=checkbox]\").click(function(){\n\t\t\t$(\"#<?php echo $element->getName(); ?>-element ul.selected-values\").on('click', 'div.relation-values input[type=checkbox]', function(){\n\t\t\t\tif ($(this).attr('checked') == 'checked') {\n\t\t\t\t\t$(this).parent().children('input[type=text].hidden').remove();\n\t\t\t\t} else {\n\t\t\t\t\t$(this).before('<input type=\"text\" class=\"hidden\" name=\"' + $(this).attr('name') + '\" value=\"0\" />');\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t//]]>\n</script>\n<?php\n\n\t\t$markup = ob_get_clean() . $this->_renderSortable();\n\n\t\tswitch ($this->getPlacement()) {\n\t\t\tcase self::PREPEND:\n\t\t\t\treturn $markup . $this->getSeparator() . $content;\n\t\t\tcase self::APPEND:\n\t\t\tdefault:\n\t\t\t\treturn $content . $this->getSeparator() . $markup;\n\t\t}\n\t}", "protected function buildElementMarkup($elMarkup, $data, $form)\n {\n $hasConditions = $this->hasConditions($data) ? 'has-conditions ' : '';\n\n $labelPlacement = ArrayHelper::get($data, 'settings.label_placement');\n\n $labelPlacementClass = $labelPlacement ? 'ff-el-form-' . $labelPlacement . ' ' : '';\n\n $validationRules = ArrayHelper::get($data, 'settings.validation_rules');\n\n $labelClass = trim(\n 'ff-el-input--label ' .\n $this->getRequiredClass($validationRules) .\n $this->getAsteriskPlacement($form)\n );\n\n $formGroupClass = trim(\n $this->getDefaultContainerClass() .\n $labelPlacementClass .\n $hasConditions .\n ArrayHelper::get($data, 'settings.container_class')\n );\n\n $labelHelpText = $inputHelpText = '';\n\n if ($form->settings['layout']['helpMessagePlacement'] == 'with_label') {\n $labelHelpText = $this->getLabelHelpMessage($data);\n } elseif ($form->settings['layout']['helpMessagePlacement'] == 'on_focus') {\n $inputHelpText = $this->getInputHelpMessage($data, 'ff-hidden');\n } else {\n $inputHelpText = $this->getInputHelpMessage($data);\n }\n\n $forStr = '';\n if (isset($data['attributes']['id'])) {\n $forStr = \"for='{$data['attributes']['id']}'\";\n }\n\n $labelMarkup = '';\n\n if (!empty($data['settings']['label'])) {\n $label = ArrayHelper::get($data, 'settings.label');\n\n $labelMarkup = sprintf(\n \"<div class='%s'><label %s>%s</label> %s</div>\",\n $labelClass,\n $forStr,\n $label,\n $labelHelpText\n );\n\n // $labelMarkup = \"<div class='\".$labelClass.\"'><label \".$forStr.\">\".$label.\"</label> {$labelHelpText}</div>\";\n }\n\n\n return sprintf(\n \"<div class='%s'>%s<div class='ff-el-input--content'>%s%s</div></div>\",\n $formGroupClass,\n $labelMarkup,\n $elMarkup,\n $inputHelpText\n );\n\n // return \"<div class='\".$formGroupClass.\"'>{$labelMarkup}<div class='ff-el-input--content'>{$elMarkup}{$inputHelpText}</div></div>\";\n }", "protected function _renderElement(\\Zend_Form_Element $element)\n {\n $element->setDecorators([ 'ViewHelper' ]);\n\n return trim($element->render($element->getView()));\n }", "public function renderElement($element) {\n $method = $element['#type'];\n if (!isset($element['#name']) && !in_array($element['#type'], array('markup', 'checkboxes'))) {\n if (!isset($element['#attributes']['name'])) {\n return '#name or #attributes[\\'name\\'] required!';\n } else {\n $element['#name'] = $element['#attributes']['name'];\n }\n }\n if (is_callable(array($this, $method))) {\n $custom_field_title = '';\n if (isset($element['#title']) && !empty($element['#title'])) {\n $custom_field_title = $element['#title'];\n }\n\n if (empty($custom_field_title) && isset($element['#name']) && !empty($element['#name'])) {\n $custom_field_title = $element['#name'];\n }\n if (!isset($element['#id'])) {\n if (isset($element['#attributes']['id'])) {\n $element['#id'] = $element['#attributes']['id'];\n } else {\n $_id = isset($this->_id) ? $this->_id . '-' : '';\n $element['#id'] = \"{$_id}{$element['#type']}-\"\n . $this->_count($element['#type']) . '-' . time();\n }\n }\n\n if (isset($this->_errors[$element['#id']])) {\n $element['#error'] = $this->_errors[$element['#id']];\n }\n // Add JS validation\n if (!empty($element['#validate'])) {\n if (isset($element['#validate']['required']) && !empty($element['#title'])) {\n // Asterisk\n $element['#title'] .= '&#42;';\n }\n $element['#attributes']['data-wpt-validate'] = esc_html(self::json_encode(apply_filters('wptoolset_forms_field_js_validation_data_' . $this->_id, $element['#validate'])));\n $element['#attributes']['data-wpt-field-title'] = esc_js($custom_field_title);\n }\n if ($element['#type'] == 'radios' && !empty($element['#options'])) {\n foreach ($element['#options'] as &$option) {\n if (!empty($option['#validate'])) {\n $option['#attributes']['data-wpt-validate'] = esc_html(self::json_encode(apply_filters('wptoolset_forms_field_js_validation_data_' . $this->_id, $option['#validate'])));\n $option['#attributes']['data-wpt-field-title'] = esc_js($custom_field_title);\n }\n }\n }\n /**\n * WPML - lock CF is has option \"copy from original\".\n */\n if (is_admin() && function_exists('wpcf_wpml_field_is_copied') && wpcf_wpml_field_is_copied($element)) {\n $element['#title'] .= sprintf(\n '<img src=\"%s/images/locked.png\" alt=\"%s\" title=\"%s\" style=\"position:relative;left:2px;top:2px;\" />', WPCF_EMBEDDED_RES_RELPATH, __('This field is locked for editing because WPML will copy its value from the original language.', 'wpcf'), __('This field is locked for editing because WPML will copy its value from the original language.', 'wpcf')\n );\n $element['#attributes']['readonly'] = true;\n $element['#attributes']['disabled'] = true;\n }\n return $this->{$method}($element);\n }\n }", "function pmi_form_element($element, $value) {\n $t = get_t();\n\n $output = '<div';\n if (!empty($element['#id'])) {\n $output .= ' id=\"' . $element['#id'] . '-wrapper\"';\n }\n $output .= \">\\n\";\n $required = !empty($element['#required']) ? '<span class=\"form-required\" title=\"' . $t('This field is required.') . '\">*</span>' : '';\n\n if (!empty($element['#title'])) {\n $title = $element['#title'];\n if (!empty($element['#id'])) {\n $output .= ' <label for=\"' . $element['#id'] . '\" class=\"lbl150\">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n else {\n $output .= ' <label class=\"lbl150\">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n }\n\n $output .= \" $value\\n\";\n\n if (!empty($element['#description'])) {\n $output .= ' <div class=\"description\">' . $element['#description'] . \"</div>\\n\";\n }\n\n $output .= \"</div>\\n\";\n\n//echo $output; exit;\n\n return $output;\n}", "public function renderFieldsetItem( ElementInterface $element )\n {\n $markup = '';\n $label = $element->getLabel();\n $labelHelper = $this->getLabelHelper();\n $elementErrorsHelper = $this->getElementErrorsHelper();\n\n if ( $this->isTranslatorEnabled() )\n {\n $labelHelper->setTranslatorEnabled( true )\n ->setTranslatorTextDomain(\n $this->getTranslatorTextDomain()\n );\n }\n else\n {\n $labelHelper->setTranslatorEnabled( false );\n }\n\n if ( $element instanceof Collection )\n {\n if ( ! empty( $label ) )\n {\n $markup .= sprintf( $this->labelOpen, 'label label-collection' );\n $markup .= PHP_EOL;\n $markup .= $labelHelper( $element );\n $markup .= PHP_EOL;\n $markup .= $this->labelClose;\n $markup .= PHP_EOL;\n }\n\n $markup .= sprintf( $this->inputOpen, 'input input-collection' );\n $markup .= PHP_EOL;\n $markup .= $this->renderElement( $element );\n $markup .= $this->renderDescription( $element );\n $markup .= PHP_EOL;\n $markup .= $this->inputClose;\n }\n else if ( $element instanceof FieldsetInterface )\n {\n $markup .= sprintf( $this->inputOpen, 'fieldset' );\n $markup .= PHP_EOL;\n $markup .= $this->renderFieldset( $element );\n $markup .= $this->inputClose;\n }\n else\n {\n $type = $element->getAttribute( 'type' );\n $req = $element->getAttribute( 'required' );\n $errors = $elementErrorsHelper->render( $element );\n $class = $type . ( $req ? ' ' . $this->elementRequiredClass\n : ' ' . $this->elementOptionalClass )\n . ( $errors ? ' ' . $this->elementErrorClass : '' );\n\n if ( ! empty( $label ) )\n {\n $markup .= sprintf( $this->labelOpen, 'label label-' . $class );\n $markup .= PHP_EOL;\n $markup .= $labelHelper( $element );\n $markup .= PHP_EOL;\n $markup .= $this->labelClose;\n $markup .= PHP_EOL;\n }\n\n if ( $type != 'hidden' || $errors )\n {\n $markup .= sprintf( $this->inputOpen, 'input input-' . $class );\n $markup .= PHP_EOL;\n }\n\n $markup .= $this->renderElement( $element );\n $markup .= $this->renderDescription( $element );\n\n if ( $errors )\n {\n $markup .= PHP_EOL;\n $markup .= $errors;\n }\n\n if ( $type != 'hidden' || $errors )\n {\n $markup .= PHP_EOL;\n $markup .= $this->inputClose;\n }\n }\n\n $markup .= PHP_EOL;\n return $markup;\n }", "public function renderElement($element) {\r\n\t\tif ($element->getType()=='text') {\r\n\t\t\techo 'clearDefault' . $element->getType();\r\n\t\t\t$empty = \"''\";\r\n\t\t\t$default = \"'\" . addslashes($element->getDefaultValue()) . \"'\";\r\n\t\t\t$js = 'onblur=\"if (this.value==' . $empty .') this.value='.$default . '\"';\r\n\t\t\t$js .= ' onclick=\"if (this.value==' . $default .') this.value='.$empty . '\"';\r\n\t\t\t\r\n\t\t\t$return = \"<input style='background-color:yellow;' type='\" . $element->getType() . \"' name='\" . $element->getName() . \"' id='\".$element->getName() . \"' class='\" . $element->compileCss() . \"' value='\" . $element->toDisplayFormat($element->getValue()) . \"' \" . $js.\" />\";\r\n\t\t\treturn $return;\r\n\t\t} else {\r\n\t\t\t// fall back to the default implementation:\r\n\t\t\treturn parent::renderElement($element);\r\n\t\t}\r\n\t}", "public function render($content)\r\n {\r\n\t\t$element = $this->getElement();\r\n\t\t$classArray = $this->buildValidationClassArray($element);\r\n\r\n\t\tif($element instanceof Zend_Form_Element_Text)\r\n\t\t\treturn $this->wrapInput($element, $this->renderTextElement($element, $classArray));\r\n\t\telse if($element instanceof Zend_Form_Element_Textarea)\r\n\t\t\treturn $this->wrapInput($element, $this->renderTextareaElement($element, $classArray));\r\n\t\telse if($element instanceof Zend_Form_Element_Password)\r\n\t\t\treturn $this->wrapInput($element, $this->renderPasswordElement($element, $classArray));\r\n\t\telse if($element instanceof Zend_Form_Element_Checkbox)\r\n\t\t\treturn $this->wrapInput($element, $this->renderCheckboxElement($element, $classArray), true);\r\n\t\telse if($element instanceof Zend_Form_Element_Submit)\r\n\t\t\treturn '';\r\n\t\telse if($element instanceof Zend_Form_Element_Hash)\r\n\t\t\treturn '<input type=\"hidden\" name=\"' . $element->getName() . '\" value=\"' . $element->getValue() . '\" />';\r\n\t\telse if($element instanceof Zend_Form_Element_Hidden)\r\n\t\t\treturn '<input type=\"hidden\" name=\"' . $element->getName() . '\" value=\"' . $element->getValue() . '\" />';\r\n\t\t\r\n\t\techo \"WTF:<pre>\" . print_r($element, true);\r\n\t\texit;\r\n }", "public function render(ElementInterface $element)\n {\n // unify elements, we also need the ID for the labels \"for\" attribute\n // and the container IDs\n if (! $element->getAttribute('id')) {\n $id = str_replace(['[', ']'], ['-', ''], $element->getName());\n $element->setAttribute('id', $id);\n }\n\n $ph = $this->getPartialHelper();\n\n $partial = 'vrok/partials/form/element';\n if (! empty($this->options['partial'])) {\n $partial = $this->options['partial'];\n }\n\n return $ph($partial, [\n 'element' => $element,\n ]);\n }", "public function render(Varien_Data_Form_Element_Abstract $element)\n {\n $this->setElement($element);\n $this->_setAddButton();\n return $this->toHtml();\n }", "protected function render( Nano_Element $element ) {\n $wrapper = $element->getWrapper();\n $type = $element->getType();\n $className = $element->getAttribute('class');\n $label = $element->getLabel();\n\n\n if ( null == ( $id = $element->getAttribute('id') ) ) {//generate unique id\n $count = $this->getElementCount();\n\n $eType = ( $eType = $element->getAttribute('type') ) ? $eType : $type;\n\n $element->setAttribute( 'id', sprintf('%s-element-%d', $eType, $count) );\n }\n\n if ( empty( $className ) ) {//generate auto classnames\n $className = $element->getClassName();\n }\n\n $content = $this->renderElement( $element );\n\n if ( null !== $label ) {//generate label around element\n $labelElement = new Nano_Element( 'label', array(\n 'for' => $element->getAttribute('id'),\n 'class' => \"label-\" . $element->getAttribute('type')\n ));\n\n $labelElement->setVertile();\n\n // checkbuttons and radios have a label on the right. saves gazillions of css.\n if ( in_array( $element->getAttribute('type'), array( 'checkbox', 'radio' ) ) ) {\n $content = $content . $this->renderElement( $labelElement->addContent( $label ) );\n }\n else {\n $content = $this->renderElement( $labelElement->addContent( $label ) ) . $content;\n }\n\n }\n\n if ( $type !== 'hidden' && !empty($wrapper) ) {\n $content = $this->renderElement( $wrapper->addContent( $content ) );\n }\n\n return sprintf( \"%s%s%s\", $element->getPrefix(), $content, $element->getSuffix() );\n }", "public function render(Varien_Data_Form_Element_Abstract $element){\n return $this->toHtml();\n }", "function jplesson_form_element($element, $value) {\n // This is also used in the installer, pre-database setup.\n $t = get_t();\n\n $output = '<div class=\"form-item '. $element['#attributes']['class'] .'\"';\n if (!empty($element['#id'])) {\n $output .= ' id=\"' . $element['#id'] . '-wrapper\"';\n }\n $output .= \">\\n\";\n $required = !empty($element['#required']) ? '<span class=\"form-required\" title=\"' . $t('This field is required.') . '\">*</span>' : '';\n\n if (!empty($element['#title'])) {\n $title = $element['#title'];\n if (!empty($element['#id'])) {\n $output .= ' <label for=\"' . $element['#id'] . '\">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n else {\n $output .= ' <label>' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n }\n\n $output .= \" $value\\n\";\n\n if (!empty($element['#description'])) {\n $output .= ' <div class=\"description\">' . $element['#description'] . \"</div>\\n\";\n }\n\n $output .= \"</div>\\n\";\n\n return $output;\n}", "public function _getElementHtml(\\Magento\\Framework\\Data\\Form\\Element\\AbstractElement $element)\n {\n $originalData = $element->getOriginalData();\n $this->addData(\n [\n 'button_label' => __($originalData['button_label']),\n 'button_url' => $this->getUrl($originalData['button_url']),\n 'html_id' => $element->getHtmlId(),\n ]\n );\n return $this->_toHtml();\n }", "public function button($element) {\n return $this->submit($element, 'button', 'Button');\n }", "function _renderDefault($element) {\n $messages = $this->getMessagesFor($element->getName());\n $hasMessages = count($messages) > 0 ? TRUE : FALSE;\n\n $divError = $hasMessages ? \"has-error\" : \"\";\n $html = \"<div class=\\\"form-group {$divError}\\\">\";\n $html .= \"<label class=\\\"control-label\\\" for=\\\"{$element->getName()}\\\">{$element->getLabel()}</label>\";\n $elementClasses = \"form-control \" . $element->getAttribute(\"class\", \"\");\n $element->setAttribute(\"class\", $elementClasses);\n $html .= $this->render($element->getName());\n if ($hasMessages)\n $html .= \"<span class=\\\"help-block\\\">{$messages[0]}</span>\";\n $html .= \"</div>\";\n return $html;\n }", "public function render(ElementInterface $element, $ignoreViewPartial = false)\n {\n $labelAttributes = $element->getLabelAttributes();\n $labelWidth = $element->getOption('labelWidth');\n if (!$labelWidth) {\n $labelWidth = $this->labelSpanWidth;\n }\n\n if ($element instanceof ViewPartialProviderInterface && !$ignoreViewPartial) {\n return $this->getView()->partial(\n $element->getViewPartial(),\n array(\n 'element' => $element,\n 'labelWitdh' => $labelWidth,\n 'label_attributes' => $labelAttributes\n )\n );\n }\n\n $escapeHtmlHelper = $this->getEscapeHtmlHelper();\n $labelHelper = $this->getLabelHelper();\n $elementHelper = $this->getElementHelper();\n $elementErrorsHelper = $this->getElementErrorsHelper();\n \n $inputErrorClass = $this->getInputErrorClass();\n $elementErrors = $elementErrorsHelper->render($element);\n \n // general Class\n $form_row_class = 'row';\n if ($this->layout == Form::LAYOUT_HORIZONTAL) {\n $form_row_class = 'form-group';\n }\n \n if (($elementRowClass = $element->getOption('rowClass')) != '') {\n $form_row_class .= ' '.$elementRowClass;\n }\n \n // Does this element have errors ?\n if (!empty($elementErrors) && !empty($inputErrorClass) && $this->layout != Form::LAYOUT_BARE) {\n $classAttributes = ($element->hasAttribute('class') ? $element->getAttribute('class') . ' ' : '');\n $classAttributes = $classAttributes . $inputErrorClass;\n \n $element->setAttribute('class', $classAttributes);\n }\n \n if (!$element->hasAttribute('id')) {\n $elementId = preg_replace(\n array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'),\n array('-' , '-', ''),\n $element->getName()\n );\n $element->setAttribute('id', $elementId);\n } else {\n $elementId = $element->getAttribute('id');\n }\n /*\n * add form-control class to all form elements, but \"submit\" or \"reset\" and Buttons!\n */\n if ($element->getAttribute('type') != 'submit'\n && $element->getAttribute('type') != 'reset'\n && $element->getAttribute('type') != 'checkbox'\n && !$element instanceof Button\n ) {\n $element->setAttribute('class', $element->getAttribute('class').' form-control ');\n }\n \n $elementString = $elementHelper->render($element, $ignoreViewPartial);\n $desc = $element->getOption('description', false);\n if ($desc && $this->layout != Form::LAYOUT_BARE) {\n if (null !== ($translator = $this->getTranslator())) {\n $desc = $translator->translate(\n $desc,\n $this->getTranslatorTextDomain()\n );\n }\n $elementString .= sprintf(\n '<div id=\"%s-desc\" class=\"cam-description alert alert-info\">%s</div>',\n $elementId,\n $desc\n );\n }\n \n if (!$element instanceof \\Zend\\Form\\Element\\Hidden\n && !$element instanceof \\Zend\\Form\\Element\\Button\n && $this->layout != Form::LAYOUT_BARE\n ) {\n $elementString .= sprintf(\n '<div id=\"%s-errors\" class=\"errors\">%s</div>',\n $elementId,\n $elementErrors\n );\n }\n \n // moved label here so we can change it in the ElementViewHelper\n $label = $element->getLabel();\n if (isset($label) && '' !== $label && !$element instanceof \\Zend\\Form\\Element\\Button) {\n // Translate the label\n if (null !== ($translator = $this->getTranslator())) {\n $label = $translator->translate(\n $label,\n $this->getTranslatorTextDomain()\n );\n }\n \n $label = $escapeHtmlHelper($label);\n $labelAttributes = $element->getLabelAttributes();\n \n if (empty($labelAttributes)) {\n $labelAttributes = $this->labelAttributes;\n }\n \n // Multicheckbox elements have to be handled differently as the HTML standard does not allow nested\n // labels. The semantic way is to group them inside a fieldset\n $type = $element->getAttribute('type');\n if ($type === 'multi_checkbox' || $type === 'radio') {\n $markup = sprintf(\n '<fieldset><legend>%s</legend>%s</fieldset>',\n $label,\n $elementString\n );\n } else {\n if ($this->layout == Form::LAYOUT_BARE) {\n $markup = $elementString;\n } else {\n if (!isset($labelAttributes['for'])) {\n $labelAttributes['for'] = $elementId;\n }\n if (Form::LAYOUT_HORIZONTAL == $this->layout) {\n if (!isset($labelAttributes['class'])) {\n $labelAttributes['class'] = '';\n }\n $labelAttributes['class'] .= ' control-label';\n }\n $element->setLabelAttributes($labelAttributes);\n\n $label = $labelHelper($element, $label);\n if ($this->shouldWrap) {\n $spanWidth = 12 - $labelWidth;\n $elementString = sprintf(\n '<div class=\"col-md-%d%s\" id=\"' . $elementId . '-span\">%s</div>',\n $spanWidth,\n $elementErrors ? \" $inputErrorClass\" : '',\n $elementString\n );\n $label = sprintf(\n '<div class=\"col-md-%d yk-label\">%s</div>',\n $labelWidth,\n $label\n );\n }\n $markup = $label . $elementString;\n }\n }\n } else {\n if ($this->shouldWrap\n && !$element instanceof \\Zend\\Form\\Element\\Hidden\n && !$element instanceof \\Zend\\Form\\Element\\Button\n && $this->layout != Form::LAYOUT_BARE\n ) {\n $elementString = sprintf(\n '<div class=\"col-md-12\">%s</div>',\n $elementString\n );\n }\n $markup = $elementString;\n }\n if ($this->shouldWrap\n && !$element instanceof \\Zend\\Form\\Element\\Hidden\n && !$element instanceof \\Zend\\Form\\Element\\Button\n && $this->layout != Form::LAYOUT_BARE\n ) {\n $markup = sprintf('<div class=\"controls controls-row ' . $form_row_class . '\">%s</div>', $markup);\n }\n \n return $markup;\n }", "function protocol_button($element) {\n if (isset($element['#attributes']['class'])) {\n $element['#attributes']['class'] = 'form-' . $element['#button_type'] . ' ' . $element['#attributes']['class'];\n }\n else {\n $element['#attributes']['class'] = 'form-' . $element['#button_type'];\n }\n\n return '<div class=\"button-wrapper-outer\"><div class=\"button-wrapper\"><input type=\"submit\" ' . (empty($element['#name']) ? '' : 'name=\"' . $element['#name'] . '\" ') . 'id=\"' . $element['#id'] . '\" value=\"' . check_plain($element['#value']) . '\" ' . drupal_attributes($element['#attributes']) . \" /></div></div>\\n\";\n}", "public function render(\\Magento\\Framework\\Data\\Form\\Element\\AbstractElement $element) {\n $this->setElement($element);\n\n return $this->toHtml();\n }", "function dapper_button($variables) {\n $element = $variables['element'];\n\n $element['#attributes']['type'] = 'submit';\n if ($element['#type'] == \"button\") {\n element_set_attributes($element, array('id', 'name', 'title'));\n return '<button' . drupal_attributes($element['#attributes']) . '>' . $element['#value'] . '</button>';\n\n } else {\n element_set_attributes($element, array('id', 'name', 'value'));\n\n $element['#attributes']['class'][] = 'form-' . $element['#button_type'];\n if (!empty($element['#attributes']['disabled'])) {\n $element['#attributes']['class'][] = 'form-button-disabled';\n }\n\n return '<input' . drupal_attributes($element['#attributes']) . ' />';\n\n }\n}", "public function render(ElementInterface $element, $labelPosition = null)\n {\n\n if ($element->getAttribute('type') != 'submit') {\n $elementAttributes = $element->getAttributes();\n if (isset($elementAttributes['class']) && $elementAttributes['class'] != null) {\n $elementAttributes['class'] .= ' form-control';\n } else {\n $elementAttributes['class'] = 'form-control';\n }\n $element->setAttributes($elementAttributes);\n }\n\n\n $row = parent::render($element, $labelPosition);\n return '<div class=\"form-group\">' . $row . '</div>';\n }", "function element_form($element, $record, $options = array())\n{\n $html = '';\n // If we have an array of Elements, loop through the form to display them.\n if (is_array($element)) {\n foreach ($element as $key => $e) {\n $html .= get_view()->elementForm($e, $record, $options);\n }\n } else {\n $html = get_view()->elementForm($element, $record, $options);\n }\n return $html;\n}", "public function render($content)\n {\n $element = $this->getElement();\n $view = $element->getView();\n if (null === $view) {\n require_once 'Zend/Form/Decorator/Exception.php';\n throw new Zend_Form_Decorator_Exception('UiWidgetElement decorator cannot render without a registered view object');\n }\n\n if(method_exists($element, 'getJQueryParams')) {\n $this->setJQueryParams($element->getJQueryParams());\n }\n $jQueryParams = $this->getJQueryParams();\n\n $helper = $this->getHelper();\n $separator = $this->getSeparator();\n $value = $this->getValue($element);\n $attribs = $this->getElementAttribs();\n $name = $element->getFullyQualifiedName();\n\n $id = $element->getId();\n $attribs['id'] = $id;\n\n $elementContent = $view->$helper($name, $value, $jQueryParams, $attribs);\n switch ($this->getPlacement()) {\n case self::APPEND:\n return $content . $separator . $elementContent;\n case self::PREPEND:\n return $elementContent . $separator . $content;\n default:\n return $elementContent;\n }\n }", "function form_button($data = '', $content = '', $extra = '')\n {\n $ci =& get_instance();\n $ci->load->library('user_agent');\n\n $defaults = array('name' => ((! is_array($data)) ? $data : ''), 'type' => 'submit');\n\n if (is_array($data) and isset($data['content'])) {\n $content = $data['content'];\n $data['value'] = $data['content'];\n unset($data['content']); // content is not an attribute\n }\n\n /*\n * if a user has IE 7, we need to show them an input tag instead of a button tag\n * because of the way IE 7 handles submitting multiple buttons (it send the\n * innerHTML instead of the value in the key=>value pair)\n */\n if ($ci->agent->browser() == 'Internet Explorer' && $ci->agent->version() < 8) {\n return \"<input \"._parse_form_attributes($data, $defaults).$extra.\" />\";\n } else {\n return \"<button \"._parse_form_attributes($data, $defaults).$extra.\"><span>\".$content.\"</span></button>\\n\";\n }\n }", "public function render(Varien_Data_Form_Element_Abstract $element)\n {\n $html\n = '\n <div>\n <div class=\"col-e-2 monetivo-logo\">\n </div>\n <div class=\"col-e-4\">\n <a href=\"https://merchant.monetivo.com/register\" class=\"m-button\" target=\"_blank\">Rejestracja</a>\n <br>\n Masz już konto?\n <a href=\"https://merchant.monetivo.com/login\" class=\"m-login\" target=\"_blank\">Zaloguj</a>\n </div>\n </div>';\n\n return $html;\n }", "public function render(ElementInterface $formElement, $value = '', $attributes = array())\n {\n $this->checkDependencies();\n\n $config = $this->di->get('config');\n\n if (empty($this->templateName) && !empty($config->forms->templates->default_name)) {\n $this->templateName = $config->forms->templates->default_name;\n }\n\n $this->variables['element'] = $formElement;\n $this->variables['value'] = $value;\n $this->variables['attributes'] = $attributes;\n\n $partial = $this->generatePartial();\n\n return $partial;\n }", "protected function _getElementHtml(\\Magento\\Framework\\Data\\Form\\Element\\AbstractElement $element)\n {\n $originalData = $element->getOriginalData();\n $this->addData(\n [\n 'button_label' => __($originalData['button_label']),\n 'html_id' => $element->getHtmlId(),\n 'ajax_url' => $this->_urlBuilder->getUrl('cms_data_sync/action/testConnection'),\n 'field_mapping' => str_replace('\"', '\\\\\"', json_encode($this->_getFieldMapping()))\n ]\n );\n\n return $this->_toHtml();\n }", "public function render($content){\n\n\n\t\t$attributes = array(\n\t\t\t\t'name' => 'Upload['.$this->getElement()->getName(false).']',\n\t\t\t\t'value' => 'Select a file',\n\t\t\t\t'type' => $this->getElement()->getType(),\n\t\t\t\t'data-url' => $this->getUploadUrl(),\n\t\t\t\t'multiple' => 'multiple'\n\t\t\t);\n\n\t\t$uploadsHtml = $this->renderUploads();\n\n\t\t$attributes = array_merge($attributes,$this->_element->getAttributes());\n\n\t\t$html = '<div class=\"input file\">';\n\t\t$html = $this->getForm()->getDecorator('error',$this->_element)->render($html);\n\t\t$html .= '<input '.\\Smally\\Util::toAttributes($attributes).'/> <span class=\"html5-browser\">'.__('FORM_DECORATOR_FILE_HELPER').'</span>';\n\t\t$html .= '<hr />';\n\t\t$html .= $this->getElement()->getItemTemplate();\n\t\t$html .= $uploadsHtml;\n\t\t$html = $this->getForm()->getDecorator('help',$this->_element)->render($html);\n\t\t$html .= '<hr />';\n\t\t$html .= '</div>';\n\n\t\treturn $this->concat($html,$content);\n\t}", "protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)\n {\n $this->setElement($element);\n $url = $this->getUrl('logmailer/adminhtml_manualsend/send');\n\n $html = $this->getLayout()->createBlock('adminhtml/widget_button')\n ->setType('button')\n ->setClass('scalable')\n ->setLabel($this->__('MANUALLY_SEND_NOW'))\n ->setOnClick(\"setLocation('$url')\")\n ->toHtml();\n\n return $html;\n }", "public function render()\n {\n $template = $this->_template ?: $this->_getDefaultButtonTemplate();\n return $template($this);\n }", "public function render(ElementInterface $element, array $displayOptions = array())\n {\n $labelContent = $element->getLabel();\n if (empty($labelContent)) {\n throw new DomainException(sprintf('%s: No label set in the element.', __METHOD__));\n }\n //Translate\n if (null !== ($translator = $this->getTranslator())) {\n $labelContent = $translator->translate($labelContent, $this->getTranslatorTextDomain());\n }\n //Escape\n $escaperHtml = $this->getEscapeHtmlHelper();\n $labelContent = $escaperHtml($labelContent);\n //Label attributes\n $labelAttributes = $element->getLabelAttributes();\n if (empty($labelAttributes)) {\n $labelAttributes = array();\n }\n $labelAttributes = $this->genUtil->addWordsToArrayItem('control-label', $labelAttributes, 'class');\n if (array_key_exists('required', $displayOptions) && $displayOptions['required']) {\n $labelAttributes = $this->genUtil->addWordsToArrayItem('required', $labelAttributes, 'class');\n }\n $element->setLabelAttributes($labelAttributes);\n $formLabelHelper = $this->formLabelHelper;\n return $formLabelHelper($element, $labelContent);\n }", "function minorite_button($variables) {\n $element = $variables['element'];\n element_set_attributes($element, array('id', 'name', 'title', 'value'));\n\n if ($element['#type'] == 'submit') {\n $element['#attributes']['type'] = 'submit';\n }\n\n // Adds CSS selector on icon button.\n if (isset($element['#icon'])) {\n $element['#value'] = '<i></i>' . $element['#value'];\n $element['#attributes']['class'][] = $element['#icon'];\n }\n\n return '<button' . drupal_attributes($element['#attributes']) . '>' . $element['#value'] . '</button>';\n}", "function bang_form_element($variables) {\n $element = &$variables['element'];\n\n // This function is invoked as theme wrapper, but the rendered form element\n // may not necessarily have been processed by form_builder().\n $element += array(\n '#title_display' => 'before',\n );\n\n // This is where changes have been introduced.\n // Base attributes on the #attributes value for the element and remember to\n // initialize the classes array.\n $attributes = $element['#wrapper_attributes'];\n if (!isset($attributes['class'])) {\n $attributes['class'] = array();\n }\n\n // Add element #id for #type 'item'.\n if (isset($element['#markup']) && !empty($element['#id'])) {\n $attributes['id'] = $element['#id'];\n }\n // Add element's #type and #name as class to aid with JS/CSS selectors.\n // Add the base form-item class to the array.\n $attributes['class'][] = 'form-item';\n if (!empty($element['#type'])) {\n $attributes['class'][] = 'form-type-' . strtr($element['#type'], '_', '-');\n }\n if (!empty($element['#name'])) {\n $attributes['class'][] = 'form-item-' . strtr($element['#name'],\n array(\n ' ' => '-',\n '_' => '-',\n '[' => '-',\n ']' => '',\n ));\n }\n // Add a class for disabled elements to facilitate cross-browser styling.\n if (!empty($element['#attributes']['disabled'])) {\n $attributes['class'][] = 'form-disabled';\n }\n\n $output = '<div' . drupal_attributes($attributes) . '>' . \"\\n\";\n\n // If #title is not set, we don't display any label or required marker.\n if (!isset($element['#title'])) {\n $element['#title_display'] = 'none';\n }\n $prefix = isset($element['#field_prefix']) ? '<span class=\"field-prefix\">' . $element['#field_prefix'] . '</span> ' : '';\n $suffix = isset($element['#field_suffix']) ? ' <span class=\"field-suffix\">' . $element['#field_suffix'] . '</span>' : '';\n\n switch ($element['#title_display']) {\n case 'before':\n case 'invisible':\n $output .= ' ' . theme('form_element_label', $variables);\n $output .= ' ' . $prefix . $element['#children'] . $suffix . \"\\n\";\n break;\n\n case 'after':\n $output .= ' ' . $prefix . $element['#children'] . $suffix;\n $output .= ' ' . theme('form_element_label', $variables) . \"\\n\";\n break;\n\n case 'none':\n case 'attribute':\n // Output no label and no required marker, only the children.\n $output .= ' ' . $prefix . $element['#children'] . $suffix . \"\\n\";\n break;\n }\n\n if (!empty($element['#description'])) {\n $output .= '<div class=\"description\">' . $element['#description'] . \"</div>\\n\";\n }\n\n $output .= \"</div>\\n\";\n\n return $output;\n}", "public function RenderElement() {\n\n // prepare most important attributes\n $Attr= $this->BuildAttributes(array('type'=>'checkbox'));\n // prepare attribute \"value\", remember - this is not value of [$Value, $InitValue]\n $Attr['value']= $this->GetOption('Value');\n // prepare attribute \"checked\"\n $Attr['checked']= $this->IsChecked() ? 'checked' : '';\n // render tag\n return $this->Form->RenderTag('input', $Attr, false);\n }", "public function render(ElementInterface $element)\n {\n $name = $element->getName();\n if ($name === null || $name === '') {\n throw new Exception\\DomainException(sprintf(\n '%s requires that the element has an assigned name; none discovered',\n __METHOD__\n ));\n }\n\n $attributes = $element->getAttributes();\n $attributes['type'] = $this->getType($element);\n $attributes['name'] = $name;\n if (array_key_exists('multiple', $attributes) && $attributes['multiple']) {\n $attributes['name'] .= '[]';\n }\n\n $value = $element->getValue();\n if (is_array($value) && isset($value['name']) && !is_array($value['name'])) {\n $attributes['value'] = $value['name'];\n } elseif (is_string($value)) {\n $attributes['value'] = $value;\n }\n\n $size = $element->getOption('size');\n\n if (empty($size)) {\n return sprintf(\n '<input %s%s',\n $this->createAttributesString($attributes),\n $this->getInlineClosingBracket()\n );\n }\n\n return sprintf(\n '<div class=\"col-lg-%s col-md-%s col-sm-%s col-xs-%s\">\n <input %s%s\n </div>',\n $size, $size, $size, $size,\n $this->createAttributesString($attributes),\n $this->getInlineClosingBracket()\n );\n }", "function minorite_form_element($variables) {\n $element = &$variables['element'];\n\n // Add element #id for #type 'item'.\n if (isset($element['#markup']) && !empty($element['#id'])) {\n $attributes['id'] = $element['#id'];\n }\n\n // If #title is not set, we don't display any label or required marker.\n if (!isset($element['#title'])) {\n $element['#title_display'] = 'none';\n }\n\n if (!isset($element['#title_display'])) {\n $element['#title_display'] = 'invisible';\n }\n\n $output = '';\n switch ($element['#title_display']) {\n case 'before':\n case 'invisible':\n $output .= theme('form_element_label', $variables);\n $output .= $element['#children'] . \"\\n\";\n break;\n\n case 'grid':\n $output .= '<p class=\"w-1\">' . theme('form_element_label', $variables) . \"</p>\\n\";\n $output .= '<p class=\"w-2\">' . $element['#children'] . \"</p>\\n\";\n break;\n\n case 'none':\n case 'after': // TODO.\n $output .= $element['#children'] . \"\\n\";\n break;\n }\n\n // If the element has help specified, append an icon.\n if (!empty($element['#description'])) {\n $help = theme('form_element_help', $variables);\n $grid = $element['#title_display'] == 'grid';\n $output .= ($grid ? '<p class=\"w-3\">' . $help . '</p>' : $help) . \"\\n\";\n }\n\n // If the element has grid specified, append a <p> tag.\n if (!empty($element['#grid'])) {\n $output = '<p class=\"' . $element['#grid'] . \"\\\">\\n\" . $output . \"</p>\\n\";\n }\n\n return $output;\n}", "public function ov_button($content){\n $args = func_get_args(); array_shift($args);\n $args[] = array('content' => $content);\n return $this->generate_input('button', '', null, false, $args);\n }", "function backend_button($caption, $attributes = array(), $ajaxHandler=null, $ajaxParams = null, $formElement = null)\n\t{\n\t\treturn Backend_Html::button($caption, $attributes, $ajaxHandler, $ajaxParams, $formElement);\n\t}", "public function buildElement()\n\t{\n\t\t$e = $this->getElement();\n\t\t$view = $e->getView();\n\t\t$helper = $e->helper;\t\t\n\t\t\n\t\t$type = $e->getType();\n\t\t\n\t\t$attribs = $e->getAttribs();\n\t\t\n\t\t/*$mode = self::MODE_FILE;\n\t\tif (is_string($attribs['selector_mode']) && in_array($attribs['selector_mode'], $this->_modes)) {\n\t\t\t$mode = $attribs['selector_mode'];\n\t\t}\n\t\t$attribs['selector_mode'] = $mode;*/\n\t\t\n\t\t$buttonLabel = '';\n\t\t\n\t\t$selectMultiple = 'false';\n\t\t$jsMethod = 'mainImageRenderer';\n\t\tif (isset($attribs['selectMultiple']) && !!$attribs['selectMultiple']) {\n\t\t\t$selectMultiple = 'true';\n\t\t\t$jsMethod = 'imagesRenderer';\n\t\t}\n\t\t\n\t\t$imgType = '';\n\t\tif (is_string($attribs['media-type'])) {\n\t\t\t$imgType = $attribs['media-type'];\n\t\t\tunset ($attribs['media-type']);\n\t\t}\n\t\t\n\t\t$xhtml = '<div class=\"' . $this->_namespace . '-tag\">'\n\t\t\t . $view->formHidden($e->getName(), $e->getValue(), array('media-type' => $imgType, 'select-multiple' => $selectMultiple, 'autocomplete' => \"off\"))\n\t\t\t . $view->$helper($e->getName(), $buttonLabel, $attribs, $e->options)\n\t\t\t . '<script>$(document).ready(function(){ $.fn.cmsManager(\\'' . $jsMethod . '\\', null, \\'' . $e->getName() . '\\'); })</script>'\n\t\t\t . '</div>';\t\t\t\n\t\n\t\treturn $xhtml;\n\t}", "function _renderRadio($element) {\n $messages = $this->getMessagesFor($element->getName());\n $hasMessages = count($messages) > 0 ? TRUE : FALSE;\n\n $divError = $hasMessages ? \"has-error\" : \"\";\n $html = \"<div class=\\\"radio {$divError}\\\">\";\n $html .= \"<label for=\\\"{$element->getName()}\\\">{$this->render($element->getName())} {$element->getLabel()}</label>\";\n if ($hasMessages)\n $html .= \"<span class=\\\"help-block\\\">{$messages[0]}</span>\";\n $html .= \"</div>\";\n return $html;\n }", "function form_element_submit( $name, $buttonlabel )\n{\n\treturn sprintf(\"<input type=\\\"submit\\\" name=\\\"%s\\\" value=\\\"%s\\\" />\\n\", $name, $buttonlabel );\n}", "public function render(Varien_Data_Form_Element_Abstract $element) {\n $this->_element = $element;\n if($this->_element->getValue()) {\n $lockDateTime = Mage::getSingleton('core/date');\n $lockDateTimeValue = $lockDateTime->date(Varien_Date::DATETIME_PHP_FORMAT, $this->_element->getValue());\n $this->_element->setValue($lockDateTimeValue);\n }\n $this->_element->setDisabled('disabled');\n return $this->toHtml();\n }", "public function renderError($element) {\n if (!isset($element['#error'])) {\n return '';\n }\n $output = '<label class=\"' . $this->css_class . '-error\" for=\"'\n . $element['#id'] . '\" generated=\"true\">'\n . $element['#error'] . '</label>' . \"\\r\\n\";\n// $output = '<div class=\"form-error '\n// . $this->css_class . '-error '\n// . $this->css_class . '-form-error '\n// . $this->css_class . '-' . $element['#type'] . '-error '\n// . $element['#type'] . '-error form-error-label'\n// . '\">' . $element['#error'] . '</div>'\n// . \"\\r\\n\";\n return $output;\n }", "public function renderElement( ElementInterface $element )\n {\n if ( ! method_exists( $this->view, 'plugin' ) )\n {\n // Bail early if renderer is not pluggable\n return '';\n }\n\n if ( $element instanceof HelperAwareInterface &&\n $plugin = $element->getRendererHelperName() )\n {\n $plugin = $this->tryLoadPlugin( $plugin );\n }\n\n if ( empty( $plugin ) )\n {\n $class = explode( '\\\\', get_class( $element ) );\n $plugin = $this->tryLoadPlugin( 'form_' . end( $class ) );\n }\n\n if ( empty( $plugin ) )\n {\n $plugin = $this->tryLoadPlugin( 'form_' .\n $element->getAttribute( 'type' ) );\n }\n\n if ( empty( $plugin ) )\n {\n $plugin = $this->tryLoadPlugin( 'form_input' );\n }\n\n $enabled = $this->isTranslatorEnabled();\n $textDomain = $this->getTranslatorTextDomain();\n\n if ( $element instanceof TranslatorSettingsAwareInterface )\n {\n $enabled = $element->isTranslatorEnabled();\n\n if ( null !== $element->getTranslatorTextDomain() )\n {\n $textDomain = $element->getTranslatorTextDomain();\n }\n }\n\n if ( method_exists( $plugin, 'setTranslatorEnabled' ) )\n {\n $plugin->setTranslatorEnabled( $enabled );\n }\n\n if ( $enabled )\n {\n if ( method_exists( $plugin, 'setTranslatorTextDomain' ) )\n {\n $plugin->setTranslatorTextDomain( $textDomain );\n }\n }\n\n return $plugin( $element );\n }", "public function render()\n {\n $boton = '<button type=\"' . $this->_type . '\" value=\"' . $this->_value . '\"';\n if ($this->_form) {\n $boton .= ' form=\"' . $this->_form . '\" ';\n }\n if ($this->_name) {\n $boton .= ' name=\"' . $this->_name. '\" ';\n }\n if ($this->_autoFocus) {\n $boton .= ' autofocus=\"' . $this->_autoFocus. '\" ';\n }\n if ($this->_disabled) {\n $boton .= ' disabled ';\n }\n if ($this->getClass()) {\n $boton .= 'class=\"' . $this->getClass() . '\" ';\n }\n if ($this->_id) {\n $boton .= 'id=\"' . $this->_id . '\" ';\n }\n \n $boton .= '>' . $this->_value . '</button>' . \"\\n\";\n $boton = str_replace(\" \", \" \", $boton);\n return $boton;\n }", "function input_submit($element_name, $label) {\r\n print '<input type=\"submit\" name=\"' . $element_name .'\"id=\"'.$element_name.'\" value=\"';\r\n print htmlentities($label, ENT_NOQUOTES, 'UTF-8') .'\"/>';\r\n}", "public function render_content() {\n\t\tif ( ! empty( $this->button_text ) ) {\n\t\t\techo '<button type=\"button\" class=\"button menu-shortcut ' . esc_attr( $this->button_class ) . '\" tabindex=\"0\">';\n\t\t\tif ( ! empty( $this->button_class ) ) {\n\t\t\t\techo '<i class=\"fa ' . esc_attr( $this->icon_class ) . '\" style=\"margin-right: 10px\"></i>';\n\t\t\t}\n\t\t\techo esc_html( $this->button_text );\n\t\t\techo '</button>';\n\t\t}\n\t}", "protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {\n $this->addData(array(\n 'html_id' => $element->getHtmlId(),\n ));\n return $this->getButtonHtml();\n }", "public function render($content)\r\n\t{\r\n\t\t$element = $this->getElement();\r\n\t\t$view = $element->getView();\r\n\t\tif (null === $view) {\r\n\t\t\treturn $content;\r\n\t\t}\r\n\t\r\n\t\t$dijitParams = $this->getDijitParams();\r\n\t\t$attribs = array_merge($this->getAttribs(), $this->getOptions());\r\n\t\r\n\t\treturn $view->{$this->_helper}($element->getName(), $attribs, $content);\r\n\t}", "function form_button($value, $js='', $name = '') {\n\n\tif (!$name) {\n\t\t$name = $value;\n\t}\n\n\t$override = NULL;\n\t$value = html_form_escape($value, $override);\n\n\treturn \"<input type=\\\"button\\\" name=\\\"$name\\\" value=\\\"$value\\\" $js />\";\n\n}", "private function _field($elements, $isMultiInput) {\r\n\t\t$form = '<div class=\"field\" id=\"element-' . $elements[0]['id'] . '\">'; \r\n\t\t$form .= '<div class=\"two columns alpha\">';\r\n\t\t$form .= '<label>' . __($elements[0]['name']) . '</label>'; \r\n\t\t$form .= '<button name=\"add_element_' . $elements[0]['id'] . '\" id=\"add_element_' . $elements[0]['id'] . '\" type=\"button\" value=\"Add Input\" class=\"add-element\">Add Input</button>';\r\n\t\t$form .= '</div>';\r\n\t\t$form .= '<div class=\"inputs five columns omega\">';\r\n\t\t$form .= '<p class=\"explanation\">' . __($elements[0]['description']) . '</p>';\r\n\t\t$form .= $this->_inputBlock($elements, $isMultiInput);\r\n\t\t$form .= '</div>';\r\n\t\t$form .= '</div>';\r\n\t\t\r\n\t\treturn $form;\r\n\t}", "public function buildHTML()\n {\n $view = $this->container;\n $attr = [];\n if (is_array($this->container)) {\n if (isset($this->container[0])) {\n list($view, $attr) = $this->container;\n } else {\n $view = 'webarq::manager.cms.form.element';\n $attr = $this->container;\n }\n }\n\n if ('hidden' === $this->type) {\n return $this->buildInput();\n }\n\n return view($view, [\n 'title' => $this->getTitle(),\n 'input' => $this->buildInput(),\n 'attribute' => Arr::merge((array)$attr, ['class' => 'form-group'], 'join'),\n 'info' => $this->info,\n 'type' => $this->type\n ] + get_object_vars($this))->render();\n }", "public function render()\n {\n return view('components.submit-button',[\n 'content' => $this->content,\n 'size' => $this->size,\n 'block' => $this->block,\n 'confirmation' => $this->confirmation,\n 'color' => $this->color,\n ]);\n }", "public function renderElement(array $element)\n {\n $content = $this->prepend($element['prepend']) . $element['content'] . $this->append($element['append']);\n\n if (empty($content) && isset($element['allowEmpty']) && $element['allowEmpty'] === false) {\n return '';\n }\n\n if (isset($element['formatter']) && is_callable($element['formatter'])) {\n $content = call_user_func($element['formatter'], $element, $content);\n }\n\n if ($element['tag'] === false) {\n return $content;\n }\n\n return Html::tag($element['tag'], $content, $element['options']);\n }", "protected function renderElement() {\n $result = \"\";\n $result .= $this->getOpeningTag();\n $result .= (!empty($this->options['content'])) ? $this->options['content'] : \"\";\n $result .= $this->getClosingTag();\n return $result;\n }", "public function render($content)\n\t{\n\t\t$tag\t = $this->getTag();\n\t\t$placement = $this->getPlacement();\n\t\t$noAttribs = $this->getOption('noAttribs');\n\t\t$openOnly = $this->getOption('openOnly');\n\t\t$closeOnly = $this->getOption('closeOnly');\n\t\t$this->removeOption('noAttribs');\n\t\t$this->removeOption('openOnly');\n\t\t$this->removeOption('closeOnly');\n\n\t\t$attribs = null;\n\t\tif (!$noAttribs) {\n\t\t\t$attribs = $this->getOptions();\n\t\t}\n\n\t\t$element = $this->getElement();\n\t\t$errors = $element->getMessages();\n\t\tif ( ! empty($errors)) {\n\t\t\t$attribs['class'] .= ' error';\n\t\t}\n\t\telse {\n\t\t\t$attribs['class'] = str_replace(' error', '', $attribs['class']);\n\t\t}\n\n\t\tswitch ($placement) {\n\t\t\tcase self::APPEND:\n\t\t\t\tif ($closeOnly) {\n\t\t\t\t\treturn $content . $this->_getCloseTag($tag);\n\t\t\t\t}\n\t\t\t\tif ($openOnly) {\n\t\t\t\t\treturn $content . $this->_getOpenTag($tag, $attribs);\n\t\t\t\t}\n\t\t\t\treturn $content\n\t\t\t\t\t . $this->_getOpenTag($tag, $attribs)\n\t\t\t\t\t . $this->_getCloseTag($tag);\n\t\t\tcase self::PREPEND:\n\t\t\t\tif ($closeOnly) {\n\t\t\t\t\treturn $this->_getCloseTag($tag) . $content;\n\t\t\t\t}\n\t\t\t\tif ($openOnly) {\n\t\t\t\t\treturn $this->_getOpenTag($tag, $attribs) . $content;\n\t\t\t\t}\n\t\t\t\treturn $this->_getOpenTag($tag, $attribs)\n\t\t\t\t\t . $this->_getCloseTag($tag)\n\t\t\t\t\t . $content;\n\t\t\tdefault:\n\t\t\t\treturn (($openOnly || !$closeOnly) ? $this->_getOpenTag($tag, $attribs) : '')\n\t\t\t\t\t . $content\n\t\t\t\t\t . (($closeOnly || !$openOnly) ? $this->_getCloseTag($tag) : '');\n\t\t}\n\t}", "function vals_soc_fix_submit_button($markup, $element) {\n $markup = str_replace('type=\"submit', 'type=\"button', $markup);\n return $markup;\n}", "public static function preRenderWebformElement($element) {\n $webform = ($element['#webform'] instanceof WebformInterface) ? $element['#webform'] : WebformEntity::load($element['#webform']);\n if (!$webform) {\n return $element;\n }\n\n if ($webform->access('submission_create')) {\n $values = [];\n\n // Set data.\n $values['data'] = $element['#default_data'];\n\n // Set source entity type and id.\n if (!empty($element['#entity']) && $element['#entity'] instanceof EntityInterface) {\n $values['entity_type'] = $element['#entity']->getEntityTypeId();\n $values['entity_id'] = $element['#entity']->id();\n }\n elseif (!empty($element['#entity_type']) && !empty($element['#entity_id'])) {\n $values['entity_type'] = $element['#entity_type'];\n $values['entity_id'] = $element['#entity_id'];\n }\n\n // Build the webform.\n $element['webform_build'] = $webform->getSubmissionForm($values);\n\n // Set custom form action.\n if (!empty($element['#action'])) {\n $element['webform_build']['#action'] = $element['#action'];\n }\n }\n elseif ($webform->getSetting('form_access_denied') !== WebformInterface::ACCESS_DENIED_DEFAULT) {\n // Set access denied message.\n $element['webform_access_denied'] = static::buildAccessDenied($webform);\n }\n else {\n // Add config and webform to cache contexts.\n $config = \\Drupal::configFactory()->get('webform.settings');\n $renderer = \\Drupal::service('renderer');\n $renderer->addCacheableDependency($element, $config);\n $renderer->addCacheableDependency($element, $webform);\n }\n\n return $element;\n }", "private function renderButton()\n {\n $this->params = Json::encode([\n 'btnName' => $this->options['id'],\n 'cookieName' => $this->cookie['name'],\n 'cookieValue' => addslashes($this->getHashedCookieValue($this->cookie['value'])),\n 'cookieOptions' => isset($this->cookie['options']) ? $this->cookie['options'] : null,\n ]);\n\n if($this->cookie($this->cookie['name'])) {\n Html::addCssClass($this->options, 'active');\n }\n\n echo Button::widget([\n 'label' => $this->encodeLabel ? Html::encode($this->label) : $this->label,\n 'encodeLabel' => $this->encodeLabel,\n 'options' => ArrayHelper::merge(['data-toggle' => 'button'], $this->options),\n 'tagName' => $this->buttonTagName\n ]);\n }", "public function render()\n {\n return (new Button($this->attributes, [\n new Italic(['class' => 'icon ' . $this->icon]),\n $this->content,\n ]))->render();\n }", "public function render()\n {\n return <<<'blade'\n<button {{ $attributes->merge(['class' => 'btn', 'type' => '']) }}>\n\t{{ $text }}\n</button>\nblade;\n }", "public function init(){\n\t\t\n\t\tparent::init();\n\t\t\n\t\t$this->_html .= $this->get_label();\n\t\t\n\t\t$this->_html .= '<input type=\"submit\" ';\n\t\t\n\t\tif(isset($this->_options['id'])){\n\t\t\t$this->_html .= 'id=\"'.$this->_options['id'].'\" ';\n\t\t}\n\t\t\n\t\tif(isset($this->_options['class'])){\n\t\t\t$this->_html .= 'class=\"'.$this->_options['class'].'\" ';\n\t\t}\n\t\t\n\t\tif(isset($this->_options['value'])){\n\t\t\t$this->_html .= 'value=\"'.$this->_options['value'].'\" ';\n\t\t}\t\n\t\t\n\t\tif(isset($this->_options['name'])){\n\t\t\t$this->_html .= 'name=\"'.esc_attr($this->_options['name']).'\" ';\n\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t$this->_html .= ' />';\n\t}", "public function render()\n {\n $content = \"Ext.create('Ext.form.Panel', {\";\n \n $content .= \"frame: true\";\n \n if ($this->getAction()) {\n $content .= \", url: '\" . $this->getAction() . \"'\";\n }\n \n foreach ($this->getAttribs() as $name => $value) {\n $content .= \", \";\n \n switch ($name) {\n case 'renderTo':\n $content .= \"renderTo: Ext.get('\" . (string)$value . \"')\";\n break;\n case 'height':\n case 'width':\n $content .= $name . \": \" . (int)$value;\n break;\n case 'standardSubmit':\n case 'hidden':\n $content .= $name . \": \" . ((boolean)$value === true ? 'true' : 'false');\n break;\n case 'onEnter':\n $content .= \"listeners: {\n afterRender: function(form, options){\n this.keyNav = Ext.create('Ext.util.KeyNav', this.el, {\n enter: function() {\" . $value . \"},\n scope: this\n });\n }\n }\";\n break;\n case 'defaults':\n $content .= \"defaults: \" . (string)$value;\n break;\n default:\n $content .= $name . \": '\" . htmlspecialchars((string)$value, ENT_QUOTES) . \"'\";\n break;\n }\n }\n \n if (!$this->getAttrib('renderTo')) {\n $content .= \", renderTo: Ext.getBody()\";\n }\n \n $content .= \", items: [\";\n \n if ($this->hasSubForms()) {\n $iterator = new ArrayIterator($this->getSubForms());\n while($iterator->valid()) {\n $subForm = $iterator->current();\n $content .= \"{\";\n \n if ($subForm->getAttrib('width')) {\n $content .= \"width: \" . (int)$subForm->getAttrib('width') . \",\";\n }\n \n $content .= $subForm->render();\n \n $content .= \"}\";\n \n $iterator->next();\n if ($iterator->valid()) {\n $content .= \",\";\n } \n }\n }\n \n if ($this->hasElements()) {\n $iterator = new ArrayIterator($this->getElements());\n while ($iterator->valid()) {\n $element = $iterator->current();\n $content .= $element->render();\n \n $iterator->next();\n if ($iterator->valid()) {\n $content .= \",\";\n }\n }\n }\n\n $content .= \"],\";\n \n $content .= \"buttons: [\";\n \n $iterator = new ArrayIterator($this->getButtons());\n while ($iterator->valid()) {\n $button = $iterator->current();\n \n $content .= $button->render();\n \n $iterator->next();\n \n if ($iterator->valid()) {\n $content .= \",\";\n }\n \n }\n \n $content .= \"]\";\n \n $content .= '});';\n \n return $content;\n }", "public static function processIdLabel(&$element, FormStateInterface $form_state, &$form) {\n $default_values = isset($element['#default_value']) ? $element['#default_value'] : NULL;\n $parents = $element['#parents'];\n $cardinality = $element['#cardinality'];\n $id = $element['#id_label_id'];\n $id_prefix = implode('-', $parents);\n $wrapper_id = Html::getUniqueId($id_prefix . '-add-more-wrapper-' . $id);\n $element_state = static::getElementState($parents, $form_state);\n if ($element_state === NULL) {\n $element_state = [\n 'items_count' => !empty($default_values) ? count($default_values) - 1 : 0,\n ];\n static::setElementState($parents, $form_state, $element_state);\n }\n // Determine the number of elements to display.\n $max = $cardinality === self::CARDINALITY_UNLIMITED ? $element_state['items_count'] : ($cardinality - 1);\n for ($i = 0; $i <= $max; $i++) {\n $element[$i]['title'] = [\n '#type' => 'markup',\n '#markup' => \"<h5>Réponse \" . ($i + 1) . \" : </h5>\",\n ];\n $element[$i]['id'] = [\n '#type' => 'textfield',\n '#title' => t('Id'),\n '#required' => TRUE,\n '#default_value' => isset($default_values[$i]['id']) && !empty($default_values[$i]['id']) ? $default_values[$i]['id'] : '',\n ];\n\n $element[$i]['label'] = [\n '#type' => 'textfield',\n '#title' => t('Label'),\n '#required' => TRUE,\n '#default_value' => isset($default_values[$i]['label']) && !empty($default_values[$i]['label']) ? $default_values[$i]['label'] : '',\n ];\n\n $element[$i]['goto'] = [\n '#type' => 'textfield',\n '#title' => t('Go to'),\n '#default_value' => isset($default_values[$i]['goto']) && !empty($default_values[$i]['goto']) ? $default_values[$i]['goto'] : '',\n ];\n }\n\n if ($cardinality === self::CARDINALITY_UNLIMITED && !$form_state->isProgrammed()) {\n\n $element['#prefix'] = '<div id=\"' . $wrapper_id . '\">';\n $element['#suffix'] = '</div>';\n $element['add_more'] = [\n '#type' => 'submit',\n '#name' => strtr($id_prefix, '-', '_') . '_add_more_' . $id,\n '#value' => \"add more\",\n '#attributes' => ['class' => ['id-label-add-more-submit']],\n '#submit' => [[static::class, 'addMoreSubmit']],\n '#ajax' => [\n 'callback' => [static::class, 'addMoreAjax'],\n 'wrapper' => $wrapper_id,\n 'effect' => 'fade',\n ],\n ];\n if ($max !== 0) {\n $element['delete_item'] = [\n '#type' => 'submit',\n '#name' => strtr($id_prefix, '-', '_') . '_delete_item_' . $id,\n '#value' => \"delete item\",\n '#attributes' => ['class' => ['id-label-delete-item-submit']],\n '#submit' => [[static::class, 'deleteItemSubmit']],\n '#limit_validation_errors' => [$element['#array_parents']],\n '#ajax' => [\n 'callback' => [static::class, 'addMoreAjax'],\n 'wrapper' => $wrapper_id,\n 'effect' => 'fade',\n ],\n ];\n }\n\n }\n\n return $element;\n }", "public function buildElement() {\n\n // Set the element type\n $this->addType('example');\n\n // Add the element attributes\n $this->addAttributes(array(\n // Some attributes\n ));\n\n // Example if we need to add child object\n // to this element\n $object = new VTCore_Form_Base();\n $object->addType('example_child');\n $object->addAttributes(array(\n // Some Attributes\n ));\n\n // Adding a plaing text as child of subchild\n $object->addText('some text');\n\n // Inject the child and subchild back to parent\n $this->addChildren($object);\n\n // No need to echo or print anything, all the\n // actual rendering will be performed by\n // VTCore_Form_Base() when user is invoking\n // the render or __toString method.\n }", "public function render()\n {\n echo htmlspecialcharsbx($this->getPrefix());\n $action = $this->getAction();\n $id = $this->getId();\n $class = $this->getClass();\n $name = $this->getName();\n $dataAttributes = $this->getDataAttributes();\n $dataAttributesString = '';\n foreach ($dataAttributes as $key => $value) {\n $dataAttributesString .= ' data-' . $key . '=\"' . $value . '\" ';\n }\n\n $formArguments = 'action=\"' . (($action !== null) ? $action : '#') . '\" ';\n $formArguments .= ($id !== null) ? 'id=\"' . $id . '\" ' : '';\n $formArguments .= !empty($class) ? 'class=\"' . implode(' ', $class) . '\" ' : '';\n $formArguments .= ($name !== null) ? 'name=\"' . $name . '\" ' : '';\n $formArguments .= $dataAttributesString;\n echo '<form ' . $formArguments . '>';\n\n $fields = $this->getFields();\n foreach ($fields as $key => $field) {\n $field->render();\n }\n\n echo '</form>';\n\n echo htmlspecialcharsbx($this->getPostfix());\n }", "public function render(Varien_Data_Form_Element_Abstract $element)\n {\n $html = '<tr style=\"height: 13px;\"><td colspan=\"4\"></td></tr>';\n $html .= '<tr>';\n $html .= '<td colspan=\"4\">';\n $html .= $this->_getElementHtml($element);\n\n if ($element->getComment()) {\n $html .= '<p class=\"note\" style=\"margin-left: 20px; margin-bottom: 15px;\">';\n $html .= '<span>' . $element->getComment() . '</span>';\n $html .= '</p>';\n }\n\n $html .= '</td>';\n $html .= '</tr>';\n\n return $html;\n }", "public function renderWidget()\n {\n $id = $this->attr['id'];\n $name = $this->attr['name'];\n $contents = '';\n $values = $this->getValue();\n foreach ( $this->params['choices'] as $key => $label )\n {\n $options = $this->params;\n $options['attr'] = $this->attr;\n $options['attr']['id'] = $id . \"_$key\";\n $options['attr']['name'] = $name . \"[$key]\";\n $options['attr']['value'] = $key;\n if ( isset( $values[$key] ) && $values[$key] )\n {\n $options['attr']['checked'] = 'checked';\n }\n $widget = new InputCheckboxWidget( $options );\n $contents .= HtmlToolkit::buildTag( 'label', array(), false, $widget->render() . ' ' . $label );\n }\n\n return $contents;\n }", "protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)\n {\n $html = parent::_getElementHtml($element);\n\t\t$html .= '<input type=\"hidden\" name=\"category_dummy\" id=\"'.$element->getHtmlId().'\" />';\n return $html;\n }", "function render( &$definition )\n {\n $html = null;\n $id = call_user_func_array(array(&$this, 'fetchId'), array($definition));\n $action = call_user_func_array(array(&$this, 'fetchButton'), $definition);\n\n // Build id attribute\n if ($id) {\n $id = \"id=\\\"$id\\\"\";\n }\n\n // Build the HTML Button\n $html .= \"<li class=\\\"button\\\" $id>\\n\";\n $html .= $action;\n $html .= \"</li>\\n\";\n\n return $html;\n }", "protected function getField( $aField ) {\n \n $aField['label'] = $aField['label'] ? $aField['label'] : $this->oMsg->get( 'submit' );\n \n if ( isset( $aField['attributes']['src'] ) ) {\n $aField['attributes']['src'] = $this->resolveSRC( $aField['attributes']['src'] );\n }\n $_bIsImageButton = isset( $aField['attributes']['src'] ) && filter_var( $aField['attributes']['src'], FILTER_VALIDATE_URL );\n $_aInputAttributes = array(\n // the type must be set because child class including export will use this method; in that case, the export type will be assigned which input tag does not support\n 'type' => $_bIsImageButton ? 'image' : 'submit', \n 'value' => ( $_sValue = $this->_getInputFieldValueFromLabel( $aField ) ),\n ) \n + $aField['attributes']\n + array(\n 'title' => $_sValue,\n 'alt' => $_bIsImageButton ? 'submit' : '',\n );\n\n $_aLabelAttributes = array(\n 'style' => $aField['label_min_width'] ? \"min-width:\" . $this->sanitizeLength( $aField['label_min_width'] ) . \";\" : null,\n 'for' => $_aInputAttributes['id'],\n 'class' => $_aInputAttributes['disabled'] ? 'disabled' : null,\n );\n $_aLabelContainerAttributes = array(\n 'style' => $aField['label_min_width'] ? \"min-width:\" . $this->sanitizeLength( $aField['label_min_width'] ) . \";\" : null,\n 'class' => 'admin-page-framework-input-label-container admin-page-framework-input-button-container admin-page-framework-input-container',\n );\n\n return \n $aField['before_label']\n . \"<div \" . $this->generateAttributes( $_aLabelContainerAttributes ) . \">\"\n . $this->_getExtraFieldsBeforeLabel( $aField ) // this is for the import field type that cannot place file input tag inside the label tag.\n . \"<label \" . $this->generateAttributes( $_aLabelAttributes ) . \">\"\n . $aField['before_input']\n . $this->_getExtraInputFields( $aField )\n . \"<input \" . $this->generateAttributes( $_aInputAttributes ) . \" />\" // this method is defined in the base class\n . $aField['after_input']\n . \"</label>\"\n . \"</div>\"\n . $aField['after_label'];\n \n }", "public function jQueryUIButtonsetElement($name, $value = null, $attribs = null, $options = null)\n {\n $this->view->jQuery()->addOnLoad(\"$('#button-set-$name').buttonset(); $('#button-set-$name').parents('.form-prompt').css('min-height', '2.6em'); \");\n\n //get data from values\n $default = isset($value) ? $value : null;\n $theme = $attribs['ui-theme'];\n $size = $attribs['ui-size'];\n $radioAttribs = $attribs['radio'];\n $this->html = \"<span id='button-set-$name' class='$theme $size'>\";\n $this->html .= $this->view->fisdapFormRadio($name, $default, $radioAttribs, $options, \"\");\n $this->html .= \"</span>\";\n\n\n\n return $this->html;\n }", "public function render()\n {\n $label = $this->presentLabel();\n\n return '<div class=\"form-group\">'.PHP_EOL.$label.$this->renderInner().'</div>';\n }", "public function render()\n {\n return view('itlogiko::components.submit-button');\n }", "public function render_content() {\n\n\t\t\t// Process the palette\n\t\t\tif ( is_array( $this->palette ) ) {\n\t\t\t\t$palette = implode( '|', $this->palette );\n\t\t\t} else {\n\t\t\t\t// Default to true.\n\t\t\t\t$palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true';\n\t\t\t}\n\n\t\t\t// Support passing show_opacity as string or boolean. Default to true.\n\t\t\t$show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true';\n\n\t\t\t?>\n\t\t\t\t<label>\n\t\t\t\t\t<?php\n\t\t\t\t\t// Output the label and description if they were passed in.\n\t\t\t\t\tif ( isset( $this->label ) && '' !== $this->label ) {\n\t\t\t\t\t\techo '<span class=\"customize-control-title\">' . esc_html( sanitize_text_field( $this->label ) ) . '</span>';\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset( $this->description ) && '' !== $this->description ) {\n\t\t\t\t\t\techo '<span class=\"description customize-control-description\">' . esc_html( sanitize_text_field( $this->description ) ) . '</span>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t\t<input class=\"alpha-color-control\" type=\"text\" data-show-opacity=\"<?php echo esc_attr( $show_opacity ); ?>\" data-palette=\"<?php echo esc_attr( $palette ); ?>\" data-default-color=\"<?php echo esc_attr( $this->settings['default']->default ); ?>\" <?php $this->link(); ?> />\n\t\t\t<?php\n\t\t}", "public function render(ElementInterface $element)\n {\n $name = $element->getName();\n if (empty($name) && $name !== 0) {\n throw new Exception\\DomainException(sprintf(\n '%s requires that the element has an assigned name; none discovered',\n __METHOD__\n ));\n }\n\n $attributes = $element->getAttributes();\n $attributes['name'] = $name;\n $content = (string) $element->getValue();\n $escapeHtml = $this->getEscapeHtmlHelper();\n\n if (! isset($attributes['id']))\n $attributes['id'] = $name;\n\n $size = $element->getAttribute('size');\n if (empty($size)) {\n return sprintf(\n '<textarea %s>%s</textarea>',\n $this->createAttributesString($attributes),\n $escapeHtml($content)\n );\n }\n\n return sprintf(\n '<div class=\"col-lg-%s col-md-%s col-sm-%s col-xs-%s\">\n <textarea %s>%s</textarea>\n </div>', $size, $size, $size, $size,\n $this->createAttributesString($attributes), $escapeHtml($content)\n );\n }", "public function render_content()\n {\n if ( !empty( $this->label ) && !empty( $this->url ) ) : ?>\n <a\n href=\"<?= esc_url( $this->url ) ?>\"\n title=\"<?= esc_attr( !empty( $this->description ) ? $this->description : $this->label ) ?>\"\n target=\"<?= esc_attr( $this->target ) ?>\"\n ><?= esc_html( $this->label ) ?></a>\n <?php endif;\n }", "protected function render_text() {\n $settings = $this->get_settings_for_display();\n\n $this->add_render_attribute( [\n 'content-wrapper' => [\n 'class' => 'elementor-button-content-wrapper',\n ],\n 'icon-align' => [\n 'class' => [\n 'elementor-button-icon',\n 'elementor-align-icon-' . $settings['icon_align'],\n ],\n ],\n 'text' => [\n 'class' => 'elementor-button-text',\n ],\n ] );\n\n $this->add_inline_editing_attributes( 'text', 'none' );\n ?>\n <span <?php echo $this->get_render_attribute_string( 'content-wrapper' ); ?>>\n <?php if ( ! empty( $settings['icon'] ) ) : ?>\n <span <?php echo $this->get_render_attribute_string( 'icon-align' ); ?>>\n <i class=\"<?php echo esc_attr( $settings['icon'] ); ?>\" aria-hidden=\"true\"></i>\n </span>\n <?php endif; ?>\n <span <?php echo $this->get_render_attribute_string( 'text' ); ?>><?php echo $settings['text']; ?></span>\n </span>\n <?php\n }", "public function render(Varien_Data_Form_Element_Abstract $element)\n {\n $country = $this->getRequest()->getParam(self::REQUEST_PARAM_COUNTRY);\n if ($country) {\n $element->setValue($country);\n }\n\n if ($element->getCanUseDefaultValue()) {\n $defaultConfigNode = Mage::getConfig()->getNode(null, 'default');\n if ($defaultConfigNode) {\n $this->_defaultCountry = (string)$defaultConfigNode->descend('paypal/general/merchant_country');\n }\n if (!$this->_defaultCountry) {\n $this->_defaultCountry = Mage::helper('core')->getDefaultCountry();\n }\n if ($country) {\n $shouldInherit = $country == $this->_defaultCountry\n && $this->getRequest()->getParam(self::REQUEST_PARAM_DEFAULT);\n $element->setInherit($shouldInherit);\n }\n if ($element->getInherit()) {\n $this->_defaultCountry = null;\n }\n }\n\n return parent::render($element);\n }", "public function addElementInMiddle(IElement $element): IFormBuilder;", "public function render() {\n $formContainsRequiredFields = FALSE;\n $htmlElements = array();\n\n foreach($this->elements as $element) {\n if(!$this->getMarkRequiredFields()) {\n $element['object']->markIfRequired(FALSE);\n }\n\n if($element['object']->isRequired()) $formContainsRequiredFields = TRUE;\n $element['object']->render();\n if($element['object']->errorOccured()) $this->setError(TRUE);\n\n $htmlElements[] = $element['object']->fetch();\n $this->javascripts .= $element['object']->getJavaScripts();\n }\n\n $this->html = implode(\"\\n<span class=\\\"element_separator\\\">&nbsp;</span>\", $htmlElements);\n $preForm = (bool)$this->headline ? FORMWIZARD_PRE_FORM_HEADLINE : FORMWIZARD_PRE_FORM;\n\n $html = NULL;\n\n $html .= '<style type=\"text/css\">@import url('.FORMWIZARD_CSS_URL.\");</style>\\n\";\n $html .= str_replace('{headline}', $this->headline, $preForm);\n $html .= \"\\n\".'<form name=\"'.$this->name.'\" method=\"'.$this->method.'\" action=\"'.$this->action.'\" enctype=\"multipart/form-data\">';\n $html .= \"\\n\".'<input type=\"hidden\" name=\"__'.$this->name.'_submitted\" value=\"1\" />';\n $html .= \"\\n\".$this->html;\n $html .= \"\\n\".'</form>';\n $html .= \"\\n\".'<script type=\"text/javascript\">'.$this->javascripts.'</script>';\n\n if($formContainsRequiredFields && $this->markRequiredFields) {\n $html .= \"\\n\".FORMWIZARD_LEGEND_REQUIRED_FIELD;\n }\n\n $this->html = $html.\"\\n\".FORMWIZARD_POST_FORM;\n\n $this->isRendered = TRUE;\n }", "public function render(): void\n {\n $this->label->render();\n $this->input = $this->reader->read();\n }", "protected function buildElementLabel($data, $form)\n {\n $helpMessage = '';\n if ($form->settings['layout']['helpMessagePlacement'] == 'with_label') {\n $helpMessage = $this->getLabelHelpMessage($data);\n }\n\n $id = isset($data['attributes']['id']) ? $data['attributes']['id'] : '';\n $label = isset($data['settings']['label']) ? $data['settings']['label'] : '';\n $requiredClass = $this->getRequiredClass(ArrayHelper::get($data, 'settings.validation_rules', []));\n $classes = trim('ff-el-input--label ' . $requiredClass . $this->getAsteriskPlacement($form));\n\n return \"<div class='\" . $classes . \"'><label for='\" . $id . \"'>\" . $label . \"</label>{$helpMessage}</div>\";\n }", "function YOUR_THEME_form($variables) {\n $element = $variables['element'];\n if (isset($element['#action'])) {\n $element['#attributes']['action'] = drupal_strip_dangerous_protocols($element['#action']);\n }\n element_set_attributes($element, array('method', 'id'));\n if (empty($element['#attributes']['accept-charset'])) {\n $element['#attributes']['accept-charset'] = \"UTF-8\";\n }\n return '<form' . drupal_attributes($element['#attributes']) . '>' . $element['#children'] . '</form>';\n}", "public function modifyFormElement()\n {\n $el = $this->getElement();\n if (!$el) {\n /**\n * @uses Parsonline_Exception_ContextException\n */\n require_once('Parsonline/Exception/ContextException.php');\n throw new Parsonline_Exception_ContextException(\n \"No form element is assigned to the element modifier yet\"\n );\n }\n $separator = $this->getSeparator();\n $additionalTitles = implode($separator, $this->getTitles());\n if (!$additionalTitles) return $this;\n \n $title = $el->getAttrib('title');\n $placement = $this->getPlacement();\n \n if (!$title) {\n $newTitle = $additionalTitles;\n } elseif ($placement === self::PREPEND) {\n $newTitle = $additionalTitles . $separator . $title;\n } else {\n if (!strrpos($title, $separator)) $title .= $separator;\n $newTitle = $title . $additionalTitles;\n }\n \n $el->setAttrib('title', $newTitle);\n return $this;\n }", "public function actionUpdateelementlabel() {\n\t\tif (\\Yii::$app->SessionCheck->isLogged () == true) \t\t// checking logged session\n\t\t{\n\t\t\t\n\t\t\t$post = \\Yii::$app->request->post ();\n\t\t\t$id = $post ['id'];\n\t\t\t$elementid = $post ['elementid'];\n\t\t\t\n\t\t\tif (! empty ( $id )) {\n\t\t\t\t\n\t\t\t\t$transaction = \\Yii::$app->db->beginTransaction (); // begining the transaction\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\t$model = TblAcaElementMaster::Elementuniquedetails ( $id );\n\t\t\t\t\t$model->element_label = strip_tags ( $elementid );\n\t\t\t\t\t\n\t\t\t\t\tif ($model->save () && $model->validate ()) {\n\t\t\t\t\t\techo 'success'; // sending response to ajax\n\t\t\t\t\t\t$transaction->commit (); // commit the transaction\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\techo 'fail'; // sending response to ajax\n\t\t\t\t\t}\n\t\t\t\t} catch ( Exception $e ) { // catching the exception\n\t\t\t\t\t\n\t\t\t\t\t$msg = $e->getMessage ();\n\t\t\t\t\t\\Yii::$app->session->setFlash ( 'error', $msg );\n\t\t\t\t\t\n\t\t\t\t\t$transaction->rollback (); //if exception occurs transaction rollbacks\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo 'fail'; // sending response to ajax\n\t\t\t}\n\t\t} else {\n\t\t\t\\Yii::$app->SessionCheck->adminlogout (); // Redirecting to login page if session destroyed\n\t\t\t\n\t\t\treturn $this->goHome ();\n\t\t}\n\t}", "public function element($type=self::default_input_type) {\n\t\tif ((bool) $this->_is_valid_type($type) === false) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($type != 'submit') {\n\t\t\tif (!isset($this->_attrs['name']) || empty($this->_attrs['name'])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (isset($this->_attrs['name']) && !isset($this->_attrs['value']) && isset($this->_values[$this->_attrs['name']])) {\n\t\t\t$this->_attrs['value'] = $this->_values[$this->_attrs['name']];\n\t\t}\n\t\t\n\t\tif (isset($this->_attrs['name'])) {\n\t\t\t$this->_attrs['name'] = $this->_encrypt_name_attr($this->_attrs['name'], $this->_validators, $this->_filters);\n\t\t}\n\t\t\n\t\t$output = '';\n\t\t\n\t\t// Add the label in the begainning on the element\n\t\tif (isset($this->_attrs['label'])) { $output .= $this->_attrs['label']; }\n\t\t\n\t\t// Fetch the type\n\t\tif ($type == 'select') { // Select\n\t\t\t$output .= '<select';\n\t\t\t\tif ($this->_num_attrs($this->_attrs) > 0) { $output .= ' '; }\n\t\t\t\t$output .= $this->_render_attrs($this->_attrs);\n\t\t\t$output .= '>' . \"\\n\";\n\t\t\t\tforeach ($this->_options as $option) {\n\t\t\t\t\t$output .= $option;\n\t\t\t\t}\n\t\t\t$output .= '</select>' . \"\\n\";\n\t\t}\n\t\telse { // Other input (text, submit, etc...)\n\t\t\t$output .= '<input type=\"' . $type . '\" ';\n\t\t\t\t$output .= $this->_render_attrs($this->_attrs);\n\t\t\t$output .= '/>' . \"\\n\";\n\t\t}\n\t\t\n\t\tif (!isset($this->_attr['name'])) {\n\t\t\t$this->_elements[] = $output;\n\t\t}\n\t\t/*else if (array_key_exists($this->_elements, $this->_attr['name'])) {\n\t\t\treturn false;\n\t\t}*/\n\t\telse {\n\t\t\t$this->_elements[$this->_attr['name']] = $output;\n\t\t}\n\t\t$this->last_element = $output;\n\t\t$this->_clear_cache();\n\t\treturn $output;\n\t}", "public function buildSubmitButton()\n {\n $this->submitButton->setAttributes($this->submitButtonAttr);\n return $this->submitButton->render($this->submitButtonName);\n }", "function minorite_form_element_label($variables) {\n $element = $variables['element'];\n\n // If title and required marker are both empty, output no label.\n if ((!isset($element['#title']) || $element['#title'] === '')) {\n return '';\n }\n\n // If the element is required, a required marker is appended to the label.\n $required = !empty($element['#required']) ? theme('form_required_marker', array('element' => $element)) : '';\n\n $title = !empty($element['#title']) ? filter_xss_admin($element['#title']) : '';\n\n $attributes = array();\n if (!empty($element['#id'])) {\n $attributes['for'] = $element['#id'];\n }\n // Add a class for required elements to facilitate cross-browser styling.\n if (!empty($element['#required'])) {\n $attributes['class'] = array('form-required');\n }\n\n return '<label' . drupal_attributes($attributes) . '>' . $title . $required . '</label>';\n}", "function itcr_search_form_wrapper( $variables ) {\n $output = '<div class=\"field append\">';\n $output .= $variables['element']['#children'];\n $output .= '<button type=\"submit\" class=\"medium primary btn small-4 headsearch-btn\">';\n $output .= '<span class=\"icon-search entypo scale-lg\"><label for=\"search-form\">SEARCH</label></span>';\n// $output .= '<span class=\"element-invisible\"><label for=\"search-block-form\">' . t('Search') . '</label></span>';\n $output .= '</button>';\n $output .= '</div>';\n return $output;\n}", "function editor_element($params)\n {\n extract(av_backend_icon($params)); // creates $font and $display_char if the icon was passed as param \"icon\" and the font as \"font\"\n\n $inner = \"<div class='avia_button_box avia_hidden_bg_box avia_textblock avia_textblock_style'>\";\n $inner .= \"\t\t<div \" . $this->class_by_arguments('icon_select, color, size, position',\n $params['args']) . \">\";\n $inner .= \"\t\t\t<span \" . $this->class_by_arguments('font', $font) . \">\";\n $inner .= \"\t\t\t<span data-update_with='label' class='avia_iconbox_title' >\" . $params['args']['label'] . \"</span>\";\n $inner .= \"\t\t\t<span \" . $this->class_by_arguments('font', $font) . \">\";\n $inner .= \"\t\t</div>\";\n $inner .= \"</div>\";\n\n $params['innerHtml'] = $inner;\n $params['content'] = null;\n $params['class'] = \"\";\n\n return $params;\n }", "function FormElement($labelContent, $input,$colspan=6){\n \n $div= new Div();\n $div->setClass(\"form-group\");\n $label = new Label($labelContent);\n $label->setClass(\"col-sm-2 control-label\");\n $div->add($label);\n $divInput = new Div();\n $divInput->setClass(\"col-sm-{$colspan}\");\n \n $divInput->add($input);\n // $div->add(new Br()); \n $div->add($divInput);\n \n \n return $div;\n \n \n \n }", "public function render(): string\n {\n $this->applyElementBehavior();\n\n $elements = [];\n\n if ($this->cloneElement()) {\n $originalArguments = $this->arguments();\n $originalMethods = $this->methods();\n\n $locales = $this->locales();\n // Check if a custom locale set is requested.\n if ($count = func_num_args()) {\n $args = ($count == 1 ? head(func_get_args()) : func_get_args());\n $locales = array_intersect($locales, (array) $args);\n }\n\n foreach ($locales as $locale) {\n $this->arguments($originalArguments);\n $this->methods($originalMethods);\n $this->overwriteArgument('name', $originalArguments['name'] . '[' . $locale . ']');\n if ($this->translatableIndicator()) {\n $this->setTranslatableLabelIndicator($locale);\n }\n if (!empty($this->config['form-group-class'])) {\n $this->addMethod('addGroupClass', str_replace('%locale', $locale, 'form-group-translation'));\n }\n if (!empty($this->config['input-locale-attribute'])) {\n $this->addMethod('attribute', [$this->config['input-locale-attribute'], $locale]);\n }\n $elements[] = $this->createInput($locale);\n }\n } else {\n $elements[] = $this->createInput();\n }\n\n $this->reset();\n\n return implode('', $elements);\n }", "public function render_wwof_button( $value ) {\r\n\r\n // Change type accordingly\r\n $type = $value[ 'type' ];\r\n if ( $type == 'wwof_button' )\r\n $type = 'button';\r\n\r\n // Custom attribute handling\r\n $custom_attributes = array();\r\n\r\n if ( ! empty( $value[ 'custom_attributes' ] ) && is_array( $value[ 'custom_attributes' ] ) ) {\r\n foreach ( $value[ 'custom_attributes' ] as $attribute => $attribute_value ) {\r\n $custom_attributes[] = esc_attr( $attribute ) . '=\"' . esc_attr( $attribute_value ) . '\"';\r\n }\r\n }\r\n\r\n // Description handling\r\n if ( true === $value[ 'desc_tip' ] ) {\r\n\r\n $description = '';\r\n $tip = $value[ 'desc' ];\r\n\r\n } elseif ( ! empty( $value[ 'desc_tip' ] ) ) {\r\n\r\n $description = $value[ 'desc' ];\r\n $tip = $value[ 'desc_tip' ];\r\n\r\n } elseif ( ! empty( $value[ 'desc' ] ) ) {\r\n\r\n $description = $value[ 'desc' ];\r\n $tip = '';\r\n\r\n } else\r\n $description = $tip = '';\r\n\r\n ob_start();\r\n ?>\r\n <tr valign=\"top\">\r\n <th scope=\"row\" class=\"titledesc\">\r\n <label for=\"<?php echo esc_attr( $value[ 'id' ] ); ?>\">\r\n <?php echo esc_html( $value[ 'title' ] ); ?>\r\n <?php echo $tip; ?>\r\n </label>\r\n </th>\r\n <td class=\"forminp forminp-<?php echo sanitize_title( $value[ 'type' ] ); ?>\">\r\n <input\r\n name=\"<?php echo esc_attr( $value[ 'id' ] ); ?>\"\r\n id=\"<?php echo esc_attr( $value[ 'id' ] ); ?>\"\r\n type=\"<?php echo esc_attr( $type ); ?>\"\r\n style=\"<?php echo esc_attr( $value[ 'css' ] ); ?>\"\r\n value=\"<?php echo esc_attr( __( 'Create Page' , 'woocommerce-wholesale-order-form' ) ); ?>\"\r\n class=\"<?php echo esc_attr( $value[ 'class' ] ); ?>\"\r\n <?php echo implode( ' ', $custom_attributes ); ?>\r\n />\r\n <span class=\"spinner\" style=\"margin-top: 3px; float: none;\"></span>\r\n <?php echo $description; ?>\r\n\r\n </td>\r\n </tr>\r\n <?php\r\n echo ob_get_clean();\r\n\r\n }" ]
[ "0.72595936", "0.6740637", "0.663367", "0.64231735", "0.6422572", "0.6362841", "0.63407815", "0.62650824", "0.6247542", "0.62100774", "0.61997294", "0.6197363", "0.6188993", "0.6138451", "0.609974", "0.60960966", "0.6076923", "0.6049642", "0.60371333", "0.6026059", "0.5975614", "0.5972947", "0.59696454", "0.5961816", "0.5939588", "0.5927845", "0.5896757", "0.58782506", "0.5819949", "0.5816949", "0.57876784", "0.5784404", "0.5779858", "0.57465416", "0.57022154", "0.5691155", "0.56762236", "0.5661734", "0.56575376", "0.5646763", "0.56133825", "0.55880076", "0.5586604", "0.5545455", "0.5535626", "0.55193496", "0.5503234", "0.5493223", "0.5484167", "0.5481405", "0.5475804", "0.5470679", "0.54519707", "0.54298794", "0.5424505", "0.54176146", "0.5409533", "0.5374542", "0.53583306", "0.5357521", "0.5354363", "0.53484905", "0.5322028", "0.53122157", "0.5294889", "0.5290581", "0.5284456", "0.52758044", "0.52665025", "0.52548605", "0.5231709", "0.5224463", "0.5211377", "0.5198747", "0.5196561", "0.5193472", "0.51835173", "0.5183185", "0.5176996", "0.5175748", "0.51749265", "0.5174596", "0.5171583", "0.5171354", "0.51697135", "0.5160861", "0.5160774", "0.51588273", "0.51453704", "0.51437527", "0.51414704", "0.5140071", "0.5137755", "0.5137726", "0.5121532", "0.5121046", "0.511811", "0.51156145", "0.5110738", "0.5103981" ]
0.65198797
3
Handle magic getters and setters
public function __call($method, array $args) { $type = $this->getMagicMethodType($method); $property = $this->getMagicMethodProperty($method); if ($type === 'get') { // Return the property return $this->object[$property]; } // Not getting, so we must be setting; set the property $this->object[$property] = $args[0]; // Fluent interface return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function setRequiredGetters();", "abstract protected function getDirectGetters();", "function doGetterSetter() {\n\tglobal $description_obj;\n\tglobal $table_name, $class_name;\n\tglobal $tabs, $tab2, $tab3;\n\n\tfComment($tabs,\"Getters and Setters\");\n\tforeach($description_obj as $obj) {\n\t\t//print_r($obj);\n\n\t\techo $tabs,\"/// getter for '$obj->Field'\\n\",\n\t\t\t $tabs,\"public function get_{$obj->Field}()\\t\\t{return \\$this->$obj->Field;}\\n\",\n\t\t\t $tabs,\"/// setter for '$obj->Field'\\n\",\n\t\t\t $tabs,\"public function set_{$obj->Field}(\\$val)\\t{\\$this->$obj->Field = \",assignEscape($obj),\";}\\n\",\n\t\t\t \"\\n\";\n\t}\n\techo $tabs,\"public function get_last_error()\\t\\t{return \\$this->_last_error;}\\n\";\n\techo \"\\n\\n\";\n}", "public static function setters();", "public static function getters();", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public static function getters()\n {\n return parent::getters() + self::$getters;\n }", "public function __get($prop) {}", "function __get($name)\n { return $this->$name = $this->$name();\n }", "public function __get($value);", "abstract protected function handle_set($name,$value);", "public function __set($name, $value) {\r\n\r\n\t\t/* Call setter only if setter exists */\r\n\t\tif (method_exists($this, \"set_\" . $name)) {\r\n\t\t\t$methodName = \"set_\" . $name;\r\n\t\t\t$this->$methodName($value);\r\n\t\t}\r\n\t\t/**\r\n\t\t * Set property value only if property does not exists (in order to do not revrite privat or protected properties),\r\n\t\t * it will craete dynamic property, like usually does PHP\r\n\t\t */ else if (!property_exists($this, $name)) {\r\n\t\t\t/**\r\n\t\t\t * Disallow add new properties dynamicly (cause of its change type of object to stdObject, i dont want that)\r\n\t\t\t */\r\n\t\t\t$this->$name = $value;\r\n\t\t}\r\n\t\t/**\r\n\t\t * property exists and private or protected, do not touch. Keep OOP\r\n\t\t */ else {\r\n\t\t\t//Do nothing\r\n\t\t}\r\n\t}", "public function populate_from_request()\r\n\t\t{\t\t\r\n\t\t\t// Interate through each class method.\r\n\t\t\tforeach(get_class_methods($this) as $method) \r\n\t\t\t{\t\t\r\n\t\t\t\t$key = str_replace('set_', '', $method);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t// If there is a request var with key matching\r\n\t\t\t\t// current method name, then the current method \r\n\t\t\t\t// is a set mutator for this request var. Run \r\n\t\t\t\t// it (the set method) with the request var. \r\n\t\t\t\tif(isset($_GET[$key]))\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\t$this->$method($_GET[$key]);\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public static function setters() {\n return self::$setters;\n }", "private function __set($name, $value)\n {\n// \tprint(\"Property set for [$name]<br/>\");\n if (method_exists($this, ($method = 'set_'.$name)))\n {\n $this->$method($value);\n }\n }", "public function getSetters() {\n $fqsen = $this->fqsen;\n $setters = [];\n $propertiesPropertyFound = false;\n do {\n //var_dump($fqsen);\n $class = $this->fqsenToClass($fqsen);\n $methods = $class->getMethods();\n foreach ($methods as $method) {\n if (preg_match('/^set([A-Z0-9].*)$/', $method->getName(), $matches) && !array_key_exists($matches[1], $setters)) {\n $setters[lcfirst($matches[1])] = null;\n }\n }\n if (!$propertiesPropertyFound) {\n $properties = $this->classGetProperty($class, \"properties\");\n if ($properties) {\n $properties = $properties->getDefault();\n $properties = $this->arrayTokenScanner->scan($properties);\n foreach ($properties as $propertyKey => $propertyValue) {\n if (!array_key_exists($propertyKey, $setters)) {\n $setters[$propertyKey] = $propertyValue;\n }\n }\n $propertiesPropertyFound = true;\n }\n }\n $fqsen = strval($class->getParent());\n } while ($fqsen);\n return $setters;\n }", "public function testGeneralGetterAndSetter()\n {\n\n $this->assertNull($this->object->getId());\n\n $date = new \\DateTime();\n $this->object->setCreatedAt($date);\n $this->assertEquals($date, $this->object->getCreatedAt());\n $this->object->setUpdatedAt($date);\n $this->assertEquals($date, $this->object->getUpdatedAt());\n\n $city = $this->object2;\n $city->prePersist();\n $this->assertTrue(is_object($city->getCreatedAt()));\n $city->preUpdate();\n $this->assertTrue(is_object($city->getUpdatedAt()));\n }", "public function testAccessorMethods()\n {\n // Id accessors\n static::assertNull($this->dto->getId());\n $this->dto->setId($expected = 1);\n static::assertSame($expected, $this->dto->getId());\n\n // Name accessors\n static::assertNull($this->dto->getName());\n $this->dto->setName($expected = 'Requestmon');\n static::assertSame($expected, $this->dto->getName());\n\n // Status accessors\n static::assertNull($this->dto->getOnlineStatus());\n $this->dto->setOnlineStatus($expected = 'Alive');\n static::assertSame($expected, $this->dto->getOnlineStatus());\n\n // ClusterId accessors\n static::assertNull($this->dto->getClusterId());\n $this->dto->setClusterId($expected = 1);\n static::assertSame($expected, $this->dto->getClusterId());\n\n // Address accessors\n static::assertNull($this->dto->getAddress());\n $this->dto->setAddress($expected = new Address());\n static::assertSame($expected, $this->dto->getAddress());\n\n // Telephone accessors\n static::assertNull($this->dto->getTelephone());\n $this->dto->setTelephone($expected = new Telephone());\n static::assertSame($expected, $this->dto->getTelephone());\n\n // Email accessors\n static::assertNull($this->dto->getEmail());\n $this->dto->setEmail($expected = new Email());\n static::assertSame($expected, $this->dto->getEmail());\n\n // Account type id accessors\n static::assertNull($this->dto->getAccountTypeId());\n $this->dto->setAccountTypeId($expected = 1);\n static::assertSame($expected, $this->dto->getAccountTypeId());\n\n // Module list id accessors\n static::assertNull($this->dto->getModuleList());\n $this->dto->setModuleList($expected = '1,2,3');\n static::assertSame($expected, $this->dto->getModuleList());\n }", "private static function checkMagicGetterOrSetterProperty(\n StatementsAnalyzer $statements_analyzer,\n PhpParser\\Node\\Expr\\MethodCall $stmt,\n $fq_class_name\n ) {\n if (!$stmt->name instanceof PhpParser\\Node\\Identifier) {\n return true;\n }\n\n $method_name = strtolower($stmt->name->name);\n if (!in_array($method_name, ['__get', '__set'], true)) {\n return true;\n }\n\n $first_arg_value = $stmt->args[0]->value;\n if (!$first_arg_value instanceof PhpParser\\Node\\Scalar\\String_) {\n return true;\n }\n\n $prop_name = $first_arg_value->value;\n $property_id = $fq_class_name . '::$' . $prop_name;\n $codebase = $statements_analyzer->getCodebase();\n $class_storage = $codebase->classlike_storage_provider->get($fq_class_name);\n\n switch ($method_name) {\n case '__set':\n // If `@psalm-seal-properties` is set, the property must be defined with\n // a `@property` annotation\n if ($class_storage->sealed_properties\n && !isset($class_storage->pseudo_property_set_types['$' . $prop_name])\n && IssueBuffer::accepts(\n new UndefinedThisPropertyAssignment(\n 'Instance property ' . $property_id . ' is not defined',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )\n ) {\n // fall through\n }\n\n // If a `@property` annotation is set, the type of the value passed to the\n // magic setter must match the annotation.\n $second_arg_type = isset($stmt->args[1]->value->inferredType)\n ? $stmt->args[1]->value->inferredType\n : null;\n\n if (isset($class_storage->pseudo_property_set_types['$' . $prop_name]) && $second_arg_type) {\n $pseudo_set_type = ExpressionAnalyzer::fleshOutType(\n $codebase,\n $class_storage->pseudo_property_set_types['$' . $prop_name],\n $fq_class_name,\n new Type\\Atomic\\TNamedObject($fq_class_name)\n );\n\n $type_match_found = TypeAnalyzer::isContainedBy(\n $codebase,\n $second_arg_type,\n $pseudo_set_type,\n $second_arg_type->ignore_nullable_issues,\n $second_arg_type->ignore_falsable_issues,\n $has_scalar_match,\n $type_coerced,\n $type_coerced_from_mixed,\n $to_string_cast\n );\n\n if ($type_coerced) {\n if ($type_coerced_from_mixed) {\n if (IssueBuffer::accepts(\n new MixedTypeCoercion(\n $prop_name . ' expects \\'' . $pseudo_set_type . '\\', '\n . ' parent type `' . $second_arg_type . '` provided',\n new CodeLocation($statements_analyzer->getSource(), $stmt)\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // keep soldiering on\n }\n } else {\n if (IssueBuffer::accepts(\n new TypeCoercion(\n $prop_name . ' expects \\'' . $pseudo_set_type . '\\', '\n . ' parent type `' . $second_arg_type . '` provided',\n new CodeLocation($statements_analyzer->getSource(), $stmt)\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // keep soldiering on\n }\n }\n }\n\n if (!$type_match_found && !$type_coerced_from_mixed) {\n if (TypeAnalyzer::canBeContainedBy(\n $codebase,\n $second_arg_type,\n $pseudo_set_type\n )) {\n if (IssueBuffer::accepts(\n new PossiblyInvalidPropertyAssignmentValue(\n $prop_name . ' with declared type \\''\n . $pseudo_set_type\n . '\\' cannot be assigned possibly different type \\'' . $second_arg_type . '\\'',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // fall through\n }\n } else {\n if (IssueBuffer::accepts(\n new InvalidPropertyAssignmentValue(\n $prop_name . ' with declared type \\''\n . $pseudo_set_type\n . '\\' cannot be assigned type \\'' . $second_arg_type . '\\'',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // fall through\n }\n }\n }\n }\n break;\n\n case '__get':\n // If `@psalm-seal-properties` is set, the property must be defined with\n // a `@property` annotation\n if ($class_storage->sealed_properties\n && !isset($class_storage->pseudo_property_get_types['$' . $prop_name])\n && IssueBuffer::accepts(\n new UndefinedThisPropertyFetch(\n 'Instance property ' . $property_id . ' is not defined',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )\n ) {\n // fall through\n }\n\n if (isset($class_storage->pseudo_property_get_types['$' . $prop_name])) {\n $stmt->inferredType = clone $class_storage->pseudo_property_get_types['$' . $prop_name];\n }\n\n break;\n }\n\n return true;\n }", "protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function testHowToHandleCustomizedGetterSetter()\n {\n $form = $this->container->get('form.factory')->createBuilder('form', array('full_name' => 'Joseph Rouff'), array())\n ->add('name', null, array('property_path' => '[full_name]')) // [...] notation is only for array, if it is an object \"fullName\" is enough.\n ->getForm();\n ;\n\n $this->assertEquals('Joseph Rouff', $form->get('name')->getData());\n }", "public function __get($property) {}", "protected function isObjectAccessorMode() {}", "public function __get($propertyName){\n if(array_key_exists($propertyName, $this->properties)){\n\n return $this->properties[$propertyName];\n }\n \n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }", "public static function setters()\r\n {\r\n return self::$setters;\r\n }" ]
[ "0.74332964", "0.7180878", "0.6868192", "0.6624118", "0.6369697", "0.63672346", "0.63672346", "0.63672346", "0.63672346", "0.63672346", "0.63672346", "0.63672346", "0.63672346", "0.63672346", "0.63672346", "0.63672346", "0.63672346", "0.63672346", "0.6075628", "0.6075628", "0.6075628", "0.6075628", "0.6075628", "0.6075628", "0.6075628", "0.6075628", "0.6075628", "0.6075628", "0.6075628", "0.6075628", "0.6075628", "0.60682476", "0.60309565", "0.6008722", "0.6006909", "0.6000393", "0.59930706", "0.59546614", "0.5944778", "0.59120494", "0.58689237", "0.5864867", "0.5858822", "0.58350694", "0.5832813", "0.58171105", "0.5811298", "0.58077365", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464", "0.58053464" ]
0.0
-1
Load object data in this entity from array
public function exchangeArray(array $data) { foreach ($this->object as $key => $value) { if (array_key_exists($key, $data)) { $setter = $this->getSetter($key); $this->$setter($data[$key]); } } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toEntity($array);", "public function toEntity($array);", "public function load(array $data);", "function loadFromArray(array $inArray) {\n\t\t$this->setID((int)$inArray['ID']);\n\t\t$this->setEventID((int)$inArray['EventID']);\n\t\t$this->setSourceID((int)$inArray['SourceID']);\n\t\t$this->setUserID((int)$inArray['UserID']);\n\t\t$this->setHasEvent($inArray['hasEvent']);\n\t\t$this->setModified(false);\n\t}", "public function loadData(Array $data): void\n {\n foreach($data as $fieldName => $fData) {\n if (property_exists($this, $fieldName)) {\n $this->{$fieldName} = $fData;\n }\n }\n }", "function loadFromArray($inArray) {\n\t\t$this->setID((int)$inArray['ID']);\n\t\t$this->setMovieID((int)$inArray['movieID']);\n\t\t$this->setType($inArray['type']);\n\t\t$this->setExt($inArray['ext']);\n\t\t$this->setProfileID((int)$inArray['profileID']);\n\t\t$this->setDescription($inArray['description']);\n\t\t$this->setWidth((int)$inArray['width']);\n\t\t$this->setHeight((int)$inArray['height']);\n\t\t$this->setFilename($inArray['filename']);\n\t\t$this->setDateModified($inArray['modified']);\n\t\t$this->setCdnURL($inArray['cdnURL']);\n\t\t$this->setNotes($inArray['notes']);\n\t\t\n\t\t$arr = unserialize($inArray['metadata']);\n\t\tif ( is_array($arr) ) {\n\t\t\t$this->setMetadata($arr);\n\t\t}\n\t\tunset ($arr);\n\t\t$this->setModified(false);\n\t}", "private function fillEntity(array $data)\n {\n $this->entity->setData($data);\n }", "public function fromArray(array $array){\n if(array_key_exists($this->idField, $array)){//verifica se possui id se sim seta o id;\n $this->{$this->idField} = $array[$this->idField];\n }\n $this->content = $array;\n }", "function loadFromArray(array $inArray) {\n\t\t$this->setID((int)$inArray['ID']);\n\t\t$this->setCoverImageID((int)$inArray['coverImageID']);\n\t\t$this->setTrackID((int)$inArray['trackID']);\n\t\t$this->setStatus((int)$inArray['status']);\n\t\t$this->setRank((int)$inArray['rank']);\n\t\t$this->setCreateDate($inArray['createDate']);\n\t\t$this->setModified(false);\n\t}", "public function hydrate($data)\n\t{\n\t\tif (is_array($data))\n\t\t{\n\t\t\t//get our id back\n\t\t\t$this->id = $data['id'];\n\n\t\t\t//obviously we want to load our data.\n\t\t\t$this->data = $data['data'];\n\t\t}\n\t}", "public function hydrate(array $data);", "function loadFromArray(array $inArray) {\n\t\t$this->setMovieID((int)$inArray['movieID']);\n\t\t$this->setUserID((int)$inArray['UserID']);\n\t\t$this->setCountryID((int)$inArray['CountryID']);\n\t\t$this->setBroadCastDate($inArray['broadCastDate']);\n\t\t$this->setCreatedDate($inArray['createdDate']);\n\t\t$this->setModified(false);\n\t}", "function loadFromArray($inArray) {\n\t\t$this->setID((int)$inArray['ID']);\n\t\t$this->setUserID((int)$inArray['userID']);\n\t\t$this->setProfileName($inArray['profileName']);\n\t\t$this->setActive((int)$inArray['active']);\n\t\t$this->setCreateDate($inArray['createDate']);\n\t\t$this->setUpdateDate($inArray['updateDate']);\n\t\t$this->setModified(false);\n\t}", "public function loadData(array $data) \n {\n foreach($data as $k => $v) {\n if (property_exists($this, $k)) {\n $this->{$k} = $v;\n }\n }\n }", "public function fromArray($row) {\n $this->_preload();\n\n // clear out saved data\n $this->_magicProperties = array();\n\n // clear out cached relations\n $this->_related = array();\n\n\n $this->loaded= false;\n if (is_array($row) || is_object($row)) {\n foreach($row as $k => $v) {\n $this->$k = $v;\n }\n $this->loaded = true;\n }\n $this->_postload($this->loaded);\n return $this->loaded;\n }", "function loadData()\n\t{\n\t\tstatic $data;\n\t\t\n\t\tif(!$data)\n\t\t\t$data=self::getData();\n\n\t\tif(isset($data[$this->id]))\n\t\t\t$this->setValues((array)$data[$this->id]);\t\t\t\n\t}", "public function testBasicPopulate() {\n\t\t$class = get_class($this->entity);\n\t\t$array = $this->entity->toArray(true);\n\t\t$filled = $this->fillArray($array);\n\n\t\t$entity = new $class($filled);\n\t\t$result = $entity->toArray();\n\t\t\n\t\t$this->assertEquals($filled, $result);\n\t}", "public function hydrate($object, array $data);", "public function loadFromArray($array){\n\t\t\tforeach ($array as $key => $value) {//iterate given array key=>values\n\t\t\t\tif(in_array($key, $this->columns) || in_array($key, $this->keys)){//if this key belongs to the valid columns\n\t\t\t\t\t$this->__set($key, $value);//save it\n\t\t\t\t}\n\t\t\t}\n\t\t}", "abstract public function loadData();", "protected function load()\n\t{\n\n $data = simplexml_load_string(file_get_contents($this->_origin));\n\n\n\n $data = json_decode(json_encode((array)$data), TRUE);\n\n //$this\n\n $this->_data = [];\n\n\n $firstKey = array_keys($data)[0];\n\n //print_r($data[$firstKey]);\n //echo \"<br><br>\";\n\n foreach($data[$firstKey] AS $element) {\n\n\n //var_dump(self::arrayToObject($element));\n\n $this->_fields = array_keys($element);\n\n\n $this->_data[@$element['id']] = self::arrayToObject($element);\n\n }\n\n\t\t$this->reindex();\n\t}", "function loadFromArray($inArray) {\n\t\t$this->setID((int)$inArray['ID']);\n\t\t$this->setReplacesTerms((int)$inArray['replacesTerms']);\n\t\t$this->setVersion($inArray['version']);\n\t\t$this->setDescription($inArray['description']);\n\t\t$this->setHtmlLink($inArray['htmlLink']);\n\t\t$this->setPdfLink($inArray['pdfLink']);\n\t\t$this->setModified(false);\n\t}", "public function fromArray($data)\n {\n $this->data = $data;\n\n\n }", "protected function lookupData()\n\t{\n\t\t//nope, load it normally.\n\t\t$data = $this->getData(true);\n\t\tif (count($data) && is_array($data))\n\t\t\n\t\tif (!empty($data))\n\t\t\t$this->hydrate($data);\n\t}", "public function __construct(array $array)\n {\n parent::hydrate($array);\n }", "public function fromArray(array $data);", "public function fromArray(array $data);", "public function loadFromArray(array $data = array())\n {\n $relations = $this->getRelations();\n\n foreach ($data as $key => $value) {\n if (array_key_exists($key, $relations)) {\n $class = $relations[$key];\n $model = new $class();\n\n if (!($model instanceof Base)) {\n throw new \\Exception(sprintf(\n 'Invalid relation object. Relation object must be instance of %s, %s given.',\n 'Model\\WealthbotRebalancer\\Base',\n $class\n ));\n }\n\n $model->loadFromArray($value);\n $this->$key = $model;\n\n } else {\n $this->$key = $value;\n }\n }\n }", "public function loadDataFromId(){\r\n\t\t\t$this -> loadFromId();\r\n\t }", "public function fromArray(array $data)\n {\n parent::fromArray($data);\n $this->parseDynamicProperties($data);\n }", "public function hydrate(string $className, array $data): EntityInterface;", "public final function __fromArray($data)\n {\n foreach ($data as $k => $v)\n {\n if ($k!=self::CLASS_FIELD_KEY)\n {\n //codice pronto da usare per la trasformazione degli oggetti in cascata.\n /* \n //associazione tramite chiave esterna\n if (ActiveRecord::isValidArrayDO($v))\n {\n $this->{$k} = ActiveRecord::fromArray($v);\n }\n else\n if (is_array($v)) //associazione tramite tabella esterna\n {\n $result = array();\n foreach ($v as $nes_key => $nes_value)\n {\n $result[] = ActiveRecord::fromArray($nes_value);\n }\n $this->{$k} = $result;\n }\n else*/\n $this->{$k} = $v;\n }\n }\n }", "private function load() {\n\n $db = Database::getInstance(); \n\t $con = $db->getConnection();\n \n $query = \"SELECT * FROM Products ORDER by ID DESC\";\n \n if ($result = $con->query($query)) {\n \t/* fetch object array */\n \t while ($prod = $result->fetch_object(\"Product\")) {\n\t\t\t \tarray_push($this->products, $prod);\n \t}\n \t/* free result set */\n \t$result->close();\n }\n\t}", "public function load($data)\n\t{\n\t\t//did we get an array of data to set?\n\t\tif (is_array($data))\n\t\t\t$this->hydrate($data);\n\t\t//nope, maybe its an id for the database...\n\t\telse if ($data)\n\t\t\t$this->loadData($data, $deep);\n\t}", "public function load( $arr )\r\n\t{\r\n\t $this->vars = $arr; // keep for use later\r\n\t $this->subject_id = $this->vars['id'];\r\n\t $this->name = $this->vars['name'];\r\n\t $this->url = $this->vars['url'];\r\n\t $this->position = $this->vars['position'];\r\n\t parent::load($arr);\r\n\t}", "public function load( &$object );", "protected function load($data_array) {\n\t\t$this->setItemID(isset($data_array[\"itemId\"])?$data_array[\"itemId\"]:0);\n\t}", "public function load() : array;", "public function load_data( $data ) {\r\n foreach ( $data as $key => $value ) {\r\n $this->$key = $value;\r\n }\r\n }", "public function load($data);", "abstract protected function loadData(ObjectManager $em);", "protected function getPersistableDataArray() {}", "protected function getPersistableDataArray() {}", "protected function getPersistableDataArray() {}", "protected function getPersistableDataArray() {}", "public function setFromArray(array $data): AbstractEntity {\n\n foreach ($data as $property => $value) {\n\n if(true === is_array($value)) {\n $value = filter_var_array($value, FILTER_SANITIZE_SPECIAL_CHARS);\n } else {\n $value = filter_input(INPUT_POST, $property, FILTER_SANITIZE_SPECIAL_CHARS);\n }\n $this->vars[$property] = $value;\n }\n return $this;\n }", "abstract protected function getPersistableDataArray();", "public function fromArray(array $arrayData);", "private function get_object_array($array){\n \n }", "public function importFrom(array $data);", "public function setFromArray($array){\n\t\tif(isset($array['nome_artista'])) $this->nome_artista = $array['nome_artista'];\n\t\tif(isset($array['foto'])) $this->foto = $array['foto'];\n\t\tif(isset($array['autore'])) $this->autore = $array['autore'];\n\t\tif(isset($array['genere'])) $this->genere = $array['genere'];\n\t\tif(isset($array['data'])) $this->data = $array['data'];\n\t\tif(isset($array['stato'])) $this->stato = $array['stato'];\n\t\tif(isset($array['stato_pubblicazione'])) $this->stato_pubblicazione = $array['stato_pubblicazione'];\n\t\tif(isset($array['id'])) $this->id = $array['id'];\n\t\tif(isset($array['id_artista'])) $this->id_artista = $array['id_artista'];\n\t\tif(isset($array['descrizione'])) $this->descrizione = $array['descrizione'];\n\t\t\n\t}", "public function exchangeArray(array $data)\n {\n foreach ($data as $name => $value) {\n if(property_exists($this, $name)) {\n if(strstr($name,'_id')\n && empty($value)){\n $this->$name = null;\n }else{\n $this->$name = $value;\n }\n }\n }\n }", "protected function _fillFromArray($entity, $data)\n { \n \n if ($data) {\n \n foreach ($data as $key => $value) {\n if (!is_null($value)){\n if (is_array($value)) {\n $className = 'MercadoPago\\\\' . $this->_camelize($key);\n if (class_exists($className, true)) {\n $entity->_setValue($key, new $className, false);\n $entity->_fillFromArray($this->{$key}, $value);\n } else {\n $entity->_setValue($key, json_decode(json_encode($value)), false);\n }\n continue;\n }\n $entity->_setValue($key, $value, false);\n }\n }\n }\n }", "public function load()\n {\n $pdo = $this->getDbConnection();\n $query = \"SELECT * FROM {$this->dbTable}\";\n $data = $pdo->query($query)->fetchAll(\\PDO::FETCH_ASSOC);\n\n foreach ($data as ['key' => $key, 'value' => $value]) {\n $this->setData($key, $value);\n }\n }", "protected function importData()\n\t{\n\t\tinclude_once \"./Services/ADN/ED/classes/class.adnSubobjective.php\";\n\t\t$subobjectives = adnSubobjective::getAllSubobjectives($this->objective_id);\n\n\t\t$this->setData($subobjectives);\n\t\t$this->setMaxCount(sizeof($subobjectives));\n\t}", "public function fromArray($array) {\n \n foreach ( $array as $key => $value ) {\n \n if ( $this->$key instanceof PersistentCollection ) {\n \n $value = new ArrayCollection(\n array_unique(array_merge($this->$key->toArray(), $value->toArray()), \\SORT_REGULAR)\n );\n \n }\n \n $this->$key = $value; \n }\n \n //return $this;\n }", "public function fromArray($array) {\n \n foreach ( $array as $key => $value ) {\n \n if ( $this->$key instanceof PersistentCollection ) {\n \n $value = new ArrayCollection(\n array_unique(array_merge($this->$key->toArray(), $value->toArray()), \\SORT_REGULAR)\n );\n \n }\n \n $this->$key = $value; \n }\n \n //return $this;\n }", "public function hydrate(array $data){ \n \tforeach ($data as $key => $value){\n \t\t$method = 'set'.ucfirst($key); \n \tif (method_exists($this, $method)){\n \t$this->$method($value);\n }\n }\n\t}", "abstract public function hydrate($data);", "abstract public function load_object(array $args);", "abstract protected function load(): array;", "private static function loadEntityList()\n {\n if (!isset(self::$_data[self::KEY_ENTITY_LIST]))\n {\n $_adapter = self::getZendDbAdapter(TRUE);\n $_dbSelect = $_adapter->select()\n ->from(\"c_entity\", array(\"entity_id\" => \"id\", \"entity_name\" => \"name\", \"entity_label\" => \"label\"))\n ->join(\"c_entity_field\", \"c_entity_field.entity_id = c_entity.id\", array(\"field_id\" => \"id\", \"field_name\" => \"name\", \"field_label\" => \"label\"))\n ->join(\"c_entity_option\", \"c_entity_option.field_id = c_entity_field.id\", array(\"option_id\" => \"id\", \"option_value\" => \"value\", \"option_label\" => \"label\"))\n ->order(\"c_entity.id\")\n ->order(\"c_entity_field.id\")\n ->order(\"c_entity_option.label\")\n ;\n $_recordList = $_adapter->fetchAll($_dbSelect);\n\n $_data = array();\n foreach ($_recordList as $_record)\n {\n $_eName = $_record[\"entity_name\"];\n $_fName = $_record[\"field_name\"];\n $_oName = $_record[\"option_value\"];\n if (!isset($_data[$_eName]))\n {\n $_data[$_eName] = array(\n \"id\" => $_record[\"entity_id\"],\n \"label\" => $_record[\"entity_label\"],\n \"field_list\" => array()\n );\n }\n if (!isset($_data[$_eName][\"field_list\"][$_fName]))\n {\n $_data[$_eName][\"field_list\"][$_fName] = array(\n \"id\" => $_record[\"field_id\"],\n \"label\" => $_record[\"field_label\"],\n \"option_list\" => array()\n );\n }\n\n $_data[$_eName][\"field_list\"][$_fName][\"option_list\"][$_oName] = array(\n \"id\" => $_record[\"option_id\"],\n \"label\" => $_record[\"option_label\"]\n );\n }\n self::$_data[self::KEY_ENTITY_LIST] = $_data;\n }\n }", "public function loadData($data)\n {\n foreach ($data as $key => $value) {\n if(property_exists($this, $key))\n {\n $this->{$key} = $value;\n }\n }\n }", "public function update(array $data){\n $entity = $this->em->getReference($this->entity, $data['id']);\n //Peguei o que eu precisava, agora � necessario pupular o registro com os dados que vieram\n //do array data. E para isso vamos usar o hidrator.\n //Populando o entity\n (new Hydrator\\ClassMethods())->hydrate($data,$entity);\n \n $this->em->persist($entity);\n $this->em->flush();\n return $entity;\n }", "abstract protected function getPersistableDataArray() ;", "private final function loadObjectFromDb()\n {\n # TODO: would be far preferable to use the objectsFromDestinations() code, possibly by refactoring into another shareable function. this is needed because otherwise we're in object A and OrmClass->load() is generating object B, instead of populating object A\n # TODO:NOTE01\n # TODO: must use $this->setLoadedFromDb() per class\n throw new Exception('TODO');\n }", "abstract protected function prepareEntity(/*array*/ $entity_data);", "function setDataByArray($array) {\n\t\n\t\tforeach($array as $key => $value) {\n\t\t\t$this->setData($key, $value);\n\t\t}\n\t\t\n\t\t$this->dataLoaded = true;\n\t\treturn $this;\n\t\t//surely we need to set dataLoaded = true?\n\t}", "public function exchangeArray($data){\n\t\t$this->id \t = (!empty($data['id'])) ? $data['id'] : null;\n\t\t$this->description = (!empty($data['description'])) ? $data['description'] : null;\n\t\t$this->date \t = (!empty($data['date'])) ? $data['date'] : null;\n\t\t$this->type = (!empty($data['type'])) ? $data['type'] : null;\n\t\t$this->user_id = (!empty($data['user_id'])) ? $data['user_id'] : null;\n\t}", "protected function hydrate($array){\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\t$methodName = 'set'.ucfirst($key);\r\n\t\t\tif(method_exists($this, $methodName)){\r\n\t\t\t\t$this->$methodName($value);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function fromArray($data = array())\n {\n foreach ($data as $property => $value) {\n $method = \"set{$property}\";\n $this->$method($value);\n }\n }", "public function loadData(array $data)\n {\n // Loop through a child array if their is data for this specific object\n if ($this->objectName !== null && isset($data[$this->objectName]) === true) {\n $data = $data[$this->objectName];\n }\n\n foreach ($data as $key => $value) {\n // Check if the value is allowed to be set\n if (in_array($key, $this->allowedProperties, true) === false) {\n continue;\n }\n\n // Function calls should be in camelcase\n $setter = 'set' . str_replace('_', '', ucwords($key, '_'));\n\n $this->{$setter}($value);\n }\n\n $this->initialized = true;\n\n return $this;\n }", "public function testEntityToArray() {\n\t\t// 1. simple data\n\t\t$data = [\n\t\t\t'Author' => [\n\t\t\t\t'name' => 'Basuke',\n\t\t\t\t'programmer' => 'Programmer',\n\t\t\t],\n\t\t];\n\n\t\t$author = $this->Author->newEntity($data);\n\t\t$reversed = $author->toArray();\n\t\t$this->assertEqual($reversed, $data);\n\n\t\t// 2. has many\n\t\t$data = [\n\t\t\t'Author' => [\n\t\t\t\t'id' => '123',\n\t\t\t\t'name' => 'Basuke',\n\t\t\t\t'programmer' => 'Programmer',\n\t\t\t],\n\t\t\t'Comment' => [\n\t\t\t\t[\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'author_id' => '123',\n\t\t\t\t\t'comment' => 'Hello',\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'author_id' => '123',\n\t\t\t\t\t'comment' => 'World',\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\t$author = $this->Author->newEntity($data);\n\t\t$reversed = $author->toArray();\n\t\t$this->assertEqual($reversed, $data);\n\n\t\t// 3. has one\n\t\t$data = [\n\t\t\t'Author' => [\n\t\t\t\t'id' => '123',\n\t\t\t\t'name' => 'Basuke',\n\t\t\t\t'programmer' => 'Programmer',\n\t\t\t],\n\t\t\t'Image' => [\n\t\t\t\t'id' => '1',\n\t\t\t\t'author_id' => '123',\n\t\t\t\t'url' => 'Hello',\n\t\t\t],\n\t\t];\n\n\t\t$author = $this->Author->newEntity($data);\n\t\t$reversed = $author->toArray();\n\t\t$this->assertEqual($reversed, $data);\n\t}", "public function loadData($data)\n {\n foreach ($data as $key => $value) {\n if (property_exists($this, $key)) {\n $this->{$key} = $value;\n }\n }\n }", "public function withData(iterable $data): EntityInterface;", "public function __construct(array $datas) {\n $this->hydrate($datas);\n }", "abstract public function hydrate(array $data, $options);", "public abstract function readObjects();", "public function hydrate(array $data)\n {\n foreach ($data as $key => $value) {\n $method = 'set' . str_replace(\"_\", \"\", ucwords($key, \"_\"));\n if (method_exists($this, $method)) {\n $this->$method($value);\n }\n }\n }", "public function initFromArray($o) {\n parent::initFromArray($o);\n if( isset($o['description']) ) {\n $this->description = $o[\"description\"];\n }\n if( isset($o['name']) ) {\n $this->name = $o[\"name\"];\n }\n if( isset($o['id']) ) {\n $this->id = $o[\"id\"];\n }\n }", "public function fromArray($data)\r\n {\r\n $inputFilter = $this->getInputFilter($data);\r\n if (!$inputFilter->isValid()) {\r\n Thrower::throwValidationException('Error de Validacion', $inputFilter->getMessages());\r\n }\r\n $data = $inputFilter->getValues();\r\n \r\n foreach ($data as $property => $value) {\r\n $this->$property = $value;\r\n }\r\n }", "private function parseobject($array)\n {\n if (is_object($array)) {\n if (get_class($array) == 'DataObject') {\n return $array;\n }\n $do = DataObject::create();\n foreach (get_object_vars($array) as $key => $obj) {\n if ($key == '__Type') {\n $do->setField('Title', $obj);\n } elseif (is_array($obj) || is_object($obj)) {\n $do->setField($key, $this->parseobject($obj));\n } else {\n $do->setField($key, $obj);\n }\n }\n return $do;\n } elseif (is_array($array)) {\n $dataList = ArrayList::create();\n foreach ($array as $key => $obj) {\n $dataList->push($this->parseobject($obj));\n }\n return $dataList;\n }\n return null;\n }", "public function loadData(){\r\n $this->host = Team::find($this->host);\r\n $this->guest = Team::find($this->guest);\r\n $this->winner = Team::find($this->winner);\r\n $this->tournament = Tournament::find($this->tournamentID); \r\n }", "public function hydrate(array $data)\n {\n foreach ($data as $key => $value) {\n $method = 'set'.ucfirst($key);\n\n if (method_exists($this, $method)) {\n $this->$method($value);\n }\n }\n }", "public static function fromData(array $data);", "public function fromArray($data)\n {\n if (isset($data['field_name']))\n $this->fieldName = $data['field_name'];\n\n if (isset($data['direction']))\n $this->direction = $data['direction'];\n }", "protected function loadObjects() {\n if (!isset($this->objects)) {\n $this->obj_builder->toggleAutoload('on');\n $this->objects = $this->obj_builder->buildObjects();\n $this->obj_builder->toggleAutoload('off');\n }\n }", "public function load($id = null){\n\t\n\t\tif(!isset($id)){\n\t\t\t$id = $this->__get('id');\n\t\t}\n\t\t$class = strtolower(substr_replace(get_class($this) ,\"\",-5));\n\t\t$data = $this->getById($id);\n\t\t\n\t\t$class = ucfirst($class.'Model');\n\t\tif(count($data) > 0){\n\t\t\t$object = new $class;\n\t\t\tforeach ($data as $key => $v){\n\t\t\t\t$object->__set($key,$v);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $object;\n\t\t\n\t}", "public function populate(array $data);", "public function importArray($data);", "public function exchangeArray($data)\n {\n $this->id = (isset($data['id'])) ? $data['id'] : null;\n $this->idmz = (isset($data['idmz'])) ? $data['idmz'] : null;\n\t\t$this->img = (isset($data['img'])) ? $data['img'] : null;\n\t\t$this->description = (isset($data['description'])) ? $data['description'] : null;\n $this->title = (isset($data['title'])) ? $data['title'] : null;\n $this->page = (isset($data['page'])) ? $data['page'] : null;\n \n }", "abstract public function populate();", "public function fromArray(array $data)\n {\n foreach ($data as $key => $value) {\n $this->{'set'.ucfirst($key)}($value);\n }\n }", "public function loadFromObject($object){\n foreach ($object as $property => $value) {\n //we must ignore this fields\n if(\\in_array($property,['_type','_primary_key','id'])){\n continue;\n }\n $this->{$property}=$value;\n }\n # we set the real short class name\n if(property_exists($model,'_type')){\n $this->setTableName($model->_type);\n }else{\n $modelObj->setTableName(RedBeanEngine::classNameToTableName($model)); \n }\n }", "public function exchangeArray($data)\n {\n $this->id = (!empty($data['id'])) ? $data['id']:null; // int\n $this->migration = (!empty($data['migration'])) ? $data['migration']:null; // varchar\n $this->batch = (!empty($data['batch'])) ? $data['batch']:null; // int\n }", "public function load()\r\n\t{\r\n\t\t$entities = $this->query($this->entity, $this->relation)->getResults($this->relation);\r\n\t\t\r\n\t\t$this->loaded = true;\r\n\r\n\t\treturn $entities;\r\n\t}", "protected function load($objRow) {\n $this->_data['intID'] = $objRow->pkID;\n $this->_data['intProductID '] = $objRow->fkProductID;\n $this->_data['intValue'] = $objRow->fldValue;\n }", "public function loadFromObject($obj)\n\t{\n\t\t//throw new Exception('i');\n\t\t//var_dump($obj);\n\t\t//print_r($obj);\n\t\t\n\t\t$vars_info = $this->loadTableDescription($obj->getTableName());\n\t\t//print_r($vars_info);\n\t\t$vars = array();\n\t\tforeach($vars_info as $inf)\n\t\t{\n\t\t\t$varname = $inf['COLUMN_NAME'];\n\t\t\t$vars[$varname] = array();\n\t\t\t$v =& $vars[$varname];\n\t\t\t\n\t\t\t$v['current_value'] = $obj->$varname;\n\t\t\t\n\t\t\t//TODO: use export instead??\n\t\t\t$v['DATA_TYPE'] = $inf['DATA_TYPE'];\n\t\t\t$v['CHARACTER_MAXIMUM_LENGTH'] = $inf['CHARACTER_MAXIMUM_LENGTH'];\n\t\t\t$v['NUMERIC_PRECISION'] = $inf['NUMERIC_PRECISION'];\n\t\t\t$v['COLUMN_TYPE'] = $inf['COLUMN_TYPE'];\n\t\t\t$v['IS_NULLABLE'] = $inf['IS_NULLABLE'];\n\t\t\t$v['COLUMN_KEY'] = $inf['COLUMN_KEY'];\n\t\t\t$v['COLUMN_COMMENT'] = $inf['COLUMN_COMMENT'];\n\t\t\t\n\t\t\t$ref_tbl = $inf['REFERENCED_TABLE_NAME'];\n\t\t\t$ref_col = $inf['REFERENCED_COLUMN_NAME'];\n\t\t\tif(!empty($ref_tbl) && !empty($ref_col))\n\t\t\t{\n\t\t\t\t//TODO: this is a workaround.\n\t\t\t\t$name = ($ref_tbl == 'style') ? 'class' : 'name';\n\t\t\t\t$name = ($ref_tbl == 'user') ? 'username' : $name;\n\t\t\t\t$name = ($ref_tbl == 'IBO_student_exam') ? 'id' : $name;\n\t\t\t\t$v['references'] = SqlQuery::getInstance()->listQuery($ref_tbl,$ref_col,$name,'DISTINCT',1);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$v['references'] = NULL;\n\t\t}\n\t\t\n\t\t//and make the call to construct elements:\n\t\t$this->loadFromDescription($vars);\n\t\t\n\t}", "protected function convertArrayToObject(array $array)\n {\n $object = $this->getNewEntityInstance();\n $object->setFromArray($array);\n\n return $object;\n }", "public function fromArray($array) {\n \n foreach ( $array as $key => $value ) {\n \n $this->$key = $value; \n }\n \n //return $this;\n }", "function load() {\n\t\tglobal $mysql;\n //if(!$this->exists()) return;\n \t$id \t\t= $mysql->escape($this->id);\n \t$tablename \t= $this->class_name();\n \t$this->data = $mysql->executeSql(\"SELECT * FROM \".$tablename.\" WHERE id=$id;\");\n \t$this->id\t= $this->data['id'];\n \tunset($this->data['id']);\n }" ]
[ "0.66998065", "0.66998065", "0.65862995", "0.6548694", "0.63810503", "0.63747996", "0.6340249", "0.63290715", "0.6322639", "0.6317292", "0.63054967", "0.6297818", "0.62703043", "0.6269695", "0.6183968", "0.61438626", "0.61417484", "0.6126637", "0.60630745", "0.60271907", "0.60218817", "0.6001936", "0.594888", "0.5912269", "0.59032845", "0.5879834", "0.5879834", "0.58564156", "0.5855627", "0.58493805", "0.5847905", "0.58354867", "0.5827209", "0.58171475", "0.5815352", "0.5812763", "0.5812243", "0.58094954", "0.57878757", "0.5769828", "0.5756039", "0.57517576", "0.57517576", "0.5750054", "0.57497513", "0.574832", "0.57415706", "0.572639", "0.5714146", "0.570421", "0.56822824", "0.56814545", "0.5680197", "0.5678484", "0.56779814", "0.5670952", "0.5670952", "0.5667683", "0.5658018", "0.5638689", "0.56343985", "0.5627751", "0.55977356", "0.5587075", "0.55859417", "0.5580341", "0.55715674", "0.5570641", "0.5570216", "0.55701154", "0.5564027", "0.55533445", "0.5550627", "0.55453175", "0.5543591", "0.55394644", "0.55377334", "0.5520772", "0.55182755", "0.55140287", "0.5501498", "0.54898584", "0.54824626", "0.5479495", "0.54791325", "0.5476781", "0.54755574", "0.5471885", "0.54672444", "0.54593694", "0.5457676", "0.5449265", "0.54306555", "0.5430537", "0.5405649", "0.54023117", "0.53974456", "0.5381415", "0.5375893", "0.5370682", "0.53636795" ]
0.0
-1